Wrox Programmer Forums
|
Classic ASP Professional For advanced coder questions in ASP 3. 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 Professional 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 28th, 2005, 12:23 AM
Authorized User
 
Join Date: Jan 2005
Posts: 15
Thanks: 0
Thanked 0 Times in 0 Posts
Default Print Problem

I just typed in HELLO but it doesn't print .... do i miss something? where? can youi give ne am example? thanks...
-------------------------------------------------------
<%@ Language=VBScript %>

<HTML>
<BODY>
<FORM METHOD=POST ACTION="bingo1.asp" id=form1 name=form1>
<input type=hidden name=item value=<% = Request.form("item") %>>
<INPUT TYPE=text NAME=item><BR>
<INPUT TYPE=SUBMIT VALUE="Click Me">
</BODY>
</HTML>
----------------------------------------------------------

<%@ Language=VBScript %>
<% Option Explicit %>

<HTML>
<BODY>
<%
Dim fso, folder,f,ts

Set fso = CreateObject("Scripting.FileSystemObject")
Set f = fso.GetFile("w:\boseo\test.txt")
Set ts = f.OpenAsTextStream(1,-2)

do while ts.AtEndOfStream = false
  Response.Write ts.ReadLine & "<BR>"
loop
%>

</BODY>
</HTML>

 
Old January 28th, 2005, 01:41 PM
Friend of Wrox
 
Join Date: May 2004
Posts: 642
Thanks: 0
Thanked 43 Times in 42 Posts
Default

Following input types are with same name:

<input type=hidden name=item value=<% = Request.form("item") %>>
<INPUT TYPE=text NAME=item><BR>

what is the requirement?
do you wan to print content or read text file?


Om Prakash
 
Old January 28th, 2005, 02:14 PM
Authorized User
 
Join Date: Jan 2005
Posts: 15
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Yes, I want to print contents... and also I want to write it to this file... for example, if i typed in HELLO that will print vertically or horizonally on the page and also write out to test.txt. when i opended test.txt and there is no HELLO in this file... i don't know how to.... thanks a lot for your help... i still need help.. thans tanks thanks.

 
Old January 28th, 2005, 02:43 PM
Friend of Wrox
 
Join Date: May 2004
Posts: 642
Thanks: 0
Thanked 43 Times in 42 Posts
Default

following is the code to create & write contents in text file:

    Set fso = CreateObject("Scripting.FileSystemObject")
    Set a = fso.CreateTextFile("c:\testfile.txt", True)
    a.WriteLine("This is a test.")
    a.Close
    set a = nothing
    set fso = nothing

For printing, please check the following link:

http://www.taltech.com/TALtech_web/s..._Printing.html



Om Prakash
 
Old January 28th, 2005, 08:05 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 217
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to mega
Default

use

• VbCrLf for Carrie return Linefeeds

• VbLf for Linefeeds

• VbCr for Carrie return

and of course <br /> in your page (it's absolutely legal to write both VbCrLf and <br> in HTML).

om_prakash got the answer regarding writing to a file

 - mega
Moving to C# .NET





Similar Threads
Thread Thread Starter Forum Replies Last Post
Textbox problem print preview vs. print jenisageek Access 5 May 2nd, 2008 12:54 PM
Print problem in chapter 7 kathy Thisted BOOK: Beginning VB.NET 2nd Edition/Beginning VB.NET 2003 5 April 17th, 2008 06:57 AM
print problem annie_stwg ASP.NET 2.0 Basics 0 September 18th, 2006 12:19 AM
print problem madhukp Classic ASP Basics 2 August 20th, 2004 11:39 PM





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