Tech Tip: Selected element in an array
PRODUCT: 4D | VERSION: | PLATFORM: Mac & Win
Published On: December 6, 2002
Compatibility: Version 6.7.x and 6.8.x
Platform: Mac & Windows
Every array has a long integer value associated with the array that represents the selected element of that array. You can use this long integer value as a variable to pre-define what the user has selected from the array through the interface. This long integer variable has the same name as the array itself.
For example:
ARRAY TEXT(arrNames;4)
arrNames{1}:=Bob
arrNames{2}:=Joe
arrNames{3}:=Tom
arrNames{4}:=Sue
arrNames{arrNames} refers to the contents of the element of the array.
If the user chooses Joe from the form, then arrNames = 2 and arrNames{arrNames} = Joe.