473,473 Members | 2,174 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Multiple line variable

52 New Member
Hopefully this will be an easy one...

Is there any way I can have ASP recognize that the declairation of my variable continues to the next line?

I'm trying to put all of my drop down box options in an asp variable so i only call the variable instead of having 50+ lines each time i want to use that list. and I'd like to keep the code easy to read ... something like this

DropList = response.write("<option>Choice 1</option>
<option>Choice 2</option>
...
Instead of

DropList = response.write("<option>Choice 1</option> <option>Choice2</option> <option>...

However when i do it on multiple lines i get Unterminated string constant errors.

Please help!
Jul 5 '07 #1
3 5442
jhardman
3,406 Recognized Expert Specialist
Expand|Select|Wrap|Line Numbers
  1. DropList = "<option>Choice 1</option>" & vbNewLine & _
  2.                 "<option>Choice 2</option>" & vbNewLine & _
  3.                 'etc
but it would probably be better to do it without the line continuation marks like this:
Expand|Select|Wrap|Line Numbers
  1. DropList = "<option>Choice 1</option>" & vbNewLine
  2. DropList = DropList & "<option>Choice 2</option>" & vbNewLine
  3. DropList = DropList & "<option>Choice 3</option>" & vbNewLine 'etc
Let me know if this helps.

Jared
Jul 5 '07 #2
Shisou
52 New Member
Thanks for the information jared...

I actually went out and found a different solution that goes a little something like this

response.write("<option>choice 1</option>"&_
"<option>Choice 2</option>"&_
I tend to shy away from extra typing :)

I appreciate the help though
Jul 5 '07 #3
jhardman
3,406 Recognized Expert Specialist
that's fine, but a lot of experienced programmers shy away from multiple line continuation marks. Just fyi, your solution is perfectly valid.

Jared
Jul 5 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

6
by: Jon LaRosa | last post by:
I'm am trying to remove multiple line breaks ("\n"). Here's my code: $imageStr = trim($_POST); $imageStr = str_replace("\n\n", "\n", $imageStr); ---------- $_POST is a textarea field, and...
8
by: MrTrix | last post by:
Hello: I'm having a problem formulating the code to execute a multiple line command. I'm trying to execute something like: set rowcount 100000 declare @rowct int select @rowct = 1 while...
3
by: Arjen | last post by:
Hi, If the users enters some data it must be have 1 ... 100 characters. These characters may be placed on multiple lines. (textbox) I use this: .{1,100} But this only works with one line. ...
8
by: bendes | last post by:
Hi all, I just have a quick question here: I have this site: http://irx.inf.elte.hu/~begoaai/pizzaboy/index2.html It's sort of a pizza online order site, you can order pizza, you can...
19
by: =?Utf-8?B?QnJpYW4gQ29vaw==?= | last post by:
This is an example of the data; 2007/07/27 11:00:03 ARES_INDICATION 010.050.016.002 404.2.01 (6511) RX 74 bytes 2007/07/27 11:00:03 65 11 26 02 BC 6C AA 20 76 93 51 53 50 76 13 48...
1
by: stewc | last post by:
Hi I am using this line of code var str = (<r><!]></r>).toString(); to convert a multiple line string to a single line so I can remove the line breaks It works great in Firefox but...
6
by: huohaodian | last post by:
Hi, How can I define a long string variable in C# with multiple lines ? For example private string longName = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" ...
4
by: franc sutherland | last post by:
Hello, Is it possible to make multiple line notes in the VB editor? I know about using the apostrophe ' to make a single line note. Is there a version for making multiple lined notes? If...
1
by: mohan lal | last post by:
Hi, I have a variable in php $test = "This is a string It has multiple lines there are three total" ; (Output from a text area) I want to pass this variable to a javascript function
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.