[Gambas-user] File opening dialog and one more question

Dmitrij Malkov dima.malkov.russia at ...626...
Fri Jan 6 18:22:21 CET 2012



Caveat wrote:
> 
> 
>> works correct without any DIM at all? 
> 
> Because HowManyUnits is a static function so you don't need to create
> any instances of CUnit to be able to call that function.
> 
> 

Yes.

All my problem was in my messing up "DIM" and real creation of an object.
Code that satisfying me:

Public Sub Main()
   Dim Unit1, Unit2, Unit3, Unit4 As CUnit 
   
   CUnit.HowManyUnits()
   Unit1 = New CUnit
   Unit2 = New CUnit
   CUnit.HowManyUnits()
   Unit3 = New CUnit
   Unit4 = New CUnit
   CUnit.HowManyUnits()
End

The output is:

There are 0 objects of class 'CUnit'
New Unit was created
New Unit was created
There are 2 objects of class 'CUnit'
New Unit was created
New Unit was created
There are 4 objects of class 'CUnit'

All right, thanks to everybody, I calmed down.
-- 
View this message in context: http://old.nabble.com/File-opening-dialog-and-one-more-question-tp33085420p33094447.html
Sent from the gambas-user mailing list archive at Nabble.com.





More information about the User mailing list