Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

variable intialisation

Status
Not open for further replies.

AQWQ

Programmer
Aug 5, 2001
33
IN
U people may find my question a bit funny..but i have a doubt in variable declaration in VB.what does this mean
Dim hello$ as string.
My question is that what difference does the declaration have if the variable name ends with a $ symbol?does it have any added advantage?? please help me out.

Thanx in Advance Santhosh Ravindran
 
The $ is not necessary in the declaration. The "As String" does the job. However, use MID$, Left$, Trim$ etc with strings so a string is returned instead of variant with a sting inside.
 
Yeah, you probably have an example where someone was duplicating stuff.
You can declare a variable
Dim strName$
and that is the same as saying
Dim strName as string
Currency datatype is the @ symbol
Dim curtotal@
Integer datatype is the % symbol
Dim intNum%
VB Help lists them all
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top