BBS: Inland Empire Archive
Date: 03-03-92 (17:38) Number: 172
From: PAUL LANKOW Refer#: NONE
To: ZACK JONES Recvd: NO
Subj: COMMAND LINE PARAMATERS Conf: (11) Modula-2
ZJ>I'm learing QuickBASIC - mainly from typing in programs
ZJ>written in magazines
ZJ>(but hey, I've gotta start somewhere). Anyway - one program I typed in
ZJ>recently is called Qcopy and is from the Jan 90 issue of PC Hands On.
ZJ>Basically what the program does is while copying a file it displays a
ZJ>bargraph showing % completed. The program prompts you for the Source File
ZJ>and Output file using INPUT statements. How can I
ZJ>modify the program to pas
ZJ>these two file names as command line paramaters? What
ZJ>I'd like to be able t
ZJ>do is type "Qcopy Sourcefile Outputfile" instead of using the INPUT
ZJ>statements. Thanks in advace for the help. Take Care, Zack Jones.
It would go something like this, assuming the strings as being SourceFile$
and OutputFile$, ok?
cmd$ = COMMAND$
p = instr (cmd$, " ")
if p=0 then
Print "Usage: Qcopy <source> <destination>"
SourceFile$ = left$(cmd$, p-1)
OutputFile$ = Mid$(cmd$, p+1)
And now, my friend, you're off to the races. Hope this helps. By the way,
learning from other people's programs is one of the best ways to do it.
* SLMR 2.1a * Unable to locate Coffee -- Operator Halted!
--- WM v2.01 [Eval]/91-2236
* Origin: DON'T PANIC! Resistance is USELESS! 206-573-9411 (1:105/107)