What is the logic behind the DoneEvent? - WeOnlyDo Discussion board

What is the logic behind the DoneEvent? (wodFtpDLX / wodFtpDLX.NET)

by Jasmine, Tuesday, October 06, 2015, 08:21 (1441 days ago) @ tonym

Hi Tony.

Your code should be state driven. You can have your own enumeration of states like

MyState = {SomethingBefore, MakingDirectory, UploadingFile, SomethingAfter....}

and then in Done do

if MyState == SomethingBefore
MyState = MakingDirectory
Ftp1.MakeDir...
else
if MyState == MakingDirectory
MyState = UploadingFile
Ftp1.PutFile (local, remote)
else
if MyState == UploadingFile
MyState = SomethingAfter
Ftp1.Do Something.
endif

so, you end up always in Done, but your 'MyState' variable decides which command to execute.

I hope this helps!
Jasmine.


Complete thread: