binary in fields and strings

Dar Scott dsc at swcp.com
Thu Nov 13 13:47:52 EST 2003


On Thursday, November 13, 2003, at 11:05 AM, Alex Rice wrote:

> Is it true that Revolution fields and strings can contain any 
> character including NULL and EOF?

Strings do just fine with ASCII NUL (0) and EOT (4).  The Revolution 
EOF is encoded as 4, also.

A few features have trouble with some values.  For example, you can't 
have a NUL in an array key.

I have seen (some versions back) NULs cause trouble in fields.  They 
mess up display and the data gotten back is garbled.  The last I 
looked, IIRC, the docs recommended avoiding any control characters in 
fields other than tab and the end of line (LF in Rev).

I don't know of a way somebody might type those.  I have some vague 
memory of holding down some key and typing digits in Windows.  I have 
not tried that with Revolution.

> I am debugging a situation where somehow a EOF character within a 
> string got sent to my CLIPS external, which caused an error, 
> understandably.

I am not sure I understand.

Is this because you open a pipe to a process and that process looks for 
the EOF character instead of a close?

Or is this because it makes a mess of parsing?

> Just want to make sure I understand what's happening before I make a 
> fix.

The limits, I think, to data passed to an external include the string 
being null terminated and some sort of 64K limit.  I don't remember 
whether the latter is for the entire call or a single parameter.

If the CLIPS library has a character set limitation, it would be 
reasonable to matchText() on that in any case.  I'd put that in and 
then use that to track down the source.

Dar Scott



More information about the use-livecode mailing list