On 3/13/05 1:52 PM, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote:
>> Say you have 5 text fields on one card is it possible to have them all
>> save to one file that the user names?
> Eminently so. The basic idea is that you collect up all five fields into
> one variable, and you save that variable to disc. Here's a very simple handler
> which needs to be told where you want to save the variable to:
>
> on SaveAllFiveTo MyTextFile
> put fld "first bit of text" into Fred
> put return & return & fld "second bit of text" after Fred
> put return & return & fld "third bit of text" after Fred
> put return & return & fld "fourth bit of text" after Fred
> put return & return & fld "fifth bit of text" after Fred
>
> open file MyTextFile
> write Fred to file MyTextFile
> close file MyTextFile
> end SaveAllFiveTo
If all 5 fields are numbered in sequence, you can do it even faster this
way:
on SaveAll pNumFields,pTextFilePath
put "" into tData
repeat with x = 1 to pNumFields
put fld x & numToChar(1) after tData
end repeat
delete last char of tData
put tData into url("file:" & pTextFilePath)
end SaveAll
It's probably better to use a delimiter like numToChar(1) instead of CR
because each field may already have return-delimited data in it.
Just my 2 cents,
Ken Ray
Sons of Thunder Software
Web site: http://www.sonsothunder.com/
Email: [EMAIL PROTECTED]
_______________________________________________
use-revolution mailing list
[email protected]
http://lists.runrev.com/mailman/listinfo/use-revolution