Hey fellow developers! π While working with Uniface 10.4, I came across the fieldvideo
statement - a deprecated but still interesting feature for dynamically setting field video attributes. With some assistance from AI, I've put together this comprehensive guide based on the official Uniface Documentation 10.4.
π¨ What is fieldvideo?
The fieldvideo
statement is a Uniface function that dynamically sets video attributes for form fields. Think of it as a way to add visual emphasis to your fields - like highlighting, blinking, borders, or color coding.
β οΈ Deprecation Notice
Important to note: fieldvideo is deprecated! It has been superseded by the $fieldvideo
function, which works across all component types. However, understanding legacy code is still valuable for maintenance projects.
π§ Syntax & Parameters
fieldvideo Field, AttributeList
Parameters:
- Field (String): The field name where video properties are set. If omitted, current field is used.
- AttributeList (String): Video attributes to apply. Defaults to "DEF" if omitted.
π― Available Video Attributes
Code | Description |
---|---|
BLI | Blinking β¨ |
BOR | Border π² |
BRI | Bright π‘ |
HLT | System highlight color π¨ |
INV | Inverse π |
UND | Underline ___ |
COL=n | Set color to code n π |
π‘ Practical Example
Here's a real-world example that highlights invalid names with bright, underlined, blinking text:
; field : NAMEDUMMY.E1
trigger Detail
if (F2.E1 != NAMEDUMMY)
$curOcc$ = $curocc
$name$ = NAMEDUMMY
$counter$ = 1
repeat
setocc "E1",$counter$
$counter$ = ($counter$ + 1)
until ((F2.E1 = $name$) | ($status < 0))
if ($status < 0)
message "%%$name$ not available."
setocc "E1",$curOcc$
fieldvideo NAMEDUMMY, "BRI,UND,BLI"
$prompt = NAMEDUMMY.E1
return (0)
endif
endif
$prompt = F2.E2
end ; Detail
π Key Takeaways
- Use
fieldvideo
for dynamic field highlighting in legacy Uniface applications - Place calls after read statements in read triggers for best results
- Remember that
^CLEAR
and^RETRIEVE
reset video attributes - Migration tip: Consider upgrading to
$fieldvideo
function for new development
Understanding deprecated features like fieldvideo
helps maintain existing codebases while planning for future upgrades. Happy coding! π
Top comments (0)