Navigation:  MCL Reference > Conversion Functions >

GCnv( )

Print this Topic Previous pageReturn to chapter overviewNext page

The function searches a list of items (cListToBeSearched) for an item equal to or greater than the first argument (cToSearch) and returns another a string item at the same ordinal position from another list (cListOfReturnItems). Search will be carried out from left to right. Once an item equal to or greater than cToSearch is found, all the following items will be ignore, the corresponding item in cListOfReturnItems will be returned.






String to be searched. eToSearch can be of any data type


List of items for searching (matching). The items in the list must be from small to large. If eToSearch is not of character type, the function will convert each member item of cListToBeSearched into the same data type before comparing. Please don't put any space after each comma. Otherwise the space will be regarded as a character of the item.


List of items for returning. If the nth item in cListToBeSearched matches eToSearch, the nth item of cListOfReturnItems will be returned. If no in cListToBeSearch is equal to or greater than eToSearch, the function will return a value as follows:

IF the items in cListOfReturnItems are more than that in cListToBeSearched, the first excess item of cListToBeSearched will be returned.
Otherwise, .Null. will be returned.


Please don't put any space after each comma. Otherwise the space will be regarded as a character of the item.


If a .Null. value is passed into eToSearch, the function will return the value of cNullSearchReturn. However, if cNullSearchReturn is empty, .NULL. will be returned.


The default list item separator is comma (,), you may change the separator by passing a string into cSeparator.







String "ee" will be returned.



String "ee" will be returned.



.Null. will be returned.



String "gg" will be returned.



String "hh" will be returned.



String 'Right("Many",2)' will be returned.



If y=10, String "ee" will be returned.


GCnv(HrDate( ),'{^2000/1/2},{^2000/1/8},{^2000/1/14}','13,39,12')

If HrDate( ) returns 1st Jan 2000, String "13" will be returned.


See also

Cnv( ) | SCnv( ) | ListItem( ) | RListItem( ) | Conv( ) | SConv( ) | GConv( ) | IIF( )



Page url: