if x contains "Finder" then
else if x contains "Mail" then
else if x contains ...
NEVER DO THIS.
At the very least, go to a function that handles Mail, such as HandleMailApp, or what to do in the Finder such as HandleFinderApp
Declare a variable for your monitor size and use a lookup table of monitor sizes to determine what to do based on the result.
You've got a 500 line main handler.
Start declaring some properties and start referencing them.
Never call a variable x. If x is your application's name, then call it myApp.
We now have the option of using descriptive variable names. Calling variables, i, j, or x is meaningless. Call the variable what it represents. I use the short, but effective prefix of "my" to indicate that it is a local.
For the love of puppies, please preface your globals with a g. This tells you instantly that it is a global. You don't have to think about it, you just know.
Like so: gMonitorSize pMonitorSize myMonitorSize
You only will become a better programmer when you learn to break these habits.
On Jan 10, 2011, at 12:01 PM, Robert Poland wrote: <setBounds.zip>
|