Instead of creating a "super" field (The Text) as a receipient of all the fields
and lines of data, use a variable (theText).  Write the variable to the text
file.  Same on importing.  It seems that most code works about 10 to 20 times
faster on variables than it does on fields.  When you're done building the
variable - dump it to a field - and - conversely, on input, create the variable
and then at conclusion, dump it to a field.

Good luck,

Jack Rarick
Braintree Athletic Systems

[EMAIL PROTECTED] wrote:

> I have an "excel-like" spreadsheet Metacard stack with 26 multiple scrolling
> fields and 1000 lines of data. The "export" function takes several minutes to
> work! My script is:
> on writeFile content,filePath
>   open file filePath
>   write content  to file filePath
>   close file filePath
> end writeFile
> on toComputer
>   cur
>   lock recent
>   lock messages
>   lock screen
> end toComputer
> on cur
>   set cursor to busy
> end cur
> on mouseUp
>   toComputer
>   set numberFormat to "0"
>   put empty into  fld "The Text"
>   repeat with y= 1 to 1000
>     repeat with x = 1 to 26
>       put line y of  bg fld  ("c"&x)  & tab after fld "The Text"
>     end repeat
>     put return after fld "The Text"
>   end repeat
>    put exportFileDialog() into filePath
>   if word 1 of filePath is not "error" then
>     cur
>     writeFile (bg fld "The Text" && return),filePath
>     answer "The export file is complete." -- �?
>   end if
>   ---
> end mouseUp
> function exportFileDialog
>   ask file "Create export file for this column named:" with "Export File.txt"
> -- �?
>   if (it is empty) or (the result is cancel) then return "Error : cancelled"
>   else return it
> end exportFileDialog
>
> Any ideas to speed up the process. the same problem occurs with the import
> function of very large data files.
> [EMAIL PROTECTED]
>
> Archives: http://www.mail-archive.com/[email protected]/
> Info: http://www.xworlds.com/metacard/mailinglist.htm
> Please send bug reports to <[EMAIL PROTECTED]>, not this list.


Archives: http://www.mail-archive.com/[email protected]/
Info: http://www.xworlds.com/metacard/mailinglist.htm
Please send bug reports to <[EMAIL PROTECTED]>, not this list.

Reply via email to