Would it be possible to allow underscores in Control Names?
All this time using FF and I never even noticed they weren't. Usually FF ads them in code, so it would most likely have to limit it to not being the 1st or last char. Since FF adds them though Paul may use them internally to parse code or something, so we'll see. Usually I use a type of Title Case and Hungarian Notation like MySubmitBtn, StateCmb, or FirstNameLbl.
Roger,
I use the Title Case as you do... What is the Hungarian notation?
I do like the way you do it. I was prefacing the Control Type and shortening it more. I have turned out some confusing stuff like CBBlue (Command Buttion Blue) and TB. I think I could adopt your style rather easily, BlueBtn looks good. I was thinking underscores would help make it more clear as in - CB_Blue for instance. I think I will switch to your style instead. Underscores might still be useful if they aren't too hard to implement though.
Thanks,
David
Underscores have special meaning to the FireFly code parser so they are disallowed to be embedded into a control or form name.
I use the convention that I have used since VisualBasic days.... prefic the control name with cmd for CommandButton, lbl for Label, lst for ListBoxes, cmb for ComboBoxes, pic for Pictures, txt for TextBoxes, etc....
cmdOK
txtAddress
lblHeader
etc...
Paul,
Well enough... both you and Roger had good tips. I just noticed that FF adds them itself to the names of variables contrived from the name we provide (for example cmdExit becomes HWND_MAIN_cmdExit & IDC_MAINcmdExit). I will accept that you needed to disallow underscores in control and form names. I was just hoping that it was an oversight. :P
Thanks,
David
Quote from: Jim Dunn on May 10, 2010, 08:19:24 AM
Paul, either way is ok with me... but you could use a double-underscore internally... allowing the underscore for us...
"__" for you; "_" for us.
: )
It is too late in the game now to change that functionality. Whenever a message handler is constructed it is done so by building it using the underscore to separate the form name, control name and message name. To change it now would break thousands of lines of code in existing FF applications. :)
Quote from: David Kenny on May 09, 2010, 09:31:25 PM
Roger,
I use the Title Case as you do... What is the Hungarian notation?
The "Hungarian Notation" is the portion in both mine and Paul's that describes the control- txt- text/edit box, cmd- command button, btn- button, cmb- combo, lbl- label. Same thing some use in programming like sName where the s means it is a string, or lQty where the Qty is a Long, etc.
Thanks Roger,
I guess I knew what it was without knowing its name. ::)
David
I've been on Pauls back with this one early(!) on, and would have nagged him to pieces if the train hadn't passed us by already then. I love the extra readability the underscore would give, and use it extensively where I can/could.
(That would be VB before, and ASP now).