 |
| Classic ASP Basics For beginner programmers starting with "classic" ASP 3, pre-".NET." 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 Basics 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
|
|
|
|

August 30th, 2009, 11:43 PM
|
|
Friend of Wrox
|
|
Join Date: Jan 2004
Posts: 1,870
Thanks: 12
Thanked 20 Times in 20 Posts
|
|
write value as string using FSO to ASP file
How can I write a value to an asp file and ensure its a string? The only difficulty I am have is getting the double quotes around the value. EG:
I want (the start of my file):
<%
Const Title_App = ''CERMT''
However I using this code:
OpenFileobj.writeLine("<%")
OpenFileobj.WriteLine("Const Title_App = " & trim(request.form("appName")))
I get:
<%
Const Title_App = CERMT
I have tried all combinations od double double, double single double etc.....but cant seem to get double quotes around the word CERMT. Any ideas would be very helpful?
TYIA
__________________
Wind is your friend
Matt
|
|

August 31st, 2009, 12:46 AM
|
|
Friend of Wrox
|
|
Join Date: May 2004
Posts: 642
Thanks: 0
Thanked 43 Times in 42 Posts
|
|
OpenFileobj.WriteLine("Const Title_App = """ & trim(request.form("appName")) & """")
__________________
Om Prakash Pant
Click the "Thanks" button if this post helped you.
|
|
The Following User Says Thank You to om_prakash For This Useful Post:
|
mat41 (August 31st, 2009)
|
|

August 31st, 2009, 02:16 AM
|
|
Friend of Wrox
|
|
Join Date: Jan 2004
Posts: 1,870
Thanks: 12
Thanked 20 Times in 20 Posts
|
|
Three doubles then four at the end. A combination I did not try, trhank you om_prakash you have a fine day...
__________________
Wind is your friend
Matt
|
|

August 31st, 2009, 02:34 AM
|
|
Friend of Wrox
|
|
Join Date: Jan 2004
Posts: 1,870
Thanks: 12
Thanked 20 Times in 20 Posts
|
|
Any idea why I get an 'Unterminated string constant' on this line:
OpenFileobj.writeLine("%>")
All is well after your assistance however the closing ASP delimiter now seems to be an issue.
TYIA
__________________
Wind is your friend
Matt
|
|

August 31st, 2009, 02:42 AM
|
|
Friend of Wrox
|
|
Join Date: Jan 2004
Posts: 1,870
Thanks: 12
Thanked 20 Times in 20 Posts
|
|
Any idea why I get an 'Unterminated string constant' on this line:
OpenFileobj.writeLine("%>")
All is well after your assistance however the closing ASP delimiter now seems to be an issue. Do I need to use the VB code for a % I assume?
TYIA
__________________
Wind is your friend
Matt
|
|

August 31st, 2009, 06:22 AM
|
|
Friend of Wrox
|
|
Join Date: May 2004
Posts: 642
Thanks: 0
Thanked 43 Times in 42 Posts
|
|
Try:
Code:
OpenFileobj.writeLine("%" & ">")
__________________
Om Prakash Pant
Click the "Thanks" button if this post helped you.
|
|
The Following User Says Thank You to om_prakash For This Useful Post:
|
mat41 (August 31st, 2009)
|
|

August 31st, 2009, 05:03 PM
|
|
Friend of Wrox
|
|
Join Date: Jun 2008
Posts: 1,649
Thanks: 3
Thanked 141 Times in 140 Posts
|
|
The reason being that you can *NOT* embed <% or %> tags inside of existing <% ... %> tags.
The ASP engine preprocesses those tags before the code is sent to the compiler, and so the compiler gets broken code.
|
|
The Following User Says Thank You to Old Pedant For This Useful Post:
|
mat41 (August 31st, 2009)
|
|

August 31st, 2009, 05:53 PM
|
|
Friend of Wrox
|
|
Join Date: Jan 2004
Posts: 1,870
Thanks: 12
Thanked 20 Times in 20 Posts
|
|
Excellent thank you both for your time, as always very much appreciated :o)
__________________
Wind is your friend
Matt
|
|
 |