Add/edit declarations | CPN Tools help |
How-to |
The declarations are located in the index under the Declarations entry under the net name.
Clicking on the triangle next to the Declarations entry opens the declarations. Clicking on a triangle next to an individual declaration or clicking on the declaration text opens this declaration.
To add a declaration, bring up the Declarations marking menu on the top declarations node or on one of the separate declarations in the index. Select the New Decl entry.
The added declaration will appear either at the bottom of the list of declarations or below the declaration where you added it. The declaration will be in text edit mode when it appears so it can be modified right away.
You can insert new lines by pressing Enter, and you can create a new declaration below the one you are editing by pressing Ctrl-Enter. You can also add a declaration to an existing declaration if you separate them with a ';'. When you finish text editing, the declarations will be split into separate declarations.
To finish text editing, click somewhere on the background or press the ESC
key.
Declaration blocks are used to divide declarations into groups, often in larger nets with many declarations. Below, the variables are put together under a block called VARIABLES:
To add a declaration block, bring up the Declarations marking menu and select the New Block entry. The new block will appear at the bottom of the list or after the declaration where you added it, and it will be in text edit mode when it appears.
To add a declaration to a block, bring up the Declarations marking menu on the block and select the New Decl entry.
The only limitation is the syntax check, which requires declarations to come after those it depends on. Which in turn can be achieved by dragging declarations.
If you are editing a declaration or block (see below), you can add a new declaration by pressing Ctrl-Enter. If you are editing in the index, the new declaration will appear below the one you are editing. If you are editing in a text sheet, the new declaration will be opened in the same binder as the one you are working in.
To edit a declaration or block, open it in the index by clicking on the triangle next to it, and then click on the declaration or block text. The redish color indicates that all text is selected. See more about how to edit text.
To finish editing, click somewhere on the background or press the ESC
key to exit text edit mode.
Alternatively, drag the declaration/block from the index to a text sheet.
Click on the text and edit it. To finish editing, click somewhere outside of the text or press the ESC
key. The text will now be syntax checked, and any errors that might occur will be shown with highlighting. See Syntax checking for more information.
If you are editing a declaration or block (see below), you can jump to the next declaration or block by pressing TAB. If you are editing in the index, you will jump to the next declaration or block in the index. If you are editing in a text sheet, you will jump to the next declaration in the same binder.