Core Function isVarInt

From Sputnik Wiki
(Difference between revisions)
Jump to: navigation, search
(Created page with "<pre> isVarInt( $variable ) </pre> === Description === Checks if a variable is a signed 32-bit integer type. === Parameters === ==== variable ==== The variable to check. ==...")
 
 
Line 15: Line 15:
 
=== Return Value ===
 
=== Return Value ===
  
Success: Returns 1.
+
Success: Returns true.
  
Failure: Returns 0.
+
Failure: Returns false.
  
 
=== Remarks ===
 
=== Remarks ===
  
None.
+
Int is an alias for Int32.
  
 
=== Example ===
 
=== Example ===
  
 
<syntaxhighlight lang="sputnik">
 
<syntaxhighlight lang="sputnik">
$var1 = "check me";
+
$var1 = (int)100;
 
println( "Is it?: " . isVarInt($var1) );
 
println( "Is it?: " . isVarInt($var1) );
 +
// Alternative
 +
println( $var1 is int  );
 +
// Alternative
 +
println( $var1 ~~ int  );
 
</syntaxhighlight>
 
</syntaxhighlight>
  
 
[[Category:Core Function]]
 
[[Category:Core Function]]

Latest revision as of 14:24, 21 August 2013

isVarInt( $variable )

Contents

Description

Checks if a variable is a signed 32-bit integer type.

Parameters

variable

The variable to check.

Return Value

Success: Returns true.

Failure: Returns false.

Remarks

Int is an alias for Int32.

Example

$var1 = (int)100;
println( "Is it?: " . isVarInt($var1) );
// Alternative
println( $var1 is int  );
// Alternative
println( $var1 ~~ int  );
Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox