Well i was just reading through a VB.NET book and i saw this one syntax that i was unsure how to convert into VB 6.0 Syntax.
This code is placed in General Declarations (VB.NET):
The "= 0" part isn't supported in VB 6.0 so if anyone could help me covert the code into VB 6.0 form it would be niceDim Number1 As Integer = 0.
Thanks in advance.
It's been a little while since I worked with the VB 6 compiler, but I think the problem is that you can't assign a value to a variable outside of a method (function or sub), unless it is a constant.
So how would i go about writing the code in VB 6.0?
If I'm not wrong it would be
In the General Declerations Write:
[HIGHLIGHT="VB"]Dim Number1 As Integer[/HIGHLIGHT]
And in the Form_Load() Write:
[HIGHLIGHT="VB"]Number1=0[/HIGHLIGHT]
Simple![]()
It doesn't matter where you Dimension the variable. You can't assign a value to it. Unless you dimension as follows:
Const VariableName as Integer = 10
If you don't want it to be constant, this is the correct method:
Dim VariableName as Integer
VariableName = 10
You can use either method in the General Declarations, or under sub or function. Hope this helps.
Option Explicit
Umm, when i put:
Dim VariableName As Integer
VariableName = 10
It comes up with an error when i press play.
the error says "Compile Error: Invalid outside procedure"
Ahh! TheComputerMaster thanks very much. I followed your instructions and it worked.
Now i need to find out how to change this code:
Into VB 6.0 syntax from VB.NETDate.Now.AddMinutes(Difference1*60 _
- Difference2*60)
Any help?
I never said I was anything. I feel like I'm repeating myself... I remember in another post I was explaining to you that I wasn't "1337" either. So yeah, you got me this one time. YAY! You're better than me now. Good job!
Option Explicit
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks