Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Function to validate string for numeric with decimal point
#11
ok i think i get it know. like this?


Code:
FUNCTION validate% (userinput$, decmax%)
validate% = -1
FOR i = 1 TO LEN(userinput$)
IF MID$(userinput$, i, 1) = "." THEN
  dec% = 1
ELSE
  IF dec% = 1 THEN decamount% = decamount% + 1
  IF ASC(MID$(userinput$, i, 1)) > 57 OR ASC(MID$(userinput$, i, 1)) < 48 THEN validate% = 0: EXIT FUNCTION
END IF
IF decamount% > decmax% THEN validate% = 0: EXIT FUNCTION
NEXT i
END FUNCTION
[Image: sig.php]
Back by popular demand!
I will byte and nibble you bit by bit until nothing remains but crumbs.
Reply


Messages In This Thread
Function to validate string for numeric with decimal point - by whitetiger0990 - 07-09-2003, 07:29 AM
To WhiteTiger, Nathan, Agamemnus: - by Moneo - 07-09-2003, 10:28 PM
ah, young one - by Agamemnus - 07-11-2003, 07:08 AM
Re: ah, young one - by oracle - 07-11-2003, 07:13 AM
well..... - by Agamemnus - 07-12-2003, 07:15 AM
Re: well..... - by Moneo - 07-13-2003, 04:59 AM
programming help - by Agamemnus - 07-13-2003, 04:47 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)