Global Mapper v25.0

Scripting Reference: PATH Convention

kbellis
kbellis Global Mapper UserTrusted User
edited October 2013 in Technical Support
Checking from Global Mapper v5 and forward through v14 (can't manage to find the online Scripting Reference for v15) as well as in the internal Help file file that comes with Global Mapper, the General Overview section indicates paths are to be stated in a particular fashion; e.g.,
FILENAME="c:\\my documents\\test.tif"

Just curious: What is the purpose of doubling up the backslashes?

In my tests this afternoon, it didn't seem to make any difference writing it either way in this little script:
[SIZE=1]GLOBAL_MAPPER_SCRIPT VERSION=1.00
// Saturday, October 12, 2013, 2:02 PM, VKB - path conventions, single or double backslashes?
EXPORT_METADATA FILENAME="*.las" METADATA_FILENAME="C:\MCC-LIDAR experiments\examinations\Baseline\stats01.txt"
EXPORT_METADATA FILENAME="*.las" METADATA_FILENAME="C:\\MCC-LIDAR experiments\\examinations\\Baseline\\stats02.txt"[/SIZE]

Comments

  • tjhb
    tjhb Global Mapper User Trusted User
    edited October 2013
    I don't know whether the double-slash syntax is intentional in the overview section (was it something to facilitate parsing, to distinguish path syntax from end-of-line continuation?) or just an oversight that no one else has ever spotted.

    To my knowledge double slashing is never necessary. (I haven't tested; it may even be a syntax error.)

    None of the examples (at the bottom of each scripting page) uses double slashes.

    The version 15 scripting reference has no version number in the path. (Which is far from ideal; who knows why the change was made? Not by a programmer!)
    Global Mapper Scripting Reference
  • kbellis
    kbellis Global Mapper User Trusted User
    edited October 2013
    Tim - Thanks for the reply. And thanks for the link. I completely agree - there are problems awaiting down the road without a clear linkage between application-document versioning.

    One crazy idea I glimpsed as to the origins of what looks like that maybe it was a legacy issue from back in the early days of Global Mapper comes from a text editor I use (TextPad) where the \\ is used to validate a normal backslash during regular expression operations as the single \ is paired with for example \t (for tab) or \n (for new line).
  • global_mapper
    global_mapper Administrator
    edited October 2013
    It is likely something from the old days when I wrote the help by hand. The \\ is an escape sequence in code for \, so in code they have double-slashes, but not in a script. I probably just wrote it like code usually is.

    For version numbers the help included with each installer should be correct for that version, there just wasn't included script reference for the old versions so they could be out of date. But of course just upgrade then :)

    Thanks,

    Mike
    Global Mapper Guru
    geohelp@bluemarblegeo.com
    Global Mapper
  • kbellis
    kbellis Global Mapper User Trusted User
    edited October 2013
    So Mike, are you saying that we should stick with using the scripting references with the install and not rely on a non-versioned online script reference?
  • global_mapper
    global_mapper Administrator
    edited October 2013
    For a normal user I would say stick with the one that comes with the installer, but for those of you getting new builds all the time there wouldn't be any harm in using the online one that I update directly.

    Thanks,

    Mike
    Global Mapper Guru
    geohelp@bluemarblegeo.com
    Blue Marble Geographics for Coordinate Conversion, Image Reprojection and Vector Translation
  • kbellis
    kbellis Global Mapper User Trusted User
    edited October 2013
    Good to know =)

    Thank you Mike!