E
Eric van Dijken
Dim Hundred as Integer
Hundred = 100
won't work.
What's wrong??
(I'm a vb6 programmer.)
Eric
Hundred = 100
won't work.
What's wrong??
(I'm a vb6 programmer.)
Eric
Dim Hundred as Integer
Hundred = 100
won't work.
What's wrong??
(I'm a vb6 programmer.)
Dim Hundred as Integer
Hundred = 100
won't work.
What's wrong??
(I'm a vb6 programmer.)
OK, thank you!Rory Becker said:Hello Eric,
It should be fine, but needs to happen within a class / method.
also ... In Vb.Net you can comine them
-------------------------------------------------------------
Dim Hundred as Integer =
100 -------------------------------------------------------------
in later versions you can trun on Option infer and you'll be able to
let the compiler figure out the Integer bit.
It is not like VB6 where the datatype was resolved at runtime.
Eric van Dijken said:OK, thank you!
I put that code at the beginning at formload.
Probably youcan tell how I make a class / method?
I have a lot to learn for VB2010...!
I have a lot to learn for VB2010...!
This what I did:Rory Becker said:Hello Eric,
It should be fine, but needs to happen within a class / method.
This what I did:
Public Class Form1
?
Dim A1, B1, C1, D1, E1, F1, G1, H1 As Integer
Dim A2, B2, C2, D2, E2, F2, G2, H2 As Integer
Dim A3, B3, C3, D3, E3, F3, G3, H3 As Integer
Dim A4, B4, C4, D4, E4, F4, G4, H4 As Integer
Dim A5, B5, C5, D5, E5, F5, G5, H5 As Integer
Dim A6, B6, C6, D6, E6, F6, G6, H6 As Integer
Dim A7, B7, C7, D7, E7, F7, G7, H7 As Integer
Dim A8, B8, C8, D8, E8, F8, G8, H8 As Integer
a1=21
?
End Class
Please tell me what is exactly wrong...
thank you,
Eric
It's been years since I've looked at VB6, but even in that, did you not
have to put this code in a sub or function?
I believe in VB6 that was legal - and was equivalent to the Private keyword.
VB.NET no longer allows that - and has deprecated the use of DIM at the
class/module level.
Eric van Dijken said:OK, thank you!
I put that code at the beginning at formload.
But I'll look for, as you said: it needs to happen within a class /
method.
Probably youcan tell how I make a class / method?
I have a lot to learn for VB2010...!
It is not like VB6 where the datatype was resolved at runtime.
Dim A8, B8, C8, D8, E8, F8, G8, H8 As Integer
a1=21
?
End Class
[...]
I believe in VB6 that was legal - and was equivalent to the Private keyword.
VB.NET no longer allows that - and has deprecated the use of DIM at the
class/module level.
Tom,
Am 10.03.2010 01:00, schrieb Tom Shelton:Dim A8, B8, C8, D8, E8, F8, G8, H8 As Integer
a1=21
?
End Class
[...]
I believe in VB6 that was legal - and was equivalent to the Private keyword.
VB.NET no longer allows that - and has deprecated the use of DIM at the
class/module level.
It's still legal, as is 'Private Dim A8 As Integer'.