« Risposta #2 il: 21 Aprile 2014, 00:18:21 »
...continua...
"
Attached. But be warned (again?): the interpreter is actually not my
business. Virtually, I don't even know what I've done to the code as an
entire with my patch but it worked in the single test case I had.
I tested code like this to have VariantArray implement Extract() and it
succeeded:Public Sub Extract(Start As Integer, Optional Length As Integer = 1) As VariantArray
Dim hNew As New VariantArray
Dim vElt As Variant
For Each vElt in Super.Extract(Start, Length)
hNew.Add(vElt)
Next
Raise ExtractEvent
Return hNew
End
Note that VariantArray.Extract(), just like Variant[].Extract(), returns
a new object which has, by default, no event name. So don't be surprised
if the returned object doesn't fire any events. You have to manually assign
it to an event observer using Object.Attach(). Another reason against giving
events to data containers ;-)
>
> Thank you very much for your efforts coding on the interpreter.
Well, that's pretty much the only thing I can do when Benoit is not around
to answer those core questions (which is seldom the case anyway).
Regards,
Tobi"
I fixed your patch, as it didn't work when using the "Object" datatype.
You get it in revision #6249.
Regards,
--
Benoît Minisini "
« Ultima modifica: 25 Aprile 2014, 00:51:57 da vuott »
Registrato
« Chiunque, non ricorrendo lo stato di necessità, nel proprio progetto Gambas fa uso delle istruzioni Shell o Exec, è punito con la sanzione pecuniaria da euro 20,00 a euro 60,00. »