Le 25/02/2012 19:18, nando a écrit : > Benoit, > > I came across the need to call many different common small pieces of code > multiple times. > Naturally, we tend to make a SUB just for all of them. > > I wondered if you'd consider resurrecting GOSUB {label} > which is in the same sub. > > It would be in the same scope, no parameters allowed and > acts just like a leaf subroutine with only return on the stack > and no formal stack frame. It's also part compromise to embedded SUBs > > Would overal execution run faster ? > > ?? > -Fernando >
It may be a little bit faster. You can check that by simulate the GOSUB with some GOTOs and compare the speed with a similar function call. Anyway, there is a syntax problem. In Basic, GOSUB is ended by a RETURN instruction, but RETURN is already used to exit the all function. Or maybe RETURN will return from the function only if there is no pending GOSUB. Can you test if there is any speed gain I as said above? I don't have the time to do that now. If the speed gain is worth it, then I may implement GOSUB! Regards, -- Benoît Minisini ------------------------------------------------------------------------------ Virtualization & Cloud Management Using Capacity Planning Cloud computing makes use of virtualization - but cloud computing also focuses on allowing computing to be delivered as a service. http://www.accelacomm.com/jaw/sfnl/114/51521223/ _______________________________________________ Gambas-user mailing list Gambas-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gambas-user