472,352 Members | 1,565 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,352 software developers and data experts.

Another solution for this??

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

Apr 11 '07 #1
6 1184

"the other john" <ki*****@yahoo.comwrote in message
news:11**********************@w1g2000hsg.googlegro ups.com...
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'>"
dim aVariable
aVariable = ""
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
aVariable = aVariable & word

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
Apr 11 '07 #2
On Apr 11, 10:55 am, "ThatsIT.net.au" <me@thatsitwrote:
"the other john" <kina...@yahoo.comwrote in messagenews:11**********************@w1g2000hsg.go oglegroups.com...
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'>"

dim aVariable
aVariable = ""
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

aVariable = aVariable & word
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- Hide quoted text -

- Show quoted text -
Thanks. I tried this before...actually I tried it like this and it
didn't work.

firstWords = word & " " and firstWords 'need a space between each

what am I missing?

Thanks again!
Apr 11 '07 #3

"the other john" <ki*****@yahoo.comwrote in message
news:11*********************@w1g2000hsg.googlegrou ps.com...
On Apr 11, 10:55 am, "ThatsIT.net.au" <me@thatsitwrote:
>"the other john" <kina...@yahoo.comwrote in
messagenews:11**********************@w1g2000hsg.g ooglegroups.com...
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'>"

dim aVariable
aVariable = ""
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

aVariable = aVariable & word
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- Hide quoted text -

- Show quoted text -

Thanks. I tried this before...actually I tried it like this and it
didn't work.

firstWords = word & " " and firstWords 'need a space between each

what am I missing?

Thanks again!

aVariable = aVariable & word & " "

Apr 15 '07 #4
On Apr 15, 8:09 am, "ThatsIT.net.au" <me@thatsitwrote:
"the other john" <kina...@yahoo.comwrote in messagenews:11*********************@w1g2000hsg.goo glegroups.com...


On Apr 11, 10:55 am, "ThatsIT.net.au" <me@thatsitwrote:
"the other john" <kina...@yahoo.comwrote in
messagenews:11**********************@w1g2000hsg.go oglegroups.com...
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'>"
dim aVariable
aVariable = ""
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
aVariable = aVariable & word
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- Hide quoted text -
- Show quoted text -
Thanks. I tried this before...actually I tried it like this and it
didn't work.
firstWords = word & " " and firstWords 'need a space between each
what am I missing?
Thanks again!

aVariable = aVariable & word & " "- Hide quoted text -

- Show quoted text -
this was my solution....

wordCount = rsStoryData("fld_order_firstWords")
for i = 1 to wordCount
spacepos = instr(para," " )
word = left(para,spacepos)
If i 1 Then
thisWord = thisWord & word
Else
thisWord = word
End If
para = right(para,len(para)-spacepos)
next

Thanks!

Apr 17 '07 #5
On Apr 17, 1:47 pm, the other john <kina...@yahoo.comwrote:
On Apr 15, 8:09 am, "ThatsIT.net.au" <me@thatsitwrote:


"the other john" <kina...@yahoo.comwrote in messagenews:11*********************@w1g2000hsg.goo glegroups.com...
On Apr 11, 10:55 am, "ThatsIT.net.au" <me@thatsitwrote:
>"the other john" <kina...@yahoo.comwrote in
>messagenews:11**********************@w1g2000hsg.g ooglegroups.com...
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'>"
>dim aVariable
>aVariable = ""
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
>aVariable = aVariable & word
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- Hide quoted text -
>- Show quoted text -
Thanks. I tried this before...actually I tried it like this and it
didn't work.
firstWords = word & " " and firstWords 'need a space between each
what am I missing?
Thanks again!
aVariable = aVariable & word & " "- Hide quoted text -
- Show quoted text -

this was my solution....

wordCount = rsStoryData("fld_order_firstWords")
for i = 1 to wordCount
spacepos = instr(para," " )
word = left(para,spacepos)
If i 1 Then
thisWord = thisWord & word
Else
thisWord = word
End If
para = right(para,len(para)-spacepos)
next

Thanks!- Hide quoted text -

- Show quoted text -
Oh, an incidentally, I didn't need to use vbcrlf for some reason.
When I did it added a space making 2 spaces...strange. So, for
reasons I can't explain, it creates it's own space. Got me why.

Apr 17 '07 #6

"the other john" <ki*****@yahoo.comwrote in message
news:11**********************@e65g2000hsc.googlegr oups.com...
On Apr 15, 8:09 am, "ThatsIT.net.au" <me@thatsitwrote:
>"the other john" <kina...@yahoo.comwrote in
messagenews:11*********************@w1g2000hsg.go oglegroups.com...


