stop executing the loop
Posted: Thu Oct 11, 2018 5:42 pm
SRB:
Da li neko može da mi pomogne u sledećem problemu:
Definisao sam prozor Form_1, u njemu Grid_1, u gridu Toolbar_1, a u toolbaru dugmad Button_1, Button_2,...Button_n.
Klikom na jedno od dugmadi pokreće se procedura u kojoj je jedna FOR-NEXT petlja. Želeo bih da korisnik može, pritiskom na neki taster na tastaturi (npr. ESC), zaustavi izvršavanje petlje, pa da ga program pomoću MsgYesNo() funkcije pita da li želi da prekine izvršavanje ili da nastavi.
Pokušao sam sa funkcijom INKEY(), zatim GetAsincKeyState(), GetKeyState() ali bez uspeha. Da li može neko da me posavetuje kako da rešim problem?
P.S. Ne govorim engleski, ovaj post mi je prevela koleginica iz škole
EN:
Can anyone help me with the following problem:
I defined the window Form_1, Grid_1 in Form_1, Toolbar_1 in Grid_1, and the buttons in the toolbar: Button_1, Button_2,...Button_n.
By clicking one of the buttons the procedure with a FOR-NEXT loop starts. I would like that the user can stop executing the loop by clicking one of the keys on the keyboard (for example ESC), and that the program using MsgYesNo() function asks the user if he wants to stop or to continue executing the loop.
I tried the INKEY() function, then the GetAsincKeyState() and the GetKeyState() but with no result.
Can anyone give me a piece of advice how to solve this problem?
Da li neko može da mi pomogne u sledećem problemu:
Definisao sam prozor Form_1, u njemu Grid_1, u gridu Toolbar_1, a u toolbaru dugmad Button_1, Button_2,...Button_n.
Klikom na jedno od dugmadi pokreće se procedura u kojoj je jedna FOR-NEXT petlja. Želeo bih da korisnik može, pritiskom na neki taster na tastaturi (npr. ESC), zaustavi izvršavanje petlje, pa da ga program pomoću MsgYesNo() funkcije pita da li želi da prekine izvršavanje ili da nastavi.
Pokušao sam sa funkcijom INKEY(), zatim GetAsincKeyState(), GetKeyState() ali bez uspeha. Da li može neko da me posavetuje kako da rešim problem?
P.S. Ne govorim engleski, ovaj post mi je prevela koleginica iz škole
EN:
Can anyone help me with the following problem:
I defined the window Form_1, Grid_1 in Form_1, Toolbar_1 in Grid_1, and the buttons in the toolbar: Button_1, Button_2,...Button_n.
By clicking one of the buttons the procedure with a FOR-NEXT loop starts. I would like that the user can stop executing the loop by clicking one of the keys on the keyboard (for example ESC), and that the program using MsgYesNo() function asks the user if he wants to stop or to continue executing the loop.
I tried the INKEY() function, then the GetAsincKeyState() and the GetKeyState() but with no result.
Can anyone give me a piece of advice how to solve this problem?