Skip files in GetFiles Method - WeOnlyDo Discussion board

Skip files in GetFiles Method (wodSFTP / wodSFTP.NET / wodSFTPdll)

by Clark Manlosa, Tuesday, May 20, 2008, 09:16 (6036 days ago)

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

by woddrazen, Tuesday, May 20, 2008, 09:37 (6036 days ago) @ Clark Manlosa

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

by Clark Manlosa, Tuesday, May 20, 2008, 17:40 (6036 days ago) @ woddrazen

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

by wodDamir, Tuesday, May 20, 2008, 19:40 (6036 days ago) @ Clark Manlosa

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

by Clark Manlosa, Wednesday, May 21, 2008, 10:20 (6035 days ago) @ wodDamir

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

by wodDamir, Wednesday, May 21, 2008, 11:59 (6035 days ago) @ Clark Manlosa

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

by Clark Manlosa, Wednesday, May 21, 2008, 12:50 (6035 days ago) @ wodDamir

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

by wodDamir, Wednesday, May 21, 2008, 13:09 (6035 days ago) @ Clark Manlosa

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