Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Register | FAQ | Members List | Calendar | 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 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
 
 
Thread Tools Search this Thread Display Modes
  #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
 


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



All times are GMT -4. The time now is 05:58 PM.


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