Wrox Programmer Forums

Need to download code?

View our list of code downloads.

| FAQ | Members List | Search | Today's Posts | Mark Forums Read
ASP.NET 1.0 and 1.1 Basics ASP.NET discussion for users new to coding in ASP.NET 1.0 or 1.1. NOT for the older "classic" ASP 3 or the newer ASP.NET 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.0 and 1.1 Basics 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 September 6th, 2004, 08:52 AM
Registered User
 
Join Date: Sep 2004
Location: London, , United Kingdom.
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default Limitations of Replace

Hi

I need to turn the string below into an asp variable, however, when I try to remove the double quotes using the Replace function, I get an error message as the quotes in the middle seem to confuse matters. The line itself is generated by an external program and cannot be altered, all I can do is wrap around it.


<a href="XXX_X082401.ppt" target="_top">01 The Main Strategic Agenda</a>

Thanks in advance (hopefully)

Phil
  #2 (permalink)  
Old September 7th, 2004, 11:18 PM
planoie's Avatar
Friend of Wrox
Points: 16,481, Level: 55
Points: 16,481, Level: 55 Points: 16,481, Level: 55 Points: 16,481, Level: 55
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Aug 2003
Location: Clifton Park, New York, USA.
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

Not sure I understand... You want to change that to a variable? Do you mean you want that string to be the value of a variable? How will it then be used?
  #3 (permalink)  
Old September 8th, 2004, 03:52 AM
Registered User
 
Join Date: Sep 2004
Location: London, , United Kingdom.
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Sorry, should have been clearer.

That line is one of many and is part of a table of contents which is generated by a content management system. Due to the limitations of the content management system, I want to turn that line, and the others in the table of contents ,into variables/an array to allow me greater control over it.

The line itself is written to the page as is and cannot be altered manually. When I try an declare it as a variable, the double quotes within cause a compilation error as it is assumed they are the end of the statement, not part of it.

I then tried the Replace function, wrapping it around the outside of the line, however this also causes a compilation error as again it thinks the double quotes in the middle of the string are the end of it, not part of it.

How do I get round this?

  #4 (permalink)  
Old September 8th, 2004, 07:58 AM
planoie's Avatar
Friend of Wrox
Points: 16,481, Level: 55
Points: 16,481, Level: 55 Points: 16,481, Level: 55 Points: 16,481, Level: 55
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Aug 2003
Location: Clifton Park, New York, USA.
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

I still don't understand what you mean by "when I try an declare it as a variable". You declare variables in your code. How are we getting from the CMS table of contents to code??

It sounds like you are trying to strip the text from this CMS page and are then putting it into some array. How about you post the relevant code so we can see what it is you are trying to attempt.
  #5 (permalink)  
Old September 8th, 2004, 11:09 AM
Registered User
 
Join Date: Sep 2004
Location: London, , United Kingdom.
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Sorry, am really quite rubbish.

The Content Management System is very limited in what you can do in terms of manipulation and formatting of the Tables Of Contents. It does, however, allow you to put some characters, whether they are VBScript commands, html or whatever immediately before and after the line generated:

{some characters before}<a href="XXX_X082401.ppt" target="_top">01 The Main Strategic Agenda</a>{some characters after}

What I want to be able to do is either give this line a name like so:

TocEntry1 = "<a href="XXX_X082401.ppt" target="_top">01 The Main Strategic Agenda</a>"

or make it one entry in a array:

MyArray (0) = "<a href="XXX_X082401.ppt" target="_top">01 The Main Strategic Agenda</a>"

When I try to give this line a name as in the first example, I get a compilation error cause by all double quotes. I tried to use the Replace function to change them, but I get the same error.

TocEntry1 = Replace("<a href="XXX_X082401.ppt" target="_top">01 The Main Strategic Agenda</a>","""","'")



  #6 (permalink)  
Old September 8th, 2004, 11:12 AM
Registered User
 
Join Date: Sep 2004
Location: London, , United Kingdom.
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Posted before I finished...

So, how do I avoid the compilation error?

Thanks

  #7 (permalink)  
Old September 8th, 2004, 01:16 PM
Friend of Wrox
 
Join Date: Jun 2003
Location: , , .
Posts: 540
Thanks: 0
Thanked 4 Times in 4 Posts
Default

Quote:
quote:Originally posted by philstaite


What I want to be able to do is either give this line a name like so:

TocEntry1 = "<a href="XXX_X082401.ppt" target="_top">01 The Main Strategic Agenda</a>"

When I try to give this line a name as in the first example, I get a compilation error cause by all double quotes. I tried to use the Replace function to change them, but I get the same error.

TocEntry1 = Replace("<a href="XXX_X082401.ppt" target="_top">01 The Main Strategic Agenda</a>","""","'")
How do you know what this value will be when you pull it? Do you set a label's text equal to that when you pull it? If so why not just do a replace on the label's (or whatever's) text itself?

J
 


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
Database Limitations rfurman1161 Access 2 April 5th, 2006 01:45 AM
Forum Features and Limitations englere BOOK: ASP.NET Website Programming Problem-Design-Solution 2 March 10th, 2006 12:37 PM
Limitations of Replace philstaite BOOK: Beginning ASP 3.0 5 September 10th, 2004 10:07 AM
MSAccess Limitations if any happygv Access 5 April 19th, 2004 08:45 PM
data type limitations trangd MySQL 0 October 16th, 2003 11:34 AM



All times are GMT -4. The time now is 12:52 PM.


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