User Login
Name
Password
Site Contents
News
About
Download
Scripts
Tutorials
Register
Support
FAQ
Script Reference
New User


Contact Me
Xide
Online Scripting Reference

isNumber

Purpose
Tests a value to see if it is a valid number.

Syntax
isNumber storageVar {value}

storageVar: A variable to hold the result of the test.

{value}: The value to be tested.



Notes
"storageVar" will be set to TRUE (1) if "value" is a number, otherwise it will be set to FALSE (0).

It is often good practice to test values entered by the user if you expect them to be numeric.

Example
:PlanetsPerSector
getInput $value "Enter number of planets per sector"
isNumber $test $value
if ($test = 0)
  echo ANSI_15 "**Value must be a number*"
  goto :PlanetsPerSector
end
setVar $build_planetsPerSector $value
saveVar $build_planetsPerSector




Return to item listing