Skip files in GetFiles Method (wodSFTP / wodSFTP.NET / wodSFTPdll)
We are testing an evaluation version of WodFtpDLX on Powerbuilder 7.
In this testing we want to achieve downloading .sql files. Base on the documentation GetFiles method will fire LoopItem event wherein we can add a script to skip or include files. However, the powerscript below failed to do this.
---using Skip
if itemtype = 0 then
Skip = True
else
if Right(RemoteFile, 4) = .sql then
Skip = False
else
Skip = True
end if
end if
with the script above i am not getting any errors but it does not skip any file. so i tried to use ItemSkip property as i found in the documentation that some programming environment like Delphi does not return values back to WodFtpDLX.
if itemtype = 0 then
ole_wodftp.object.ItemSkip = True
else
if Right(RemoteFile, 4) = .sql then
ole_wodftp.object.ItemSkip = False
else
ole_wodftp.object.ItemSkip = True
end if
end if
please give me any idea on the script above as i am getting errors like invalid property to object when using ItemSkip.
your help is very much appreciated.
thanks
Clark Manlosa
Re: Skip files in GetFiles Method
Hi Clark,
Can you please try instead True use value 1 and instead False use 0 value.
Something like this:
[code]if Right(RemoteFile, 4) = .sql then
Skip = 0
else
Skip = 1[/code]
Please try this in both your samples.
Let us know how it goes.
Regards,
Drazen
Re: Skip files in GetFiles Method
Hi Clark,
Can you please try instead True use value 1 and instead False use 0 value.Something like this:
[code]if Right(RemoteFile, 4) = .sql then
Skip = 0
else
Skip = 1[/code]Please try this in both your samples.
Let us know how it goes.
Regards,
Drazen
Hi Drazen,
I tried the above suggestion but loopitem event does allow an integer or numeric value for the variable Skip since it was declared as boolean data type.
I also tried it with ItemSkip property but I am still getting the same error invalid property to object .
Hope to hear more suggestions from you.
Thanks so much.
Clark
Re: Skip files in GetFiles Method
Hi Clark,
What version of the component are you using? Can you check what does Version property return?
Also, can you access any other property from LoopItem Event?
Does LoopItem Event get triggered at all?
Regards,
Damba
Re: Skip files in GetFiles Method
Hi Damba,
Thank you for the reply.
The version i am testing is DEMO 2.8.2.415.
Also, I am certain that LoopItem event was triggered because of the breakpoints I inserted in the event.
Hope to get more suggestions.
Thanks again.
Regards,
Clark
Re: Skip files in GetFiles Method
Clark,
Can you tell me RemoteFile value when LoopItem Event triggers? Does the code actually get to Skip line in your code?
Also, are you using .dll or .ocx version of the component?
Do you use Blocking or non-blocking mdoe?
Regards,
Damba
Re: Skip files in GetFiles Method
Hi Drazen,
Everytime the LoopItem event is triggered the value of RemoteFile changes to one of the files in the FTP server. e.g. test.sql, test1.sql and setup.exe.
Also, I traced the code in the LoopItem event to verify if values are set to Skip variable. The trace also shows that the code get to skip line. So far, it is doing that.
I am using the .ocx version of the component since this is so far I knew supported by Powerbuilder
With regards to blocking or non-blocking, I tried blocking mode but still I encounter the same problem.
Thanks
Regards,
Clark
Re: Skip files in GetFiles Method
Clark,
I've just tried the following in PB10 (I don't have PB7 to try it on):
[code]if right(remotefile,4) = .cfg then
ole_2.object.ItemSkip = true
messagebox( Item skipped: , remotefile)
end if[/code]
The above code worked perfectly for me. The .cfg file wasn't downloaded and I received a messagebox with the file in question.
I also tried it with Skip parameter, and setting it to true, but that doesn't work.
However, you mentioned that ItemSkip doesn't work, and you get compile error when you try using it.
Can you contact us at techsupport@weonlydo.com ? I can send you my sample to try it.
Regards,
Damba