Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
A small routine to throw in a library somewhere: IsNumeric
#1
This routine (in c) isn't worth a whole DLL to itself, but if someone has room (or needs it) in a library, feel free to add it.

Code:
int IsNumeric(char *pString){
    char *pEnd;
    double dbl;
    dbl = strtod (pString,&pEnd);
    if (pString != pEnd && *pEnd == '\0'){
        //it is numeric
        return 0;
    }
    else{
        //it isn't
        return -1;
    }
}

I used this command in VB a lot and thought it'd be nice to have in FB.
Reply
#2
Hi:

I would like to add this to the library of FreeBASIC functions on my website, if you don’t mind.

Have fun

Garvan
Reply
#3
Please, be my guest. Do with it as you will. :-)
Reply
#4
Quote:Please, be my guest. Do with it as you will. :-)

Thanks.

Done.

http://www.freewebs.com/weekendcode/DLL_LIB.HTM

Garvan
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)