help please

Hi All,

I have the following code where Viusal Studio is returning with syntax error while with Borland C++ i can compile it.

Value=::Value1=Value1; ::Mysetting=MySetting;

Could anyone be so kind to provide any suggestion for that ?

Thanks for any help in advance.
What's the syntax error? Always post the error messages.
Here is the error message:

1>d:\vs\xy.c(159) : error C2059: syntax error : ':'
1>d:\vs\xy.c(159) : error C2143: syntax error : missing ';' before ':'

line 159 is where the line where the code above is.

sorry for not providing the error message earlier I am still new on this forum.
Last edited on
Interesting. And it does look OK; strange, but OK. Any chance of the Borland compiler resolving a name differently? Maybe the MS compiler thinks you have a name there that doesn't belong. Any ambiguous name possibilties?
What should that statement do? I'm not a borland fan, but i could help you to "translate" it into MSVS.
That's standard C++, EssGeEich. It is assigning the value of Value1 to the variable in global scope ::Value1 and the variable Value in the first statement, and the second statment is assigning the value of MySetting to the variable in global scope ::Mysetting.
Try using this...
1
2
3
Value=Value1;
::Value=Value1;
::Mysettings=Mysettings;
I have tried to do, but VS can not compile again.

error C2143: syntax error : missing ';' before ':' at ::Value=Value1; and at ::Mysettings=Mysettings;

what will happen if i would comment out these two lines ?




Have you tried using "this->Value"?
Well, if you are using Classes and are changing the class's members, using this->Value and this->Mysettings is right.
Topic archived. No new replies allowed.