[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: Jorge Carrión <shordi@xxxxxxxxx>
- Date: Sat, 17 May 2025 06:50:32 +0200
- To: user@xxxxxxxxxxxxxxxxxxxxxx
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. > > >
Re: New control structure "Do Next..." | Fabien Bodard <gambas.fr@xxxxxxxxx> |
New control structure "Do Next..." | Benoît Minisini <benoit.minisini@xxxxxxxxxxxxxxxx> |