This article was created with AI assistance to help fellow developers understand this essential Uniface feature better. ๐ค
๐ What is the show Statement?
The show
statement is a powerful Uniface ProcScript command that displays or refreshes form components instantly. Think of it as your window refresher - it updates what users see on screen without waiting for their input! ๐
Key Feature: Unlike edit
and display
statements that pause execution waiting for user interaction, show
keeps your code running while updating the display.
๐ฏ Basic Syntax
show
That's it! Simple and clean. โจ
โ๏ธ How It Works
When you execute a show
statement, Uniface performs these actions:
- ๐ Synchronizes Display: Updates all visible field values
- ๐จ Applies Properties: Refreshes current property values (except entity properties for current occurrences)
- โก No Triggers Fired: Performs update without triggering events
- ๐ Continues Execution: Code keeps running without waiting for user input
๐๏ธ Where to Use It
Component Type: Form components only ๐ฑ
Error Alert: Using show
in service components returns error -1402 (UPROCERR_STATEMENT). Remember this limitation! โ ๏ธ
๐ป Practical Example: Live Countdown
Here's a real-world example showing show
in action for creating a live countdown display:
function CountDown() variables numeric j endvariables MyField.MyEnt = 10 while (MyField.MyEnt > 0) show ; Update display immediately j = 10000 ; Create small delay while (j>0) j = j - 1 endwhile MyField.MyEnt = MyField.MyEnt - 1 ; Decrease counter endwhile end; CountDown
What happens here:
- ๐ฏ Sets initial countdown value to 10
- ๐ Uses
show
to immediately display each countdown number - โฑ๏ธ Creates a small delay for visual effect
- ๐ Decrements counter and repeats until zero
๐ง Configuration Tips
Display Update Issues? If Uniface doesn't update the display completely, modify the AsynchGui
setting in your usys.ini
file:
AsynchGui = 2 ; Flush mode for complete screen updates
๐ Common Use Cases
- ๐ Progress Indicators: Show real-time progress during long operations
- ๐ Live Data Updates: Display changing values during calculations
- โฑ๏ธ Status Updates: Keep users informed about ongoing processes
- ๐ฎ Interactive Elements: Create dynamic user interfaces
โก Performance Considerations
Important: The show
statement forces immediate screen updates. Use it wisely in loops to avoid performance issues! Consider adding small delays between updates for better user experience. ๐ฏ
๐ Related Statements
Compare show
with similar statements:
- ๐
edit
: Displays form AND waits for user input - ๐๏ธ
display
: Shows read-only form AND waits for user interaction - โก
show
: Updates display WITHOUT waiting (continues execution)
๐ก Pro Tips
- ๐ฏ Perfect for creating responsive user interfaces
- ๐ Ideal for showing progress in batch operations
- โ ๏ธ Remember: Form components only!
- ๐ Use with
$interactive
and$editmode
for advanced form control
๐ Conclusion
The show
statement is your go-to tool for creating dynamic, responsive Uniface applications. Its simplicity makes it perfect for real-time updates, progress indicators, and interactive user experiences. Master this statement, and you'll significantly improve your application's user experience! ๐
Happy coding with Uniface! ๐
Top comments (0)