Just to expand upon what Gilbet is saying ...
To determine if a character is numeric you could create a function such as this.
Code: ags
A char variable is actually a 1-byte integer, so say if you have a char variable called blah, you can do all kind of things like:
Code:
if (blah<100 and blah>12) blablabla...;
This applies to the elements of the Chars[] array of a String, so:
Code:
if (somestring.Chars<100 and somestring.Chars>12) blablabla...;
Report to moderator Logged
Pages: [1]
To determine if a character is numeric you could create a function such as this.
// Function definition
bool IsNumber(char c) {
if (c>='0')&&(c<='9') return true;
else return false;
}
// Example usage
char somechar = '2';
if (IsNumber(somechar)) Display("It's a number");
else Display("It's not a number");
A char variable is actually a 1-byte integer, so say if you have a char variable called blah, you can do all kind of things like:
Code:
if (blah<100 and blah>12) blablabla...;
This applies to the elements of the Chars[] array of a String, so:
Code:
if (somestring.Chars<100 and somestring.Chars>12) blablabla...;
Report to moderator Logged
Pages: [1]