Path: utzoo!attcan!uunet!cs.utexas.edu!rutgers!njin!princeton!phoenix!pucc!EGNILGES From: EGNILGES@pucc.Princeton.EDU (Ed Nilges) Newsgroups: comp.sys.mac.hypercard Subject: Null lines at end of containers Message-ID: <8487@pucc.Princeton.EDU> Date: 26 May 89 00:05:51 GMT Reply-To: EGNILGES@pucc.Princeton.EDU Organization: Princeton University, NJ Lines: 39 Disclaimer: Author bears full responsibility for contents of this article Bug in HyperTalk? I'm gradually building a library of standard techniques expressed as functions in Hypertalk. This library includes nl2char and char2nl, two functions which respectively convert newlines to symbols (the function default of can be user-overridden) and symbols back to newlines. Thus: put "a" into line 1 of container put "b" into line 2 of container put nl2char(container) will yield "ab". "put nl2char(container,"/")" will yield "a/b", and "put char2nl(nl2char(container))" should yield the original string. However, a bug/feature of HyperTalk is making it difficult for these two functions to be truly inverse. Hypertalk won't append null lines to the end of a container: put "a" into container put "" into line 2 of container put number of lines of container will type 1...not 2 (try it; I've tested this uner 1.2.1 and 1.2.2) This entails that put number of lines of char2nl("a") will yield 1 in the message box, not 2, and worse nl2char(char2nl(...)) won't equal ... Any ideas? I'd observe at this point that improper handling of nulls can be a serious flaw in an interpretive language. Edward Nilges "If the universe were perfect, it wouldn't exist" - Yogi Berra