β¨ This blog post was created with AI assistance to help developers understand Uniface better.
If you're working with Uniface 10.4, you might have come across the $curword function and wondered what it does. Let me break it down in simple terms! π€
What is $curword? π―
The $curword function is a handy tool that tells you exactly which word your cursor is sitting on in a Unifield. Think of it like a spotlight π¦ that identifies the specific word under your cursor.
How Does It Work? βοΈ
When you use $curword, it returns the word where your cursor is currently positioned. This might sound simple, but it's actually quite powerful for creating interactive applications.
Important notes:
- π― Only works in Form components
- π Only applies to Unifields (not regular widgets)
- π« Has no effect in widgets
Practical Example: Context-Sensitive Help π‘
Here's a real-world example of how you might use $curword:
trigger help
help $text("%%$curword%%%_HLP")
end; help
What's happening here? π€
- User places cursor on a word (like "customer" or "invoice")
- User activates the help trigger
- The system gets the current word using
$curword - It creates a help topic name by combining the word with "_HLP"
- Shows relevant help for that specific word
For example, if your cursor is on "customer", it would look for help topic "customer_HLP" π
Why Use $curword? π
This function is perfect for:
- π Creating smart help systems
- π Building context-aware documentation
- π¨ Developing interactive form experiences
- π§ Making user-friendly applications
Quick Tips for Success πͺ
Remember:
- β Test in Unifields only
- β Use for interactive features
- β Don't expect it to work in regular widgets
- β Great for help systems and user guidance
Conclusion π
The $curword function might seem small, but it's a powerful tool for creating better user experiences in Uniface applications. Whether you're building help systems or interactive forms, this function can make your applications more intuitive and user-friendly.
Happy coding! π
Keywords: uniface, curword, procscript, development
Top comments (0)