Navigation:  MCL Reference > Conversion Functions >

GConv( )

Print this Topic Previous pageReturn to chapter overviewNext page

The GConv( ) function is identical to the Conv( ) function except that if the lookup value is not found in the KeyVal column, the system will search a closest KeyVal which is greater than the lookup value and return the corresponding value in the RetVal column. If no greater value can be found, the value passed to the DefaultVal argument will be returned. If no value is passed through the DefaultVal argument, .NULL. will be returned.

 

KeyVal

RetVal

1

10

2

5

3

4

 

According to the conversion table above, similar to Conv( ), 1 will be converted to 10 and 2 will be converted to 5. In the KeyVal column, 2.5 is not found. However, 3 is the closest value that is greater than 2.5. If 2.5 is being looked up, 4 (RetVal of 3) will be returned. Similarly, if 0 is being looked up, 10 (RetVal of 1) will be returned. If 8 is being looked up, .NULL. will be returned (in case no DefaultVal is given).

 

Syntax

GConv(cLookupTableKeyVal, DefaultValue)

 

Returns

The data type of the returned value will be identical to that of the RetVal column.

 

Example

GConv("FPconv",HrFP( ),0)

The above function converts the finishing position according to the conversion table "FPconv".

 

 


Page url: http://www.racematenet.com/english/help/index.html?gconv.htm