Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
Classic ASP Components Discussions specific to components in ASP 3.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Components 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 April 15th, 2006, 12:39 AM
Authorized User
 
Join Date: Sep 2005
Location: , , India.
Posts: 18
Thanks: 0
Thanked 0 Times in 0 Posts
Default initializing variables

Can I do this in asp ?
<% dim strName="xyz" %>
Is is permitted to initiazed variable during declaration in
asp using VB Script ?

I am getting an error message.

One more proble
<dim a,b
a=1+2
b="xx"
response.write(a+b)
%>

I am getting error on the highlighted line

Thanks in advance
vin
  #2 (permalink)  
Old April 16th, 2006, 08:14 AM
Authorized User
 
Join Date: Mar 2006
Location: Chennai, Tamil Nadu, India.
Posts: 32
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to Raghunathan
Default

hi,

In ASP, using VBScript, you will not be able to initialize a variable whilst declaring itself

Dim strName 'Declare the Variable
strName = "xyz" 'Initialize the Variable


In your second problem, variable a contains an Integer and variable b contains a String. you cannot use the + operator to concatenate a string and integer. you have to use the & operator.

+ operator accepts only values of same type on both sides of the operator

Hope this info will help ur needs


Regards,
Raghu
  #3 (permalink)  
Old April 16th, 2006, 07:59 PM
Friend of Wrox
Points: 6,664, Level: 34
Points: 6,664, Level: 34 Points: 6,664, Level: 34 Points: 6,664, Level: 34
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jan 2004
Location: Sydney, NSW, Australia.
Posts: 1,870
Thanks: 12
Thanked 20 Times in 20 Posts
Send a message via AIM to mat41
Default

Vin 0x1 please dont cross post:

http://p2p.wrox.com/topic.asp?TOPIC_ID=42958



Wind is your friend
Matt


Similar Threads
Thread Thread Starter Forum Replies Last Post
variables daniel.mihalcea Javascript 1 September 9th, 2008 07:06 PM
using variables webgrphx Classic ASP Basics 3 April 11th, 2007 06:46 PM
Error whilst initializing the report server lidsurfer BOOK: Professional SQL Server Reporting Services ISBN: 0-7645-6878-7 0 November 3rd, 2004 05:17 PM
Initializing a database davest Access 4 January 16th, 2004 10:08 AM





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