T
the other john
This is a script someone here helped me with a while back and I am
very grateful for the help. I am stumped however as to how to change
it slightly.
This is the script...
storyArray = Split(myStory, vbcrlf & vbcrlf)
para = storyArray(0)
'setup the loop for the first words here
Response.write "<p><span id='firstWords'>"
for i = 1 to 4
spacepos = instr(para," " )
word = left(para,spacepos)
Response.Write word 'this is the line I need to create a variable
instead
para = right(para,len(para)-spacepos)
next
'close the first words loop and print the remaining words in the first
paragraph
Response.Write "</span>" & para & "</p>" & vbcrlf
All this was designed to do it to is to take to take the first array
item (a paragraph) and enclose the first words (in this case the first
4) in style tags. It works perfectly however, instead of "printing"
the words with this line "Response.Write word", I need to instead
place the words into a variable instead of just printing them, in
other words, create a string of the first 4 words and place them into
a variable like "firstWords" or whatever so I can call on it at a
later time in the script. It should just be a simple thing but it's
not turning out this way. I'd "really" appreciate ideas.
Thanks!!
John
very grateful for the help. I am stumped however as to how to change
it slightly.
This is the script...
storyArray = Split(myStory, vbcrlf & vbcrlf)
para = storyArray(0)
'setup the loop for the first words here
Response.write "<p><span id='firstWords'>"
for i = 1 to 4
spacepos = instr(para," " )
word = left(para,spacepos)
Response.Write word 'this is the line I need to create a variable
instead
para = right(para,len(para)-spacepos)
next
'close the first words loop and print the remaining words in the first
paragraph
Response.Write "</span>" & para & "</p>" & vbcrlf
All this was designed to do it to is to take to take the first array
item (a paragraph) and enclose the first words (in this case the first
4) in style tags. It works perfectly however, instead of "printing"
the words with this line "Response.Write word", I need to instead
place the words into a variable instead of just printing them, in
other words, create a string of the first 4 words and place them into
a variable like "firstWords" or whatever so I can call on it at a
later time in the script. It should just be a simple thing but it's
not turning out this way. I'd "really" appreciate ideas.
Thanks!!
John