Normal Topic Is there a Variable Reference command (Read 405 times)
Bharat_Naik
Senior Member
Members
*****
Offline


Ever ready to learn and
share

Posts: 1202
Location: Chicago,  Illinois
Joined: Dec 16th, 2003
Is there a Variable Reference command
Nov 7th, 2011 at 2:34am
Print Post Print Post  
There are Element Reference commands and Using that one could use loop to assign values. Command such as @Field ( ), SetThisElement, UnSetthisElement and ThisElement make things easy while working with Loop and more so if you give name of the element like M1, M2......M10. 

What I am trying to do is to initialize 30 variables with value of the StringArray of 30 strings using loop.

var vStr1 as String
var vStr2 as String
var vStr3 as String
//..
//..
var vStr30 as String


I want to initialize variable as follows using Loop

vStr1 =   @AccessStringArray (vString, 1)
vStr2 =   @AccessStringArray (vString, 2)
vStr3 =   @AccessStringArray (vString, 3)
//--
//--
vStr30 =  @AccessStringArray (vString, 30)

I tried all different ways to initialize these variables from vString (string of 30), but since there is no Variable Reference command just like Indirect Reference and Element Reference specially for Elements of forms, I could not do it.

Is there any way with using Loop to accomplish this?



  
Back to top
 
IP Logged
 
Hammer
YaBB Administrator
Lanticans
*****
Offline


Fire bad. Tree pretty.

Posts: 3436
Location: Ohio
Joined: Nov 22nd, 2002
Re: Is there a Variable Reference command
Reply #1 - Nov 7th, 2011 at 1:49pm
Print Post Print Post  
This is what Arrays are for. See pages 59-65 in the Sesame 2 Programming Guide.
  

- Hammer
The plural of anecdote is not data.
Back to top
IP Logged
 
Bharat_Naik
Senior Member
Members
*****
Offline


Ever ready to learn and
share

Posts: 1202
Location: Chicago,  Illinois
Joined: Dec 16th, 2003
Re: Is there a Variable Reference command
Reply #2 - Nov 7th, 2011 at 2:33pm
Print Post Print Post  
I used  Arrays quite a bit in the past but after having various stringarray commands, I did not get to use them for quite some time. Let me look at them. Thanks.
  
Back to top
 
IP Logged