> but with that syntax, wont PROGRAM2RUN execute regardless of whether
or not the SELECT returns results?

Yes.  Like I said, it was "for the record".

I've deleted the original post, but I think the question was about this
syntax sometimes failing:

   CLEARDATA
   DATA 'PROGRAM2RUN'
   EXECUTE 'SELECT FILE'

I have never seen that fail, so I'm no help.


And, look, let's not nitpick about how the original poster runs his
program, whether he selects inside or outside the PROGRAM2RUN, etc., how
he tests intermediate results, etc..  Obviously "FILE" and "PROGRAM2RUN"
are not the real thing.  He simplified things just to set up an example
we could all comprehend.


My own tangential point was that it is possible to stack tcl commands in
a dynamic array, separated by field marks, then execute the lot.
Basically the array can look like a paragraph, including IF, GO, and
labels. 

(Silly) example:

>CT CDS.BP CLARK

     CLARK
0001 CMD = 'TIME'
0002 CMD<-1> = 'SELECT VOC WITH TYPE = "NOSUCH" SAMPLE'
0003 CMD<-1> = 'IF @SELECTED > 0 THEN GO GOT.IT'
0004 CMD<-1> = 'GO FAILED'
0005 CMD<-1> = 'GOT.IT: DISPLAY GOT IT'
0006 CMD<-1> = 'GO DONE'
0007 CMD<-1> = 'FAILED: DISPLAY FAILED'
0008 CMD<-1> = 'DONE: DISPLAY DONE'
0009 CMD<-1> = 'WHO'
0010 CMD<-1> = 'TIME'
0011 EXECUTE CMD
>
>RUN CDS.BP CLARK
10:59:53 24 FEB 2005

0 record(s) selected to SELECT list #0.
FAILED
DONE
11 cds33896
10:59:53 24 FEB 2005
>

One nice thing about this technique is that it spawns the execution
once, not once per command to execute.
When and whether appropriate to use this command stacking technique, I
leave to individual programmers.

cds

P.S.  'empirical' is spelt with an 'i' in the middle, not an 'e' like
one ideot posted yestirday. 
-------
u2-users mailing list
[email protected]
To unsubscribe please visit http://listserver.u2ug.org/

Reply via email to