On Apr 11, 10:55 am, "ThatsIT.net.au" <me@thatsitwrote:
"the other john" <kina...@yahoo.comwrote in
messagenews:11**********************@w1g2000hsg.g ooglegroups.com...
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'>"
>dim aVariable
aVariable = ""
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
>aVariable = aVariable & word
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- Hide quoted text -
>- Show quoted text -
Thanks. I tried this before...actually I tried it like this and it
didn't work.
firstWords = word & " " and firstWords 'need a space between each
what am I missing?
Thanks again!

aVariable = aVariable & word & " "- Hide quoted text -

- Show quoted text -

this was my solution....
'here lets create a string
dim words

' here we load the P tag
words = "<p>
wordCount = rsStoryData("fld_order_firstWords")
for i = 1 to wordCount
spacepos = instr(para," " )
word = left(para,spacepos)
If i 1 Then
'If you want the first words this should be
If i < 5 Then

thisWord = thisWord & word
' here you need somthing like

words = words & "<span id='firstWords'>" & word & "</span>"& " "

Else
thisWord = word & " "
'and here

words = words & word
End If
para = right(para,len(para)-spacepos)
next

'here end with

words = words & "</p>"
Thanks!

the above code would work, but creating large string in ASP slows things
down
Using a array would be better
wordCount = rsStoryData("fld_order_firstWords")

dim words()

for i = 1 to wordCount
spacepos = instr(para," " )
word = left(para,spacepos)

redim preserve words(i)

If i < 5 Then
words(i-1) = "<span id='firstWords'>" & word & "</span>"
Else
words(i-1) = word
End If
para = right(para,len(para)-spacepos)
next
Now write back

respaonse.write "<p>"

for each thing in words
respaonse.write thing & " "
next

respaonse.write "</p>"

Apr 19 '07 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: qwweeeit | last post by:
Another math problem easier to solve by hand, but, IMHO, difficult to program in a concise way like the solution of Bill Mill (linalg_brute.py) to...
3
by: Tee | last post by:
Hi Does anyone know how to run another project that inside the same solution ? The project that going to be run is a windows application...
33
by: Partha Protim Roy | last post by:
Hello, I have a Customer form say A to enter/update customer details. In the Form A I have a button which opens another form say B. In the...
2
by: lukegregory | last post by:
Is it possible to open a form from one project from a form in another project within the same solution? If so how is this done? Thanks
3
by: blue_nirvana | last post by:
How do you access a form or code from another project in the same solution? I have a solution that has several projects and I want to be able to...
3
by: gustav | last post by:
Hey there, I have this problem: Im migrating an ASP site to ASP.NET 1.1, and I find myself stuck because of this Form that has some inputs to...
24
by: =?Utf-8?B?RHIuIFMu?= | last post by:
I am incorporating three existing programs into a new "all in one" program. I have added the three projects to the new all in one project. How do I...
43
by: Adem24 | last post by:
The World Joint Programming Language Standardization Committe (WJPLSC) hereby proclaims to the people of the world that a new programming language...
7
by: joproulx | last post by:
Hi, I was wondering if there was a way with Reflection to find dynamically if an object was referencing indirectly another object. A simple...
11
by: Jan | last post by:
Hi: Here's a problem I've had for a long time. The client is really running out of patience, and I have no answers. Access2003, front- and...
1
by: Kemmylinns12 | last post by:
Blockchain technology has emerged as a transformative force in the business world, offering unprecedented opportunities for innovation and...
0
by: Naresh1 | last post by:
What is WebLogic Admin Training? WebLogic Admin Training is a specialized program designed to equip individuals with the skills and knowledge...
0
jalbright99669
by: jalbright99669 | last post by:
Am having a bit of a time with URL Rewrite. I need to incorporate http to https redirect with a reverse proxy. I have the URL Rewrite rules made...
0
by: antdb | last post by:
Ⅰ. Advantage of AntDB: hyper-convergence + streaming processing engine In the overall architecture, a new "hyper-convergence" concept was...
0
by: Matthew3360 | last post by:
Hi there. I have been struggling to find out how to use a variable as my location in my header redirect function. Here is my code. ...
2
by: Matthew3360 | last post by:
Hi, I have a python app that i want to be able to get variables from a php page on my webserver. My python app is on my computer. How would I make it...
0
by: AndyPSV | last post by:
HOW CAN I CREATE AN AI with an .executable file that would suck all files in the folder and on my computerHOW CAN I CREATE AN AI with an .executable...
0
hi
by: WisdomUfot | last post by:
It's an interesting question you've got about how Gmail hides the HTTP referrer when a link in an email is clicked. While I don't have the specific...
0
by: Matthew3360 | last post by:
Hi, I have been trying to connect to a local host using php curl. But I am finding it hard to do this. I am doing the curl get request from my web...

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.