FIELD_CUSTOM_STRING_FUNCTION

 

Inserts the name of a custom data conversion function associated with a field., if present. Otherwise inserts nothing. The custom convert function should accept a single parameter which is of the actual data type of the real field, and have a return value which is the custom data type as defined by <FIELD_CUSTOM_DBL_TYPE> but formatted appropriately into a string value.

 

Developers can specify a custom value via a special token in the fields user text or long description, like this:

 

CUSTOM_STRING_FUNCTION=DivideBy100AsString;

 

The name of the token MUST be specified in upper case and the value MUST be terminated by a semi-colon, as shown above.

 

You can test if a field has a custom convert function specified with <IF CUSTOM_STRING_FUNCTION>.

 

For example, if a field is a D5 and you wish to process it as a D5.2 then you might set the following values in the long description:

 

CUSTOM_DBL_TYPE=D5.2;

CUSTOM_SQL_TYPE=DECIMAL(5,2);

CUSTOM_CONVERT_FUNCTION=DivideBy100;

CUSTOM_STRING_FUNCTION=DivideBy100ToString;

 

And the string convert function might look like this:

 

function DivideBy100ToString, string

    required in decimalValue, n

proc

    freturn %string(decimalValue/100.0)

endfunction

 

Usage

<FIELD_CUSTOM_CONVERT_FUNCTION>

Alternate forms

None

See also

<FIELD_CUSTOM_DBL_TYPE>

<FIELD_CUSTOM_SQL_TYPE>

<FIELD_CUSTOM_CONVERT_FUNCTION>

<FIELD_SPEC>

<FIELD_SQLTYPE>

Other field loop expansion tokens

 

 

 


Copyright © 2018  Synergex International, Inc.