I know VARIABLES should not be defined inside a WHILE loop.
Does that apply to variables that are defined in a RUN SELECT that is run inside a WHILE loop?

Specifically, I have a RUN SEL clump of code that generates sequential alpha-numeric numbers. In it, I clear 9 variables, SET VAR those 9 (all are TEXT), run about 100 lines of code, and then clear 8 of the variables.
It runs in a WHILE loop of anywhere from 1 to 30 iterations.

This is the code in the RUN SELECT, command name 'GenTaskBarCode':
CLEAR VAR  +
vTaskBarcode, +
 vDigit1, +
 vDigit2, +
 vDigit3, +
 vDigit4, +
 vDigit5, +
 vMaxDigit, +
 vMinDigit, +
 vNextDigit

SET VAR  +
  vTaskBarcodeTEXT, +
  vDigit1 TEXT, +
  vDigit2 TEXT, +
  vDigit3 TEXT, +
  vDigit4 TEXT, +
  vDigit5 TEXT, +
  vMaxDigit TEXT, +
  vMinDigit TEXT, +
  vNextDigit TEXT

Runs about 100 lines of code

CLEAR VAR  +
[8 variables, not vTaskBarcode]
RETURN

The WHILE loop is:

WHILE SQLCODE <> 100 THEN
  RUN SELECT CmdCode FROM InternalCode WHERE CmdName='GenTaskBarCode'

  UPDATE tSHPT SET tTaskBarcode  =('1467'+.vTaskBarcode) +
    WHERE PIKD_ID = .vPIKD_ID
  FETCH c#1 INTO vPIKD_ID vi1
ENDWHILE

TIA,
Doug

--
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus

--
For group guidelines, visit 
http://www.rbase.com/support/usersgroup_guidelines.php
--- You received this message because you are subscribed to the Google Groups "RBASE-L" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rbase-l/d776aa67-78b4-5183-d066-9b3a18c78f61%40wi.rr.com.

Reply via email to