[comp.sys.mac.hypercard] put command and spaces

mikef@samba.acs.unc.edu (Michael Freedburg) (11/27/90)

Dear HyperHeads,
I am currently reworking my Mailing Labels stack to fit HyperCard 2.0,
and I find that the put command does something I did not expect, so I
post here hoping that an answer will soon be forthcoming.
I let the user import a tab-delimited file, and I would read from file
theTextFile until tab, and put it into field "Names". Then I would read
from the file again till Tab and put space& it afterr field "Names".
This would put an extra space between the two items. Does it do this
because the last char it read is a Tab and it converts that to a space
when one puts the data after a file. I did the import like this to make
sure that it was placing things correctly. Now I read everything into a
variable, making sure everything is correctly positioned, and then put
the variable into the field.
I do need to know, however, about the put and the spaces. Jeanne, help
me please!! I am still waiting for my HyperTalk 2.0 book to come in, so
bear with me.
I am interested in reading the entire file into a variable and then
doing the put from there using the offset function, but I'm not sure if
this will work. If someone has code to do this, and would not mind
sending me a sample, I would greatly appreciate it.
Send to: mikef@samba.acs.unc.edu
No sig file to make you hit the space **just one more time**

smelly@polari.UUCP (Tom Benedict) (11/29/90)

You're right about HyperCard converting tabs to spaces. As for speeding up
the whole process you're/I mean your/ approach to read all the text into
a container then search/replace with offset is the right one. It will go
as fast as hypertalk will let it. The only faster way is to use XCMDs.
To read the whole text file into a container use a repeat loop that
reads for 16000 (thats the max number of chars the bugg(i mean buffer) can hold
) As long as you don't close the 
Ignore the line above, I don't know how to backspace in this stupid editor--
Just keep appending the newly read data to the container using put after
Likewise use a repeat loop with offset, exiting when offset returns "0"
.  Good luck