User`s guide
Graphics Programming Considerations
Buttons and menus can be monitored in the same window. However, the code will get
complicated, and you might consider using different windows when the button and menu
structure becomes complex.
Only one pull-down menu can be active at any time.
Design your windows with the following mechanical and aesthetic considerations:
l Keep your windows as simple and uncluttered as possible. Use color carefully and
purposefully.
l If you are using multiple windows, use similar graphic elements so the screen
elements become familiar and intuitive.
l Let the operator know what is going on. Never leave the operator in the dark as to the
status of a button push or menu selection.
l Whenever possible, have your windows mimic the real work world of the operator.
In the interest of clarity, the examples in this chapter have not been generalized. When you
actually program an application, use generalized subroutine calls for commonly used code, or
your code will quickly become unmanageable.
Using IOSTAT()
The example code in this chapter leaves out critical error detection and recovery procedures.
Effective application code requires these procedures. The IOSTAT function should be used to
build error-handling routines for use with every ATTACH, FOPEN, FCLOSE, and FSET
instruction. The syntax for using IOSTAT to check the status of I/O requests is:
IOSTAT(lun)
lun The LUN specified in the previous I/O request.
The IOSTAT function returns the following values:
1 if the last operation was successful
0 if the last operation is not yet complete
< 0 if the last operation failed, a negative number corresponding to a standard
Adept error code will be returned.
The following code checks for I/O errors:
; Issue I/O instruction (ATTACH, FOPEN, etc.)
IF IOSTAT(lun) < 0 THEN
;your code to handle the error
END
; The ERROR function can be used to return the text
Graphics Programming Considerations
(Undefined variable: Primary.Product_Name_V)Language User's Guide, version
17.x
Page 257










