473,466 Members | 1,360 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

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 1214

"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 the problem of engsol. I appreciated very much...
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 project. If I don't want to run the EXE, do I have any...
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 Form B, I am providing user with a option to search...
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 load a form or call code from say Project2 from...
3
by: gustav | last post by:
Hey there, I have this problem: I´m migrating an ASP site to ASP.NET 1.1, and I find myself stuck because of this Form that has some inputs to access an Extranet... When the user submits, the...
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 instruct the new initial menu to launch the main...
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 is needed for the benefit of the whole mankind in...
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 example would be: Object1 | --Object2 |
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 back-end. Single form with 4 subforms (each...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

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.