Is it Possible to Comment Out Blocks of Text with /*?

kbellis
Global Mapper UserTrusted User
The double forward slash // works great for commenting out a single line, and one line only, but is there anyway to comment out entire blocks of coded lines; e.g.,
/*
blah
blah
blah
*/
Best Answer
-
Hi Kelly,
Per the Script Command reference:Comments
Any lines that begin with the forward slash character (/) are considered comments and are ignored by the script processing engine. This means that you can use C or C++ style comments like // or /* at the start of your line.
But note that this applies to a single line only, and '*/' has no meaning whatsoever (it also means that '//' is not necessary to start a comment; a single '/' will do). So no, /* */ doesn't work across multiple lines in Global Mapper scripts.
Best regards,
~Jeff
Answers
-
Thanks for your reply Jeff!Okay, so the help file should read that you CANNOT use C or C++ style comments for multiline comments; e.g.,Multi-line comments (informally, C style), start with
/*
and end with*/
.,Only Single-line comments (informally, C++ style), start with//
and continue until the end of the line. If the last character in a comment line is a\
the comment will continue in the next line.So therein is another deviation from C style, Global Mapper only needs a single /
Howdy, Stranger!
Categories
- 12.2K All Categories
- 5.3K Features Discussion
- 312 Downloading Imagery
- 1.2K Elevation Data
- 371 Georeferencing Imagery Discussion
- 580 GM Script Language
- 42 User Scripts
- 111 GPS Features
- 388 Projection Questions
- 788 Raster Data
- 1.3K Vector Data
- 6.4K Support
- 159 Announcement and News
- 881 Bug Report
- 554 SDK
- 1.1K Suggestion Box
- 3.6K Technical Support
- 520 Other Discussion
- 125 GIS Data Sources
- 26 Global Mapper Showcase
- 217 How I use Global Mapper
- 99 Global Mapper Forum Website