Get command-line arguments in QB 4.5 ? 
Author Message
 Get command-line arguments in QB 4.5 ?

Hello Everybody,

How can I get the command-line arguments pass to my QB 4.5 program (if any!)
? Some sample code would be nice.

--

Lennie De Villiers

PL/I for Palm Project: http://www.*-*-*.com/ ~lennie2000/comp/PLI_Palm/
e (Exclamation) Programming Language:
http://www.*-*-*.com/ ~lennie2000/comp/e_lang/
-- Remove ~ and 9s to reply --



Sun, 08 Aug 2004 20:41:09 GMT  
 Get command-line arguments in QB 4.5 ?
On Wed, 20 Feb 2002 14:41:09 +0200, "D De Villiers"

Quote:

>Hello Everybody,

>How can I get the command-line arguments pass to my QB 4.5 program (if any!)
>? Some sample code would be nice.

print COMMAND$

--
Arargh (at arargh dot com)    http://www.arargh.com



Mon, 09 Aug 2004 07:23:38 GMT  
 Get command-line arguments in QB 4.5 ?
On Wed, 20 Feb 2002 14:41:09 +0200, "D De Villiers"

Quote:

>Hello Everybody,

>How can I get the command-line arguments pass to my QB 4.5 program (if any!)
>? Some sample code would be nice.

In QuickBasic 4.5, the whole command tail (everything on the command
line after the program name) is available from function COMMAND$ (this
is an unusual function; no parameters).  Depending on what you want to
put in the command tail, you may need to use INSTR() and MID$() to
dissect the string you get.  The EXAMPLES directory includes a QB
translation of the C function strtok(), which scans a space-delimited
string and puts each word in a seperate string.

Note that COMMAND$ is properly set only when a compiled program runs
outside the IDE.  To test code using this function inside the IDE,
make sure you have "Full menus" checked in the Options menu and use
"Modify COMMAND$" in the Run menu to enter a simulated command tail.



Mon, 09 Aug 2004 07:27:51 GMT  
 Get command-line arguments in QB 4.5 ?


Quote:
>Hello Everybody,
>How can I get the command-line arguments pass to my QB 4.5 program (if
>any!) ? Some sample code would be nice.

REM     get the command line
        cline$ = COMMAND$ + " "
        i = 0
        WHILE cline$ <> ""
                p = INSTR(cline$, " ")
                arg$(i) = RTRIM$(LEFT$(cline$, p))
                cline$ = RIGHT$(cline$, (LEN(cline$) - p))
                i = i + 1
        WEND

returns the command parms in arg$(x), one parm to each element.

Mike-

Quote:
>--
>Lennie De Villiers
>PL/I for Palm Project:
> http://www.*-*-*.com/ ~lennie2000/comp/PLI_Palm/ e (Exclamation)
>Programming Language:
> http://www.*-*-*.com/ ~lennie2000/comp/e_lang/
>-- Remove ~ and 9s to reply --

-------------------------------------------------------------------
              My web page is at http://www.*-*-*.com/

          Because network administration is like herding cats.
-------------------------------------------------------------------
It is currently impossible to email me from any address in the domains:
     mailcity.com, hotmail.com, e{*filter*}.com, yahoo.com, hotbot.com

              Mail sent from Microsoft Outlook will also be filtered.

Spam and viruses are surplus to my needs.  Sorry for the inconvenience.
-------------------------------------------------------------------

-----=  Posted via Newsfeeds.Com, Uncensored Usenet News  =-----
http://www.*-*-*.com/ - The #1 Newsgroup Service in the World!
 Check out our new Unlimited Server. No Download or Time Limits!
-----==  Over 80,000 Newsgroups - 19 Different Servers!  ==-----



Mon, 09 Aug 2004 21:13:55 GMT  
 Get command-line arguments in QB 4.5 ?
Thank You! For all your replies :) Mike your code is very handy (give me
that Java feeling!)

--

Lennie De Villiers

PL/I for Palm Project: http://www.crosswinds.net/~lennie2000/comp/PLI_Palm/
e (Exclamation) Programming Language:
http://www.crosswinds.net/~lennie2000/comp/e_lang/
-- Remove ~ and 9s to reply --



Wed, 11 Aug 2004 17:39:58 GMT  
 Get command-line arguments in QB 4.5 ?


Quote:
> Hello Everybody,

> How can I get the command-line arguments pass to my QB 4.5 program (if
any!)
> ? Some sample code would be nice.

I early post a comprehensive answer about that so check it out at

http://groups.google.com/groups?selm=96et38%24560%241%40news1.sunrise.ch

       Andreas



Tue, 17 Aug 2004 21:38:33 GMT  
 
 [ 6 post ] 

 Relevant Pages 

1. QB 4.5 for DOS, Command Line Options for BC.EXE

2. command line arguments in QB 7.1 PDS

3. QB 4.5 Printer Commands

4. QB 4.5 SHELL command in large programme help needed

5. Getting command line arguments...

6. Getting the COMMAND line arguments in QBASIC

7. Getting the command line arguments

8. Getting command line arguments with Win32_process

9. QB 4.0 Docs/QB 4.5 Wanted

10. want QB 4.5 QB 7.1 FOR FREE!!!

11. Where's QB.LIB in QB 4.5?

12. Passing a command line parameter to a QBASIC 4.5 program

 

 
Powered by phpBB® Forum Software