Array of fields

LiveCode is the premier environment for creating multi-platform solutions for all major operating systems - Windows, Mac OS X, Linux, the Web, Server environments and Mobile platforms. Brand new to LiveCode? Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
proza
Posts: 14
Joined: Thu Jul 12, 2007 3:34 pm

Array of fields

Post by proza »

I have a number of fields on a card labelled "f1", "f2", "f3", etc

I would like to ask is it possible to access then like an array?

For example:

repeat with i=1 to whatever
put i into field "f" & i
end repeat

Thanks!
xApple
Posts: 113
Joined: Wed Nov 29, 2006 10:21 pm

Post by xApple »

Yes absolutly, your code seams to be functional. Is it not ?
To add a layer of abstraction to commands you write in trascript the merge() and format() command are intresting. You can find a few exemples here:
http://forums.runrev.com/phpBB2/viewtopic.php?t=487
proza
Posts: 14
Joined: Thu Jul 12, 2007 3:34 pm

Post by proza »

When I click Apply, there is an error complaining about the & sign.
Klaus
Posts: 14324
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Post by Klaus »

Hi proza,

use brackets and it will work :-)

repeat with i=1 to whatever
put i into field ("f" & i)
end repeat

Rev will evaluate the string first to "f1", "f2" etc.


Regards

Klaus


P.S.
But an array is a complete different animal ;-)
proza
Posts: 14
Joined: Thu Jul 12, 2007 3:34 pm

Post by proza »

Thanks Klaus.
Post Reply