Develop > Programming Guide > System Language reference > List: RAD functions > RAD function: dbdict.helper(“field.type”)

RAD function: dbdict.helper(“field.type”)

A RAD utility function that helps retrieve the field type property efficiently.

Function

dbdict.helper(“field.type”)

Format

dbdict.helper(“field.type”,$L.file/$filename,fieldname)

Parameters

The following parameters are valid for this function.

Parameter

Description

$L.file/$filename

The variable or name of the file to which the field belongs

fieldname

The name of the field whose field type property is to be retrieved.

Factors

Always consider using a file variable first for better performance.

Return values

A number value that represents the field type. For information about the numeric representations of data types, see Data types.

Example

function testDBDictHelper()
{
	var file = new SCFile( 'cm3r' );
	var fieldType = system.functions.dbdict_helper("field.type", file, "assets" );
	print( "fieldType of assets in cm3r=", fieldType );

	var fieldType = system.functions.dbdict_helper("field.type", file, "type" );
	print( "fieldType of type in cm3r=", fieldType );

	fieldType = system.functions.dbdict_helper("field.type", "cm3r", "assets" );
	print( "fieldType of assets in cm3r by filename=", fieldType );

	fieldType = system.functions.dbdict_helper("field.type", "cm3r", "type" );
	print( "fieldType of type in cm3r by filename=", fieldType );
	
	print( "db type=", system.functions.dbdict_helper("db.type" ) );
	
	var isAlias = system.functions.dbdict_helper("is.alias", file, "assets" );
	print( "assets is an alias:", isAlias );
	
	isAlias = system.functions.dbdict_helper("is.alias", file, "number.vj" );
	print( "number.vj is an alias:", isAlias );
	
	isAlias = system.functions.dbdict_helper("is.alias", file, "number.vj.ooflow" );
	print( "number.vj.ooflow is an alias:", isAlias );

	isAlias = system.functions.dbdict_helper("is.alias", "cm3r", "number.vj.ooflow" );
	print( "number.vj.ooflow is an alias by filename:", isAlias );
	
	isAlias = system.functions.dbdict_helper("is.alias", file, "number.string" );
	print( "number.string is an alias:", isAlias );
	
	isAlias = system.functions.dbdict_helper("is.alias", "cm3r", "middle,type" );
	print( "middle,type is an alias by filename:", isAlias );

	isAlias = system.functions.dbdict_helper("is.alias", "cm3r", "number.string" );
	print( "number.string is an alias by filename:", isAlias );
	
	isAlias = system.functions.dbdict_helper("is.alias", file, "middle,type" );
	print( "middle,type is an alias:", isAlias );
	
	var fileArray = system.functions.dbdict_helper( "joinfile.names", "joincomputer" );
	print( "sub file array of joincomputer is: ", fileArray );
	
	var uniquekey = system.functions.dbdict_helper( "unique.key", file );
	print( "uniquekey of cm3r is: ", uniquekey );
}

This example returns the following results:

    fieldType of assets in cm3r= 8
fieldType of type in cm3r= 2
fieldType of assets in cm3r by filename= 8
fieldType of type in cm3r by filename= 2
db type= sqlserver
assets is an alias: false
number.vj is an alias: true
number.vj.ooflow is an alias: true
number.vj.ooflow is an alias by filename: true
number.string is an alias: false
middle,type is an alias by filename: false
number.string is an alias by filename: false
middle,type is an alias: false
sub file array of joincomputer is:  [C++ object Datum] - {"device", "computer"}
uniquekey of cm3r is:  [C++ object Datum] - {"number"}
uniquekey of cm3r by filename is:  [C++ object Datum] - {"number"}