Source Code Completion Options

The Edit»Show Completions and Edit»Show Prototype options display functions, variables, and prototypes in a list or tooltip as you type code in the Source window. You can use these source code completion options to help you create source code.

Note  The information that appears in source code completion tooltips and lists is taken from function panels, from documentation tags, or from browse info for user-defined functions. If you include user-defined functions, source code browsing must be enabled for the source code completion options to be available. You also can view macros if you have referenced the macro previously in the code.

Show Completions

Select Edit»Show Completions or press <Ctrl–Space> to view a list of potential matches for the function or variable you are typing. LabWindows/CVI opens a drop-down list of symbol names, and associated graphical icons, that begin with the letters you typed. The drop-down list also contains all functions in any functions panels that you have loaded. Use the arrow keys to navigate through the list and press <Enter> to insert a symbol in your code. If only one item matches, LabWindows/CVI inserts that item in your code immediately.

The Edit»Show Completions option also lists members of a syntactically correct struct, enum members, and macros. If you enable the Show function prototypes and struct/union fields while typing option in the Editor Preferences dialog box, LabWindows/CVI shows struct members when you type . or –> after a variable name. Press <Esc> to close the Show Completions list.

Show Prototype

Select Edit»Show Prototype or press <Ctrl–Shift–Space> to view the function prototype tooltip of the current function. If you enable the Show function prototypes and struct/union fields while typing option in the Editor Preferences dialog box, LabWindows/CVI shows the function prototype tooltip when you type the open parenthesis after a function name. Press <Esc> to close the function prototype tooltip.

Note  You can place the cursor on function and parameter names throughout the function call to change the currently highlighted item in the function prototype tooltip.

Select Values with the Parameter Assistant

As you type parameter values, LabWindows/CVI highlights the current parameter in the function prototype tooltip. If LabWindows/CVI provides an input selection dialog box or list of constant values for the current parameter, LabWindows/CVI displays a button next to the parameter in the function prototype tooltip. The input selection dialog boxes contain lists of constant values, file selections, channel names, and so on that are associated with the current parameter. Click the button or select Edit»Show Parameter Assistant or press <Ctrl–Shift–Enter> to view the dialog box or list of constant values. When you double-click a value or scroll to a value and press <Enter>, LabWindows/CVI inserts the value into the code. Press <Esc> to close the dialog box or list and return to the function prototype tooltip.

Declare Variables

To declare a variable for the current parameter in the function prototype tooltip, type the variable name and select Edit»Declare Parameter Variable or press <Ctrl–D>. LabWindows/CVI inserts a copy of the variable declaration at the beginning of the code block that contains your current position. If the variable you are declaring is an array, LabWindows/CVI prompts you for the number of elements in the array.

View Function and Parameter Help

To view function and parameter help for LabWindows/CVI libraries, click the question mark button that appears to the left of the function prototype or press <F1>. LabWindows/CVI displays help for the currently highlighted item. Press <Esc> to close the help and return to the function prototype.

Note  By default, you cannot select values with the Parameter Assistant, declare variables, or view help for user-defined functions. If you want to use these options for user-defined functions, you must add tags to the source code.

WAS THIS ARTICLE HELPFUL?

Not Helpful