Global Mapper v25.0

NUM(expression) syntax trouble

MKaran
edited February 2017 in GM Script Language
I'm having some troubles getting my variables defined as numbers, instead of strings. Am I setting this up correctly?
From the reference guide: Note that for the '+' operator, if both operands are numeric, then the operation will be numeric addition; otherwise, the operation will be string concatenation

GLOBAL_MAPPER_SCRIPT VERSION=1.00 

DEFINE_VAR NAME=VAR1 VALUE=10
DEFINE_VAR NAME=VAR2 FORMULA=NUM(VAR1)
DEFINE_VAR NAME=VAR3 FORMULA=VAR2+1

This is the output from script above

Defined variable VAR1 to value 10
Defined variable VAR2 to value 10
Defined variable VAR3 to value 101

Answers

  • Mykle
    Mykle Global Mapper User Trusted User
    I'm running v18.1 and getting 11 for VAR3.  What version are you running, and if not the latest, suggest updating yours. 
  • I am running v16, and I'm not sure my license supports upgrades...
  • Mykle
    Mykle Global Mapper User Trusted User
    I don't have an installation of v16 any more.  Please send your first posting to Blue Marble Geographics Support (geohelp@bluemarblegeo.com).  It will help if you include the build number along with the version as noted at the top of your Global Mapper window.  This will ensure that the support team sees your problem.  They may have a useful response for your v16.