Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP 3 Classic ASP Active Server Pages 3.0 > Classic ASP Databases
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Classic ASP Databases Discuss using ASP 3 to work with data in databases, including ASP Database Setup issues from the old P2P forum on this specific subtopic. See also the book forum Beginning ASP.NET Databases for questions specific to that book. NOT for ASP.NET 1.0, 1.1, or 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Databases section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old October 27th, 2004, 03:02 PM
Friend of Wrox
 
Join Date: Jul 2004
Location: , , .
Posts: 119
Thanks: 0
Thanked 0 Times in 0 Posts
Default Basic difference between + and & in strings

var Msg=("Do you want to delete the rate: " & dt1 + "-" & dt2 +" = " & rate1.toString());
var Msg=("Do you want to delete the rate: " + dt1 + "-" + dt2 +" = " + rate1.toString());
Can any one tell me the differenc between. I thought there is no difference between + and &. When I type the first code, it doesnot work and when I type second code. It works can anyone let me know what is difference.

Reply With Quote
  #2 (permalink)  
Old October 27th, 2004, 08:05 PM
Registered User
 
Join Date: Dec 2003
Location: , , .
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default

There is difference between + and & in vbscript and jscript.

In vbscript:

Operator + sums two numbers.
For example:
result = expression1 + expression2
But if both expressions are strings then concatenate.

Operator & forces string concatenation of two expressions.

In jscript:

Operator + adds the value of one numeric expression to another or concatenates two strings.

Operator & performs a bitwise AND on two expressions.

Thus,your first code is wrong.The & operator in the code performs a bitwise AND.

Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
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
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Difference between VB.Net and Visual Basic 2005 dotnetDeveloper Visual Basic 2005 Basics 1 June 27th, 2008 07:51 AM
difference b/w Postbacktrigger & Asycpostbacktirgg muralidharan.d ASP.NET 2.0 Basics 1 July 2nd, 2007 08:19 AM
Difference b/w Active X & Data Object bhasker_braj121 ADO.NET 0 June 19th, 2007 04:09 AM
Difference b/w $_GET & $_HTTP_GET_VARS ashuphp Beginning PHP 1 April 14th, 2007 08:50 AM
Difference between CTS & CLS sumsin General .NET 1 March 18th, 2005 08:46 AM



All times are GMT -4. The time now is 02:14 AM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.