Page 146 of 229 Start Back Next End ZBasic Language Reference 136 ZBasic Microcontrollers 9.1.3 Expand/Collapse Another capability of the editor that is based on its ability to recognize the structure of the code is its ability to expand and collapse parts of the code. If you have a .bas file open that contains an If-Then-Else statement, you’ll notice a small minus sign in the margin just to the left of the first displayed column on the line containing the If and the line containing the Else. If you left-click either one of these minus signs, you’ll note that the display collapses to hide all of the lines in the corresponding section of code. At the same time, the minus symbol changes to a plus symbol indicating that there are “invisible” lines in the document. Left-clicking on the plus sign expands the corresponding code section. The expand/collapse effect can be invoked also by typing Ctrl+Keypad-* as well. 9.1.4 Auto-Completion The editor has the ability to save you some typing by presenting a list of words having a prefix that matches a sequence of one or more characters that you have already typed. This ability, called auto- completion, comes in two distinct forms that differ in the origin of the list from which the matching list is built. The first form looks for matches in a list of words collected from the current document. This is useful for quickly inserting a variable, subroutine, or function name or language keyword that is already present elsewhere in your document. The second form looks for matches in a pre-defined list of ZBasic library routines and built-in constants. The first form of auto-completion is invoked by typing the first few characters of an identifier that you know to be in the current document and then pressing Ctrl+Enter. If one or more identifiers exist having those characters as a prefix, they will be presented in a popup window near the caret. If multiple entries exist, the Up and Down cursor keys will move the selection up and down the list. At any time, you may press Enter to replace the prefix characters that you have already typed with the entry that you have selected. If you don’t wish to use any of the items in the list, you may simply continue typing or you may press the Escape key. In either case, the popup window with the matching word list will disappear. The second form of auto-completion is invoked by typing the first few characters of pre-defined library function or built-in constant and then pressing Ctrl+I. If one or more pre-defined entities exist having those characters as a prefix, they will be presented in a popup window near the caret. As before, if multiple entries exist, the Up and Down cursor keys will move the selection up and down the list. At any time, you may press Enter to replace the prefix characters that you have already typed with the entry that you have selected. If you don’t wish to use any of the items in the list, you may simply continue typing or you may press the Escape key. In either case, the popup window with the matching word list will disappear. In either case after the popup appears you may continue typing characters of the intended word and the list will be refined to include only those entries matching the modified prefix. 9.1.5 Call Tips Another aid that helps to more quickly compose correct code is the Call Tip feature. When you type the name of a function or subroutine that is known to the system and then type a left parenthesis, a popup window will appear that will contain information about the number and type of parameters expected by that routine. In some cases, there may be multiple ways to invoke the routine, usually because some of the parameters are optional or a given parameter may be of two or more significantly different types (e.g. Single and Integer). In these cases, the Call Tip window will display a dark rectangle containing an upward pointing arrowhead of the left side of the popup. Clicking on the rectangle will display the preceding alternative while clicking to the right of the rectangle will display the next following alternative. The content of the parameter lists, if any, is intended to remind you of the purpose and allowable types for the parameters. In most cases, the word Integer implies that the expected value is the ZBasic type Integer. Note, however, that the compiler is often somewhat lenient in its type checking for built-in routines and it may allow, for example, an UnsignedInteger to be used instead. The type descriptor “AnyIntegral” means any integral type such as Byte, Integer, Long, etc. The descriptor “AnyNumeric” includes the same types as AnyIntegral but also includes the type Single. The descriptor “AnyType”