IDE capitalizes inside EnableJS

Just starting out? Need help? Post your questions and find answers here.
plouf
Posts: 295
Joined: Tue Feb 25, 2014 6:01 pm
Location: Athens,Greece

IDE capitalizes inside EnableJS

Post by plouf »

dont know if easy but

if copy from OUTSIDE a javascript code and paste it inside a EnableJS/DisableJS block
IDE capitalizes some keywords like "while" "if"
this makes faulty JS code (js sucks) and sometimes difficult to track
Christos
Fred
Site Admin
Posts: 1820
Joined: Mon Feb 24, 2014 10:51 am

Re: IDE capitalizes inside EnableJS

Post by Fred »

You should always use '!' in front on JS line, I added a note to the doc.
plouf
Posts: 295
Joined: Tue Feb 25, 2014 6:01 pm
Location: Athens,Greece

Re: IDE capitalizes inside EnableJS

Post by plouf »

Always?
Isnt EnableJS/DisableJS block
For this exact reason ?

At least after correction they work!
Christos
User avatar
Peter
Posts: 1197
Joined: Mon Feb 24, 2014 10:17 pm
Location: 127.0.0.1:9080
Contact:

Re: IDE capitalizes inside EnableJS

Post by Peter »

EnableJS/DisableJS is useful if you want to integrate a large JavaScript block as an include ((X)IncludeFile()) in the SB source. However, the prerequisite is that this include should no longer be edited with the SB IDE.
Fred
Site Admin
Posts: 1820
Joined: Mon Feb 24, 2014 10:51 am

Re: IDE capitalizes inside EnableJS

Post by Fred »

Yes, it's needed as the IDE can't disable autocasing/coloring for these blocks only. It wasn't an issue for ASM code as there is no basic keywords in it but it is an issue with JS and C, so better always put '!' before. As Peter said, using XIncludeFile works if you don't edit the JS file in the IDE.
Fred
Site Admin
Posts: 1820
Joined: Mon Feb 24, 2014 10:51 am

Re: IDE capitalizes inside EnableJS

Post by Fred »

After a few unsuccessful tries, I finally managed to do something about this limitation, it's available in the 3.01 beta 2, so feel free to test it ! :)
Post Reply