The LOCATE function is the most commonly used function in a multi-value system when searching for a specific string expression.
But there is a minimal issue when using LOCATE with sequence option in an array with precession (decimal) element.
list.array = 4.5 :@VM: 21 :@VM: 8.1 :@VM: 32 :@VM: 70
FOR v = 1 TO 5
LOCATE(list.array<1,v>,array,1;position;'ar') THEN NULL
array = INSERT(array,1,position;list.array<1,v>)
FOR a = 1 TO 5
PRINT array<1,a> :"-":
Notice that the decimal is ignore by the LOCATE function. In order to address this, you must always place your numbers in an internal format with an ICONV or multiplying by a number that will remove the decimal.
The original post for this tip can be found at: