Path: utzoo!attcan!uunet!husc6!rutgers!apple!dan From: dan@Apple.COM (Dan Allen) Newsgroups: comp.sys.mac.hypercard Subject: Re: Read file 16K limit problem Message-ID: <18776@apple.Apple.COM> Date: 14 Oct 88 16:47:43 GMT References: <455@levels.sait.edu.au> Organization: Apple Computer Inc, Cupertino, CA Lines: 64 >Does anyone have any idea on how to read a text document (that is greater >than 16K in size) into a HyperTalk container ? It is very simple. A HyperTalk variable is only limited by RAM. Try this: put empty into theText -- clear a variable named theText repeat read from file "foo" for 16384 -- maximum chars to read if it is empty then exit repeat -- end of file put it after theText -- otherwise append to variable end repeat if the length of theText > 30000 then answer "This will not fit into a single field" with "OK" end if put theText info field 1 -- or whatever you want to do This particular script would check to see if it is larger than the limit of characters for a single field. You could process the text and distribute it across several fields if you wanted. The possibilities are endless... Dan Allen Software Explorer Apple Computer Newsgroups: comp.sys.mac.hypercard,aus.mac Subject: Re: Read file 16K limit problem Summary: Expires: References: <455@levels.sait.edu.au> Sender: Followup-To: Distribution: Organization: Apple Computer Inc, Cupertino, CA Keywords: In article <455@levels.sait.edu.au> mari@levels.sait.edu.au (Renato Iannella CC2-4 X3033) writes: >Does anyone have any idea on how to read a text document (that is greater >than 16K in size) into a HyperTalk container ? It is very simple. A HyperTalk variable is only limited by RAM. Try this: put empty into theText -- clear a variable named theText repeat read from file "foo" for 16384 -- maximum chars to read if it is empty then exit repeat -- end of file put it after theText -- otherwise append to variable end repeat if the length of theText > 30000 then answer "This will not fit into a single field" with "OK" end if put theText info field 1 -- or whatever you want to do This particular script would check to see if it is larger than the limit of characters for a single field. You could process the text and distribute it across several fields if you wanted. The possibilities are endless... Dan Allen Software Explorer Apple Computer