PDA

View Full Version : Pls help. Getting data from a text file.


pitterpatter
09-17-2004, 08:56 AM
hi, i'm a newbie to asp coding. am doing a project now which requires me extract data from a .txt file. i'm using frontpage to do the codings, is there any better applications to create asp pages?

since i'm new, started with the basics such as this:

<script language="vbscript" runat="server">

sub writeSomething

response.write ("hello")

end sub

</script>

<html>
<head>
<title>Written Text</title>
</head>
<br>
<body onload="vbscript:writeSomething">
<form name=form1>

</form>
</body>
</html>


but i get the error that Object Required: Response.

someone pls help. i'm really new in this and i've got a project to complete urgently. any kind soul out there who's willing to provide "on-site" help, please add this email to ur MSN messenger: pitterpatter_raindrops@hotmail.com.


or is someone able to help me with the codes of extracting data from a text file? thanks alot in advance.

glenngv
09-17-2004, 12:19 PM
http://www.w3schools.com/asp/asp_ref_textstream.asp

Roy Sinclair
09-17-2004, 05:47 PM
As a newbie you are definitely making some typical mistakes, for example:


<script language="vbscript" runat="server">
sub writeSomething
...


Means this code is to be run on the server only and it will not be send to the client but later:


<body onload="vbscript:writeSomething">


your call to that function is made using a client side construct.

Remember that the code running server side will be 100% complete before the code running client side even starts (not strictly true but the way the http protocol works makes it effectively so). You can't call client side code from the server and you can't call server side code from the client.

Check out the W3Schools link Glenngv gave you, which he pointed at a specific example there's a lot you can learn just by looking at the various scripts and tutorials they have there and that'l help move you out of "newbie" status in a hurry.