On 23/02/2012 18:31, Mark Smith wrote:
What if you want to put fld fieldname into myvar as in the original that Bob
suggested:

"put fld myfield into tvar"&  x

Myfield holds the name of a field that is being copied to a temp variable
that is incrementing inside a loop. I tried various things but could'nt get
it to work.

I suppose I'd ask why you'd need to?

If you want to use a different destination variable each time through the loop, if you don't care to keep it, doesn't this give you a nice squeaky clean new variable each time through:

repeat with idx = 1 to blah
  -- create a new tVar
  local tVar
  put "test"&1 into fldName
  put fld fldName into tVar

  -- use tVar somehow
end repeat

if you do care to keep it, put it into an array:

repeat with idx = 1 to blah
  put "test"&1 into fldName
  put fld fldName into tVar[idx]

  -- use tVar[idx] somehow
end repeat

Wouldn't that do it for you?

-Ken

_______________________________________________
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Reply via email to