DEV Community

Peter + AI
Peter + AI

Posted on

📚 Understanding the Uniface `refresh` Statement: A Quick Character Mode Guide

Working with Uniface can sometimes feel like navigating through a maze of documentation, but today I want to share a simple yet useful statement that can make your character mode development smoother: the refresh statement. 🖥️

🎯 What does refresh\ do?

The refresh statement in Uniface is designed to redraw the current Form component, but here's the catch - it only works in character mode. If you're running under Windows, this command won't have any effect. 📝

⚙️ Technical Details

  • Return Values: None
  • Usage: Form components only
  • Compatibility: Character mode exclusively (no effect in Windows)
  • Components: Allowed in form, service, session service, entity service, and report components (non-self-contained)

🚀 When to Use It

The primary use case for refresh is cleaning up the screen after a spawn statement. Think of it as your screen's reset button - it gives you the same effect as manually using the structure editor function ^REFRESH. ✨

💡 Practical Example

Here's a simple scenario where you might use it:

; After spawning a process that might clutter the screen
spawn "some_external_process"

; Clean up the display
refresh
Enter fullscreen mode Exit fullscreen mode

🤔 Why Character Mode Only?

This limitation makes sense when you consider that character mode applications often deal with text-based interfaces where screen redrawing is more critical for maintaining a clean user experience. In modern GUI environments, the operating system typically handles display refresh automatically. 🖼️

📋 Quick Reference

Aspect Details
Statement refresh
Mode Character mode only
Components Forms (and related non-self-contained components)
Primary Use Screen cleanup after spawn operations

While this might seem like a small feature, understanding these little utilities can make your Uniface development more efficient. Every tool in your toolkit counts! 🔧

This post is based on the Uniface documentation 10.4, and I had some help from AI in organizing the content. 🤖

Top comments (0)