[Gambas-user] Better use of prefixes

Cedron Dawg cedron at exede.net
Sat Mar 16 19:07:18 CET 2019


Variables that are object references, should be suffixed as such.

For instance,

    Dim theNewTB as TextBox
    
    Dim theRoughDraftDA as DrawingArea
    
Or you can optionally go full out if there is only one

    Sub FillWithYoMommasName( argTextBox as TextBox )
    
    Sub FillWithYoMommasName( argTB as TextBox )
    
For local variables without a prefix, I use upper case for objects, lower case for variables.

I've been doing this a lot lately:

        Dim theResult As String
        Dim O As Stream
        
        O = Open String For Write
        
        Print #O, ....
        Print #O, ....
        Print #O, ....
        
        theResult = Close #O
        



More information about the User mailing list