[Gambas-user] Raises the event

Jussi Lahtinen jussi.lahtinen at ...626...
Fri Jul 13 17:48:41 CEST 2012


I don't think Gambas supports static events.
So you need to remove static from declaration, or use sub instead.
Why you need myTest() sub to be static?

Jussi



On 13 July 2012 09:23, Ivan Kern <ivan-kern at ...308...> wrote:

> Hi to all,
>
> I have made my own gambas component  in gambas2 under ubuntu 10.04.
>
> It works well till I want raise an event. I always get  an error  message
>
> "Cannot raise event in static function."
>
>
>
> The code is like this:
>
>
>
> 'Gambas class file
>
>
>
> EXPORT
>
>
>
> STATIC PUBLIC $A AS INTEGER
>
> STATIC PUBLIC $B AS INTEGER
>
>
>
> EVENT TEST(Value as Boolean)
>
>
>
>
>
> STATIC PUBLIC SUB Main()
>
>
>
> END
>
>
>
> STATIC PUBLIC SUB myTest()
>
>   DIM iResult AS INTEGER
>
>
>
>   iResult = $A*$B
>
>   IF iResult = 2 THEN
>
>     RAISE TEST(TRUE)
>
>   ELSE
>
>     RAISE TEST(FALSE)
>
>   ENDIF
>
> END
>
>
>
> How can I manage it?
>
> Regards,
>
> Ivan.
>
>
>
>
> ------------------------------------------------------------------------------
> Live Security Virtual Conference
> Exclusive live event will cover all the ways today's security and
> threat landscape has changed and how IT managers can respond. Discussions
> will include endpoint security, mobile security and the latest in malware
> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
> _______________________________________________
> 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