Rt - WeOnlyDo Discussion board

Rt (wodTelnetDLX)

by Dave Langley, Thursday, October 30, 2014, 14:41 (3675 days ago)

Hi

I have a really simple program that sets the prompt property to "<ESC><STX>". Text will follow which is terminated with chr(13). What I want to accomplish is extracting the text that follows the prompt.

So I might have "<ESC><STX>THIS IS A TEST"+charact(13) and wish to extract "THIS IS A TEST" from the string. How do I accomplish this? I tried using "textLine=object.ReceiveLine()" and the activex control crashes my application as if this method cannot be used to return a value.

====================================================
I am using WinDev and these are the lines of code I am using

//global declaractions
AX_Term>>Prompt="<ESC><STX>"

//initialise AX_Term
ActiveXEvent("OnPromptReceived",AX_Term,"PromptReceived")

//OnPromptReceived procedure
PROCEDURE OnPromptReceived()
sTest is string
sTest=AX_Term>>ReceiveLine()//----- crash occurs here
Trace(sTest)

===== here is the windev error, which may help ================
Error at line 3 of Local Procedure OnPromptReceived process.
'ReceiveLine' Automation method called.
Attempt to invoke <ReceiveLine> method or to read <ReceiveLine> property. Error returned by Automation/ActiveX object:
'Erreur 800A755B : None found.'
Attempt to invoke <ReceiveLine> method. Error returned by Automation/ActiveX object:
'Erreur 800A755B : None found.'
Attempt to read <ReceiveLine> property. Error returned by Automation/ActiveX object:
'Erreur 80020003, Le membre demandé n'existe pas'
Attempt to write <ReceiveLine> property. Error returned by Automation/ActiveX object:
'Erreur 80070057, Un ou plusieurs arguments sont invalides'

Rt

by Jasmine, Thursday, October 30, 2014, 15:47 (3675 days ago) @ Dave Langley

Hi Dave.

I don't know about WinDev, so I can only guess what the problem is. Anyway, this is not crash at all.

Eror that was returned is 'None found', and it is genuine error that is returned by ReceiveLine that says - there are no lines to receive that have arrived from the server.

I think changing your code to wait for it, such as with setting Blocking property to True, would solve the problem. Can you try that?

Best regards.
Jasmine.

Rt

by Dave Langley, Thursday, October 30, 2014, 15:52 (3675 days ago) @ Jasmine

Thanks. I can try thankyou.