2 ; -- written by Alexis de Valence --
6 ; Push 3 ; to get the 3rd parameter of the command line
8 ; Pop $R0 ; saves the result in $R0
9 ; returns an empty string if not found
11 Function GetONEParameter
26 loop3: ; looking for a char that's not a space
28 StrCpy $R0 $CMDLINE 1 $R2
30 StrCpy $R3 $R2 ; found the begining of the current parameter
33 loop: ; scanning for the end of the current parameter
35 StrCpy $R0 $CMDLINE 1 $R2
41 last: ; there will be no other parameter to extract
44 loop2: ; found the end of the current parameter
46 IntCmp $R4 $R5 0 NextParam end
47 StrCpy $R6 1 ; to quit after this process
49 IntOp $R1 $R2 - $R3 ;number of letter of current parameter
50 StrCpy $R0 $CMDLINE $R1 $R3 ; stores the result in R0
53 IntCmp $R6 1 end ; leave if found or if not enough parameters
55 ; process the next parameter
62 Pop $R6 ; restore R0 - R6 to their initial value
69 Exch $R0 ;Puts the result on the stack
73 ; -- written by Michel Meyers --
74 ; ParameterGiven - checks first 9 parameters on the command line
76 ; Push "/parameter" ; to check command line for /parameter
78 ; Pop $R0 ; saves the result in $R0 (result = true or false)
80 Function ParameterGiven
89 StrCmp $R1 9 AllChecked
93 Pop $R2 ; saves the result in $R2