Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Naming convention, the keynote at the
Message
From
13/04/2009 14:48:26
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
 
 
To
13/04/2009 08:08:00
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Miscellaneous
Thread ID:
01394369
Message ID:
01394647
Views:
74
>>[this started as a footnote to message #1394363, but it didn't feel right to pour this on Evelyn just because I happened to be replying to her at the moment. Could be anybody.]
>>
>>"Command1" is a very bad name. I can't imagine a button where .click() contains of "thisform.do1()" - one is not a verb, not an action, so not knowing what your button is doing, other than it needs to show/hide other buttons, I can't conclude anything from its name.
>
>FWIW, if you use the Toolbox to drop controls onto forms and classes, it offers a really easy way to make sure that you rename each control as you go.
>
>In the Toolbox, right-click on a control class and choose Properties. Then, click on the Add button next to the Properties editbox. In the Set Object Property dialog that appears, choose Name from the dropdown and then for the Value, specify "(InputBox())" (without the parens and you can add additional params if you want). That'll prompt you to name the control as you drop it. One thing you might want to do is specify part of the name as the default value, for example, "cmd" for a button. Click OK twice to get out and from then on, when you put that control on a form or class, you'll be prompted. Bit of a PITA to set it up for every class in the first place, but do it once and you're good.

The only reason that I'm not using the toolbox is that it's not coming up on its own. It's a VFP form. When I test the app, CLEAR ALL on launch and exit will kill it, and it doesn't restore. Which is too bad, I mean my not using it, but I simply forget.

As for the naming, I do it manually, or retroactively rename the control - in PEM window and in code, or (if still early enough before code is written), have a builder which will compose names out of class prefixes (including "Yb" for my yellow button class) and controlsources. If no source, then from the caption. After that, any remaining nameless controls are easy to deal with.

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform