The varient datatype equivlent in VB.NET is Object.
Here's a sample:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim MyVar as Object
MyVar = "Hello"
MyVar = 10 + 10
MyVar += 50
MyVar = New FileStream("c:\test.txt", FileMode.Open)
MyVar = Nothing
End Sub
You can set basically anything to it :-). I don't reccomend using this type often, it takes lots of memory.
Also, you may want to set your variable equal to nothing when your finished with it, just in case the GC dosen't get to it fast enough.
Tekmaven
Software Architect
1,274 posts since Feb 2002
Reputation Points: 322
Solved Threads: 28
:-D Glad I can help! The .NET framework is so amazing. You can do things so many ways, its a joke :-).
What's the best part? Your VB apps run just as fast as c# or c++ apps :-).
(I'm in a smiley mood)
Tekmaven
Software Architect
1,274 posts since Feb 2002
Reputation Points: 322
Solved Threads: 28
Well almost as fast. Even though it's the .NET architecture C# and C++ (even more) will always have less overhead than VB.
samaru
a.k.a inscissor
1,256 posts since Feb 2002
Reputation Points: 262
Solved Threads: 18
Nope. C++ and C# apps compile to MSIL just like VB.net apps. MSIL is MSIL, and it executes at the same exact speed.
The only overhead? The .NET Framework itself.
*MSIL = Microsoft Intermediate Language
Tekmaven
Software Architect
1,274 posts since Feb 2002
Reputation Points: 322
Solved Threads: 28
Whether it's MSIL or anything else, there's still overhead, even in .NET. Otherwise, why would anyone use C++ or C# over VB? Any development tool that has premade objects, especially drag and drop ones like in VB.NET or VisualFoxPro create more overhead because you're giving up performance over simplicity.
Do you have any proof that it's the same speed? The reason I say this is because the same issue goes with anything else. You're adding another layer of complexity. JSPs are compiled to Java code but have to be converted to servlets first. Servlets are compiled directly to Java byte code but it's more time consuming to develop as compared to JSPs (even though they both run on the JRE). The same comparison goes with C++, C# vs VB.NET.
samaru
a.k.a inscissor
1,256 posts since Feb 2002
Reputation Points: 262
Solved Threads: 18
This is the exact point that Dr. Liang brought up in Programming Languages class yesterday. The higher the level of abstraction the more overhead there is. That's why OOP languages weren't developed sooner ... older hardware wouldn't have been able to handle dealing with the layer of abstraction they provide.
cscgal
The Queen of DaniWeb
19,424 posts since Feb 2002
Reputation Points: 1,474
Solved Threads: 230
Ewww Dr. Liang! Was she the one that taught the robotics class with the Lego bots?
Heh, Hofstra's finest.
Tekmaven
Software Architect
1,274 posts since Feb 2002
Reputation Points: 322
Solved Threads: 28
No, Dr. Barr teaches A.I. class ;)
cscgal
The Queen of DaniWeb
19,424 posts since Feb 2002
Reputation Points: 1,474
Solved Threads: 230
VC++.NET compiles to MSIL or standard machine code. You can set it in the project properties. (The /clr switch)
Tekmaven
Software Architect
1,274 posts since Feb 2002
Reputation Points: 322
Solved Threads: 28
Don't embed your password into your app; it's very bad practice. What if the password changes? You'd need to recompile every time..
Tekmaven
Software Architect
1,274 posts since Feb 2002
Reputation Points: 322
Solved Threads: 28