Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 environment or not
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
agnivohneb




PostPosted: Tue Mar 18, 2008 8:35 am   Post subject: environment or not

I seem to have a problem when I want to access a file from the web using the Net.OpenURLConnection function. I always get a 404. I am not sure if it is my code or the environmnet because when I ruin it in 4.0.5 I get a 404 HTML error. When I run it in 4.1.1 the program will stop responding.
Here it is:
Turing:
var url : string := "http://turingnetchatserver.doesntexist.com/test.txt"

var netStream : int
var line : string

netStream := Net.OpenURLConnection (url)
if netStream <= 0 then
    put "Unable to connect to ", url
    return
end if
loop
    exit when eof (netStream)
    get : netStream, line : *
    put line
end loop
Net.CloseConnection (netStream)
Sponsor
Sponsor
Sponsor
sponsor
isaiahk9




PostPosted: Tue May 06, 2008 5:02 pm   Post subject: Re: environment or not

I'm pretty sure its the environment - I tested it out a couple times on my computer and it seemed to work fine. Sorry i can't help any more . . .
But then again, my computer was hacked a lot by my older-bro, so he might have changed some files in C drive.
Display posts from previous:   
   Index -> Programming, Turing -> Turing Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 2 Posts ]
Jump to:   


Style:  
Search: