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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Sorry! Simple question!! 1

Status
Not open for further replies.

chris921

Technical User
Mar 9, 2004
82
GB
Can someone explain the use of $ in VB6 to me? I've pretty much been thrown in the deep end in with a company (Java Background for me) so just a brief explanation of its use and functions if possible?

I've tried googling it but it doesn't like the use of $ sign.

Thanks!!
 
Take an example of Left and Left$:
Dollar sign functions return a value of type String. The
non-dollar sign functions return a Variant Data Type.
Dollar sign functions run faster than non dollar sign functions, so in general, it's a good choice to use them.
Do you need the non-dollar sign function?
Yes---if there's a possibility that the function will encounter a Null character in its argument string, you
need to use the non-dollar sign version--otherwise the function will bomb.
For instance, in this code:
Left(string1, 1)
Left$(string1, 1)
both will return the left-most character of the string. However, if string1 contains a Null
character, Left$ will bomb---however, Left will work fine.

Sharing the best from my side...

--Prashant--
 
My Pleasure. [smile]


Sharing the best from my side...

--Prashant--
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top