Rocket Uniface User Forum

 View Only

Enhancing Uniface Coding Efficiency with Auto-Complete

By Kathy Larson posted 03-12-2024 13:24

  

by Jonke Korzelius

When you are writing Uniface ProcScript, every keystroke matters. Efficiency and accuracy are important and will boost your productivity. Auto-complete, also known as code completion, is a functionality integrated into modern code editors that predicts and suggests completions for the code you are typing based on the characters you have entered. It is like having an assistant that offers suggestions to streamline your coding process.

How Auto-Complete Works

When you start typing in a ProcScript editor with auto-complete enabled, it at once starts analyzing the character entered and presents a list of suggestions that match what you are typing. These suggestions can range from statements, functions, and pre-compiler directives, saving you from tediously typing out long names and thus preventing syntax errors. Entering a character, a-z, will suggest the list of statements that start with that letter, the $ plus character gives you the list of functions starting with that letter, and # plus character the pre-compiler directives accordingly. Continuing typing will look for the combination of characters in the list provided, backspace to close the list or hit Esc. Use the up and down arrow keys to navigate the list and Tab or Enter to accept a suggestion. Very much how this works in all popular editors.

You can disable the auto-complete feature in your usys.ini file if you do not need it or feel hindered by it, or if you have ideas on how we can improve this feature please contact us.
Go to the [widgets] section and change the codecompletion property to false:
SourceEdit=usrcedit(font=procboxfont;language=uniface;indenttabs=off;autoindent=on;indentsize=2;indentguides=off;codecompletion=false;codecompletionheight=10)

What this line also tells us is that you can specify the height of the code completion list; values between 10 and 30 are accepted, the default is 10.

In action:

Benefits of Auto-Complete

·        Speeds Up Coding: By reducing the need to manually type out every character, auto complete accelerates coding tasks. With just a few keystrokes, you can select the desired suggestion from the list and move on to the next part of your code.

·        Reduces Errors: Typos and syntax errors are common pitfalls in coding. Auto-complete helps mitigate these risks by suggesting correct syntax, minimizing the chances of introducing bugs into your codebase.

·        Enhances Discoverability: Auto-complete serves as a powerful discovery tool. It exposes available statements, functions, and pre-compiler directives as you type, making it easier to explore and use the capabilities of the Uniface programming language.

Stay updated

Keep your Uniface installations up to date to receive help from the latest improvements and enhancements. We continually refine these tools to provide better suggestions and a smoother user experience.


#tofp
2 comments
16 views

Permalink

Comments

03-19-2024 12:37

Hi Larry,

Code completion was introduced in Uniface 10.4.02.41 - Rocket Uniface 10.4.02-041 Released | Rocket Uniface Support Resources (rocketsoftware.com).

Kind regards,

Mike

03-15-2024 10:08

What versions of Uniface is this compatible in? I tried it in 10.3.02-062 and nothing different happened in the proc editor after changing the values in the SourceEdit section of the usys.ini.