🎉 Celebrating 25 Years of GameDev.net! 🎉
Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!
Comments in ExecuteString()
Hello,
I am wondering wether there are any restrictions regarding comments when using ExecuteString(). I get complaints when using // , /**/ seems to work for me though. Ideas?
Thanks.
Do you have \n somewhere in your script? it might be that you are commenting out an entire script... or large parts.
Hm, I don't understand what you mean.
I get a comlaint when I do something like this:
I get a comlaint when I do something like this:
ExecuteString("var = 3; //comment...");
You need to add a line break after the comment. Just like Rain Dog suspected.
What happens is that AngelScript takes your string and concatenates it with a couple of predefined strings to form a function, which is then compiled and executed. With your example the script that is getting compiled is this:
Which obviously won't compile as the closing bracket is commented.
Regards,
Andreas
What happens is that AngelScript takes your string and concatenates it with a couple of predefined strings to form a function, which is then compiled and executed. With your example the script that is getting compiled is this:
void ExecuteString() {var = 3; //comment...;}
Which obviously won't compile as the closing bracket is commented.
Regards,
Andreas
It should be enough with a '\n':
If this doesn't work, then it is a bug in AngelScript. I'll verify it.
ExecuteString("var = 3; //comment...\n");
If this doesn't work, then it is a bug in AngelScript. I'll verify it.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement