[Date Prev][Date Next][Thread Prev][Thread Next]
[Author Index] [Date Index] [Thread Index]
[SQR-USERS Info] [SQRUG Home Page]

RE: [sqr-users] Using the value of one variable to create a new variable



Hi Avery,
you can't create variables like that on-the-fly.
All variables are created when the program is compiled.
But if you already have all the information in an array, that may help you
achieve your required result. What are you actually trying to do, there may
be another solution.
Cheers, Steve

-----Original Message-----
From: sqr-users-admin@sqrug.org [mailto:sqr-users-admin@sqrug.org]On
Behalf Of Avery Nelson
Sent: Monday, 17 February 2003 2:46 AM
To: sqr-users@sqrug.org
Subject: [sqr-users] Using the value of one variable to create a new
variable



Hi All,

I have the following situation. I would like to use the value of one
variable (e.g. $A = 'B') to create a new variable ($B).

In short, I have an array. In the column Variable, I have values such as $A,
$B, $C. Note, they are stored as literals, but the value in the array is not
quoted.

I would like to Get the value from the array (e.g. $A), and then use that
value to create a new variable, letting $A now equal a new value.

begin-Program

Create-Array Name=DetailRec Size=13
Field=Variable:Char
Field=FirstChar:Char
Field=Length:Char

Put '$ItemIdInitial' '14' '30' Into DetailRec (0) Variable FirstChar Length

Get $Variable $FirstChar $Length from DetailRec (0) Variable FirstChar
Length
Let #FirstChar = to_number($FirstChar)
Let #Length = to_number($Length)
Extract $Variable From $CurrentRecord #FirstChar #Length

end-Program

Where Extract $Variable From $CurrentRecord #FirstChar #Length would
actually be processed like:

Extract $ItemIdInitial From $CurrentRecord #FirstChar #Length

How do you do this????

Avery



---------------------------------
Do you Yahoo!?
Yahoo! Shopping - Send Flowers for Valentine's Day

_______________________________________________
sqr-users mailing list
sqr-users@sqrug.org
http://www.sqrug.org/mailman/listinfo/sqr-users


_______________________________________________
sqr-users mailing list
sqr-users@sqrug.org
http://www.sqrug.org/mailman/listinfo/sqr-users