Page 1 of 1
grab the names of all fields
Posted: Fri Oct 19, 2012 2:03 pm
by adventuresofgreg
Hello: Is there a way to grab the names of every single field in a stack?
Re: grab the names of all fields
Posted: Fri Oct 19, 2012 2:07 pm
by dunbarx
Sure. Write a short script that navigates to each card (I assume there are different fields on those cards) and collects the field name info on each.
The script ought to be about eight lines. This will be terrific practice, since you will be using two nested repeat loops. (hint)
Do you need help doing this? Write back if you need me to do it, but you should try first.
Craig Newman
Re: grab the names of all fields
Posted: Fri Oct 19, 2012 2:11 pm
by Thierry
adventuresofgreg wrote:Hello: Is there a way to grab the names of every single field in a stack?
Here is some code :
on mouseUp
local tmp
repeat with i=1 to the number of fields of this card
put the short name of field i &cr after tmp
end repeat
put tmp
end mouseUp
HTH
Thierry
Re: grab the names of all fields
Posted: Fri Oct 19, 2012 4:55 pm
by adventuresofgreg
oh ya - use the field number. duh. I'm so used to ref field names, I forget they are sequentially numbered. Thanks. I'm writing a handler to save the state of a standalone to file - probably a cloud based file. I write the contents of every field, and state of each button, etc to an array and dump it into a file - then on open, read that array back in, and fill-in fields, and set buttons etc.
Re: grab the names of all fields
Posted: Fri Oct 19, 2012 7:12 pm
by dunbarx
Hi.
Well and good, then.
Remember. The three main identifying properties of an object, and this dates back to 1987, are the name, number and id. LC has others for certain classes of objects, but these three should be able to handle any possible contingency. They each have their own special attributes. Make sure you know what the id can and cannot do.
Craig Newman