DavidW Posted December 14, 2016 Share Posted December 14, 2016 (edited) Hi everyone, Currently i made some parameters that later will be used in a function, I've run across a parameter that doesn't work, hopefully i can get some advice here. $mapje = $map If $cmdline [0]>0 Then Global $mapje = $cmdline[0] Switch $mapje Case "" Case Else msgbox(0, "", "error") EndSwitch EndIf It gives the error undeclared global variable, what i just want is with the first cmdline parameter is that the user types a myprogram.exe C:\test and that it will be stored in an variable. so it can be later used for my function could you guys point me out in the right way? Edited December 14, 2016 by DavidW Link to comment Share on other sites More sharing options...
mikell Posted December 14, 2016 Share Posted December 14, 2016 Global $mapje = $map If $cmdline[0] <> 0 Then ;<<< remove the space between $cmdline and [0] $mapje = $cmdline[1] ;<<< first param is in $cmdline[1] 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