Restored from previous forum. Originally posted by marlo.
I need to call my exe by external parameters, but i dont know how can i work with 2nd or more parameters.
Parameter$ = ProgramParameter()
How can i take the second parameter here if i pass a command line like
myfile.exe firstparameter secondparameter
The firstparameter is Parameter$
Thanks for any help to newbie
from the ass of the world
External Parameters
-
BackupUser
- PureBasic Guru

- Posts: 16777133
- Joined: Tue Apr 22, 2003 7:42 pm
Restored from previous forum. Originally posted by PB.
Keep calling ProgramParameter() until it returns an empty string, because each
time it's called, it returns the NEXT parameter. For example:
PB - Registered PureBasic Coder
Edited by - PB on 19 August 2002 21:55:28
Keep calling ProgramParameter() until it returns an empty string, because each
time it's called, it returns the NEXT parameter. For example:
Code: Select all
Dim p$(99) ; To store parameters (well, up to 99 of them!).
Repeat
a$=ProgramParameter()
If a$"" ; Parameter found!
p=p+1 : p$(p)=a$ ; Add it to the list.
EndIf
Until a$=""
PB - Registered PureBasic Coder
Edited by - PB on 19 August 2002 21:55:28
-
BackupUser
- PureBasic Guru

- Posts: 16777133
- Joined: Tue Apr 22, 2003 7:42 pm