Page tree
Skip to end of metadata
Go to start of metadata



Introduced in

Version:3.4

Description

Description:Checks whether a MGRS coordinate string is compatible with the coordToPos command.

Syntax

Syntax:[coords, allowEmpty] call fn_vbs_validateGPSCoord
Parameters:
  • coords: String - MGRS coordinate to be tested
  • allowEmpty: Boolean - If true, then empty coordinates are allowed, and will return a positive result.
Return Value:Number - Result of check:
  • 0: String is a valid coordinate,
  • 1: String was empty and it wasn't allowed,
  • 8: The format of the coordinate is incorrect

Alternative Syntax

Syntax:[coords, allowEmpty, formats] call fn_vbs_validateGPSCoord (V3.6+)
Parameters:
  • coords: String - MGRS coordinate to be tested
  • allowEmpty: Boolean - If true, then empty coordinates are allowed, and will return a positive result.
  • formats: Array of String - Format(s) to check against. (optional, default: ["MGRS"])
    • "GRID": Grid position, as interpreted by gridToPosition (e.g. "008003")
    • "MGRS": Long (3 component) MGRS coordinate (e.g. "24SVJ0250082520")
    • "MGRSSHORT": Short MGRS coordinate, without the grid-zone and square identifiers (e.g. "0250082520")
Return Value:Number - Result of check:
  • 0: String is a valid coordinate,
  • 1: String was empty and it wasn't allowed,
  • 8: The format of the coordinate is incorrect

Warning

When using functions in VBS versions older than 3.4, certain limitations and requirements should be kept in mind - the main ones being that capitalization of the function name is crucial, and that #include "\vbs2\headers\function_library.hpp" has to be included in every script that utilizes it. More Category VBS Scripting Functions.

Examples

Examples:
_valid = ["21MTU7639588684"] call fn_vbs_validateGPSCoord
_valid = ["008003",0,["GRID"]] call fn_vbs_validateGPSCoord
_valid = ["24SVJ0250082520",0,["MGRS"]] call fn_vbs_validateGPSCoord
_valid = ["0250082520",0,["MGRSSHORT"]] call fn_vbs_validateGPSCoord

Additional Information

See also: coordToPos, fn vbs validateCoords
Multiplayer:
Problems:

Notes