Is (function): Difference between revisions

From NSB App Studio
Jump to navigation Jump to search
Brendon (talk | contribs)
Created page with "ISARRAY(''expression'') ISDATE(''expression'') ISEMPTY(''expression'') ISNULL(''expression'') ISNUMERIC(''expression'') ISOBJECT(''expression'') '''Description''' The I..."
 
Brendon (talk | contribs)
No edit summary
Line 1: Line 1:
ISARRAY(''expression'')
IsArray(''expression'')


ISDATE(''expression'')
IsDate(''expression'')


ISEMPTY(''expression'')
IsEmpty(''expression'')


ISNULL(''expression'')
IsNull(''expression'')


ISNUMERIC(''expression'')
IsNumeric(''expression'')


ISOBJECT(''expression'')
IsObject(''expression'')


'''Description'''
== Description ==


The Is functions return TRUE if a variable type corresponds to the function call, FALSE is returned otherwise. The required parameter, expression, is the variable whose type status is being determined.
The Is functions return TRUE if a variable type corresponds to the function call, FALSE is returned otherwise. The required parameter, expression, is the variable whose type status is being determined.


'''Example'''
== Example ==


<pre>
<pre>
REM Is Functions Example
Rem Is Functions Example
DIM Children(3), Chef, When
Dim Children(3), Chef, When
TestVariable Children
TestVariable Children
Chef = 1
Chef = 1
TestVariable Chef
TestVariable Chef
When = NOW
When = Now
TestVariable When
TestVariable When
SUB TestVariable(x)
Sub TestVariable(x)
   IF ISARRAY(x) THEN
   If IsArray(x) Then
     PRINT "The variable is an array."
     Print "The variable is an array."
   ELSEIF ISDATE(x) THEN
   ElseIf IsDate(x) Then
     PRINT "The variable is a date."
     Print "The variable is a date."
   ELSEIF ISNUMERIC(x) THEN
   ElseIf IsNumeric(x) Then
     PRINT "The variable is a number."
     Print "The variable is a number."
   END IF
   End If
END SUB
End Sub
</pre>
</pre>


'''Output'''
== Output ==


<pre>
<pre>
Line 44: Line 44:
</pre>
</pre>


'''Related Items'''
== Related Items ==


[[typename|TYPENAME]], [[vartype|VARTYPE]]
[[typename|TYPENAME]], [[vartype|VARTYPE]]
[[Category:Language Reference]]

Revision as of 01:46, 17 August 2012

IsArray(expression)

IsDate(expression)

IsEmpty(expression)

IsNull(expression)

IsNumeric(expression)

IsObject(expression)

Description

The Is functions return TRUE if a variable type corresponds to the function call, FALSE is returned otherwise. The required parameter, expression, is the variable whose type status is being determined.

Example

Rem Is Functions Example
Dim Children(3), Chef, When
TestVariable Children
Chef = 1
TestVariable Chef
When = Now
TestVariable When
Sub TestVariable(x)
  If IsArray(x) Then
    Print "The variable is an array."
  ElseIf IsDate(x) Then
    Print "The variable is a date."
  ElseIf IsNumeric(x) Then
    Print "The variable is a number."
  End If
End Sub

Output

The variable is an array.
The variable is a number.
The variable is a date.

Related Items

TYPENAME, VARTYPE