![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks. |
| |||||||
![]() |
| |
| | #1 (permalink) |
| | Show each word of array in a diff line I'm trying to show each word in an array on each line in vbscript. I've tried: dim ray(2) ray(0)="ray1" ray(1)="ray2" ray(2)="ray3" for i=0 to 2 document.write(" " & ray(i)) next The code above works but I now need to get words in an array and show each word on a different line in a span block named answer3. The answer I currently get is only "tools" from the "john" string.. The code I have is: <html> <head> <script language="vbscript"> <!-- sub fred john_val=window.document.alice.john.value dim joarsp joarsp=split(john_val, " ") answer2.innerHTML=joarsp(0)+cstr(" ")+joarsp(12) for i=0 to 12 answer3.innerHTML=(joarsp(i) & " ") next end sub --> </script> </head> <body> <form name="alice"> The string john = <input type="text" size="60" name="john" value="this is a string for the purpose of playing with string coding tools"> </form> <ol> <li><span id="answer2">this is the contents of the span block with id answer2</span> <li><span id="answer3">this is the contents of the span block with id answer3</span> </ol> <input type="button" value="GO" onClick="fred"> </body> </html> Thanks. |
My System Specs![]() |
| | #2 (permalink) |
| | Re: Show each word of array in a diff line For i = 0 to 2 response.write(ray(i)) & "<br>" & vbCrLf Next -- ..::[ Hz ]::. |
My System Specs![]() |
![]() |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Forum | |||
| the word [SPAM] added to subject line | Live Mail | |||
| array members to outfile on new line | PowerShell | |||
| Read word doc line-by-line | VB Script | |||
| How to debug a vbscript/ show each line BEFORE execution and with var values? | VB Script | |||
| Line distance Word 2000 | Vista General | |||