Click here to Skip to main content
15,913,836 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: Other problem with Parameters in Select statement Pin
Dave Kreskowiak26-Jan-09 11:38
mveDave Kreskowiak26-Jan-09 11:38 
AnswerRe: Other problem with Parameters in Select statement Pin
Jon_Boy26-Jan-09 9:07
Jon_Boy26-Jan-09 9:07 
AnswerRe: Other problem with Parameters in Select statement Pin
Wendelius26-Jan-09 18:36
mentorWendelius26-Jan-09 18:36 
QuestionUse of Private Properties Pin
Jay Royall26-Jan-09 4:27
Jay Royall26-Jan-09 4:27 
AnswerRe: Use of Private Properties Pin
Wendelius26-Jan-09 5:23
mentorWendelius26-Jan-09 5:23 
GeneralRe: Use of Private Properties Pin
Jay Royall26-Jan-09 5:40
Jay Royall26-Jan-09 5:40 
GeneralRe: Use of Private Properties Pin
Wendelius26-Jan-09 6:06
mentorWendelius26-Jan-09 6:06 
AnswerRe: Use of Private Properties Pin
Jon_Boy26-Jan-09 7:55
Jon_Boy26-Jan-09 7:55 
Due to a recent hard to find problem with this same scenario, I switched to using properties exclusively for setting variable values (per recommendation of Dave K).

It's a couple more lines of code and very minimal time to just break it out. Even if your code for now doesn't have any extra checks/logic before setting the value and it's module/class scope, you could easily expand the property to add checks in the future. It also helps in determining when a variable gets a value that is not expected.

In VB6, you could create and set a global breakpoint to "break" when the variable is set = to the value your looking for. That type of global break point doesn't exist in VB.Net. If your variable is set using a property, then you can indeed easily do this without breakpointing everywhere the variable is being set.

As you mentioned, you can have mix match of scope within the property itself.

Performance wise, unless your doing something off the wall like a trillion loops with reading/setting values, you are not going to have a performance issue; otherwise, you might want to access the variable directly in these rarer cases (like Mike discussed).

Any suggestions, ideas, or 'constructive criticism' are always welcome.

"There's no such thing as a stupid question, only stupid people." - Mr. Garrison

GeneralRe: Use of Private Properties Pin
Jay Royall26-Jan-09 21:55
Jay Royall26-Jan-09 21:55 
GeneralRe: Use of Private Properties Pin
Dave Kreskowiak27-Jan-09 1:35
mveDave Kreskowiak27-Jan-09 1:35 
GeneralRe: Use of Private Properties Pin
Jon_Boy27-Jan-09 2:23
Jon_Boy27-Jan-09 2:23 
QuestionWebBrowser control Pin
Stephen Lintott26-Jan-09 0:25
Stephen Lintott26-Jan-09 0:25 
AnswerRe: WebBrowser control Pin
Manas Bhardwaj26-Jan-09 1:03
professionalManas Bhardwaj26-Jan-09 1:03 
GeneralRe: WebBrowser control Pin
Stephen Lintott26-Jan-09 1:24
Stephen Lintott26-Jan-09 1:24 
AnswerRe: WebBrowser control Pin
EliottA26-Jan-09 2:59
EliottA26-Jan-09 2:59 
Questionadd an ID from an from an combobox in buttun click event Pin
Qendro25-Jan-09 12:01
Qendro25-Jan-09 12:01 
AnswerRe: add an ID from an from an combobox in buttun click event Pin
Steven J Jowett25-Jan-09 23:16
Steven J Jowett25-Jan-09 23:16 
GeneralRe: add an ID from an from an combobox in buttun click event Pin
Qendro25-Jan-09 23:39
Qendro25-Jan-09 23:39 
GeneralRe: add an ID from an from an combobox in buttun click event Pin
Christian Graus26-Jan-09 0:23
protectorChristian Graus26-Jan-09 0:23 
Question[Message Deleted] Pin
IvanIT25-Jan-09 10:45
IvanIT25-Jan-09 10:45 
AnswerRe: Insert new Line in a Text File Pin
Wendelius25-Jan-09 10:59
mentorWendelius25-Jan-09 10:59 
GeneralRe: Insert new Line in a Text File Pin
IvanIT25-Jan-09 11:06
IvanIT25-Jan-09 11:06 
GeneralRe: Insert new Line in a Text File Pin
Wendelius25-Jan-09 11:20
mentorWendelius25-Jan-09 11:20 
GeneralRe: Insert new Line in a Text File Pin
Jon_Boy26-Jan-09 1:54
Jon_Boy26-Jan-09 1:54 
GeneralRe: Insert new Line in a Text File Pin
IvanIT26-Jan-09 7:40
IvanIT26-Jan-09 7:40 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.