Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 4dce83a

Browse files
authored
Update 525-console-form.markdown
1 parent bf78b46 commit 4dce83a

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

_build/reference/525-console-form.markdown

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,8 @@ To get a list of all available elements of the n-th GUI element, you can simply
8383

8484
### Example 1: Creating a push button using callback function
8585

86+
When using buttons in combination with callback functions, the `doEvents()` function is not necessary. Without this function the execution of the program will not be blocked. In the following example a number will be incremented in a while loop and printed to the screen. When the button is pressed, the callback function is executed and will block the program until the callback function ends.
87+
8688
```
8789
button.type = "button"
8890
button.x = 120
@@ -96,16 +98,19 @@ formMAP.inputs << button
9698
f = form(formMAP)
9799
98100
while 1
99-
f.doEvents()
101+
ii++
102+
locate 0,0: print ii
103+
delay(100)
100104
wend
101105
102106
f.close()
103107
104108
sub ButtonClicked()
105-
at 0,0
109+
locate 1,0
106110
Clicked++
107111
print "Button clicked " + Clicked + " times"
108112
end
113+
109114
```
110115

111116
### Example 2: Creating a push button using doEvents result

0 commit comments

Comments
 (0)