String variables

04-09-2002, 06:27 AM
i have one string variable.

dim qry as string

im saying

qry = "Welcome to VB Programming"

if i say

print qry
print qry$

i'm getting the same result. then we are appending the $ symbol with string variables?

Also what is the difference between mid function and mid$ function?

04-09-2002, 06:31 AM
In the older versions of basic $ stands for a string
# stands for a double ! stands for single

you could use these instead of dimming a variable as string or as double...


04-09-2002, 06:39 AM
in reply to your second question,

the Mid function treats the expression as a Variant. The Mid$ function treats the expression as a string. If you are definitely dealing with a string use the $ version as this is not only faster (more efficient) but also using Mid on a string in conjuction with other code can cause unexpected results(because the string is treated as a variant not a string). This applies to the Trim function and the other string manipulation functions.

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum