Dear SKILL experts
I tried to write a SKILL function that shows a form created by hiCreateAppForm() on the screen and blocks execution until the form is removed from the screen by the user with a OK or Cancel.
In the form I have a listBoxField. The user selects ONE item in the listBox. When OK is pressed the SKILL function that showed the form returns the selected item, when Cancel was selected the function returns nil.
I tried the argument: ?dialogStyle 'modal but the form does not block the execution.
The code is in one SKILL file that I load but the execution of the SKILL statements in the file is not blocked while the form is on the screen.
Here is the code:
file listBox.il:
; Create the application form
hiCreateAppForm(
?name 'VARselectListForm
?formTitle "Title"
?dialogStyle 'modal
?initialSize t
?buttonLayout 'OKCancel
?fields list(
list(
hiCreateListBoxField(
?name 'VARselectListFormListBox
?choices nil
?value nil
?prompt "Nodes"
) ; hiCreateListBoxField
list(0 0)
list(150 400)
50
) ; list
) ; list
) ; hiCreateAppForm
procedure(SHOWselectListBoxForm(title choices)
when(and(boundp('VARselectListForm)
hiIsForm(VARselectListForm))
VARselectListForm->title = title
VARselectListForm->VARselectListFormListBox->choices=choices
hiDisplayForm(VARselectListForm)
VARselectListForm->VARselectListFormListBox->value
) ; when
) ; SHOWselectListBoxForm
And the the file that uses this:
load("listBox.il")
choices = '("aaa" "bbb" "ccc" "ddd" "eee")
title = "Form title"
printf("Before the box\n")
choice = SHOWselectListBoxForm(title choices)
printf("After the box: %L\n" choice)
The message After the box............. already appears while the form is on the screen.
I want a blocking solution. The dialog style systemModal is gone.
Of course I can make a wait loop with global variables, but is there a better way?
Hans Kok