PDA

View Full Version : Writing the contents of an Edit Box to a file.


DaveWortley
05-27-2008, 09:40 AM
I've got a EditBox with some text in and I want to write this to a text file.

But if I had something like

This
Is
My
Text

It writes it to the file as

ThisisMyText

I'm currently using BinStream to write it to the file as StringStream puts in quotation marks either side.

"ThisisMyText" and I don't need them in the text file.

Gravey
05-27-2008, 11:35 AM
i'm guessing you're using:
print (myStringstream as string) to:myFile
instead of
format (myStringstream as string) to:myFile

using format will not put the "" around the string.

As for your multi line string problem, could that be because you are using binstream? I've never used a binstream before so i can't be certain of that.

If not, another solution comes to mind:
parse your multiline string by using something like:
myStringArray = filterstring myMultiLineString "\n"
and then
for s in myStringArray do format "%\n" s to:myFile

DaveWortley
05-27-2008, 01:40 PM
Cheers will test that later.

CGTalk Moderation
05-27-2008, 01:40 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.