Lucence 10 Posted October 15, 2013 Howdy brothers, thanks in advance for your assistance! I'm eager to be in company with such brilliant minds... The beef of it: I can code in init.sqf adding comments and line breaks without a problem... when I create an sqf script file to be executed from init.sqf, it will throw script errors if I add comments or line breaks([Enter]) inside of that created script file... For example, if I call a {...}forEach anArray;... I need to put the entire call on one line for the script to work... { ... }forEach anArray //croaked... <-- that comment makes it croak too That goes with all other control structures... Any line break or comment kills it. Even though this isn't a show stopper, my years of programming and scripting has put this little voice in the back of my head telling me "COMMENT!, Make things clean and readable so YOU and other people know where your logic was...". This problem has made that much more difficult, if not about impossible. Any ideas? Is this intended design? :confused: ---------- Post added at 01:24 ---------- Previous post was at 00:37 ---------- It seems as if, even though I'm calling the scripts as .sqf and they are named .sqf... they are being ran in .sqs context. Is there a toggle of some sort I've missed? ---------- Post added at 01:29 ---------- Previous post was at 01:24 ---------- Alright... I figured it out. I was using exec instead of execVM this entire time. lol I can now say goodbye to my hundred character lines of code >.<. Geez... I always feel like a derp every time I pull something like this. Share this post Link to post Share on other sites
bloodxgusher 10 Posted October 15, 2013 Howdy brothers, thanks in advance for your assistance! I'm eager to be in company with such brilliant minds...The beef of it: I can code in init.sqf adding comments and line breaks without a problem... when I create an sqf script file to be executed from init.sqf, it will throw script errors if I add comments or line breaks([Enter]) inside of that created script file... For example, if I call a {...}forEach anArray;... I need to put the entire call on one line for the script to work... { ... }forEach anArray //croaked... <-- that comment makes it croak too That goes with all other control structures... Any line break or comment kills it. Even though this isn't a show stopper, my years of programming and scripting has put this little voice in the back of my head telling me "COMMENT!, Make things clean and readable so YOU and other people know where your logic was...". This problem has made that much more difficult, if not about impossible. Any ideas? Is this intended design? :confused: ---------- Post added at 01:24 ---------- Previous post was at 00:37 ---------- It seems as if, even though I'm calling the scripts as .sqf and they are named .sqf... they are being ran in .sqs context. Is there a toggle of some sort I've missed? ---------- Post added at 01:29 ---------- Previous post was at 01:24 ---------- Alright... I figured it out. I was using exec instead of execVM this entire time. lol I can now say goodbye to my hundred character lines of code >.<. Geez... I always feel like a derp every time I pull something like this. So for example. _null = [] execvm "car_horns\sedan_horns_init2.sqf"; could not look like ? _null = [] execvm "car_horns\sedan_horns_init2.sqf"; Share this post Link to post Share on other sites
na_palm 19 Posted October 15, 2013 You could try to adapt to call/spawn instead of execVM. works like a charm for me :) Share this post Link to post Share on other sites
p1nga 23 Posted October 15, 2013 For example, if I call a {...}forEach anArray;... I need to put the entire call on one line for the script to work... { ... }forEach anArray //croaked... <-- that comment makes it croak too In the above example the missing semi-colon will stop some scripts from working. Not sure maybe it was a typing mistake in the post but: { ... }forEach anArray; //croaked Share this post Link to post Share on other sites