Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
Classic ASP Basics For beginner programmers starting with "classic" ASP 3, pre-".NET." NOT for ASP.NET 1.0, 1.1, or 2.0
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old January 27th, 2005, 09:04 AM
Authorized User
 
Join Date: Jan 2005
Location: , , .
Posts: 15
Thanks: 0
Thanked 0 Times in 0 Posts
Default tough code please help...

!) a user has to type in like
HELLO

2) the result that prints like
H
E
L
L
O

3) H-E-L-L-O

I need an example of this code that will print an input string vertically but don't forget --- a user has to type in HELLO... not first print like for i = 1 to letters(strvar)
response.write(strvar, i, 1)

but a user has to type in HELLO... pleaes give me an example of this code that will print an input string vertically and horizonally with dash... any help would be appreciated... thanks a lot.

 
Old January 27th, 2005, 10:31 AM
Friend of Wrox
 
Join Date: Oct 2003
Location: Cochin, Kerala, India.
Posts: 463
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to madhukp
Default

You can use this function.

private function funcWriteStringVertically(strText)
    dim iLoop
    dim strReturnString
    strReturnString = ""
    for iLoop = 1 to len(strText)
        if(strReturnString="") then
            strReturnString = mid(strText,iLoop,1)
        else
            strReturnString = strReturnString & "<br>" & mid(strText,iLoop,1)
        end if
    next
    funcWriteStringVertically = strReturnString
end function

This will return the text passed to it ready to be vertically printed.

Response.Write funcWriteStringVertically("India is my country.")

will print the string "India is my country" vertically.
 
Old January 27th, 2005, 12:23 PM
Authorized User
 
Join Date: Jan 2005
Location: , , .
Posts: 15
Thanks: 0
Thanked 0 Times in 0 Posts
Default

<%@ Language=VBScript %>

<HTML>
<BODY>
<FORM METHOD=POST ACTION="bingo1.asp" id=form1 name=form1>
<INPUT TYPE=text NAME=item><BR>
<INPUT TYPE=SUBMIT VALUE="Click Me" id=SUBMIT1 name=SUBMIT1>
</BODY>
</HTML>


<%@ Language=VBScript %>
<% Option Explicit %>
<%
Dim fso, file, folder
Set fso = CreateObject("Scripting.FileSystemObject")

set folder = fso.CreateFolder("w:\BoSeo")
Set file = fso.CreateTextFile("w:\BoSeo\bingo.txt")
%>

<HTML>
<BODY>
<%
Dim strVar1, strVar2, i
strVar = Request.Form("item")

For i = 1 to len(strVar1)
     Response.write mid(strVar,i,1) & "<BR>"
Next
  For i = 1 to len(strVar2)
     Response.write ucase(mid(strVar, i, 1)) & "-" "<BR>"
Next
%>

%>
</BODY>
</HTML>

1. Using he file system object, i want to write the name of this file to the screen the contents of this file look like
H
E
L
L
O

2. Using the contents of the file, i want to create a second file named bingo.txt. and write out the contents of this file so it looks like this
H-E-L-L-O


any help would be appreciated. thanks lots






Similar Threads
Thread Thread Starter Forum Replies Last Post
Urgent:hard disk serial code and vb code ivanlaw Pro VB 6 0 July 25th, 2007 04:05 AM
VB: .Exe file, serial code and activation code ivanlaw Pro VB 6 8 July 6th, 2007 05:44 AM
Fatal Error - A tough one! gargamel BOOK: Beginning PHP5, Apache, and MySQL Web Development ISBN: 978-0-7645-7966-0 3 April 4th, 2007 04:25 PM
Tough one !! xls as frontend with mdb as backend Stanny Access 5 January 7th, 2005 11:01 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.