IsNumber

Share your advanced PureBasic knowledge/code with the community.
thefool
Always Here
Always Here
Posts: 5875
Joined: Sat Aug 30, 2003 5:58 pm
Location: Denmark

Post by thefool »

Its damn annoying that you brittish people use a dot "." :twisted:
CodeMonkey
User
User
Posts: 12
Joined: Tue Jul 12, 2005 6:55 pm
Location: United Kingdom

Post by CodeMonkey »

I know and someone needs to tell the americans about that 'mm/dd/yyyy' thing for dates! it's just wrong! :wink:
Killswitch
Enthusiast
Enthusiast
Posts: 731
Joined: Wed Apr 21, 2004 7:12 pm

Post by Killswitch »

Hey we invented English, and we owned 0.25 of the world at one point - so you can stick your commas! :P
~I see one problem with your reasoning: the fact is thats not a chicken~
thefool
Always Here
Always Here
Posts: 5875
Joined: Sat Aug 30, 2003 5:58 pm
Location: Denmark

Post by thefool »

hehe :lol:
Dare2
Moderator
Moderator
Posts: 3321
Joined: Sat Dec 27, 2003 3:55 am
Location: Great Southern Land

Post by Dare2 »

:D

Also stop throwing the "U" out of words like colour! Imagine that taken to an extreme:

This is or hose.
We use flor to bake or cakes.
News updates on the hor. :)
Por some water on it!
Of corse it's wrong!
@}--`--,-- A rose by any other name ..
thefool
Always Here
Always Here
Posts: 5875
Joined: Sat Aug 30, 2003 5:58 pm
Location: Denmark

Post by thefool »

lol haha
dagcrack
Addict
Addict
Posts: 1868
Joined: Sun Mar 07, 2004 8:47 am
Location: Argentina
Contact:

Post by dagcrack »

I know and someone needs to tell the americans about that 'mm/dd/yyyy' thing for dates! it's just wrong! Wink
True... I don't know where they took the idea from .. (stole it from who? :lol:) But I prefer dd/mm/yy all life.


Well.. Colour < Color ..
Color is used even in spanish! so it wins. end of story :lol:


Salute the chavs for me (those bloody townies!).
Castel for the Brit - Castle for the Yankee
:D :D :D
! Black holes are where God divided by zero !
My little blog!
(Not for the faint hearted!)
Dare2
Moderator
Moderator
Posts: 3321
Joined: Sat Dec 27, 2003 3:55 am
Location: Great Southern Land

Post by Dare2 »

dagcrack wrote:Color is used even in spanish! so it wins. end of story
lol.

Who can (or wants to) argue with that. :)
@}--`--,-- A rose by any other name ..
thefool
Always Here
Always Here
Posts: 5875
Joined: Sat Aug 30, 2003 5:58 pm
Location: Denmark

Post by thefool »

heh no argumenting, i just always write colour :)

dd/mm/yy is the correct one. Those americans, jeez :roll:
:D
User avatar
nco2k
Addict
Addict
Posts: 1344
Joined: Mon Sep 15, 2003 5:55 am

Post by nco2k »

@british people
stop driving in the wrong way. :wink:

oh and btw...

Code: Select all

Procedure IsNumeric(String.s)
  If Str(Val(String)) <> "0"
    Result = #True
  Else
    Result = #False
  EndIf
  ProcedureReturn Result
EndProcedure

Debug IsNumeric("99")
Debug IsNumeric("ABC")
Debug IsNumeric("AB99CD")
for the most people it should be good enough. :wink:

c ya,
nco2k
If OSVersion() = #PB_OS_Windows_ME : End : EndIf
User avatar
aszid
Enthusiast
Enthusiast
Posts: 162
Joined: Thu May 01, 2003 8:38 pm
Location: California, USA
Contact:

Post by aszid »

that last one wont catch 0's though.... maybe this?

Code: Select all

Procedure IsNumeric(String.s)
  If String = Str(Val(string))
    Result = #True
  Else
    Result = #False
  EndIf
  ProcedureReturn Result
EndProcedure

Debug IsNumeric("99")
Debug IsNumeric("ABC")
Debug IsNumeric("AB99CD")
Debug IsNumeric("0")
--Aszid--

Making crazy people sane, starting tomorrow.
User avatar
nco2k
Addict
Addict
Posts: 1344
Joined: Mon Sep 15, 2003 5:55 am

Post by nco2k »

@aszid
yes you are right, my mistake sorry. :oops:

c ya,
nco2k
If OSVersion() = #PB_OS_Windows_ME : End : EndIf
User avatar
aszid
Enthusiast
Enthusiast
Posts: 162
Joined: Thu May 01, 2003 8:38 pm
Location: California, USA
Contact:

Post by aszid »

*editted*


blarg.... forget i even posted, i read to the beginning and saw the same code practically >.<
--Aszid--

Making crazy people sane, starting tomorrow.
Dare2
Moderator
Moderator
Posts: 3321
Joined: Sat Dec 27, 2003 3:55 am
Location: Great Southern Land

Post by Dare2 »

:D

Hate it when that happens.
@}--`--,-- A rose by any other name ..
Dräc
Enthusiast
Enthusiast
Posts: 150
Joined: Sat Oct 09, 2004 12:10 am
Location: Toulouse (France)
Contact:

Post by Dräc »

Just for fun...:wink:

Code: Select all

Procedure IsNumeric(String.s) 
  ProcedureReturn String = Str(Val(String)) 
EndProcedure
...but with a limitation for string starting by "0"

Code: Select all

Debug IsNumeric("0899")
Dräc
Post Reply