Geoffrey,
Even better solution
SET vAmpName='vCement' -- or what ever you want the assigned name to be
or
SELECT ('v'+columnname) INTO vAmpName FROM tablename WHERE ...
SET &vAmpName INTEGER = 6294
SHOW VAR vCement
result 6294 INTEGER
OR
SET &vAmpName TEXT = 'New value for vNewName'
SHOW VAR vCement
result 'New Value for vNewName' TEXT
Use of an '&varname' functions just a it would in other commands. Replacing the
&varname with its value.
Emmitt Dove wrote:
Geoffrey,
>
>Yes you can.
>
>SELECT columnname INTO vvarname FROM tablename WHERE ...
>SET VAR vcmd = 'SET VAR v' + .vvarname & '= somevalue'
>&vcmd
>RETURN
>
>
>Emmitt Dove
>Manager, Converting Applications Development
>Evergreen Packaging, Inc.
>[email protected]
>(203) 214-5683 m
>(203) 643-8022 o
>(203) 643-8086 f
>[email protected]
>
>-----Original Message-----
>From: [email protected] [mailto:[email protected]] On Behalf Of Geoffrey
>Wheeler
>Sent: Tuesday, July 21, 2009 9:21 PM
>To: RBASE-L Mailing List
>Subject: [RBASE-L] - Naming Variables from another variable result
>
>Is is possible to define a variable name based on the result of another
>variable?
>For instance, I would like to look up a product name based on a product
>number
>and assign it to vprodname, say the result is vprodname = cement. I would
>then
>like to define another variable using that product name in the new variable
>name,
>say v"cement"usage. Can this be done? Thanks
>
>
Jim Bentley
American Celiac Society
[email protected]
tel: 1-504-737-3293