Welcome to our new forum platform. We realize there is still some work to do and we appreciate your patience. Please let us know if you have any ideas or suggestions: paul@globalmapperforum.com

Allow script parameters in batch mode.

EricGagneEricGagne Global Mapper UserPosts: 129Trusted User mod
edited August 2012 in Suggestion Box
Mike,

Would it be possible to allow passing parameter values on the command line when running a script in batch mode ?

Given the following example
GLOBAL_MAPPER_SCRIPT VERSION=1.00
SET_LOG_FILE FILENAME="G:\Canvec1.log"

DEFINE_VAR NAME="iPath"        VALUE="S:\Data\Geomatique\Cartes\Canvec" PROMPT=NO
DEFINE_VAR NAME="lPath"        VALUE="S:\Data\Geomatique\Cartes\Geobase\Elevation\50K" PROMPT=NO 
DEFINE_VAR NAME="ePath"        VALUE="S:\Data\Geomatique\Cartes" PROMPT=NO
DEFINE_VAR NAME="Projet"    VALUE="Maison" PROMPT=NO
DEFINE_VAR NAME="Zone"        VALUE="031" PROMPT=YES PROMPT_TEXT="Zone Number:"
DEFINE_VAR NAME="Section"    VALUE="E" PROMPT=YES PROMPT_TEXT="Section"




command line arguments would allow to pass the prompted variables to the script.


global_mapper13 scriptfile.gms 'Zone=032' 'Section=A'

I built a script that I will need to run 160 times with different values (10 zones with 16 sections each). Now I do it interactively and I type in my values but it would be nice if I could make a batch file to run GM with my parameters 160 times and just let it go unattended.

Comments

  • global_mapperglobal_mapper Administrator Posts: 17,238BMG Staff ✭✭
    edited August 2012
    There is actually additional looping support coming in the v14 release that would allow you to loop over the numbers you need from an outer script, then use EMBED_SCRIPT to call your other script after using DEFINE_VAR based on the loop values. See http://www.globalmapper.com/helpv14/ScriptReference.html#cmd_var_loop_start for how the new looping support will function. We expect to release v14 in early September.

    Thanks,

    Mike
    Global Mapper Guru
    gmsupport@bluemarblegeo.com
    http://www.globalmapper.com
  • EricGagneEricGagne Global Mapper User Posts: 129Trusted User mod
    edited August 2012
    Mike,

    I'm aware of the coming VAR_LOOP as I'm the person who suggested it :).

    Does it support looping on alphabetical sequences like A to P ? Maybe I misunderstood but I thought it would only work for numbers.
  • global_mapperglobal_mapper Administrator Posts: 17,238BMG Staff ✭✭
    edited August 2012
    Ah yes it was just written to loop over numbers, but I've just updated it to work over ranges of characters as well now too, so you will be able to loop over A to P.

    Thanks,

    Mike
    Global Mapper Guru
    gmsupport@bluemarblegeo.com
    http://www.globalmapper.com
  • EricGagneEricGagne Global Mapper User Posts: 129Trusted User mod
    edited August 2012
    Wonderful.

    Thank's Mike. I'm really looking forward to v14.
Sign In or Register to comment.