取得cmdline參數
Result$ = ProgramParameter([Index])
Gets the next parameter string that was passed to the executable when it was launched or, if the 'Index' parameter (starting with 0) is specified, the parameter with that index. When no more parameters are available, an empty string is returned.
This function is especially useful for console programs, where the user passes one or more parameter at the program start.
Note: Relying on the return of an empty string to detect the last parameter is not a good practice, since the function also returns an empty string if an empty string was passed in "" on the commandline. The prefered method which should be used to get all parameters, is to get the count with CountProgramParameters() and then to call ProgramParameter() as often as needed.
Example:
MyProgram.exe MyText.txt /FAST "Special Mode"
The first time that ProgramParameter() is called, it will return "MyText.txt", the second time "/FAST" and the third time "Special Mode".
沒有留言:
張貼留言