Willy Raets wrote:
> 
> 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
> 

So easy? Ok. But why the code

 Public Sub Main()
    CUnit.HowManyUnits()
 End

works correct without any DIM at all? If Benoit will say, that this code
works and that code doesn't because just gambas syntax allows this and
deprecates that and my brain is small to understand these simple things, so,
I will calm down.
-- 
View this message in context: 
http://old.nabble.com/File-opening-dialog-and-one-more-question-tp33085420p33093901.html
Sent from the gambas-user mailing list archive at Nabble.com.


------------------------------------------------------------------------------
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

Reply via email to