There are boilerplate snippets of text which can be inserted with a few keystrokes or mouse clicks, saving a lot of time otherwise spent typing frequently-repeated blocks of text (function headers, certain XCALLs, if/else/endif blocks, etc.) Several have been pre-defined, but you may want to customize them and/or add your own. Use View > Windows > Text Clips to display the Text Clips panel:
Make sure that the language at the top is set to A-Shell Basic. Then use the buttons at the bottom of the panel to add/edit/delete/import. When creating text clips, you can optionally define a shortcut as an alternate way to insert the clip (type the shortcut and hit TAB). Also, the text of the clip can contain variables:
${1} first parameter (cursor lands here first)
${2} second param (TAB takes you from one to the next)
${0} place where final TAB leaves the cursor
To specify a default for any parameter, just append a colon and the text after the number within the brackets, as in this example:
To use the clip, enter the shortcut (“cb”) and hit TAB:
or double-click the clip in the text clip panel. The clip is inserted and the cursor goes to the first parameter:
… Type a comment ...
… Hit TAB again, and the cursor then lands at the position of the ${0}.
Text clips can also contain the following (hopefully self-explanatory) system variables:
${PN_Date} |
${PN_CurrentColumn} |
${PN_ProjectPath} |
${PN_Time} |
${PN_CurrentWord} |
${PN_ProjectGroupPath} |
${PN_Filename} |
${PN_CurrentLineText} |
${PN_ProjectName} |
${PN_FileDirectory} |
${PN_SelectedText} |
${PN_ProjectGroupName} |
${PN_FilenameNoExt} |
${PN_CurrentProjectFile} |
${PN_UseTabsYesNo} |
${PN_FilePath} |
${PN_CurrentProjectGroupFile} |
${PN_TabSize} |
${PN_CurrentLine} |
|
|
For example,
results in:
Note that text clips, like most other configuration attributes, are user-specific and stored in %APPDATA%\Echo Software\PN2. In this case they are in the asb sub-folder as asb.clips and asb-xcall.clips.