On vr, 2012-01-06 at 07:33 -0800, Dmitrij Malkov wrote: > I wondered that the code > ------------------------------------------- > Public Sub Main() > CUnit.HowManyUnits() > End > ------------------------------------------- > works, but the code > ------------------------------------------- > Public Sub Main() > CUnit.HowManyUnits() > Dim Unit1 As New CUnit > End > ------------------------------------------- > does not ("Dim is unexpected"). I awaited a message like "CUnit is not an > object" in a worst time. You answered, that gambas syntax doesn't allow it. > But in the documentation the next only is written: "All DIM declarations > must be in the FUNCTION or SUB before the first executable command." I don't > see that I have breaked this.
Well you have broken that. Afther Public Sub or Function Dim comes first. In your code Dim comes second Try: Public Sub Main() Dim Unit1 As New CUnit CUnit.HowManyUnits() End Willy ------------------------------------------------------------------------------ Ridiculously easy VDI. With Citrix VDI-in-a-Box, you don't need a complex infrastructure or vast IT resources to deliver seamless, secure access to virtual desktops. With this all-in-one solution, easily deploy virtual desktops for less than the cost of PCs and save 60% on VDI infrastructure costs. Try it free! http://p.sf.net/sfu/Citrix-VDIinabox _______________________________________________ Gambas-user mailing list Gambas-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gambas-user