Mats,

Clever but not quite there... 
That would only work if the subroutine used arg 1 as a return argument.

Brian

> -----Original Message-----
> From: [EMAIL PROTECTED] 
> [mailto:[EMAIL PROTECTED] On Behalf Of Mats Carlid
> Sent: 03 February 2005 10:22
> To: u2-users@listserver.u2ug.org
> Subject: Re: [U2] [AD] UniBasic Program with arguments
> 
> Well,
> 
> actually you can, sort of :
> 
> LIST VOC SAMPLE 1 EVAL  "SUBR('your.subroutine', arg1 , arg2 )"
> 
> Then we can argue forever if this is really running from TCl 
> or what.  ;^)
> 
> And  IIRC  this has been mentioned on the list before.
> 
> -- mats
> 
> 
> Chauhan, Savita wrote:
> 
> >Thanks all you guys for all your replies. 
> >This list has come to my rescue so many times. I have so 
> much more to 
> >learn.
> >
> >I realized that I can run my program (with args) only as one of the 
> >following (without any external utitlity) :
> >1. as a subroutine (with no args, but can use @COMMAND to read the 
> >command line) 2. as an external subroutine (with args)
> >
> >If I make it a subroutine, then I cannot call it from 
> another pgm and 
> >pass it args.
> >If I make external subroutine, I cannot run it from TCL.
> >
> >Thanks again.
> >
> >Savita Chauhan,
> >Programmer/Analyst
> >x:1754 Central Texas College.
> >-------------------------------------------
> >Change is the only Constant.
> >
> >
> >-----Original Message-----
> >From: [EMAIL PROTECTED]
> >[mailto:[EMAIL PROTECTED] On Behalf Of Mark Johnson
> >Sent: Wednesday, February 02, 2005 8:18 AM
> >To: u2-users@listserver.u2ug.org
> >Subject: Re: [U2] [AD] UniBasic Program with arguments
> >
> >Here it is, pretty quickly.
> >
> >Create a Databasic Program, I call mine PRINT (losing regard 
> for PRINT 
> >being there). That is a simple program that takes the @COMMAND or 
> >PROCREAD or TCLREAD line you just typed as the first line in a Basic 
> >program, throw an END at the end, compile and run itself.
> >
> >Thus, you can have this or virtually any single line program 
> run from 
> >TCL.
> >This is the absolutely best and simplest method. I use this 100's of 
> >time a day for testing the OCONV's, simple math, anything. Its only 
> >limitation is multiple line IF statements or anything with an ELSE.
> >
> >PRINT ; CALL MY.SUB(ARG1, ARG2, WHATEVER) ; PRINT WHATEVER
> >
> >PRINT 5+5
> >PRINT OCONV("12345","DMA")
> >PRINT ; OPEN "MD" THEN READ X FROM "YOUR.ID" THEN WRITEV "A" ON 
> >"SOMETHING",
> >2
> >PRINT ; FOR I=1 TO 15 STEP 2 ; PRINT I,I*11 ; NEXT I
> >
> >ED MD PRINT
> >001 PQN
> >002 HRUN BP PRINT.PROG
> >003 P
> >
> >ED BP PRINT.PROG
> >001 PROCREAD TEST ELSE STOP
> >OR
> >001 TCLREAD TEST
> >OR
> >001 [EMAIL PROTECTED]
> >001+ CONVERT CHAR(254) TO " " IN TEST
> >002 OPEN "BP" TO F.BP ELSE STOP
> >003 TEST<2>="END"
> >004 ID="PRINTTT"
> >005 WRITE TEST ON F.BP, ID
> >006 EXECUTE "DECATALOG BP ":ID
> >007 EXECUTE "BASIC BP ":ID
> >008 EXECUTE "RUN BP ":ID
> >
> >That's it. I created this in 1978 and have written 2 
> articles about it, 
> >one in Datastream and the other for Spectrum. It should be 
> part of the 
> >MV OS.
> >
> >My 3 cents.
> >
> >----- Original Message -----
> >From: "Chauhan, Savita" <[EMAIL PROTECTED]>
> >To: <u2-users@listserver.u2ug.org>
> >Sent: Tuesday, February 01, 2005 5:48 PM
> >Subject: [U2] [AD] UniBasic Program with arguments
> >
> >
> >  
> >
> >>Hi,
> >>
> >>I am trying to run a unibasic program (external subroutine) 
> that takes 
> >>two arguments.
> >>I don't know how do I pass it the arguments if I run it 
> directly from 
> >>shel prompt instead of calling it from another program.
> >>I have gone through the manual, but can't find anything. Pls help.
> >>
> >>Thanks
> >>Savita.
> >>-------
> >>u2-users mailing list
> >>u2-users@listserver.u2ug.org
> >>To unsubscribe please visit http://listserver.u2ug.org/
> >>    
> >>
> >-------
> >u2-users mailing list
> >u2-users@listserver.u2ug.org
> >To unsubscribe please visit http://listserver.u2ug.org/
> >-------
> >u2-users mailing list
> >u2-users@listserver.u2ug.org
> >To unsubscribe please visit http://listserver.u2ug.org/
> -------
> u2-users mailing list
> u2-users@listserver.u2ug.org
> To unsubscribe please visit http://listserver.u2ug.org/
-------
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/

Reply via email to