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-k...@freenet.de> 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@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/gambas-user
>
------------------------------------------------------------------------------
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@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user

Reply via email to