Code Window: Difference between revisions

From NSB App Studio
Jump to navigation Jump to search
No edit summary
No edit summary
Line 3: Line 3:
The Code Window is used the edit the code in your program. You can put all your code in a single block, or have a separate code block for each form as well as a global section. At runtime, they are treated as a single block, so be careful not to redefine functions or variables.
The Code Window is used the edit the code in your program. You can put all your code in a single block, or have a separate code block for each form as well as a global section. At runtime, they are treated as a single block, so be careful not to redefine functions or variables.


In BASIC, statements can be made longer than one line by using a space and a “_” character at the end of a line. Syntax checking is done as each BASIC line is completed. If there is a syntax error, the line gets a red underline. If you hover over it, you can see the full error message.
Code can be in JavaScript, BASIC or PHP, depending on the setting in [[New Project Dialog|New Project,]] [[Properties Window|Form or Code Module]] properties.


Code Folding makes it easier to look at just the code you are interested in. Click on the minus sign to the left of a code block to collapse it.
== Features ==
 
=== Editing ===
 
In BASIC, statements can be made longer than one line by using a space and a “_” character at the end of a line.
 
Syntax checking is done as each BASIC line is completed. If there is a syntax error, the line gets a red underline. If you hover over it, you can see the full error message.


Cut, Paste, Delete and other similar functions can be used from the Menu, the Toolbar or the keyboard.  
Cut, Paste, Delete and other similar functions can be used from the Menu, the Toolbar or the keyboard.  
Line numbers may be up to 99999.
=== Moving Around ===


The dropdown bar at the top of the screen can be used to go directly to a Sub, Function or line number.
The dropdown bar at the top of the screen can be used to go directly to a Sub, Function or line number.
Code Folding makes it easier to look at just the code you are interested in. Click on the minus sign to the left of a code block to collapse it.


To go directly to a function in your program, select the name of the function elsewhere in your code, right click and select "Go to function definition."
To go directly to a function in your program, select the name of the function elsewhere in your code, right click and select "Go to function definition."


If you are working in a language other than JavaScript, you view the translation of the code. Do a right click and select "View JavaScript". You can do this for the whole module or just a selection.
=== Translation ===
 
If you are working in a language other than JavaScript, you may view the translation of the code. Do a right click and select "View JavaScript". You can do this for the whole module or just a selection.
 
=== Inserting Code ===
 
To insert code from an external file, drag and drop the file from the Finder into the Code Window. The code will be inserted into your app at the current position, just as if you had typed it in. You can insert code from .txt, .cod, .bas or .js files.
 
=== Help ===


To bring up the Wiki page for a keyword, select the word, right click and select "Open Wiki Page".
To bring up the Wiki page for a keyword, select the word, right click and select "Open Wiki Page".


Line numbers works up to 99999 lines per module.


Code can be in JavaScript or BASIC, depending on the setting in [[New Project Dialog|New Project,]] [[Properties Window|Form or Code Module]] properties.


Next: [[Deploy_Options|Deploy Options]]
Next: [[Deploy_Options|Deploy Options]]

Revision as of 12:19, 8 December 2013

An autocomplete box appears if needed.
Right click to see these options.

The Code Window is used the edit the code in your program. You can put all your code in a single block, or have a separate code block for each form as well as a global section. At runtime, they are treated as a single block, so be careful not to redefine functions or variables.

Code can be in JavaScript, BASIC or PHP, depending on the setting in New Project, Form or Code Module properties.

Features

Editing

In BASIC, statements can be made longer than one line by using a space and a “_” character at the end of a line.

Syntax checking is done as each BASIC line is completed. If there is a syntax error, the line gets a red underline. If you hover over it, you can see the full error message.

Cut, Paste, Delete and other similar functions can be used from the Menu, the Toolbar or the keyboard.

Line numbers may be up to 99999.

Moving Around

The dropdown bar at the top of the screen can be used to go directly to a Sub, Function or line number.

Code Folding makes it easier to look at just the code you are interested in. Click on the minus sign to the left of a code block to collapse it.

To go directly to a function in your program, select the name of the function elsewhere in your code, right click and select "Go to function definition."

Translation

If you are working in a language other than JavaScript, you may view the translation of the code. Do a right click and select "View JavaScript". You can do this for the whole module or just a selection.

Inserting Code

To insert code from an external file, drag and drop the file from the Finder into the Code Window. The code will be inserted into your app at the current position, just as if you had typed it in. You can insert code from .txt, .cod, .bas or .js files.

Help

To bring up the Wiki page for a keyword, select the word, right click and select "Open Wiki Page".


Next: Deploy Options