Obviously my PRINT process will have its limitations. The major success is
not cluttering the BP's with so many stupid 1 or 2 line test programs. As I
acquire new clients with their prior programmers programs, I see way too
many of these. Virtually all can be replaced with my PRINT process.
As far as return arguments, I agree. If you have a major sub to a major
primary program, you would type way too much at the command line to test
that sub. But, you can have return arguments.
Case in point. One client had a price lookup process that was hand coded in
8-10 programs. Basically the same 80 lines in each. I wrote a single sub
called GET.PRICE(CUSTNO, PRODNO, PRICE) to corral the wild horses. And, yes,
I can type this at TCL:
PRINT ; CALL GET.PRICE("001385", "WINGNUT", PRICE) ; PRINT
OCONV(PRICE,"MD2")
Except for complex subs, the only other downside would be a READNEXT or
complex ELSE scenario, COMMONS, GOTOs or GOSUBs or if it just got to be too
much typing. I tend not to use any INPUT statements as well.
Bottom line is that roughly 85% of the stupid test programs can be replaced
with PRINT including testing most simple subs..
Thanks.
My 3 cents.
----- Original Message -----
From: "Chauhan, Savita" <[EMAIL PROTECTED]>
To: <[email protected]>
Sent: Thursday, February 03, 2005 9:09 AM
Subject: RE: [U2] [AD] UniBasic Program with arguments
> That's a good idea if the program doesn't have return arguments.
>
>
> -----Original Message-----
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] On Behalf Of David Jordan
> Sent: Thursday, February 03, 2005 12:52 AM
> To: [email protected]
> Subject: RE: [U2] [AD] UniBasic Program with arguments
>
> You can run a program with arguments from the command line as below
>
> RUN BP PROG ARG1 ARG2 ARG3
>
> In the program use SEEK(ARG.,..) or GET(ARG.,...) to get the arguments
> from
> the command line. Don't forget to quote the arguments if there are
> spaces
> in them.
>
> You can run the program with parameters from within a BASIC Program
> EXECUTE "RUN BP PROG ":arg1:" ":arg2:" ":arg3
>
>
> Regards
> David Jordan
> Founding U2UG Board Member
>
>
>
> -----Original Message-----
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] On Behalf Of Chauhan, Savita
> Sent: Thursday, 3 February 2005 1:59 AM
> To: [email protected]
> Subject: RE: [U2] [AD] UniBasic Program with arguments
>
> 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.
> -------------------------------------------
> -------
> u2-users mailing list
> [email protected]
> To unsubscribe please visit http://listserver.u2ug.org/
> -------
> u2-users mailing list
> [email protected]
> To unsubscribe please visit http://listserver.u2ug.org/
-------
u2-users mailing list
[email protected]
To unsubscribe please visit http://listserver.u2ug.org/