home *** CD-ROM | disk | FTP | other *** search
- ********************
-
- FUNCTION Fill_zeros
-
- PARAMETER _clipnumb, _slength
-
- IF PCOUNT() = 0
- RETURN("")
- ELSEIF PCOUNT() = 1
- _slength = 10
- ENDIF
- _clipnumb = IF(TYPE("_clipnumb") = "C", VAL(_clipnumb), _clipnumb)
-
- * This function padds the left of the number with the appropriate
- * number of zeros...
-
- _newnumb = LTRIM(TRIM(STR(_clipnumb)))
- IF _slength > 0 && Positive Number
- DO WHILE LEN(_newnumb) != _slength
- _newnumb = "0" + _newnumb
- ENDDO
- ELSE && Negative Number
- _slength = ABS(_slength)
- DO WHILE LEN(_newnumb) < _slength
- _newnumb = _newnumb + "0"
- ENDDO
- ENDIF
- RETURN(IF(("-"$_newnumb), "-"+STRTRAN(_newnumb, "-", ""), _newnumb))
-
- * End of File
-