Is this possible?
I have a line
Public temp_new_CmbTitle As String
and what i`d like is something like
Public temp_new_CmbTitle As String = "0"
is this possible?
a.
Printable View
Is this possible?
I have a line
Public temp_new_CmbTitle As String
and what i`d like is something like
Public temp_new_CmbTitle As String = "0"
is this possible?
a.
In a word NO!
This was one of my gripes when I first started with VB
The best you can do is:
Public temp_new_CmbTitle As String: temp_new_CmbTitle = "0"
Const temp_new_CmbTitle As String ="0"
I almost know that this isn't what you are looking for. Because you cant change any constants. But this is that one line thing you were asking for....
Er, yeah, a const is no good in this case. (Cos i need to have a default value, as i`m comparing against data from a db, and i get an error if i compare a zero with a null).
I`m glad its not just me it annoyed. I cant think of a reason that this was done as a design decision. Maybe to force you to use consts instead of vars? But i cant have them as consts, can I ?!
While i`m moaning, does anyone else (reading this thread, not worth starting a new one) get this bug where one of the forms (in the project explorer window) gets highlighted when you select it, and for the rest of your session it remains highlighted - you can still select other forms to edit with right-mouse/view code, but the highlight moves back to the originally highlighted form?
Thanks anyway!
Alex.