Jump to content
Sign in to follow this  
pintas

Why doesn't this work?

Recommended Posts

I want the _FileListToArray to display only '.docx' files, but i want the results to appear in _ArrayDisplay without the '.docx' in it.

My thinking seems correct but the result tells me it's not.

The _ArrayTrim would trim the results to the right in 5 characters.

What is wrong with this?

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

$FileList =_FileListToArray('D:\WordDocs\','*.docx',1)
$FileListNoDocx = _ArrayTrim($FileList, 5, 1)
_ArrayDisplay($FileListNoDocx)

Share this post


Link to post
Share on other sites

Yet again you saved me.

Still don't understand why it doesn't work...

Thanks!

It doesn't work because _ArrayTrim function trims a certain number of characters from all elements in an array but DOES NOT create a new one so it is modifiying the existing array $FileList.

You are welcome :huh2:

Share this post


Link to post
Share on other sites

It doesn't work because _ArrayTrim function trims a certain number of characters from all elements in an array but DOES NOT create a new one so it is modifiying the existing array $FileList.

You are welcome :huh2:

Ah, now i understand. ;)

Share this post


Link to post
Share on other sites

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
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...