Bruce:

Thanks.  This always gets me so I never use the RTNLIST.  :-)

Bill
Untitled Page


------------------------------------------------------------------------
----- Original Message -----
*From:* [email protected]
*To:* [email protected]
*Date:* 11/20/2013 3:56 PM
*Subject:* Re: [U2] UD PE 7.1.0 - Use of EXECUTE with the RTNLIST option
This is a reply to a old post but since this is the top search result for
RTNLIST, I'll post a reply with useful info.  Unidata's BASIC compiler seems
to be quite particular about the ORDER of the clauses on an Execute.  Put
RTNLIST, RETURNING AND CAPTURING in the wrong order and you'll see a error
like this:

Compiling Unibasic: mysource\test4 in mode 'p'.
main program: syntax error at or before
<line 7> EXECUTE \SELECT VOC\ RETURNING junk RTNLIST l.voc CAPTURING screen;
          ------------------------------------------^
Misuse of reserved word 'RTNLIST'
Expecting: end-of-file,END

compilation failed

Here is the code with examples of proper order of the clauses on an execute
and the final example of EXECUTE producing the failure message above...

done = @FALSE
l.voc = \\
i = 0
*
EXECUTE \SELECT VOC\ RTNLIST l.voc                                 ; *compiles 
ok
EXECUTE \SELECT VOC\ RTNLIST l.voc RETURNING junk                  ; *compiles 
ok
EXECUTE \SELECT VOC\ RTNLIST l.voc RETURNING junk CAPTURING screen ; *compiles 
ok
EXECUTE \SELECT VOC\ RETURNING junk RTNLIST l.voc CAPTURING screen ; *fails 
compile
*
LOOP
    READNEXT id FROM l.voc ELSE done = @TRUE
UNTIL done DO
    i=+ 1
REPEAT
CRT i:\ records counted\
STOP


_______________________________________________
U2-Users mailing list
[email protected]
http://listserver.u2ug.org/mailman/listinfo/u2-users

Reply via email to