Jump to content
Sign in to follow this  
ajit

_FileListToArray problem

Recommended Posts

ajit

Hi:

When i try to enlist files using _FileListToArray the last file is always enlisted first. There is no problem with other files. Only the last file comes first.

Could someone help me with this.

Thanking in anticipation.

Regards

Ajit.

The code below almost straight from helpfile:

#include<File.au3>

$folder = FileSelectFolder("Select Folder", "", 2)

$avCommon = _FileListToArray($folder)

$sFile = @ScriptDir & "\Test.txt"

; Write array to file by string file name

_FileWriteFromArray($sFile, $avCommon, 1)

; Display results

Run("notepad.exe " & $sFile)

Share this post


Link to post
Share on other sites
dantay9

I ran the script and got the files to be in alphabetical order. The last one wasn't first. I can't help you if the error isn't reproducable.


[font="Verdana"] [size="2"]"[/size][/font]Failure is not an option -- it comes packaged with Windows"[font="Verdana"][size="2"] Gecko Web Browser[/size][/font][font="Verdana"][size="2"], [/size][/font][font="Verdana"][size="2"]Yahtzee![/size][/font][font="Verdana"][size="2"], Toolbar Launcher (like RocketDock)[/size][/font][font="Verdana"][size="2"]Internet Blocker, Simple Calculator, Local Weather, Easy GDI+ GUI [/size][/font][font="Verdana"][size="2"]Triangle Solver, TCP File Transfer, [/size][/font][font="Verdana"][size="2"]Valuater's Autoit Wrappers[/size][/font][font="Verdana"][size="3"][size="2"][size="2"]OOP In AutoIt[/size][/size][/size][/font][font="Verdana"][size="2"][size="1"]Using Windows XP SP3, 1GB RAM, AMD Athlon Processor @ 2.1 GHzCheck me out at gadgets.freehostrocket.com[/size][/size][/font]

Share this post


Link to post
Share on other sites
ajit

I ran the script and got the files to be in alphabetical order. The last one wasn't first. I can't help you if the error isn't reproducable.

@dantay9

Thanks for your reply. I shall try running the script on another PC.

Thanks again.

Ajit

Share this post


Link to post
Share on other sites
dantay9

Try a different folder. Maybe it is just that folder.


[font="Verdana"] [size="2"]"[/size][/font]Failure is not an option -- it comes packaged with Windows"[font="Verdana"][size="2"] Gecko Web Browser[/size][/font][font="Verdana"][size="2"], [/size][/font][font="Verdana"][size="2"]Yahtzee![/size][/font][font="Verdana"][size="2"], Toolbar Launcher (like RocketDock)[/size][/font][font="Verdana"][size="2"]Internet Blocker, Simple Calculator, Local Weather, Easy GDI+ GUI [/size][/font][font="Verdana"][size="2"]Triangle Solver, TCP File Transfer, [/size][/font][font="Verdana"][size="2"]Valuater's Autoit Wrappers[/size][/font][font="Verdana"][size="3"][size="2"][size="2"]OOP In AutoIt[/size][/size][/size][/font][font="Verdana"][size="2"][size="1"]Using Windows XP SP3, 1GB RAM, AMD Athlon Processor @ 2.1 GHzCheck me out at gadgets.freehostrocket.com[/size][/size][/font]

Share this post


Link to post
Share on other sites
ajit

Try a different folder. Maybe it is just that folder.

@dantay9

I have tried multiple folders; the problem is persistent, i have tried with different number of files(5-1000 files) with different extensions.

Thanks anyway.

Regards

Ajit

Share this post


Link to post
Share on other sites
dantay9

Just to be clear. The files are in alphabetical order, but the last file (around z) is the first file and the first file (around a) is the last file. The first and last files are swapped. If you can't find the answer, you could just swap the two positions or just use ArraySort. See if that works.


[font="Verdana"] [size="2"]"[/size][/font]Failure is not an option -- it comes packaged with Windows"[font="Verdana"][size="2"] Gecko Web Browser[/size][/font][font="Verdana"][size="2"], [/size][/font][font="Verdana"][size="2"]Yahtzee![/size][/font][font="Verdana"][size="2"], Toolbar Launcher (like RocketDock)[/size][/font][font="Verdana"][size="2"]Internet Blocker, Simple Calculator, Local Weather, Easy GDI+ GUI [/size][/font][font="Verdana"][size="2"]Triangle Solver, TCP File Transfer, [/size][/font][font="Verdana"][size="2"]Valuater's Autoit Wrappers[/size][/font][font="Verdana"][size="3"][size="2"][size="2"]OOP In AutoIt[/size][/size][/size][/font][font="Verdana"][size="2"][size="1"]Using Windows XP SP3, 1GB RAM, AMD Athlon Processor @ 2.1 GHzCheck me out at gadgets.freehostrocket.com[/size][/size][/font]

Share this post


Link to post
Share on other sites
ajit

Just to be clear. The files are in alphabetical order, but the last file (around z) is the first file and the first file (around a) is the last file. The first and last files are swapped. If you can't find the answer, you could just swap the two positions or just use ArraySort. See if that works.

@dantay9

Thanks very much for your help. I shall try your suggestions.

Regards

Ajit

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  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.