On Wed, 19 Nov 2014, Rolf-Werner Eilert wrote: > > This is a standard task and therefore a "template solution" evolved in the > > Gambas sources. Attached is a project which shows how to do it cleanly, no > > public variables and no auxiliary classes needed. > > > > If you have a problem with the project and comments being German, I will > > translate it for you... > > > > Regards, > > Tobi > > > > > > > Thanks for that example. Never realised there would be this way to do > it. It does indeed save a lot of trouble with values from dialogs. On > the other hand, it means changing the form calls I'm used to from a > simple "formxyz.ShowModal" to "DIM hForm As New formxyz" "aCollection = > hForm(...)". > > Let me ask two things I stumbled over when studying the code: > > Where would I find this "call" thing in the documentation? F2 doesn't > react to event calls, and I cannot find it under the event descriptions > (like Event Management etc.). >
_call is a special method that allows you to use an object like a function. It is documented in the "Special methods" section[0]. However, it is not mandatory here. In Gambas sources you mostly see a function named Run() instead. I just like the _call() syntax better. > Why is a SUB used with a Return value? Wouldn't it be more up to > standards to use a FUNCTION instead? (As far as I understand, a SUB is a > function without a return value, one that would be of type "void" under C.) > Definitely! Usually I do that, but sometimes signatures change when I develop the code further. I must have overseen that spot. Anyway, in Gambas Sub, Procedure and Function are mutually interchangeable. Regards, Tobi [0] http://gambaswiki.org/wiki/cat/special -- "There's an old saying: Don't change anything... ever!" -- Mr. Monk ------------------------------------------------------------------------------ Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server from Actuate! Instantly Supercharge Your Business Reports and Dashboards with Interactivity, Sharing, Native Excel Exports, App Integration & more Get technology previously reserved for billion-dollar corporations, FREE http://pubads.g.doubleclick.net/gampad/clk?id=157005751&iu=/4140/ostg.clktrk _______________________________________________ Gambas-user mailing list Gambas-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gambas-user