Path: utzoo!censor!geac!torsqnt!lethe!yunexus!ists!helios.physics.utoronto.ca!news-server.csri.toronto.edu!bonnie.concordia.ca!thunder.mcrcim.mcgill.edu!snorkelwacker.mit.edu!apple!jkc From: jkc@Apple.COM (John Kevin Calhoun) Newsgroups: comp.sys.mac.hypercard Subject: Re: Another idling in pre-2.0 HC, AND file problems (pre 2.0) Message-ID: <47982@apple.Apple.COM> Date: 11 Jan 91 18:21:21 GMT References: <1991Jan10.170207.23311@usenet.ins.cwru.edu> Organization: Apple Computer Inc., Cupertino, CA Lines: 67 In article <1991Jan10.170207.23311@usenet.ins.cwru.edu> mike@pyrite.SOM.CWRU.Edu (Michael Kerner) writes: > I'm importing a file edited by an IBM. >The file is unformatted by the IBM editor, but two strange things happen with >it. Here's the script >... >open file "pathname:filename" >read from file "pathname:filename" for soManyChars >put it into card field "SoAndSo" >... > >At this point, lines 2 through last of the file have a block preceding them. That block represents a linefeed character. Many computers expect a carriage return and a linefeed at the end of a line of text to tell them to start a new line. The Macintosh expects only a carriage return. HyperCard automatically strips linefeed characters from fields when they are closed for editing and written to the disk. >To prove that all lines have a block in front I scroll to the bottom of the >field (by the way, it's a scrolling field), and check the last few lines as >well. When the scroll bar is at the bottom of the field, I type >first char of line 2 of card field "SoAndSo" >into the message box, and guess what? I get the real first character of that >line! Oh, maybe HC doesn't recognize the block, so I scroll back up to the >top, only now the blocks are ALL GONE, everywhere in the field! When you clicked on the message box (or chose "Message" from the Go menu, or whatever you did to start typing into the message box), the field was closed for editing, and HyperCard performed its automatic stripping. That's why the linefeeds went away. >Figuring I can use this trick I add >set the scroll of field "SoAndSo" to SomeHumungousNumber >put the first char of line 2 of field "SoAndSo" into it >set the scroll of field "SoAndSo" to 0 > >only that doesn't work. >AAAAUUUUUUGGGGHHH!!! Quiet down, please. I'm trying to get some work done. :-) The trick isn't in the scrolling -- the trick is in getting the field to be closed for editing. You might try this script: lock screen -- no need to watch this open file "pathname:filename" read from file "pathname:filename" for 30000 put it into card field 1 select char 1 to 30000 of card field 1 -- opens the field for editing close file "pathname:filename" unlock screen -- has the side effect of closing the field for editing > Also, I'm using version 1.2.5 - no reason to upgrade >to 2.0 until all the bugs (and XCMD's/XFCN's) are upgraded! Well, I can think of lots of reasons. Reason number 1: IMHO, HyperCard 2.0v2 has fewer bugs than HyperCard 1.2.5. Kevin Calhoun HyperCard Team Apple Computer, Inc.