Jump to content

display array - why does ths happen?


Recommended Posts

the array at the end seems to be displaying blank but I see the values in the array...

#include <Date.au3>
#include <Excel.au3>
#include <File.au3>
#include <Array.au3>
Opt("OnExitFunc", "OnAutoItExit")
If UBound(ProcessList(@ScriptName)) > 2 Then
    MsgBox(64, "* NOTE *", "Program already running", 5)
    Exit
EndIf

$DATE = StringReplace(_DateAdd('d', -1, _NowCalcDate()), "/", "")
$ExcelDoc1 = "C:\Data\AUT.xls"
$oExcel1 = _ExcelBookOpen($ExcelDoc1, 0, True)
_ExcelSheetActivate($oExcel1, "AUT")
$NowCell1 = _ExcelReadArray($oExcel1, 1, 1, 255, 1, 1)
;var2=start down 1, var3=start right 2, var4=end at 255 (MAX = 256 which is the Max # of cells excel can have if starting from cell 1)
;var5=default is 0 which is right (1=down), var6=sets index base of 0 or 1 of the array created
;starting index base at 1 makes $array[0] have the # of array objects
$N1 = 1
$Error1 = False

For $C1 = 0 To $NowCell1[0];Search all cells in the row
    If $NowCell1[$N1] = "0" Then;For some reason excell puts 6 0's at the end of the date
        ExitLoop
    Else
        
#Region --- CodeWizard generated code Start ---
;MsgBox features: Title=Yes, Text=Yes, Buttons=OK, Icon=Info
        MsgBox(64,"data found in cell",$NowCell1[$N1])
#EndRegion --- CodeWizard generated code End ---Box 
        $N1 = $N1 + 1
    EndIf
Next
$aArray = _ExcelReadSheetToArray($oExcel1);Using Default Parameters
MsgBox(0, "_ArrayToString() getting $avArray items 1 to 7", _ArrayToString($aArray, @TAB, 1, 7))
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...