How to catch empty stringfield in gui using SKILL ?
For example, if the user forgot to fill the string field and he click
the apply button, message in the CIW should be, "Stringfield is empty,
please input something ."
Thanks in advance.
There is a built-in predicate function for checking if a string is blank/empty or not: blankstrp()
You can use it directly on the form field, e.g.
warn("String myStrField is empty, please check and try again\n") ;; issue a warning message
hiHighlightField(myform 'myStrField 'error) ;; hilight the string field
hiSetCallbackStatus(myForm nil) ;; prevent the form from unmapping from the screen
hiHighlightField(myform 'myStrField 'background)
;; do the desired form action...
The above was not tested directly (so beware of any typos) but it is the sort of flow that I have used in the past.
In reply to skillUser:
Your code works like a charm.
Thank you very much.