Interesting Article on Java Script

Thanks for posting this.

We’ve started work on an article to help BASIC programmers who want to work in JavaScript (AppStudio lets you use both in the same project!):

http://wiki.nsbasic.com/JavaScript_for_BASIC_Programmers

1 Like

The best thing about JS for me is that the code structure is so similar to C and it has lots of powerful string manipulation. The worse thing about JS for me is the looseness of the variable types. VB6 is still my go-to for macro-like use due to the clarity and tight binding between the IDE and the result. You can use variants in it (like JS & VBS) or you can use strict variable types if you want to see some dazzlingly fast code.

As a personal preference, I find “if(!=){ ; }//…” ghastly. Fudge capitalisation or miss out that confounded “;” and you get some maddeningly confusing reports. I prefer to type in english … it’s more readable as well. That said, I am happy to code in either.

So, for me, NSB is a classic bridge between the two. Could do with some work in the IDE, but I’d rather suffer that than any drop in the dizzyingly huge level of functionality on offer.

Edit: JS has two major binds for me … No Yield (DoEvents) and no Goto (albeit Exit Do etc helps).

We’re always looks for ways to improve the IDE. Got suggestions? Send them along!

  • Macros (or batch files to allow single keypress instead of alt+r+m etc to deploy)
  • shortcut key config
  • pre-processing so it checks for typos and undefined items before doing a 20 second build
  • change colour schemes
  • use comment colouring in java, and hilight errors such as putting a VB comment in a java area (the number of times that’s caught me out)
  • auto format by line (mainly to standardise spacing)
  • capitalisation checks across modules (which it does for controls and functions, but not for vars in other modules)
  • goto to definition of var (like it does already with goto to def of function) with KB shortcut like shift+F2
  • F1 goes to wiki
  • “return” works after search (and has a shortcut key)
  • Auto search highlighted word
  • highlight all instance of highlighted word on page
  • speed up deploy to volt
  • speed up translate vb to java
  • stop duplicating browser page when you press F5, which I know you said can’t be done earlier, but I disagree : )
  • loads IDE quicker
  • separate tabs for code and layout
  • can access controls in containers in layout

…just a few to keep you going :slight_smile: Ps: I still think it’s amazing and I delight in the overall robustness.

Thanks, Alfie!

Some good ideas here - we’re putting them in the tracker.

Definitely need to make it possible to select objects individually within a container. Right now, we need to “Remove Child” from a container in order to select it directly or right-click on it for the context menu.

…a couple of extras (thanks for your responsiveness) :slight_smile:

  • bookmarks
  • scroll to right when search hit is off right of view area
  • certain keywords jump hard left when you press wenter after line: Case, Try, Catch, End Try, JavaScript
  • fix bug where JavaScript//…comment does horid things (ok if comment on next line).
  • darker (or coloured) highlighting in project explorer (I can’t see the selected item … too faint)

Ps: Good point @Ringo7, albeit I just select the object in the Project Explorer, and then right click on selected object works for me.

Yes, this one is on the list.

Can you tell me more about the comment bug?

Yep, I had “JavaScript//…” with no space, and when I looked in the chrome debugger, it copied “JavaScript” verbatum into code.js and then ignored it (tried to interpret my java it as VB and of course chrome complained… ). Cheers

@Alfie, the right-click does not give me the context menu of a nested object. I get the parent menu only.

For example, if I select a nested object in the Project Explorer, then move the mouse to the app designer area and right-click that highlighted object, the parent is immediately selected and I get the ‘parent’ context menu. Is it working differently for you?

Most of the time I get by using the Properties panel. Otherwise, I break it out of the parent temporarily.

…Correct (re controls in containers). Same here. But, like you, I do most of my changes in the props panel… I really really really really LIKE NSB & Volt – it’s about the most productive tool I’ve ever used, but the IDE is a bit… hmm :slight_smile: … But I’m not complaining.

Two workarounds I use… After the control in the container is selected, Ctrl+X can be used to delete or move it. Also, I just enter the events manually into code. (Eg: Copy the ID, create a sub, paste ID and add “_onclick()”).

Just a little thing but if I have a function called say “Test” and another function called “TestAgain” above “Test” in the code window, when I select “Test” in the function list it will send me to “TestAgain”

This seems like an unrelated issue. Can you put it into its own thread?