[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: New control structure "Do Next..."
[Thread Prev] | [Thread Next]
- Subject: Re: New control structure "Do Next..."
- From: Fabien Bodard <gambas.fr@xxxxxxxxx>
- Date: Sat, 17 May 2025 10:29:48 +0200
- To: Gambas Mailing List <user@xxxxxxxxxxxxxxxxxxxxxx>
Hem... I understand the idea as the procedure is like stored in a trigger array for post activation. So the loop continue until the end and then the procedure is called. But I don't understand the need. The triggering can be called after depend on a boolean flag for exemple. Can you show us something more on situation? Le sam. 17 mai 2025 à 06:50, Jorge Carrión <shordi@xxxxxxxxx> a écrit : > My old brain can't imagine where something like this would be useful. When > I can see an example, I'll try to contribute something... if I can think of > one. > > Best Regards > > El sáb, 17 may 2025 a las 1:33, Benoît Minisini (< > benoit.minisini@xxxxxxxxxxxxxxxx>) escribió: > >> Hi, >> >> I have just added a new control structure to the Gambas language: >> >> Do Next <statement> >> >> It executes the statement "later", i.e. at the next run of the event loop. >> >> To do the same thing, you had to use a Timer before. Something like that: >> >> hTimer = New Timer As "RunLater" >> hTimer.Trigger >> >> ... >> >> Public Sub RunLater_Timer() >> >> <statement> >> >> End >> >> I'm not yet fully satisfied with that syntax, even if it does not >> introduce new keywords, which is always a positive thing. >> >> But I may do something else: >> >> Do <statement> Next >> >> Do <statement> Later >> >> Or more powerful: >> >> Do >> <statement 1> >> <statement 2> >> ... >> Next >> >> Internally, the <statement> is directly compiled inside the function, >> and is run in a special context where there is no local variable. >> >> You can't use the local variables of the function inside <statement> at >> the moment. >> >> This is not a lambda expression, for those who know what it is. >> >> And I think you can still do something like 'Do Next Goto ...' which >> must be forbidden too. So a work in progress... >> >> Do not hesitate to tell what you think and give ideas. >> >> Regards, >> >> -- >> Benoît Minisini. >> >> >> Fabien Bodard
Re: New control structure "Do Next..." | Benoît Minisini <benoit.minisini@xxxxxxxxxxxxxxxx> |
New control structure "Do Next..." | Benoît Minisini <benoit.minisini@xxxxxxxxxxxxxxxx> |
Re: New control structure "Do Next..." | Jorge Carrión <shordi@xxxxxxxxx> |