Re: plz tell me error in my code
Code:
Private Sub button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles button1.Click
Dim STRUSER$
Dim STRPASS$
STRUSER = "ADMIN"
STRPASS = "SUPER"
Hello all, I am taking VB.NET this semester and I was reading this code. I understand everytrhing except the first two variables. I uderstand they are a user and password what I dont understand is the following:
Why are they capitalized, why is there a $ at the end, and why are they not declared as anything. Sorry for the newb question but we have not come accross this yet.
can someone please fill me in thanks,
Rick
Re: plz tell me error in my code
The $ comes from old basic, (1980's basic) and is used for declaring the variable type as string... so is the same as
Code:
Dim STRUSER As String
The capitals is used as personal preferance and has no effect on the declarations..
Gremmy...
Re: plz tell me error in my code
These were supported in VB6, so I suppose .Net uses them.
Quote:
Program Constants
$ = String
% = Integer
& = Long
! = Single
# = Double
@ = Currency
No Boolean, Byte, Char, Date, Object, or Short!
Re: plz tell me error in my code