Jump to content
Sign in to follow this  
JimC

Strange problem with For loop

Recommended Posts

JimC

I verify that there is information in the array and I want to write it our to another file, but it seems to just skip over the for loop. The msgbox under the for loop never occurs. Any help would be greatly appreciated.

If Not _FileReadToArray($xpcd &"\I386\WINNT.SIF",$arr4) Then

MsgBox(4096,"Error", " Error reading log to Array error:" & @error)

Exit

EndIf

_ArrayDisplay($arr4)

For $u = 1 to _ArrayMaxIndex($arr4) - 1; counter for array

msgbox(1,"",$arr4[$u])

_FileWriteToLine($ImageBuild,$linecount1,$arr4[$u])

$linecount1=$linecount1+1

Next

Share this post


Link to post
Share on other sites
JimC

Worked .... thanks !! not quite sure why.

Share this post


Link to post
Share on other sites
Nahuel

Maybe this will answer:

#include <Array.au3>
Dim $myarray[8]=[1,2,3,4,5,12]
$max=_ArrayMaxIndex($myarray);Returns the index where the highest value occurs in the array.
MsgBox(0,"",$max)

$max1=UBound($myarray);Returns the size of array dimensions.
MsgBox(0,"",$max1)
Edited by Nahuel

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  

×