Jump to content

Recommended Posts

Posted

I need help with an array, (I'm hoping this is the way to go if not please point me in the right direction)

I'm trying to make a script that will create pdfs from a random name word file.

I have a vbs script that creates the pdf, and it's command line driven so I'm good on that part

at any given time, there will only be 1 word file in c:folder

this is what I have so far

#include <File.au3>
 #include <Array.au3>

$file =  _FileListToArray ( "c:\folder" , "*.doc" )
$file2 = _ArrayDisplay ($file, "" , "1:1")


ShellExecute("c:\folder\doc2pdf.vbs" , $file )


;~ Sleep(4000)
;~ FileDelete $file


;~ ShellExecute("notepad" , "\\webserver\main_site\pages\index.htm")
  • Moderators
Posted

kaisies,

  Quote

Please note _FileListToArray is troublesome at time

Some examples please - otherwise how can we improve it. ;)

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

  Reveal hidden contents

 

Posted

  On 11/10/2014 at 6:40 PM, JohnOne said:

What exactly is troublesome about _FileListToArray?

 

  On 11/10/2014 at 6:42 PM, Melba23 said:

kaisies,

Some examples please - otherwise how can we improve it. ;)

M23

 

That's what I've read on these forums, to the effect of that _FileListtoArray() uses the windows search function, and doesn't always return expected results.  I could very well be mistaken, just trying to help :)

  • Moderators
Posted

kaisies,

The only time I can remember there being any discussion about this matter was in this thread - which discussed why there were differences between the returns from _FileListToArray & _FileListToArrayRec (read the topic to find out ;)). These differences only arise when using pretty complicated wildcard filters where the standard Windows search used by _FileListToArray can indeed return results which appear not to match - although in the vast majority of cases the return is as expected. I added something to the Remarks section of both of these functions explaining that the user had to make a choice between speed and accuracy if the required filters were that complex. :)

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

  Reveal hidden contents

 

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...