- This lesson will teach you the following concepts
- How to view the element to which the current process belongs?
- How to print the source code?
- How to perform a "find and/or replace"?
- What is the meaning of "+" and "-" signs in the code editor?
- Is it possible to identify the person who wrote a code line?
- Is it possible to find out the number of a code line?
- Is there a method to easily display the syntax or the help about a function?
- What are the useful shortcuts in the code editor?
- How to communicate with the user?
Lesson 2.5. Questions/Answers
This lesson will teach you the following concepts
How to view the element to which the current process belongs?
To view the element corresponding to the current process, on the "Code" pane, in the "Navigation" group, click "Go to object" (Ctrl + Alt + F2). The window containing the requested element is displayed.
How to print the source code?
To print the current source code, click the
icon in the "Home" pane or press Ctrl + P.
How to perform a "find and/or replace"?
The functions for performing searches or replacements (in the code, in the interface, ...) can be accessed from the "Home" pane, in the "Find" group or in the "Find - Replace" pane (Ctrl + F) :
Then, you have the ability to define the different characteristics of the search to perform.
What is the meaning of "+" and "-" signs in the code editor?
The code editor allows you to expand or collapse the WLanguage code. This feature is very useful if your processes use a lot of structured statements (loops, conditions, browses, ...).
To collapse a code section, on the "Display" pane, expand "Collapse" and select "Collapse all" (or press Ctrl + Shift + * (on the numeric keypad)).
Only the comments remain visible. The associated code is displayed in a tooltip when the comment line is hovered by the mouse cursor:
Press Ctrl + * (on the numeric keypad) to expand the entire code. A click performed on the "-" or "+" symbol allows you to collapse or expand the corresponding code section.
Is it possible to identify the person who wrote a code line?
Press F6 to display information (name and creation/modification date) about each code line.
Is it possible to find out the number of a code line?
In the code editor, to enable (or not) the numbering of code lines, on the "Display" pane, in the "Help for edit" group, click "Display the line numbers" (shortcut: Ctrl + Shift + G).
Is there a method to easily display the syntax or the help about a function?
When typing a function in the code editor:
- the name of each parameter is displayed in a tooltip for the code line currently in edit. For the parameter currently in edit, hovering the parameter name with the mouse is used to display the parameter details in a tooltip.
If several syntaxes are available, press Ctrl + Alt + Right or left arrow to go from a syntax to another one.
- the function syntax is displayed in the status bar of editor.
In the help, the parameters enclosed between [ and ] are optional parameters.
For the functions that require names of data files, controls, windows or reports, the assisted input is used to display the list of project elements corresponding to the parameter of the function currently typed.
Examples of assisted input for HReadFirst
: the <Wizard> option is used to start a code wizard. This wizard asks you questions regarding the function use and it automatically generates the corresponding code.
A help page is associated with each WLanguage function and property. This help page can be directly accessed from the editor by pressing F1 on the name of requested function or property.
What are the useful shortcuts in the code editor?
- F2 on the name of a control, class, procedure or report block displays the process of this object.
- Ctrl + F2 is used to go back to the initial process.
To move from a process to another one, press F2 repeatedly. To go back to the initial process, press Ctrl + F2 the same number of times.
- Ctrl + L deletes the current line.
- Ctrl + D duplicates the current line (or the selected lines) on the line below.
- Tab (tab key) and Shift + Tab are used to manage the indent for the selected lines.
- Ctrl + / converts the selected lines into comments, Ctrl + Shift + / removes the comments (Caution: / key on the numeric keypad).
- Ctrl + R is used to automatically re-indent the displayed code.
How to communicate with the user?
All you have to do is use an advanced dialog box. These dialog boxes are used to manage:
- the directive questioning (Dialog): The user answers a question via the buttons containing the text of the action to perform.
- the immediate input (Input), by allowing the user to type the requested value in the dialog box.
See the online help for more details (keyword: "Dialog" and "Input").
- To check the different modes for communicating with the user:
- Open the "WD My first windows" project if necessary: on the "Home" pane, in the "Online help" group, expand "Tutorial" and select "My first windows (Answer)".
- Open the "WIN_Dialog" window. This window presents the different dialog modes.
- Run the window test ("GO" button).
- Click the different buttons to check the different dialog modes.
- Stop the test of this window and go back to the code editor to study the code of each button.
Click [Add] to post a comment