Overview
The Query Editor allow the user to write scripts in SQL.
On this page:
Table of Contents | ||||
---|---|---|---|---|
|
Edit Actions
The "Edit" manages text manipulation within a Query. Users can undo and redo actions, cut, copy, paste, and delete text. It also includes commands for incremental search, selecting all content, and checking if a document is read-only.
Action | Description |
Undo | Reverts the last action taken. |
Redo | Reapplies the last undone action. |
Cut | Removes the selected content and places it on the clipboard. |
Cut/Append | Cuts the selected content and appends it to existing clipboard content. |
Copy | Copies the selected content to the clipboard. |
Copy/Append | Copies the selected content and appends it to existing clipboard content. |
Paste | Inserts content from the clipboard. |
Delete | Removes the selected content without copying it to the clipboard. |
Find (Ctrl+F) | Opens a search dialog to locate text. |
Find Next (F3) | Finds the next occurrence of the last searched text. |
Incremental Search | Searches as the user types, updating results incrementally. |
Select All | Highlights the entire document content. |
Insert Example | Inserts a predefined example or template. |
Is Document Read-only | Checks if the document is in a read-only state. |
View Options
The "View” allows users to customize the visibility of various interface elements. Users can toggle the visibility of margins, line numbers, word wrap, whitespace, and different types of highlighting. These options enhance the user's control over the document's visual presentation.
Option | Description |
Indicator Margin Visible | Toggles the visibility of the indicator margin. |
Line Number Margin Visible | Shows or hides the line number margin. |
Outlining Margin Visible | Controls the visibility of the outlining margin. |
Ruler Margin Visible | Toggles the visibility of the horizontal ruler margin. |
Selection Margin Visible | Shows or hides the selection margin. |
Word Wrap | Enables or disables word wrapping. |
Word Wrap Glyphs Visible | Toggles the visibility of glyphs indicating wrapped lines. |
Whitespace Visible | Shows or hides whitespace characters like spaces and tabs. |
Can Scroll Past Document End | Allows or disallows scrolling beyond the end of the document. |
Virtual Space at Line End | Enables positioning the cursor in virtual space beyond the line end. |
Indentation Guides Visible | Toggles the visibility of vertical guides indicating indentation levels. |
Line Modification Marks Visible | Shows or hides markers for lines modified since the last save. |
Current Line Highlighting Enabled | Highlights the line where the cursor is currently located. |
Delimiter Highlighting Enabled | Highlights matching delimiters, such as brackets or parentheses. |
Search Result Highlighting Enabled | Highlights search results within the document. |
Auto-Correct Enabled | Enables or disables automatic spelling or grammar correction. |
Toggle Token Info in Status Bar | Toggles the display of token information in the status bar. |
Advanced Options
The "Advanced" provides tools for formatting and text editing. Users can convert tabs to spaces, change character casing, and manage whitespace. It also includes commands for tabifying lines, deleting blank lines, and trimming trailing whitespace, enabling precise text adjustments within the document.
Option | Description |
Convert Tabs to Spaces | Converts tab characters to spaces in the selected text. |
Convert Spaces to Tabs | Converts spaces to tab characters in the selected text. |
Tabify Selected Lines | Replaces leading spaces with tabs in selected lines. |
Untabify Selected Lines | Replaces leading tabs with spaces in selected lines. |
Make Uppercase | Converts the selected text to uppercase. |
Make Lowercase | Converts the selected text to lowercase. |
Toggle Character Casing | Switches the case of the selected text between uppercase and lowercase. |
Capitalize | Capitalizes the first character of each word in the selected text. |
Delete Horizontal Whitespace | Removes spaces and tabs on a line without affecting content. |
Trim All Trailing Whitespace | Removes trailing spaces and tabs from all lines in the document. |
Trim Trailing Whitespace | Removes trailing spaces and tabs from the selected lines. |
Delete Blank Lines | Removes all blank lines in the selected text or document. |
In this section:
Editing Code
To edit code, follow the steps below:
- Access Datasets → Query Editor.
- Edit the code.
- Click the floppy disk icon on the toolbar to save the changes.
Productivity Tools
The Datasets Module offers tools to enhance your productivity when creating and editing scripts. They are as follow:
IntelliSense: This is a code-completion aid that features listing the available properties and methods for the objects and auto-completing their names. In addition to the Properties and Methods of the .NET Framework, it supports all project entities, like tags and displays. Type a dot (.) after an element to show its available properties.
Toolkit Namespace: The platform exposes many .NET libraries to the solution, but there are a few methods that are frequently required, such as type conversion, copying tags to DataTables and .NET objects, or dynamically changing the communication settings. Those methods are included in a library toolkit, to use then insert TK in the code editor, IntelliSense will respond with a list of all available methods and provide a summary documentation for any method you select. See the example below:
Code Block double x = TK.ConvertTo<double>("123");
Access the namespace T.Toolkit.TK class at the Namespaces API to see the list of all methods available.
Debugging and Error Handling
The platform has an integrated .NET code debugger. In order to use it, the local computer must have a cache with the necessary files to run the debugger. The steps to enable the debugger are:
Enable the Debug Information on Runtime → Build and Publish.
As necessary, save the source code you want to debug. This will create the debug information. This step is only necessary the first time you open the project on the computer. Afterwards, the background compiling generates the necessary debugging information to enable the use of breakpoints and step execution.
Attaching the .NET debugger
In order to have a .NET debugging session, the engineering environment must be connected to the runtime, and the .NET debugger must be attached to server or client process. Follow these steps.
When Running the project, go to Runtime → Startup and enable the connect check box.
If the project is already running, go to Runtime → Startup, according to the runtime you want to attach, and connect to the runtime system by pressing the connect button on those pages.
Open any script that has debugging information and press the Attach .NET debugger button. A message on the bottom of the engineering workspace will show that a debugging session is active with the server components or the client components of the running project.
When the .NET debugger is attached, the system will stop on the defined breakpoints and will stop automatically when any .NET Exception occurs.
Breakpoints, Steps, and Watch
In order to setup a breakpoint, open the desired code, select the line, and press Insert Breakpoint on the toolbar.
When the system stops on a breakpoint, you can perform step by step execution or click the continue button.
In order to inspect local .NET variables, tags, or project objects, select the text in the script editor. When the execution is stopped on a breakpoint, the toolkit will show the current value of the variable.
You can also add .NET variables or project objects to the Watch window. When adding tags or project objects, you need to use the at symbols @, like @tag.tag1
. This will allow the system to know it is a project object and not a local .NET variable. Keep in mind that the Watch display is only updated when execution is stopped. If you want to have real-time values for tags and objects, open the PropertyWatch diagnostics tool.
In this section...
Page Tree | ||||
---|---|---|---|---|
|