Ace08 Posted October 5, 2010 Posted October 5, 2010 hi guys i have sample code. $a = ':59:/12345678' $a = stringReplace($a, ":59:", "") $a = stringReplace($a, " ", "") $a = stringReplace($a, "-", "") $a = stringReplace($a, "/", "") if isnumber($a) then MsgBox(0, "line", $a) else MsgBox(0, "error", 'Not a Number') endif as you can see the the value of $a before it starts to do the if statement will be "12345678" but then again the msgbox that i am getting is the second one "Not a number". so i came up with the conclusion that $a is still a string, question is how do i do this? (what i mean is how would the script know if its already a number or not?) Work smarter not harder.My First Posted Script: DataBase
AdmiralAlkex Posted October 5, 2010 Posted October 5, 2010 The helpfile is very clear that StringReplace() returns a string. To convert a string to a number see Number(), but you probably want StringIsDigit or one of the related functions. .Some of my scripts: ShiftER, Codec-Control, Resolution switcher for HTC ShiftSome of my UDFs: SDL UDF, SetDefaultDllDirectories, Converting GDI+ Bitmap/Image to SDL Surface
Ace08 Posted October 5, 2010 Author Posted October 5, 2010 thanks for the info AdmiralAlkex its now working Work smarter not harder.My First Posted Script: DataBase
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now