Hard code or portable code

Dar Scott dsc at swcp.com
Wed Mar 3 20:52:05 EST 2004


On Wednesday, March 3, 2004, at 06:06 PM, hershrev wrote:

>> Create a list in a manner much like this:
>>
>> repeat with x = 1 to the number of fields
>>    put (the name of field x) & LF after myVar
>> end repeat
> 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")

I am probably still a little lost.  I guess I don't know what "hard 
code" is.

Once the above is set, you can get the contents with this:

put LF into bindingChar
put empty into valueAccumulator
repeat for each line f in myVar
   put field f after valueAccumulator
end repeat

Do you want to have all the field values evaluated each time you look 
at the variable?  I don't know how to do that.

Here are three things that might be close.

A.
Use a function instead of a variable.

    put catFields() into ...

B.
Use value on the variable.  Set it up like this:

    field "Alpha" && field "Beta' && field "Gamma"

Use it like this

    put value(autoCatFields) into ...

C.
Use properties.  If all those field are in a group, then define a 
custom property with a getProp that calculates the concatenation of the 
values of all fields within the group.

    put the catFields of group "Will Robinson" into ...

Am I getting closer?

Dar Scott




More information about the use-livecode mailing list