Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Accessing event parameters in a prg
Message
De
05/04/2009 00:27:28
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Accessing event parameters in a prg
Versions des environnements
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP
Database:
Visual FoxPro
Divers
Thread ID:
01393307
Message ID:
01393307
Vues:
124
I am integrating FTP software from WeOnlyDo - wodFtpDLX - into a FoxPro prg as a COM object. A user is having a problem with duplicate messages in his mailbox so I want to add the FTPReply Event to trace the commands sent back and forth.

I do not have a form, so I have to do this in code and I'm not sure how to get the values of the Event parameters into my prg.

I create the object like this:
loFtp = CREATEOBJECT('WeOnlyDo.wodFtpDLXCom.1')

Then I want to say something like the following.

loFtp.GetFile(lcPathFile)

* 090404 smr: Call FTPReply Event to debug.
ReplyCode = 0
ReplyText = ""
loFtp.FTPReply("GetFile", ReplyCode, ReplyText)

DisplayError(-1, "FTPReply after 'GetFile': "+ReplyCode+" / "+ReplyText)
* 090404 End of FTPReply debug code.

But I don't think that this code returns the value of ReplyCode and ReplyText. How do I send these values back to my prg from the WeOnlyDo FTPReply event so that I can write them to a file and see what FTP events are really happening in the user's mailbox?

The WOD description of FTPReply is the following:

Description: Fires when wodFtpDLX provides information about executed command and returned reply.

Syntax: Private Sub object_FTPReply(Command, ReplyCode, ReplyText)

The FTPReply Event syntax has these parts:
Part Description
object A wodFtpDLX object.
Command A String value. Command executed by wodFtpDLX.
ReplyCode An Integer value. Holds reply code returned by the server.
ReplyText A String value. Full reply as returned by the server.

Remarks: FTPReply event is just debug event that will be fired only with FTP-alike transfer protocols (FTP and FTPS). Each time some command is executed by wodFtpDLX, this event will be fired. It will contain executed command, and reply code (and full text) as returned by the server.
If server's reply contains more than one line, they will all be included in ReplyText. If same code produces more than one reply (with different codes), FTPReply will fire more than once. Each time Command argument will contain command that caused this reply to be returned. Typical example is 'RETR' command which causes server to send '150 Data connection open' and '226 Transfer finished'.

Thanks for helping.
Susan
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform