GOTO Statement
arunmohan
Posts: 31
Is there any GOTO Statements or key words in Netlinx? Or else what keyword or logic will help me to go back to a particular line.
0
Comments
Search for a specific word (cntrl+f) or use the following buttons that are found on the Edit toolbar:
Goto Line to go to a specific line number
Goto Section (define_event, define_variables, etc)
Goto Subroutine (gives you a list of defined functions and calls in the current file)
Add Bookmark (bookmarks the line the cursor is on, then use F2 to jump through the bookmarks)
Clear Bookmarks
I don't think any of these have keyboard shortcuts by default, but you can add your own shortcuts under Settings>Customize>Keyboard.
I find the bookmarks only nominally helpful, especially if you have more than 2 or 3 active, but they aren't entirely useless. But mostly, I just use good old ctrl-F to find a variable or a phrase, then F3 to find the next, etc.
This makes it really easy to quickly jump from the event to function just by pressing F2.
To answer your actual question, no, there's not a GOTO statement. You can build loops and branching logic using FOR, WHILE, IF, and BREAK. If you're in a function, you can also use RETURN for an early exit. If you need help translating your idea into code, let me know what you're trying to accomplish.
When you asked about a GOTO keyword and line numbers I assumed you are talking about the Neltinx language itself and not the editor.
Netlinx is not like BASIC and you don’t navigate though code by referencing line numbers. Netlinx is event driven. You can’t jump to a line with a GOTO or branch to labels. Those types of keywords don’t exist.
Your code will get triggered by events like CHANNEL_EVENT, BUTTON_EVENT, DATA_EVENT, and TIMELINE_EVENT. If you want to call some specified code you can branch to a function that is setup with DEFINE_FUNCTION.
If you are indeed questioning the editor then please ignore everything I said.