Can you do a while loop with a ssub?

SET VAR vLoop INT = 1
SET VAR vList = (1,2,3,4,5)
WHILE 1 = 1 THEN
  SET VAR vText = (SSUB(.vList,.vLoop))
  IF vText IS NULL
    BREAK
  ENDIF

  -- Do something

  SET VAR vLoop = (.vLoop + 1)
ENDWHILE

Karen


 

 

 

-----Original Message-----
From: Bruce Chitiea <[email protected]>
To: rbase-l <[email protected]>
Sent: Thu, Feb 16, 2017 10:09 am
Subject: [RBASE-L] - DECLARE CURSOR Source Data Array


All:


Is there an "elegant" way to do this with a simple array of values:


DECLARE CursorName CURSOR FOR (1,2,3,4,5)


... where we're stepping through the array WITHOUT drawing upon a source table?


A long shot:


SELECT 1,2,3,4,5 FROM TableName LIMIT 1


... (where TableName is any table chosen arbitrarily to provide syntax) 
produces:


1 2 3 4 5


... instead of the needed:


1
2
3
4
5


Thoughts?


Bruce Chitiea
SafeSectors, Inc.
909.238.9012 Mobile





-- 
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].
For more options, visit https://groups.google.com/d/optout.


-- 
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].
For more options, visit https://groups.google.com/d/optout.

Reply via email to