[Gambas-user] Gambas bug?

Emil Lenngren emil.lenngren at ...626...
Fri Feb 10 21:47:11 CET 2012


Did the Object solution not solve your problem? It should work in all cases
when the name of the function/property is the same at all calls/property
readings.

If you use different symbol names each time, maybe you can use something
like this:
Try
 Return Object.GetProperty(object, name)
Catch
 Return Object.Call(object, name)

But you probably should try another code design if you really need this
kind of code ;)

/Emil

2012/2/10 Fabián Flores Vadell <fabianfloresvadell at ...626...>

> 2012/2/10 Emil Lenngren <emil.lenngren at ...626...>
>
> > You probably get the error because Count is a property and not a method.
> >
> > There is a Object.GetProperty method you can use instead ;)
> >
> > Print Object.GetProperty(["John", "Peter"], "Count")
> >
>
> Thanks Emil.
>
> It seems to me like the encapsulation is broken because I need to be
> conscious of the implementation (property or method) in order to pass the
> message that I want.
>
> That could not be a great problem in the daily programming, but to
> programming in a reflexive way it seems to me inflexible.
>
> What you think?
>
>
> > --
> >
> Fabián Flores Vadell
> www.comoprogramarcongambas.blogspot.com
> www.speedbooksargentina.blogspot.com
>
> ------------------------------------------------------------------------------
> 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 at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/gambas-user
>



More information about the User mailing list