Go Back  Xtreme Visual Basic Talk > Legacy Visual Basic (VB 4/5/6) > General > String variables


Reply
 
Thread Tools Display Modes
  #1  
Old 04-09-2002, 06:27 AM
subbulakshmi
Guest
 
Posts: n/a
Default String variables


i have one string variable.

dim qry as string

and
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?
Reply With Quote
  #2  
Old 04-09-2002, 06:31 AM
JDavis JDavis is offline
Junior Contributor
 
Join Date: Jun 2001
Location: Knoxville, Tennessee, USA
Posts: 239
Default

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...

JDavis
Reply With Quote
  #3  
Old 04-09-2002, 06:39 AM
gallicus gallicus is offline
Junior Contributor
 
Join Date: Dec 2001
Location: at work... probably :-(
Posts: 366
Default

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.
__________________
(A)bort, (R)etry, (G)et a beer?
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
 
 
-->