Good stuff, Bot Builder.
I agree with you about the importance of privacy; I'm experimenting with starting all of my "private" Field names with an underscore ("public" ones, if any, don't have this). The same goes for any Functions or Methods intended to be private within a Type. Since I think that starting names with underscores is hideously ugly, I'm motivated never to use them outside of Type/End Type blocks and to use Methods to set and retrieve private Field values :).
Also, by putting Consts inside of types, enumerated types can be simulated (at least until actually added) and kept separate. So, with:
I agree with you about the importance of privacy; I'm experimenting with starting all of my "private" Field names with an underscore ("public" ones, if any, don't have this). The same goes for any Functions or Methods intended to be private within a Type. Since I think that starting names with underscores is hideously ugly, I'm motivated never to use them outside of Type/End Type blocks and to use Methods to set and retrieve private Field values :).
Also, by putting Consts inside of types, enumerated types can be simulated (at least until actually added) and kept separate. So, with:
Strict Type TStockMarket Const LOW = 1 Const MEDIUM = 2 Const HIGH = 3 Field _Confidence Method SetConfidence( n ) Assert ( n >= LOW ) And ( n <= HIGH ), "Confidence out of range" _Confidence = n End Method Method GetConfidence() Return _Confidence End Method End Type Type TRadio Const VERYLOW = 1 Const LOW = 2 Const MEDIUM = 3 Const HIGH = 4 Const VERYHIGH = 5 Field _Volume Method SetVolume( n ) Assert ( n >= VERYLOW ) And ( n <= VERYHIGH ), "Volume out of range" _Volume = n End Method Method GetVolume() Return _Volume End Method End Type Local DowJones:TStockMarket = New TStockMarket DowJones.SetConfidence DowJones.HIGH If DowJones.GetConfidence() = DowJones.HIGH Then Print "Buy!" Delay 1000 Local Radio:TRadio = New TRadio Radio.SetVolume Radio.HIGH If Radio.GetVolume() = Radio.HIGH Then Print "That's kind of loud!" Delay 1000 Radio.SetVolume( 0 ) 'out of range errorthere's no confusion between the stock market's HIGH and the radio's HIGH.