New to loop script

mangremangre Global Mapper UserPosts: 6
I have a large number of export raster .gms scripts in a folder.

Would anyone have a loop script that could run these sets of .gms scripts, and save the results to the same folder.

Thanks
Paul

Best Answer

  • bmg_bobbmg_bob Global Mapper Programmer Posts: 1,618
    Answer ✓
    Hello,

    You can use the DIR_LOOP_START command to loop through your script files, and the EMBED_SCRIPT command to run the scripts.

    Cheers,
    Bob

Answers

  • mangremangre Global Mapper User Posts: 6
    Hi Bob,
    That did what I have been trying to achieve.for so long. The scripts from 1 through to 15 which are Export Raster scripts. are now looping.. thanks.

    The only problem I have is once I get to 15, it re starts the loop again at 1 through to 15 again.

    Any suggestions, I have attached my script.

    Cheers
    Paul.

    GLOBAL_MAPPER_SCRIPT VERSION=1.00
    DIR_LOOP_START DIRECTORY="C:\Users\paul\AA GLOBAL MAPPER SCRIPTS\A WATER_COLOR SCRIPT\"
    EMBED_SCRIPT FILENAME="FILE 1.GMS"
    EMBED_SCRIPT FILENAME="FILE 2.GMS"
    EMBED_SCRIPT FILENAME="FILE 3.GMS"
    EMBED_SCRIPT FILENAME="FILE 4.GMS"
    EMBED_SCRIPT FILENAME="FILE 5.GMS"
    EMBED_SCRIPT FILENAME="FILE 6.GMS"
    EMBED_SCRIPT FILENAME="FILE 7.GMS"
    EMBED_SCRIPT FILENAME="FILE 8.GMS"
    EMBED_SCRIPT FILENAME="FILE 9.GMS"
    EMBED_SCRIPT FILENAME="FILE 10.GMS"
    EMBED_SCRIPT FILENAME="FILE 11.GMS"
    EMBED_SCRIPT FILENAME="FILE 12.GMS"
    EMBED_SCRIPT FILENAME="FILE 13.GMS"
    EMBED_SCRIPT FILENAME="FILE 14.GMS"
    EMBED_SCRIPT FILENAME="FILE 15.GMS"
    DIR_LOOP_END 


  • mangremangre Global Mapper User Posts: 6
    I should of placed unload all.

    Working perfect...
    Thanks
    Paul
Sign In or Register to comment.