Error handlings in Windev with COM assembly
Hello
I'am programming a transfert service in Windev, using the WINSCP .NET assembly, and I am quite new with assemblies.
I've managed to write the connection, uploads, and dowloads, everything works fine, but now I'm stuck with errors handling.
Here is what I am trying to do :
As I don't know how to convert the correct syntax from .NET to Windev, I've tried all exemples I could find in the forum :
VB syntax : transferResult.Failures.Item(0).Message => doesn't compile, "procedure Item unknown"
transferResult.Failures.Item(0).Message => compile, but fails in runtime : "<item> : number of parameters is incorrect"
C# syntax : TransferOperationResult.Failures[0].Message => doesn't compile, ends with error "member Failures is not global and cannot be accessed from a global method"
TransferOperationResult.Failures(0).Message => doesn't compile, "procedure Failures unknown"
I tryed to replace [] by (), as Windev usually doesn't use []. But I don't know if I should keep them as I am working with an assembly.
Alos tried to replace 0 by 1, as counters in Windev usually start at 1. I've hard coded the item number without using my i variable for demonstration purpose.
BTW, Windev is not case sensitive.
So, I am lost, and can't find the correct syntax.
All ideas are welcome.
Thanks
Fred.
I'am programming a transfert service in Windev, using the WINSCP .NET assembly, and I am quite new with assemblies.
I've managed to write the connection, uploads, and dowloads, everything works fine, but now I'm stuck with errors handling.
Here is what I am trying to do :
transferResult est un TransferOperationResult dynamique transferResult = clSess:GetFiles(clSess:HomePath+"/resultat2/*_index.txt", VGL_AppPath+"\", False, Null) // The path "resultat2" doesn't exists, so an error will be raised IF NOT transferResult.IsSuccess THEN // List all occuring errors FOR i = 1 _TO_ transferResult:Failures:count // this line works, it returns 1 info(transferResult:Failures:item[i]:Message) // THIS IS WHERE THE PROBLEM IS END END
VB syntax : transferResult.Failures.Item(0).Message => doesn't compile, "procedure Item unknown"
transferResult.Failures.Item(0).Message => compile, but fails in runtime : "<item> : number of parameters is incorrect"
C# syntax : TransferOperationResult.Failures[0].Message => doesn't compile, ends with error "member Failures is not global and cannot be accessed from a global method"
TransferOperationResult.Failures(0).Message => doesn't compile, "procedure Failures unknown"
I tryed to replace [] by (), as Windev usually doesn't use []. But I don't know if I should keep them as I am working with an assembly.
Alos tried to replace 0 by 1, as counters in Windev usually start at 1. I've hard coded the item number without using my i variable for demonstration purpose.
BTW, Windev is not case sensitive.
So, I am lost, and can't find the correct syntax.
All ideas are welcome.
Thanks
Fred.