|
Dan
TO understand your problem here, you must
understand the difference between a variable to the LEFT of an equal sign and
either to the RIGHT or embedded in a command in R:Base.
If to the LEFT, your & syntax works correctly
because R:base subsitutes the value of the variable for the
&var
So
SET V &vword1 = partnum FROM
becomes
SET VAR vfrprts1 = partnum FROM
However, the SAME is true when on the right side of
the equal sign, so when you later say:
AND partnum = &vword1
R:Base listens and correctly replaces
vword1 with the TEXT vfrprts1!
To get what you want, yuo must do
this:
SET VAR vCommand =
+
('SET V' & .vword2 & '=
frquantity FROM flatrateeassy +
WHERE frrpenum =' &
'.'+'vfrrepnum and partnum =' +
'.' + .vword1)
&vCommand
The SET VAR vCommand will
become:
SET V vfrprts1Quan = frquantity FROM flatrateeassy WHERE frrpenum = .vfrrepnum and partnum =
.vfrprts
I've tested this at the R> prompt
and it works - you need the '.' to put the period in where you want - before the
variable name!
----- Original Message -----
From: Dan
Champion
Sent: Tuesday, August 03, 2004 10:42 AM
Subject: [RBASE-L] - Creating variables on the fly I am hoping someone can see what I am doing wrong here: I am creating variables on the fly in a loop. Each time through the loop the variable name is incremented (and works fine) However I am having troubles using the & variable correctly. see notes in the code. vfrnew text -- this was an INT that gets incremented in the loop Why in one place does it correctly use the value of &vword1 but then on the next line it uses it as though I typed .vword1 Thanks for any advice. Dan www.championsolutions.net 616-299-7420 |
- [RBASE-L] - RE: Last (x) rows Walker, Buddy
- [RBASE-L] - RE: Last (x) rows Rob Vincent
- [RBASE-L] - RE: Last (x) rows Kenny Camp
- [RBASE-L] - Creating variables on the fly Dan Champion
- [RBASE-L] - Re: Creating variables on the fl... David M. Blocker
- [RBASE-L] - Re: Creating variables on th... Dan Champion
- [RBASE-L] - Re: Creating variables on the fly MikeB

