[Date Prev][Date Next][Subject Prev][Subject Next][Date Index][Subject Index]

Re: Handling of 00h bytes by XyWrite



Reply to note from wbass@xxxxxxxxxxxx Wed, 21 Aug 2024 21:34:45 +0000 (UTC)

Wally,

> but [NULs] they are not stripped out, if present, when a file is
> saved).

I don't think this is universally true, in either Xy3 or Xy4. At least it's not true with an
artificially constructed file, Nulls.txt, which you can download here:

https://ammaze.net/xywwweb/dls/nulls.zip

If you open it in Xy3 or Xy4, you'll see 26 chars, A-Z. But a DIRectory listing will show that the
file has 52 bytes, because, in reality, each letter is followed by an Ascii-0. When I save that file
in either Xy3 or Xy4, the NULs are stripped out, and DIR shows the file now as having only 26 bytes.
Granted, this test file is not typical.

As far as 3-byte functions are concerned, Xy4 adheres to the pattern established in earlier
versions, where the 2nd byte is Ascii 128, 129 or 130, and the 3rd bytes are odd numbers. In the
AutoIt scripting language for Windows, you get the entire range of 3-byte functions, as a string,
like this:

$sAllFuncs = ""
For $i = 128 To 130
Next

So yes, the canonical functions, by definition, never include Ascii-0. With regard to the 3-byte
Speedo chars, triggered in each case by Ascii-254, NULs are very much in the picture and can appear
in both the 2nd and 3rd bytes. The AutoIt script for a string array of Speedos looks like this (note
that Ascii-26|x1A in the 3rd byte is handled differently because the actual character can make
XyWrite unstable/crash):

$sAllSpeedos = ""
$iC = 256
For $i = 0 To 2
Next

Needless to say, constituent NULs in Speedo chars are always preserved when a file is saved.

-- 
Carl Distefano
cld@xxxxxxxxxx