Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Community Forums
 Code Support: ASP (Non-Forum Related)
 Dynamic Parse script problem
 New Topic  Topic Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

ILLHILL
Junior Member

Netherlands
341 Posts

Posted - 28 February 2007 :  12:34:53  Show Profile
Hi, I have some experience with parsing scripts I have used in the past.
What I learned is that if I want to use a script multiple times on one
page then I must rewrite the script (manually) and upload it just as
many times as it will be used, so that things like "strItemTitle"
becomes "strItemTitle01", "strItemTitle02", "strItemTitle03" in order
for the parsing not to collide with the other parsings.

For a project I am working on I would like not to add the parse script
multiple times, but just one time, dynamically.

As far as the values that would get used in the String names, I have
done the following.

extURL = "http://rss.cnn.com/rss/cnn_topstories.rss"
StrippedExtUrl = replace(replace(replace(extURL, "http://", ""), ".", ""), "/", "")

The StrippedExtUrl is the part I want to add to the values in order
to make them dynamic, so strItemTitle should become:

strItemTitlersscnncomrsscnn_topstoriesrss

This way, the value for the url to the feed is used to dynamically
change the names for the different strings and prevent them from
clashing when loaded all at once on one page.

However, here's where I'm stuck:


for each entry in channelNodes
if entry.tagName = "title" then
strChannelTitle = entry.text
elseif entry.tagName = "description" then
strChannelDescription = entry.text
elseif entry.tagName = "link" then
strChannelLink"" & StrippedExtUrl & "" = entry.text
end if
next


I have tried things like:

strChannelTitle"" & StrippedExtUrl & "" = entry.text

(added and removed quotation marks etc. etc.) all to no avail.

Anybody know how to do this the correct way?


Greets & thanks, Dominic

CLPPR.com - All The News Only Seconds Away

Shaggy
Support Moderator

Ireland
6780 Posts

Posted - 28 February 2007 :  13:01:10  Show Profile
If I understand you correctly then you're trying to create variable names dynamically by combining a string with the variable name which isn't possible. I'd suggest using an array instead.


Search is your friend
“I was having a mildly paranoid day, mostly due to the
fact that the mad priest lady from over the river had
taken to nailing weasels to my front door again.”
Go to Top of Page

ILLHILL
Junior Member

Netherlands
341 Posts

Posted - 03 March 2007 :  21:39:37  Show Profile
Thanks man!

Greets & thanks, Dominic

CLPPR.com - All The News Only Seconds Away
Go to Top of Page

Shaggy
Support Moderator

Ireland
6780 Posts

Posted - 05 March 2007 :  05:30:14  Show Profile
You're welcome


Search is your friend
“I was having a mildly paranoid day, mostly due to the
fact that the mad priest lady from over the river had
taken to nailing weasels to my front door again.”
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Topic Locked
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.25 seconds. Powered By: Snitz Forums 2000 Version 3.4.07