In Universe you can not run a program that is created as an external
subroutine.  That is, any program that has the first executable line as:
        SUBROUTINE MYPROG(PARAM1, PARAM2)

If you try to run it, directly or indirectly through a catalog entry in
the VOC you get the following message:

        "Cannot RUN a subroutine that has arguments."

If the program does not have arguments, THEN you could use the @SENTENCE
variable to see what other command line options were typed in.

BobW


> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:owner-u2-
> [EMAIL PROTECTED] On Behalf Of Cliff Bennett
> Sent: Tuesday, February 01, 2005 4:05 PM
> To: u2-users@listserver.u2ug.org
> Subject: Re: [U2] [AD] UniBasic Program with arguments
> 
> Hi, Savita.  I presume you mean running the program from TCL (:), the
U2
> command prompt.
> 
> In UniData there are two built-in variables, synonyms actually, named
> @SENTENCE and @COMMAND.  These contain the raw command line used to
> invoke your subroutine.
> 
> I usually TRIM this (to eliminate multiple blanks) and then convert
> blanks to a U2 dynamic array delimiter.  I can then count and extract
> these arguments, sort of like argv and argc in C.  A snippet ...
> 
> SUBROUTINE TEST.ARGS
> CMD.LINE = TRIM(@COMMAND)
> CONVERT ' ' TO @AM IN CMD.LINE
> NUM.CMD = DCOUNT(CMD.LINE, @AM)
> SUB.NAME = CMD.LINE<1>
> ARG1 = CMD.LINE<2>
> ARG2 = CMD.LINE<3>
> 
> I believe UniVerse has @SENTENCE also; not sure about @COMMAND.
> 
> Regards, Cliff
> 
> Chauhan, Savita wrote:
> 
> > 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/

Reply via email to