Difference between revisions of "IsNumeric"

From Catglobe Wiki
Jump to: navigation, search
 
(One intermediate revision by one other user not shown)
Line 1: Line 1:
[[Category:General_Functions]]
+
{{HelpFiles}}

+
 
 +
==== isNumeric  ====
 +
 
 +
Checks if the value of a specific parameter can be converted to a number.
 +
 
 +
'''Syntax'''
 +
 
 +
isNumeric(expression)
 +
 
 +
'''Arguments'''
 +
 
 +
expression: Is an expression of any types defined
  
====isNumeric====
+
'''Return type'''
  
Checks if the value of a specific parameter can be converted to a number.
+
bool
  
'''Syntax'''
+
'''Examples'''  
  
isNumeric(expression)
+
''string a = "1";''
  
'''Arguments'''
+
''if (isNumeric(a)) print("The value of a can be converted to a number"); ''  
  
expression: Is an expression of any types defined
+
''else print("The value of a cannot be converted to a number");''
  
'''Return type'''
+
''//Result: The value of a can be converted to a number''  
  
bool
+
''//------------------------------''
  
'''Examples'''
+
''string b = "Where do you go?";''  
  
''{''
+
''if (isNumeric(b)) print("The value of b can be converted to a number");''  
  
''string a = "1";''
+
''else print("The value of b cannot be converted to a number"); ''  
  
''if (isNumeric(a)) print("The value of a can be converted to a number");''
+
''//Result: The value of b cannot be converted to a number''  
  
''}''
+
'''Availability'''  
  
'''Availability'''
+
Version 4.8 __NOTOC__ <!-- imported from file: 417.htm-->
  
Version 4.8
+
[[Category:General_Functions]]
__NOTOC__
 
<!-- imported from file: 417.htm-->
 

Latest revision as of 04:53, 22 December 2011



isNumeric

Checks if the value of a specific parameter can be converted to a number.

Syntax

isNumeric(expression)

Arguments

expression: Is an expression of any types defined

Return type

bool

Examples

string a = "1";

if (isNumeric(a)) print("The value of a can be converted to a number");

else print("The value of a cannot be converted to a number");

//Result: The value of a can be converted to a number

//------------------------------

string b = "Where do you go?";

if (isNumeric(b)) print("The value of b can be converted to a number");

else print("The value of b cannot be converted to a number");

//Result: The value of b cannot be converted to a number

Availability

Version 4.8