Scripting Reference: PATH Convention
kbellis
Global Mapper UserTrusted User
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.,
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:
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
-
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 -
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). -
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 -
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?
-
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 -
Good to know
Thank you Mike!
Categories
- 12.7K All Categories
- 5.6K Features Discussion
- 342 Downloading Imagery
- 1.3K Elevation Data
- 380 Georeferencing Imagery Discussion
- 628 GM Script Language
- 53 User Scripts
- 113 GPS Features
- 414 Projection Questions
- 819 Raster Data
- 1.3K Vector Data
- 6.6K Support
- 177 Announcement and News
- 908 Bug Report
- 558 SDK
- 1.2K Suggestion Box
- 3.7K Technical Support
- 562 Other Discussion
- 129 GIS Data Sources
- 27 Global Mapper Showcase
- 233 How I use Global Mapper
- 107 Global Mapper Forum Website