Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[Help] String to Int conversion
SPACoD Offline
Junior Member

Posts: 13
Threads: 4
Joined: Jan 2012
Reputation: 0
#8
RE: [Help] String to Int conversion

(07-20-2012, 11:19 AM)Kreekakon Wrote: If you used a "for" type of script in there along with the "if" checks, you could make the if checks automated, requiring only four "if checks" in your case.

If you don't understand the concept of "for", I'll be more than happy to explain.
Of course I know how to use for, used around my whole script file, but you know, I'm a bit special so I forget stuff like that xD
There is easy, hard and SPACoD way which is the easy way done hard

The post that Computer directed me to didn't really help, I used the parseStringUint function and it shows up this error

No matching signatures to '_ParseDigit(uint8&)'
and this one
No matching signatures to 'parseStringUint(string)'

This is what I did:


uint parseStringUInt(string &in asString)
{
uint output = 0;
for(uint i=0; i<asString.length(); i++) {
int digit = _ParseDigit(asString[i]);
output = (digit > -1)?(10*output+digit)Sadoutput); }
return output;
}

void EnterCode(string &in asEntity)
{
if(Code[1][4] == 1)
{
PlayGuiSound("Click", 1);
Code[1][0] = parseStringUint(StringSub(asEntity, 12, 1));
Code[1][4]++;
AddDebugMessage("Entered: " + Code[1][0], false);
}
The rest is untouched...
(This post was last modified: 07-20-2012, 12:51 PM by SPACoD.)
07-20-2012, 11:53 AM
Find


Messages In This Thread
[Help] String to Int conversion - by SPACoD - 07-20-2012, 10:14 AM
RE: [Help] String to Int conversion - by SPACoD - 07-20-2012, 11:15 AM
RE: [Help] String to Int conversion - by SPACoD - 07-20-2012, 11:53 AM
RE: [Help] String to Int conversion - by Traggey - 07-20-2012, 11:32 AM



Users browsing this thread: 1 Guest(s)