OR condition in do while

OR condition in do while.

Hi All,

I want my do while to execute till the time a file is not present after download OR it should execute till my present time < 1 minute. Below is what I did:

Assign Time1Min = Now.Add(1)

I am trying to execute a Do while with below 2 condition:

(Now < Time1Min) OR (Not File.exists(“C:\Temp\abc.csv”))

The loop is continuing till the csv file is not there. I want the loop to end within 1 minute even if the file is not there.

It is just taking the 2nd condition.

Please help

1 Like

Use greater than symbol

Now > Time1Min OR

As I could see the Time1Min has 1 min extra in it

or

Use a AND condition instead of Or

Cheers @Sumit_Ghosh1

Hi,

I think it should be Now.AddMinutes(1)

Regards,

Yup.

sorry for typo. I did the same

Addminutes

Is it the case that you are implementing a logic for waiting for downloads?
if yes also have a look wait for download activity

HI,

Alright.

As @Palaniyappan mentioned, And ( or AndAlso) operator should be used because this is condition of continue loop.

(Now < Time1Min) AndAlso (Not File.exists("C:\Temp\abc.csv"))

FYI, if rewrite to condition of exit, it will be OR condition like

(Now > Time1Min) Or (File.exists("C:\Temp\abc.csv"))

Regards,