Wrox Programmer Forums
|
ASP Forms As of Oct 5, 2005, this forum is now locked. Please use "Classic ASP beginner" at http://p2p.wrox.com/forum.asp?FORUM_ID=54 or "Classic ASP Professional" http://p2p.wrox.com/forum.asp?FORUM_ID=56 instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP Forms 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:02 AM
Authorized User
 
Join Date: Jan 2005
Posts: 15
Thanks: 0
Thanked 0 Times in 0 Posts
Default Please give me an example of code

!) 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, 09:12 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 440
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Take out each letter and append it to a new string and after each letter insert some kind of token e.g. '-'. Then use Replace to change the '-' with line breaks. Then you have both combinations.

You can use the Mid function to extract the letters.

Hope it helps

Jacob.

(Some people are not to happy about cross posts no1 no2) )
 
Old January 27th, 2005, 09:19 AM
Authorized User
 
Join Date: Jan 2005
Posts: 15
Thanks: 0
Thanked 0 Times in 0 Posts
Default

but a user has to type in HELLO,... i still need an example.. thanks a lot...

 
Old January 27th, 2005, 09:23 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 440
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Here it is...
Code:
var1 = "HELLO"
var2 = ""

For i = 1 To Len(var1)
    var2 = var2 & Mid(var1, i, 1)
    If i <> Len(var1) Then
        var2 = var2 & "-"
    End If
Next

Response.Write var2
Response.Write "<br><br>"
Response.Write Replace(var2, "-", "<br>")
Very rough sketch, but it works. Just replace the variable var1 with the extract from the form.

Jacob.
 
Old January 27th, 2005, 12:04 PM
Authorized User
 
Join Date: Jan 2005
Posts: 15
Thanks: 0
Thanked 0 Times in 0 Posts
Default

but i mean request.form for example
if a user typed in Hello

<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")

%>
<%
Dim strVar1, strVar2, i

strVar1 = Request.Form("item")
For i =1 to len(strVar1)
     Response.write mid(strVar1,i,1) & "<BR>"
Next
'i mean using the file sysem object, write the name of this file to the screen. the contents of te file look like
H
E
L
L
O

<%
Set file = fso.CreateTextFile("w:\BoSeo\bingo.txt")
strVar2 = Request.Form("item")
For i =1 to len(strVar2)
     Response.write mid(strVar1,i,1) & "-"
Next
'using the contents of this file, i create a second file named bingo.txt and write out the contents into the file so it looks like H-E-L-L-O
%>







Similar Threads
Thread Thread Starter Forum Replies Last Post
Please give code for search button csateesh ASP.NET 1.0 and 1.1 Professional 0 August 7th, 2007 06:33 AM
please give me a help wujilin SQL Server 2005 2 June 2nd, 2007 04:33 PM
What is wrong in following code?Give me solution [email protected] Pro VB.NET 2002/2003 1 September 19th, 2006 04:49 PM
Email through vb code Plz give me reply sachinbashetti General .NET 0 September 23rd, 2005 04:27 AM
Myasp code is not working while html give results Raz Muhammad .NET Web Services 1 March 3rd, 2004 04:21 AM





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