Hi,
  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.


  set v vfrnew text   -- this was an INT that gets incremented in the loop
  SET V vword1 = "vfrprts" 
  set v vword1 = (.vword1 + .vfrnew) -- now .vword1 = "vfrprts1"
  set v vword2 = (.vword2 + .vfrnew + "Quan") -- now .vword2 = "vfrprts1Quan"
     
      SET V &vword1 = partnum FROM flatrateassy WHERE frrepnum = .vfrrepnum +
      AND .vfrprtsd not cont partnum
      -- this acurately fills the variable .vfrprts1 with the partnum so
      -- .vfrprts1 = "W402"
     
     
      SET V Vfrprtsd = .vfrprtsd +", "+ &vword1
      -- this acurately sets the variable .vfrprtsd = " , W402"
     
      SET V &vword2 = frquantity FROM flatrateassy +
      WHERE frrepnum = .vfrrepnum AND partnum = &vword1
      -- here is where the problem is...  The lookup instead of looking up
      -- the partnumber "W402" it looks for "vfrprts1"


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



Dan Champion
www.championsolutions.net
616-299-7420

Reply via email to