SoftTree Technologies SoftTree Technologies
Technical Support Forums
RegisterSearchFAQMemberlistUsergroupsLog in
Dir returns error if no files match mask

 
Reply to topic    SoftTree Technologies Forum Index » 24x7 Scheduler, Event Server, Automation Suite View previous topic
View next topic
Dir returns error if no files match mask
Author Message
Greig



Joined: 15 Mar 2001
Posts: 49

Post Dir returns error if no files match mask Reply with quote

When using the JAL Dir statement to return a file list, I get the following error if the mask does not match any files: "Error starting file search operation".

For example, the following code returns an error because I have no files in the root of my c:\ drive which match the mask random.*

Dim file_list, string
Dir ("c:\\random.*", file_list)

Thu Mar 15, 2001 6:43 am View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 7948

Post Re: Dir returns error if no files match mask Reply with quote

Try this

Dim found, boolean
Dim file_list, string

FileExists "c:\\random.*", found
If found, DO_JOB, EXIT

DO_JOB:
Dir "c:\\random.*", file_list

EXIT:

: When using the JAL Dir statement to return a file list, I get the following
: error if the mask does not match any files: "Error starting file
: search operation".

: For example, the following code returns an error because I have no files in
: the root of my c:\ drive which match the mask random.*

: Dim file_list, string
: Dir ("c:\\random.*", file_list)

Thu Mar 15, 2001 9:27 am View user's profile Send private message
Greig



Joined: 15 Mar 2001
Posts: 49

Post Re: Dir returns error if no files match mask Reply with quote

Thanks. This works.

However, I would not expect the Dir command to generate an error if it returns no files. I think this should be listed as a bug and fixed in a future version.

Greig



Thu Mar 15, 2001 12:01 pm View user's profile Send private message
Display posts from previous:    
Reply to topic    SoftTree Technologies Forum Index » 24x7 Scheduler, Event Server, Automation Suite All times are GMT - 4 Hours
Page 1 of 1

 
Jump to: 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


 

 

Powered by phpBB © 2001, 2005 phpBB Group
Design by Freestyle XL / Flowers Online.