Wrox Programmer Forums
| 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 software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
  #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.

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



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





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.