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
|