Script Improvement Advice

Malte Brill malte.brill at t-online.de
Thu Jun 5 05:41:00 EDT 2003


Hi Paul,

>What I would like to know is the most elegant beginners way to script
>the placement of properties into each field on pressing an element
>button. At this point I am adding the following script to each button:

Here is my two euro-cents.

I would start naming the fields you want to put your data into with a static
part and a number like:

out1
out2
out3
...

Create another field that holds your data, called "data"
each record is on a line, delimited with a comma like:

Hydrogen,1,1.008,...
  
put the following script in your buttons:

on mouseup
  put 1 into theLine
  --or whatever line of your "data" field is corresponding
  repeat with i=1 to the number of items of line theLine fld "data"
    put item i of line theLine fld "data" into fld ("out"&i)
  end repeat
end mouseup

Hope that helps,

Malte




More information about the use-livecode mailing list