Jump to content

"For...In" not working with _FileReadToArray


Recommended Posts

Hello,

 

When executing the script below (file "Excecoes_Desktop.txt" attached), the "For ... In" loop does not execute. I wonder why?

 

#include <File.au3>

Dim $matriz_excecoes_predefinidas [1]
_FileReadToArray ( "C:\Excecoes_Desktop.txt" , $matriz_excecoes_predefinidas , 0 , Chr(9) )

_ArrayDisplay ($matriz_excecoes_predefinidas)

For $excecao_predefinida In $matriz_excecoes_predefinidas

    MsgBox(0,"",$excecao_predefinida)

Next

Excecoes_Desktop.txt

Link to comment
Share on other sites

  • Developers

The _ArrayDisplay() also doesn't do anything ...right?

I think you wan to change this line:

_FileReadToArray ( "Excecoes_Desktop.txt" , $matriz_excecoes_predefinidas)

Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

  • Developers

Agree...  but try anyway what I suggested.  With those parameters, the array changes from single to multiple columns which causes the issue in the For ..In loop.

Jos 

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

I did, I had to remove the CHR (9):

 

#include <File.au3>

Dim             $matriz_excecoes_predefinidas [1]
_FileReadToArray ( "C:\Excecoes_Desktop.txt" , $matriz_excecoes_predefinidas , 0 )

_ArrayDisplay ($matriz_excecoes_predefinidas)

For $excecao_predefinida In $matriz_excecoes_predefinidas

    MsgBox(0,"",$excecao_predefinida)

Next

Thank you.

Edited by Darien
Link to comment
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
 Share

  • Recently Browsing   0 members

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