home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Power-Programmierung
/
CD1.mdf
/
magazine
/
pcmagazi
/
1991
/
03
/
makenum
< prev
next >
Wrap
Text File
|
1991-01-03
|
438b
|
23 lines
* Procedure to strip all non-numeric characters
* from a string. Note, if string has a minus
* sign, it too will be stripped.
*
PROCEDURE MAKENUM
PARAMETERS string
PRIVATE nums, newstring, x, slen
nums="0123456789"
newstring=""
x = 1
slen = LEN(string)
DO WHILE x <= slen
IF AT(SUBSTR(string,x,1),nums) <> 0)
newstring = newstring + SUBSTR(string,x,1)
ENDIF
X = X + 1
ENDDO
string = newstring
RETURN