Guest Nobody Posted April 9, 2004 Share Posted April 9, 2004 $i = 1 While $i <= $CmdLine[0] $GK_OptionString = $GK_OptionString & $CmdLine[$i] & "£" ;£ = separator $i = $i + 1 WEnd $i = 1 While $i <= $CmdLine[0] ;$GK_OptionString to array $GA_Options = StringSplit ($GK_OptionString, "£") F_StripOption("/", "KR", "=", 4) F_StripOption("/", "VR", "=", 4) $i = $i + 1 WEnd ;Removes the option itself and keeps the value behind the option DOES NOT FUNKTION!!! Func F_StripOption($LV_OptPreChar, $LV_OptChar, $LV_OptPostChar, $LV_OptLen) $LV_Option = $LV_OptPreChar & $LV_OptChar & $LV_OptPostChar If StringInStr ($GA_Options[$i], $LV_Option) > 0 Then $LV_Opt = "$GK_Opt" & $LV_OptChar $LV_Opt = StringTrimLeft ($CmdLine[$i], $LV_OptLen) MsgBox(0, "Debug $LV_Opt", $LV_Opt) ;Value MsgBox(0, "Debug $GK_OptKR", $GK_OptKR) ;No value! EndIf EndFunc How to set the value of $LV_Opt and not $LV_Opt itself? The value of $LV_Opt is: $GK_OptKR Greatful for advice Link to comment Share on other sites More sharing options...
CyberSlug Posted April 9, 2004 Share Posted April 9, 2004 I cannot quite follow what you are trying to do, but you might look at the Eval function: $a = 7 $b = Eval("a") ;notice there is no $ in the name; $b will be assigned 7 Use Mozilla | Take a look at My Disorganized AutoIt stuff | Very very old: AutoBuilder 11 Jan 2005 prototype I need to update my sig! Link to comment Share on other sites More sharing options...
Guest Nobody Posted April 10, 2004 Share Posted April 10, 2004 I'm trying to set the value of $LV_Opt. F_StripOption("/", "KR", "=", 4) ;$LV_OptChar=KR F_StripOption("/", "VR", "=", 4) ;$LV_OptChar=VR $LV_Opt = "$GK_Opt" & $LV_OptChar $LV_Opt = StringTrimLeft ($CmdLine[$i], $LV_OptLen) First lap $LV_Opt="$GK_Opt" & $LV_OptChar=$GK_OptKR Next lap $LV_Opt="$GK_Opt" & $LV_OptChar=$GK_OptVR I'm trying to use my funktion insted of: If StringInStr ($GA_Options[$i], '/KR=') > 0 Then $GK_OptKR = StringTrimLeft ($CmdLine[$i], 4) EndIf If StringInStr ($GA_Options[$i], '/VR=') > 0 Then $GK_OptVR = StringTrimLeft ($CmdLine[$i], 4) EndIf I'll check the Eval funktion out tomorrow, time is 02:15 in Sweeden and I'm getting sleepy Thanks for trying helping me out! Link to comment Share on other sites More sharing options...
trids Posted April 10, 2004 Share Posted April 10, 2004 You're setting $i outside of the function, and using it inside the function: to do this, you would need to define it as Global. See the helpfile for the differences between "Dim", "Local" and "Global".HTH Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now