473,405 Members | 2,282 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

"&" and "+" Q:

Can anyone tell me what the difference between using one or the other of
these.?
From what I have read they are the same thing, and both seem to do the same
job.

ie: CurDir + "\myfile.exe" or CurDir & "\myfile.exe"

I have noticed however when copying code from the API guide especially,
using "+" when modifying the code sometimes ends up with error until you
change to "&"

Anyone know what the standard is to use, and what the difference is if any?
Jul 17 '05 #1
5 1623

"Option^Explicit @shaw.ca>" <fu-q<remspam> wrote in message
news:ySr7c.120895$Up2.45480@pd7tw1no...
Can anyone tell me what the difference between using one or the other of
these.?
From what I have read they are the same thing, and both seem to do the same job.

ie: CurDir + "\myfile.exe" or CurDir & "\myfile.exe"

I have noticed however when copying code from the API guide especially,
using "+" when modifying the code sometimes ends up with error until you
change to "&"

Anyone know what the standard is to use, and what the difference is if any?


They're both concatenation symbol. The "+" was maintained for backwards
compatibility with QuickBasic. To avoid confusion with math operation the
ampersand "&" is prefered.
Jul 17 '05 #2
Thanks for that Raoul.
"Raoul Watson" <Wa*****@IntelligenCIA.com> wrote in message
news:Og****************@nwrdny03.gnilink.net...

"Option^Explicit @shaw.ca>" <fu-q<remspam> wrote in message
news:ySr7c.120895$Up2.45480@pd7tw1no...
Can anyone tell me what the difference between using one or the other of
these.?
From what I have read they are the same thing, and both seem to do the

same
job.

ie: CurDir + "\myfile.exe" or CurDir & "\myfile.exe"

I have noticed however when copying code from the API guide especially,
using "+" when modifying the code sometimes ends up with error until you
change to "&"

Anyone know what the standard is to use, and what the difference is if

any?


They're both concatenation symbol. The "+" was maintained for backwards
compatibility with QuickBasic. To avoid confusion with math operation the
ampersand "&" is prefered.

Jul 17 '05 #3
On Mon, 22 Mar 2004 02:06:22 GMT, "Option^Explicit"
<fu-q<remspam>@shaw.ca> wrote:
Can anyone tell me what the difference between using one or the other of
these.?
From what I have read they are the same thing, and both seem to do the same
job.

ie: CurDir + "\myfile.exe" or CurDir & "\myfile.exe"

I have noticed however when copying code from the API guide especially,
using "+" when modifying the code sometimes ends up with error until you
change to "&"


'&' is an 'addition' to BASIC, generously provided by Microsoft in (I
think) VB4

It adds together strings .. and most simple variables
ie: it sneakily turns numbers into strings

A$ = "SomeText" & 666

'+' is the original method of concatenating Strings, and will throw an
error if you try to 'add' numbers to Strings
- which helps cut down on errors

'&' is the 'trendy' way of doing things
'+' is the normal way in languages that support string concatenation
using an operator

Jul 17 '05 #4

"Option^Explicit @shaw.ca>" <fu-q<remspam> wrote
Can anyone tell me what the difference between using one or the other of
these.?
From what I have read they are the same thing, and both seem to do the same
job.

ie: CurDir + "\myfile.exe" or CurDir & "\myfile.exe"

I have noticed however when copying code from the API guide especially,
using "+" when modifying the code sometimes ends up with error until you
change to "&"

Anyone know what the standard is to use, and what the difference is if any?

Try these, then decide which you'd prefer to use:

Debug.Print "2" + 2
Debug.Print "2" & 2

LFS


-----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
-----== Over 100,000 Newsgroups - 19 Different Servers! =-----
Jul 17 '05 #5
Now it all makes sense. and explains the errors as well.
good answers :)

"J French" <er*****@nowhere.com> wrote in message
news:40****************@news.btclick.com...
On Mon, 22 Mar 2004 02:06:22 GMT, "Option^Explicit"
<fu-q<remspam>@shaw.ca> wrote:
Can anyone tell me what the difference between using one or the other of
these.?
From what I have read they are the same thing, and both seem to do the samejob.

ie: CurDir + "\myfile.exe" or CurDir & "\myfile.exe"

I have noticed however when copying code from the API guide especially,
using "+" when modifying the code sometimes ends up with error until you
change to "&"


'&' is an 'addition' to BASIC, generously provided by Microsoft in (I
think) VB4

It adds together strings .. and most simple variables
ie: it sneakily turns numbers into strings

A$ = "SomeText" & 666

'+' is the original method of concatenating Strings, and will throw an
error if you try to 'add' numbers to Strings
- which helps cut down on errors

'&' is the 'trendy' way of doing things
'+' is the normal way in languages that support string concatenation
using an operator

Jul 17 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: DrTebi | last post by:
Hello, I have the following problem: I used to "encode" my email address within links, in order to avoid (most) email spiders. So I had a link like this: <a...
2
by: DC Gringo | last post by:
I have an image control (that pulls an image off an ESRI map server): <ASP:IMAGE ID="imgZonedCountry" RUNAT="server"></ASP:IMAGE> In the code behind I am setting the ImageURL to a String value...
2
by: Eric Osman | last post by:
Hi, I'm looking for a javascript function that will convert input such as this: <CLUB Code=" into this: &lt;CLUB Code=&quot;
4
by: barney | last post by:
Hello, I' m using .NET System.Xml.XmlDOcument. When I do the following: XmlDocument xml = new XmlDocument(); xml.Load("blah"); .... xml.Save("blub"); I've got the problem that the following...
1
by: st | last post by:
Hi, I'm using xmlDocument.Save(xmlTextWriter) to create an Excel-readable file. All works well, except where I've replaced the carriage return chars in the .innertext to XML-compliant " "; It...
5
by: martin | last post by:
Hi, I would be extremly grateful for some help on producing an xml fragemt. The fragment that I wish to produce should look like this <Addresses> <Address>&qout;Somebody's Name&quot;...
7
by: DC Gringo | last post by:
I am having a bear of a time with setting a URL query string as a text value in a dropdownlist and Server.URLEncode does not seem to do its job. theFullLink = theLinkPrefix &...
14
by: Arne | last post by:
A lot of Firefox users I know, says they have problems with validation where the ampersand sign has to be written as &amp; to be valid. I don't have Firefox my self and don't wont to install it only...
13
by: Ragnar | last post by:
Hi, 2 issues left with my tidy-work: 1) Tidy transforms a "&amp;" in the source-xml into a "&" in the tidied version. My XML-Importer cannot handle it 2) in a long <title>-string a wrap is...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.