Ticket #3078: test.au3

File test.au3, 1.2 KB (added by jayme_fishman@…, 7 years ago)

test script to go with test data to reproduce possible bug with _ArrayUnique

Line 
1#include <Excel.au3>
2#include <Array.au3>
3
4func _openSourceData()
5$sourcefile=FileOpenDialog("Please select source file",@ScriptDir,"All (*.*)")
6    If @error Then
7        ; Display the error message.
8        MsgBox($MB_SYSTEMMODAL, "", "No file(s) were selected.")
9    else
10    ; Create application object
11    Local $oAppl = _Excel_Open()
12    If @error Then Exit MsgBox(16, "Excel UDF: _Excel_BookOpen Example", "Error creating the Excel application object." & @CRLF & "@error = " & @error & ", @extended = " & @extended)
13    ; *****************************************************************************
14    ; Open an existing workbook and return its object identifier.
15    ; *****************************************************************************
16    Local $sWorkbook = $sourcefile
17    $oWorkbook = _Excel_BookOpen($oAppl, $sWorkbook, Default, Default, True)
18    If @error Then Exit MsgBox($MB_SYSTEMMODAL, "Excel UDF: _Excel_BookOpen Example 1", "Error opening '" & $sWorkbook & "'." & @CRLF & "@error = " & @error & ", @extended = " & @extended)
19        $sourceArray=_Excel_RangeRead($oWorkbook)
20        _ArrayDisplay($sourceArray)
21        $unique=_ArrayUnique($sourceArray)
22        _ArrayDisplay($unique)
23    EndIf
24EndFunc
25_openSourceData()