Compiler Error
Displaying 1-4 of 4 total.
1
Please enter a numerical value for the importance of this sticky.
Enter 0 to unsticky.
Monder

1.string thing2;
2.thing2=mid(text[line2],35,1);
3.if(thing2==" ")
{
....

Ok look at code line 1. It it obviously setting up a string called thing2. Then look at line 2 and 3 which use this string. When I compile the file that 2 and 3 are in I get this error

text.vc(11) Unknown token

note:code line 3 is line 11 in the error message

why does this happen?
the compiler acepets line 2 showing it recognises the exsistance of the string thing2 why doesen't it like line 3?

someone help me please

oh if you really want to know the code is part of a function for doing word wrap in a text box




Posted on 2001-08-09 15:10:01

TheGerf

You can't compare strings with an =. You can use teh function strcmp(string one, string two) to determine if they are equal. You'd use:
if(!strcomp(thing2, " "))
{
...
}
Notice the not symbol ! . strcmp returns the difference of the strings. In the case you want, no difference, so it would return 0.



TheGerf, not just any gerf.

Posted on 2001-08-09 19:06:52

Monder

thanks for the help



Posted on 2001-08-10 06:16:28

Monder

also It's strcmp not strcomp



Posted on 2001-08-10 06:23:25


Displaying 1-4 of 4 total.
1
 
Newest messages

Ben McGraw's lovingly crafted this website from scratch for years.
It's a lot prettier this go around because of Jon Wofford.
Verge-rpg.com is a member of the lunarnet irc network, and would like to take this opportunity to remind you that regardless how babies taste, it is wrong to eat them.