Hard code or portable code

Brian Yennie briany at qldlearning.com
Wed Mar 3 20:44:55 EST 2004


Hershrev,

I'm not sure I understand what you mean by "hard-code".
If you want a persistent way to reference a field, regardless of it's 
name, you can use the ID.
Or, to get all of the fields, something like:

repeat with i=1 to (the number of flds)
   put fld i after myVar
end repeat

If you want to write a function that always returns you the latest:

function latestFields
   local myVar
   repeat with i=1 to (the number of flds)
     put fld i after myVar
   end repeat
   return myVar
end latestFields

HTH,
Brian

> Now , how do you get  the contents of all the fields ?
> if you put myVar into myQuery,  the result will be the field names and 
> not the field content ? ( THE MAIN POINT IS TO GET THE LATEST DATA 
> meaning if the user edits the field after the repeat script the result 
> should be the updated contents "as hard code")
> if you come up with a recipe  for this I'll raise my hat for you.



More information about the use-livecode mailing list