Digg this topic Add to my del.icio.us Submit to SlashDot  
Reply to this topicStart new topic
> Suggestion on WB script GUI-element names, Using "understandable" names for GUI-element variables
booty#1
post Sep 23 2007, 09:39 AM
Post #1


Advanced Member
***

Group: .script developer
Posts: 184
Joined: 30-March 07
Member No.: 4,830


Germany


Hi script developer,

in general in all programming languages it is known to be a good coding style using variable names that describe by their name what they are for (e.g. "%ExecuteTime%" instead of "%tx1%"). As WB does not limit variable names this is no problem - just with one exception:

The interface elements. They are usually called "pCheckBox1", "pTextLabel1", "pButton1" and so on.
This makes it sometimes really hard to associate script-functionality to a GUI-element. It would be much easier if a checkbox would be called "pCheckBox_AddStartmenuEntry" or "pTextBox_SourcePath".

First I thought that those names are not supported by WinBuilder but I was wrong - they work!
(@Nuno: Does those names work intentionally or by "accident"? If this works by accident I suggest to promote this functionality to an official WB feature.)

Therefore I strongly recommend using this functionality as it makes scripts easier readable and of course it is a good prevention against mixing-up interface element variables.

booty#1
Go to the top of the page
 
+Quote Post
psc
post Sep 23 2007, 10:10 AM
Post #2


Guru
***

Group: .script developer
Posts: 2,987
Joined: 14-July 06
From: Korschenbroich, Germany
Member No.: 3


Germany


QUOTE(booty#1 @ Sep 23 2007, 11:39 AM) *
Hi script developer,

in general in all programming languages it is known to be a good coding style using variable names that describe by their name what they are for (e.g. "%ExecuteTime%" instead of "%tx1%"). As WB does not limit variable names this is no problem - just with one exception:

The interface elements. They are usually called "pCheckBox1", "pTextLabel1", "pButton1" and so on.
This makes it sometimes really hard to associate script-functionality to a GUI-element. It would be much easier if a checkbox would be called "pCheckBox_AddStartmenuEntry" or "pTextBox_SourcePath".

First I thought that those names are not supported by WinBuilder but I was wrong - they work!
(@Nuno: Does those names work intentionally or by "accident"? If this works by accident I suggest to promote this functionality to an official WB feature.)

Therefore I strongly recommend using this functionality as it makes scripts easier readable and of course it is a good prevention against mixing-up interface element variables.

booty#1

If you have a static GUI, it is no problem to rename the names.
As far as I know MedEvil uses this practice since a long time.

But I hade sometimes troubles when adding an element to the GUI.
Maybe depending on alphabetical order existing elements were deleted.

Therefore I decided currently to use the system generated (rather 'cryptic') names.

Peter
Go to the top of the page
 
+Quote Post
Nuno Brito
post Sep 23 2007, 11:01 AM
Post #3


Advanced Member
***

Group: .script developer
Posts: 4,156
Joined: 13-July 06
From: Azores
Member No.: 1


Portugal


Yes, there are no limitations anywhere but there is still a lot to be improved. (IMG:../forums/style_emoticons/default/cheers.gif)
Go to the top of the page
 
+Quote Post
« Next Oldest · Support and Bug reporting · Next Newest »
 

Fast ReplyReply to this topicStart new topic
2 User(s) are reading this topic (2 Guests and 0 Anonymous Users)
0 Members:

Collapse

> Similar Topics

  Topic Replies Topic Starter Views Last Action
No new Topic has attachmentsScript for Altiris SVS
22 Trax 677 6th October 2007 - 08:23 AM
Last post by: TheHive
No New Posts wb script extension and screensavers
Confict btwn winbuild .scr extension and ScrSaver files
6 thunn 188 30th September 2007 - 04:35 AM
Last post by: thunn
No New Posts wbxpe desktop shortcut? and change ramdisk?
how to change shortcusts and ramdisk
2 carfan 215 16th September 2007 - 01:37 PM
Last post by: carfan
No new Script Levels
project depending ?!
20 psc 702 4th September 2007 - 11:38 AM
Last post by: MedEvil
No new Topic has attachmentsWBXPE
44 h7se 2,481 4th September 2007 - 12:07 AM
Last post by: MedEvil


 

Display Mode: Standard · Switch to: Linear+ · Switch to: Outline

Track this topic · Email this topic · Print this topic · Subscribe to this forum

- Lo-Fi Version Time is now: 12th October 2007 - 02:49 PM

MKPortal ©2003-2006 mkportal.it