Login | Register

Quotation mark

October 1, 2006, 20:26 by Calle
[loading]
-->
<b>Question:</b> execute_string("global.inv" + string(global.inventory) + "=" + string("none";)


how can i execute this piece of code AND include those parentheses around the word none? so literally it would return "none" and not just none

anyone?

<b>Answer:</b>
execute_string("global.inv" + string(global.inventory) + "=" + string('"none"'));

Will work; ' before " will make " a part of the string, while " before ' will make ' a part of the string. If you want to use both in the same string, then you will have to use something externally to save the value (which could work just as good!), the registry or a file for an example.

Comments

Loading comments... [loading]
.
Users logged in:

game maker articles, game maker examples, game maker tutorials, gmtutorials, game maker questions and answers, game maker crash course, how to create games