Navigation:  MCL Reference > Conversion Functions >

SCnv( )

Print this Topic Previous pageReturn to chapter overviewNext page

The function searches a list of items (cListToBeSearched) for an item equal to or smaller 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 smaller 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). 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. The items in the list must be from large to small. If the nth item in cListToBeSearched matches eToSearch, the nth item of cListOfReturnItems will be returned. If no in cListToBeSearch is equal to or smaller 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 "dd" will be returned.



String "ff" 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 "ff" will be returned.


SCnv(HrDate( ),'{^2000/1/21},{^2000/1/18},{^2000/1/14}','13,39,12')

If HrDate( ) is 30th Jan 2000, String "13" will be returned.


See also

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



Page url: