Page 1 of 1
Posted: Wed Mar 06, 2002 11:55 pm
by BackupUser
Restored from previous forum. Originally posted by rmann.
Hi. I've written a program to make a telnet session to rainmaker.underground.com. After it makes the connection, it gets the forecast for Daytona Beach. There is one problem. Since rainmaker is a menu type system, whenever I run this program it shows a line at the bottom of the data that says something like press return or x to exit. How do I keep users from seeing this bottom line whenever they run this program? Thanks. My code is below.
output.s = Space(10000)
InitNetwork()
OpenNetworkConnection("rainmaker.wunderground.com", 23)
ReceiveNetworkData(0, @output, Len(output))
a$ = output ; I don't want this to be displayed
send.s = Chr(13)+Chr(10)
SendNetworkData(0, @send, Len(send))
ReceiveNetworkData(0, @output, Len(output))
a$ = output ; I don't want this to be displayed
send.s = "dab"+Chr(13)+Chr(10)
SendNetworkData(0, @send, Len(send))
ReceiveNetworkData(0, @output, Len(output))
a$ = output ; I don't want this to be displayed
ReceiveNetworkData(0, @output, Len(output))
send.s = "x"+Chr(13)+Chr(10)
MessageRequester("Forcast:", output, 0)
;The above messagerequester command displays the information that I want to be displayed.
CloseNetworkConnection()
Posted: Thu Mar 07, 2002 1:17 am
by BackupUser
Restored from previous forum. Originally posted by Franco.
Hi ...?
If I put a delay command in than it works fine on my computer.
But I don't know exactly if 1 second is enough...
Code: Select all
output.s = Space(10000)
InitNetwork()
OpenNetworkConnection("rainmaker.wunderground.com", 23)
ReceiveNetworkData(0, @output, Len(output))
a$ = output ; I don't want this to be displayed
send.s = Chr(13)+Chr(10)
SendNetworkData(0, @send, Len(send))
ReceiveNetworkData(0, @output, Len(output))
a$ = output ; I don't want this to be displayed
send.s = "dab"+Chr(13)+Chr(10)
Delay(1000) ;<- if I put a delay it works... on my computer and my connection (Westcoast)
SendNetworkData(0, @send, Len(send))
ReceiveNetworkData(0, @output, Len(output))
a$ = output ; I don't want this to be displayed
ReceiveNetworkData(0, @output, Len(output))
send.s = "x"+Chr(13)+Chr(10)
MessageRequester("Forcast:", output, 0)
;The above messagerequester command displays the information that I want to be displayed.
CloseNetworkConnection()
Hope this helps
Have a nice day...
Franco
Sometimes you have to go a lonely way to accomplish genius things.
Posted: Thu Mar 07, 2002 1:54 am
by BackupUser
Restored from previous forum. Originally posted by rmann.
Yeah, That delay command solved the problem, although I don't know why a delay command would make a difference as far as that is concerned, but it seems to. Thanks.
Hi ...?
If I put a delay command in than it works fine on my computer.
But I don't know exactly if 1 second is enough...
Code: Select all
output.s = Space(10000)
InitNetwork()
OpenNetworkConnection("rainmaker.wunderground.com", 23)
ReceiveNetworkData(0, @output, Len(output))
a$ = output ; I don't want this to be displayed
send.s = Chr(13)+Chr(10)
SendNetworkData(0, @send, Len(send))
ReceiveNetworkData(0, @output, Len(output))
a$ = output ; I don't want this to be displayed
send.s = "dab"+Chr(13)+Chr(10)
Delay(1000) ;<- if I put a delay it works... on my computer and my connection (Westcoast)
SendNetworkData(0, @send, Len(send))
ReceiveNetworkData(0, @output, Len(output))
a$ = output ; I don't want this to be displayed
ReceiveNetworkData(0, @output, Len(output))
send.s = "x"+Chr(13)+Chr(10)
MessageRequester("Forcast:", output, 0)
;The above messagerequester command displays the information that I want to be displayed.
CloseNetworkConnection()
Hope this helps
Have a nice day...
Franco
Sometimes you have to go a lonely way to accomplish genius things.
Posted: Thu Mar 07, 2002 3:37 am
by BackupUser
Restored from previous forum. Originally posted by Franco.
Yeah, That delay command solved the problem, although I don't know why a delay command would make a difference as far as that is concerned, but it seems to. Thanks
You Welcome,
but neither do I...
I started to put MessageRequesters after every:
a$ = output
send.s = Chr(13)+Chr(10)
to see the value of a$ and send.s.
Than I saw that the last sentence with 'press return or x ...' was gone.
But this doesn't seems to be the solution.
It's not working under WinXP and HighSpeed Internet.
So the best would be to remove the last sentence from your output text, and hope they don't change it.
Try this:
Code: Select all
Procedure$ Remove(String$,RemoveString$)
StringLenght = Len(String$)
RemoveStringLenght = Len(RemoveString$)
RemoveStringPos = FindString(String$, RemoveString$, 1)
If StringLenght = 0
OutputString$ = "Remove: Main String is missing !"
Else
If RemoveStringLenght = 0
OutputString$ = "Remove: Search String is missing !"
Else
If RemoveStringPos = 0
OutputString$ = "Remove: String not found !"
Else
FirstString$ = Left(String$,RemoveStringPos - 1)
EndStringPos = RemoveStringPos + RemoveStringLenght - 1
EndString$ = Right(String$,StringLenght - EndStringPos)
OutputString$ = FirstString$ + EndString$
EndIf
EndIf
EndIf
ProcedureReturn OutputString$
EndProcedure
output.s = Space(5000)
InitNetwork()
OpenNetworkConnection("rainmaker.wunderground.com", 23)
ReceiveNetworkData(0, @output, Len(output))
a$ = output ; I don't want this to be displayed
send.s = Chr(13)+Chr(10)
SendNetworkData(0, @send, Len(send))
ReceiveNetworkData(0, @output, Len(output))
a$ = output ; I don't want this to be displayed
send.s = "PDX"+Chr(13)+Chr(10)
SendNetworkData(0, @send, Len(send))
ReceiveNetworkData(0, @output, Len(output))
a$ = output ; I don't want this to be displayed
ReceiveNetworkData(0, @output, Len(output))
send.s = "x"+Chr(13)+Chr(10)
output=Remove(output,"Press Return to continue, M to return to menu, X to exit:")
MessageRequester("Forcast:", output, 0)
;The above messagerequester command displays the information that I want to be displayed.
CloseNetworkConnection()
This works fine for me
Another possibility: look for the last carriage return char in the output text and delete all characters after that.
Have a nice day...
Franco
Sometimes you have to go a lonely way to accomplish genius things.
Edited by - franco on 07 March 2002 04:15:27