Jump to content
Sign in to follow this  

assign a map location to an parameter

Recommended Posts


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")

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 by DavidW

Share this post

Link to post
Share on other sites
Global $mapje = $map

If $cmdline[0] <> 0 Then   ;<<< remove the space between $cmdline and [0]
    $mapje = $cmdline[1]   ;<<< first param is in $cmdline[1]


Share this post

Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this