Talk:SDBUIRadioButton

From MediaMonkey Wiki
Revision as of 19:51, 5 May 2008 by Steegy (talk | contribs) (Example could be improved)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

In the code example, wouldn't it be better to use

Dim Rad1Opt1 : Set Rad1Opt1 = SDB.UI.NewRadioButton(Pnl)

' bla bla bla

If Rad1Opt1.Checked Then Station1 = 1

instead of

Dim Rad : Set Rad = SDB.UI.NewRadioButton(Pnl)

' bla bla bla

If Frm.Common.ChildControl("RadioStation1").Common.ChildControl("R01").Checked Then Station1 = 1

In the example you can re-use the variable name Rad, but that isn't a real advantage. Readability, speed, ... is less good. Of course on such a scale that doesn't matter, but I think that a source like the scripting wiki (where novice to advanced scripters rely on) should give the best code as possible. -- Steegy 15:51, 5 May 2008 (EDT)