IsSimpleValue

Determine whether the given value is a string, boolean, numeric, or date value.

Method Signature

IsSimpleValue(value=[any])

Arguments

Argument
Type
Required
Description
Default

value

any

false

Value to test for simple-ness.

Examples

A number is a simple value

Run Example

isSimpleValue( 42 );

Result: true

A string is a simple value as well

Run Example

isSimpleValue( "Hello world" );

Result: true

A structure is a complex value

So it can't a be simple value

Run Example

isSimpleValue( structNew() );

Result: false

An array is a complex value

Run Example

isSimpleValue( arrayNew( 1 ) );

Result: false

Additional Examples

Run Example

writeOutput( isSimpleValue( "string" ) & "<br>" );
writeOutput( isSimpleValue( 123456 ) & "<br>" );
writeOutput( isSimpleValue( getTimezone() ) & "<br>" );
writeOutput( isSimpleValue( now() ) & "<br>" );
writeOutput( isSimpleValue( javacast( "char", "A" ) ) & "<br>" );
writeOutput( isSimpleValue( nullValue() ) & "<br>" );
writeOutput( isSimpleValue( [] ) & "<br>" );
writeOutput( isSimpleValue( {} ) & "<br>" );
writeOutput( isSimpleValue( queryNew( "test" ) ) );

Last updated

Was this helpful?