Variable initialisation

  • Thread starter Thread starter JohnFol
  • Start date Start date
J

JohnFol

If you look at the following two pieces of code they perform exactly the
same task

Dim sMessage As String
sMessage = "Hello!"

Dim sMessage As String = "Hello!"

Is there any difference "behind the scenes" where one of the following is
preferable to the other, or is this just personal preference?
 
Personnal preference (unlike VB6). You could look at the MSIL code to make
sure...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top