Path: utzoo!utgpu!watmath!att!tut.cis.ohio-state.edu!purdue!decwrl!shelby!agate!saturn!ssyx.ucsc.edu!sirkm
From: sirkm@ssyx.ucsc.edu (Greg Anderson)
Newsgroups: comp.sys.mac.hypercard
Subject: Re: HyperCard NumToChar bug
Keywords: NumToChar, CharToNum, bug
Message-ID: <8652@saturn.ucsc.edu>
Date: 7 Aug 89 19:09:18 GMT
References: <2332@uvabick.UUCP>
Sender: usenet@saturn.ucsc.edu
Reply-To: sirkm@ssyx.ucsc.edu (Greg Anderson)
Organization: UC Santa Cruz; Division of Social Sciences
Lines: 38

In article <2332@uvabick.UUCP> sinteur@uvabick.UUCP (John Sinteur) writes:
>I recently ran into a bug in HyperCard:
>NumtoChar does not function if you pass a zero as a parameter,
>that is, if you want to write a hex $00 to a disk file, you can't.
>Instead, you get a $20 on disk.
>The same goes for reading a $00. it reads a 'space' instead, so if you
>do a 'chartonum', a 32 results.

(stuff deleted)

>This bug will probably be solved, but I can't wait for that).
>
>Any ideas?
>
>-John Sinteur
>sinteur@uvabick
>adegroot@hroeur5.bitnet
>john sinteur, 2:512/114 @fidonet

Don't wait, the 'bug' you describe will never be fixed: it's not a bug,
it's a feature.

HyperCard variables and fields are null-terminated; this means that the
last character of any variable or field is a null (hex $00).  If you
were to place a null in the middle of a variable or field, HyperCard
would think that it signified the end of the contents of the text; everything
that followed would be truncated.

HyperCard is by design a text-only system.  There isn't any way to
process nulls with HyperCard; you must either change your design so
you do not need to process nulls (the best solution), or do all of
your processing outside of HyperCard (in an XCMD, perhaps).


  ___\    /___               Greg Anderson              ___\    /___ 
  \   \  /   /         Social Sciences Computing        \   \  /   /
   \  /\/\  /    University of California, Santa Cruz    \  /\/\  /
    \/    \/              sirkm@ssyx.ucsc.edu             \/    \/