Selecting Proper Variables

  • Thread starter Thread starter Guest
  • Start date Start date
Well that's nice.

I know it wasn't that way in prior version of vb, and for that reason Hard
Core VB mentioned using one globally defined empty instance.

Thanks,

Shane
 
That's why there will be a 'TryParse' method for the 'Int32' datatype in
.NET 2.0.

In addition, TryParse has the correct semantics, as opposed to the VB
Is??? functions. TryParse (at least last time I saw it) doesn't just
test, it also performs the conversion, so we can avoid code that looks
like...

If ParseThisOnceJustToTest(myvar) Then
anotherVar = ParseThisAgainJustToWasteTime(myvar)
End If
 
Shane,
Correct VB6 & prior did not intern string literals.

I should add, that the string interning is true for all string literals.

There is only one instance of the "aaa" string in the following:

Dim s1 As String = "aaa"
Dim s2 As String = "aaa"

Hence the "New String("a"c, 3)" in my example, I was creating a string with
3 a's that was not a literal.

Hope this helps
Jay


SStory said:
Well that's nice.

I know it wasn't that way in prior version of vb, and for that reason Hard
Core VB mentioned using one globally defined empty instance.

Thanks,

Shane
<<snip>>
 

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