spacegremlin Posted February 16, 2020 Share Posted February 16, 2020 basicly a simple question, but i dont know. I want to place TESTVARIABLE there, so i can place the value of that somewhere else. but if i use this i got an error. because if you would do this in a define command, it does work. const MODULE_CONTENT_I_TITLE_DESCRIPTION = 'link "blablabla'.TESTVARIABLE.'" end'; thank you Link to comment Share on other sites More sharing options...
♥ecartz Posted February 16, 2020 Share Posted February 16, 2020 You can only use const in global or class context, not inside a function. So if you have something like function do_stuff() { const WHATEVER = 'whatever'; } you'll get an error. You also can only do const with things that can be done at compile time. So function do_stuff() { return 'whatever'; } const WHATEVER = do_stuff(); for anything that needs to be calculated at run time. The define is done at run time, so it doesn't care about that. Always back up before making changes. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.