home *** CD-ROM | disk | FTP | other *** search
- ********************
-
- FUNCTION Long_elem
-
- PARAMETERS _array, _delimit
-
- _delimit = IF((TYPE("_delimit") = "U"), "/", _delimit)
-
- IF PCOUNT() = 0
- RETURN(-1)
- ELSEIF TYPE("_array") != "A"
- IF TYPE("_array") != "C"
- RETURN(-1)
- ELSE
- * turn the string into an array
- _choices = _array
- DECLARE _array[Occurence(_delimit, _choices) + 1]
- _uptohere = Occurence(_delimit, _choices) + 1
- FOR _qaz = 1 TO LEN(_array)
- _array[_qaz] = Parsing(@_choices)
- NEXT
- ENDIF
- ENDIF
-
- * This function returns the longest character element
- * in an array.
-
- PRIVATE _the_ret_val, _the_element, _downtoit, _dtype
-
- _the_ret_val = 0
- _the_element = ""
- FOR _downtoit = 1 TO LEN(_array)
- IF TYPE("_array[_downtoit]") != "U"
- _dtype = _array[_downtoit]
- IF TYPE("_dtype") = "C"
- IF LEN(_dtype) > LEN(_the_element)
- _the_element = _dtype
- _the_ret_val = _downtoit
- ENDIF
- ENDIF
- ENDIF
- NEXT
- RETURN(_the_ret_val)
-
- * End of File