TypeName: Difference between revisions

From NSB App Studio
Jump to navigation Jump to search
Brendon (talk | contribs)
Created page with "TYPENAME(''variable'') '''Description''' TYPENAME returns a string specifying the type of a variable. The required parameter, ''variable'', is any variable. '''Table 24: TY..."
 
Seneca (talk | contribs)
m Output: Changes capitalization on return values; return values are in lowercase, not sentnece case
 
(14 intermediate revisions by 5 users not shown)
Line 1: Line 1:
TYPENAME(''variable'')
TypeName(''variable'')


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


TYPENAME returns a string specifying the type of a variable. The required parameter, ''variable'', is any variable.
TypeName returns a string specifying the type of a variable. The required parameter, ''variable'', is any variable.


'''Table 24: TYPENAME return values'''
'''Table 24: TypeName return values'''


{| class="wikitable"
{| class="wikitable"
Line 11: Line 11:
! Return value !! Description  
! Return value !! Description  
|-
|-
| Boolean || Boolean value  
| boolean || Boolean value  
|-
|-
| Currency || Currency value
| currency || Currency value
|-
|-
| Date|| Date value
| date|| Date value
|-
|-
| Double || Double-precision floating-point value
| double || Double-precision floating-point value
|-
|-
| Integer|| Integer value
| integer|| Integer value
|-
|-
| Object|| Generic object
| object|| Generic object
|-
|-
| String|| String value
| string|| String value
|-
|-
| Array|| Array
| array|| Array
|}
|}


'''Example'''
== Example (Basic) ==


<pre>
<pre>
REM TYPENAME Example
Rem TypeName Example
'TYPENAME returns variable type as a string
'TypeName returns variable type as a string
DIM nInteger, nSingle
Dim nInteger, nSingle
nInteger = CINT(44)
nInteger = CInt(44)
PRINT 44 & " is a/an " & TYPENAME(nInteger)
Print 44 & " is a/an " & TypeName(nInteger)
nSingle = CSNG(99.44)
nSingle = CSng(99.44)
PRINT 99.44 & " is a/an " & TYPENAME(nSingle)
Print 99.44 & " is a/an " & TypeName(nSingle)
</pre>


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


<pre>
<pre>
44 is a/an Integer
44 is a/an integer
99.44 is a/an Double
99.44 is a/an double
</pre>
</pre>


'''Related Items'''
== Related Items ==
 
[[is (operator)|Is]], [[vartype|VarType]]
 
[[Category:Language Reference]]
 
[[Category:Variable Handling]]
 
[[Category:Variable Handling]]


[[isarray|ISARRAY]], [[isdate|ISDATE]], [[isempty|ISEMPTY]], [[isnull,ISNULL]], [[isnumeric|ISNUMERIC]], [[isobject|ISOBJECT]], [[vartype|VARTYPE]]
[[Category:BASIC Functions]]

Latest revision as of 02:55, 3 February 2025

TypeName(variable)

Description

TypeName returns a string specifying the type of a variable. The required parameter, variable, is any variable.

Table 24: TypeName return values

Return value Description
boolean Boolean value
currency Currency value
date Date value
double Double-precision floating-point value
integer Integer value
object Generic object
string String value
array Array

Example (Basic)

Rem TypeName Example
'TypeName returns variable type as a string
Dim nInteger, nSingle
nInteger = CInt(44)
Print 44 & " is a/an " & TypeName(nInteger)
nSingle = CSng(99.44)
Print 99.44 & " is a/an " & TypeName(nSingle)

Output

44 is a/an integer
99.44 is a/an double

Is, VarType