The PowerBuilder code editor has been refactored, and provides the following features, to enhance the coding experience and productivity.
Code editor refers to the script editor opened from the Edit popup menu in the system tree, as well as the source editor opened from the Edit Source menu.
Coding assistance features:
-
AutoScript – The code auto-completion list can be triggered in more contexts of coding and offers a richer set of suggestions. For detailed instructions, refer to the section called “Using AutoScript” in Users Guide.
-
Parameter Info -- Automatically pops up the syntax details when typing a function or event name followed by "(", aiding in understanding the function's syntax requirements. For more details, refer to the section called “Using Parameter Info” in Users Guide.
-
QuickInfo -- Displays relevant information about a variable, function, event etc. when the mouse hovers over it, providing quick insights into the details. (However, QuickInfo does not work when the parameter is an array.) For more details, refer to the section called “Using QuickInfo” in Users Guide.
Editing features:
(Refer to the section called “About the Script editor” in Users Guide for more information)
-
Line Numbers -- Displays line numbers in the editor for easy reference and navigation within the code. This feature can be turned off in the Design menu > Options menu > Script tab page.
-
Highlight Current Line/Element -- The current line where the cursor is located is highlighted with a grey box. This feature can be turned off in the Design menu > Options menu > Script tab page. When clicking on a name of a class, variable, function, etc., all occurrences of the same name are highlighted automatically.
-
Bracket Matching -- Automatically highlights matching brackets when the cursor is positioned near a left or right bracket.
-
Syntax Coloring – More elements such as function name, variable name, class name etc. can be configured with different syntax color. You can enable/disable the syntax coloring and configure different colors for different syntax in the Design menu > Options menu > Coloring tab page.
-
Change Tracking – Displays a vertical color bar next to line numbers to indicate the line has been edited, helping developers track recent changes in the code.
-
Outlining & Folding -- Supports the outlining & folding display of syntax elements like FOR/NEXT, IF/ENDIF, CHOOSE, TRY etc.
-
Word Wrap -- Automatically wraps text to the next line when it exceeds the editor's width. This feature can be turned off in the Design menu > Options menu > Script tab page.
-
Rectangular Selection -- Selects a rectangular area of text by holding the Alt key and dragging the mouse. This is useful for editing multiple rows and columns simultaneously.
-
Multi-cursor Editing -- Edits the text at multiple locations (multi-cursors) at the same time. To do this, hold down the Ctrl key and use the mouse to click multiple locations to insert the cursor or select multiple text locations and edit the text.
-
View White Space -- Displays the white space to help developers easily identify spaces (which will display as dots) and tabs (which will display as arrows) in the code, enhancing readability and ensuring consistent formatting. This feature can be turned on in the Design menu > Options menu > Script tab page.
-
Horizontal Whitespace Removal -- Remove extra or unnecessary spaces and tabs that appear between elements in a single line of code, through the right-click menu.
-
Case Conversion -- Converts the case of selected text via the right-click menu.
-
Line Indentation -- Increases or decreases line indentation via the right-click menu. You can also enable/disable auto indenting inside statements such as IF, FOR etc. in the Design menu > Options menu > Script tab page.
-
Comments -- Adds or removes comment characters to/from the selected line or the current line, via the right-click menu.
-
Status Bar – Adds a status bar at the bottom right corner of the editor, displaying line and column numbers of the current line for easy reference.
-
Zooming – Adds a zooming slider at the bottom left corner of the editor to allow users to adjust the text size for better readability.
Others:
-
Enhanced Find and Replace with Regex -- Improved find and replace functionality with keyword highlighting, as well as enhanced regex support for advanced search operations. For more, refer to the section called “Finding and replacing scripts” in Users Guide.
-
Breakpoint enhancement -- You can click the gray bar at the beginning of a line to add or remove a breakpoint for that line. This feature is only available in the script editor (not in the source editor).
-
Enhanced menu & toolbar -- New items for formatting and editing in the menus and toolbar. The Edit menu has been added with the Code Formatting menu and the following sub-menus: Comment Selection, Uncomment Selection, Make Uppercase, Make Lowercase, Increase Line Indent, Decrease Line Indent, & Delete Horizontal White Space. The toolbar has been added with the following items: Make Uppercase, Make Lowercase, Increase Line Indent, & Decrease Line Indent.