Conversions

From NSB App Studio
Revision as of 04:16, 29 June 2012 by Brendon (talk | contribs)
Jump to navigation Jump to search

Function

CBOOL(expression)

CBYTE(expression)

CCUR(expression)

CDATE(expression)

CDBL(expression)

CINT(expression)

CLNG(expression)

CSNG(expression)

CSTR(expression)

Description

The conversion functions return an expression that has been converted to the appropriate type. The required parameter, expression, is any valid expression.

If the return value lies outside the acceptable range of its return type, an error occurs.

Table 5: Conversion Functions


Example

REM Conversion Functions Example
PRINT "CBYTE(99.44) = " & CBYTE(99.44)
PRINT "CCUR(9283.066) = " & CCUR(9283.066)
PRINT "CDATE(8/18/98) = " & CDATE("8/18/98")
PRINT "CDBL(3.141593) = " & CDBL("3.141593")
PRINT "CINT(3.141593) = " & CINT("3.141593")
PRINT "CSNG(10) = " & CSNG(10)
PRINT "CSTR(TRUE) = " & CSTR(TRUE)

Output

CBYTE(99.44) = 99
CCUR(9283.066) = 9283.066
CDATE(8/18/98) = 8/18/1998
CDBL(3.141593) = 3.141593
CINT(3.141593) = 3
CSNG(10) = 10
CSTR(TRUE) = True

Related Items'

IS FUNCTION