udfArrayDisplayElements
int udfArrayDisplayElements (arr, int)
;------------------------------------------------------------------------------------------------------------------------------------------
#DefineFunction udfArrayDisplayElements (arrArray, intSecondsToWait)
If ArrInfo (arrArray, 6) == 0 Then Return Message ("Array|Elements=0", "No elements ... nothing to do.")
; objWsh = ObjectCreate ("WScript.Shell")
strElems = "Array|Dim=" : ArrInfo (arrArray, 0) : "|Elements=" : ArrInfo (arrArray, 6)
arrE = ArrDimension (6)
For intD = 0 To 5
   arrE [intD] = ArrInfo (arrArray, intD)
Next
For intD = 1 To arrE [0]
   arrE [intD] = arrE [intD] - 1
Next
Switch arrE [0]
Case 1
   intElem = -1
   For intA = 0 To arrE [1]
      intElem = intElem + 1
      strElem = "|Index=" : intElem : ":" : intA
      strContent = "Content=" : arrArray [intA]
      ; If 2 == objWsh.Popup(strContent, intSecondsToWait, : strElems : strElem, 1) Then Return
      If Display (intSecondsToWait, strElems : strElem, strContent) Then If DllCall ("USER32.DLL", long : "GetAsyncKeyState", word : 27) Then Return
   Next
   Break
Case 2
   intElem = -1
   For intA = 0 To arrE [1]
      For intB = 0 To arrE [2]
         intElem = intElem + 1
         strElem = "|Index=" : intElem : ":" : intA : "," : intB
         strContent = "Content=" : arrArray [intA, intB]
         ; If 2 == objWsh.Popup(strContent, intSecondsToWait, : strElems : strElem, 1) Then Return
         If Display (intSecondsToWait, strElems : strElem, strContent) Then If DllCall ("USER32.DLL", long : "GetAsyncKeyState", word : 27) Then Return
      Next
   Next
   Break
Case 3
   intElem = -1
   For intA = 0 To arrE [1]
      For intB = 0 To arrE [2]
         For intC = 0 To arrE [3]
            intElem = intElem + 1
            strElem = "|Index=" : intElem : ":" : intA : "," : intB : "," : intC
            strContent = "Content=" : arrArray [intA, intB, intC]
            ; If 2 == objWsh.Popup(strContent, intSecondsToWait, : strElems : strElem, 1) Then Return
            If Display (intSecondsToWait, strElems : strElem, strContent) Then If DllCall ("USER32.DLL", long : "GetAsyncKeyState", word : 27) Then Return
         Next
      Next
   Next
   Break
Case 4
   intElem = -1
   For intA = 0 To arrE [1]
      For intB = 0 To arrE [2]
         For intC = 0 To arrE [3]
            For intD = 0 To arrE [4]
               intElem = intElem + 1
               strElem = "|Index=" : intElem : ":" : intA : "," : intB : "," : intC : "," : intD
               strContent = "Content=" : arrArray [intA, intB, intC, intD]
               ; If 2 == objWsh.Popup(strContent, intSecondsToWait, : strElems : strElem, 1) Then Return
               If Display (intSecondsToWait, strElems : strElem, strContent) Then If DllCall ("USER32.DLL", long : "GetAsyncKeyState", word : 27) Then Return
            Next
         Next
      Next
   Next
   Break
Case 5
   intElem = -1
   For intA = 0 To arrE [1]
      For intB = 0 To arrE [2]
         For intC = 0 To arrE [3]
            For intD = 0 To arrE [4]
               For intE = 0 To arrE [5]
                  intElem = intElem + 1
                  strElem = "|Index=" : intElem : ":" : intA : "," : intB : "," : intC : "," : intD : "," : intE
                  strContent = "Content=" : arrArray [intA, intB, intC, intD, intE]
                  ; If 2 == objWsh.Popup(strContent, intSecondsToWait, : strElems : strElem, 1) Then Return
                  If Display (intSecondsToWait, strElems : strElem, strContent) Then If DllCall ("USER32.DLL", long : "GetAsyncKeyState", word : 27) Then Return
               Next
            Next
         Next
      Next
   Next
   Break
EndSwitch
:CANCEL
#EndFunction
;------------------------------------------------------------------------------------------------------------------------------------------


; Test.

; Example 1.
; Create a WB Dim-1 array.
Message ("WB example for udfArrayDisplayElements.", "Next step:" : @LF : "Create Dim-1 WB array and display all elements in WB array.")
arrWB = ArrDimension (7)
arrWB[0] = "Monday"
arrWB[1] = "Tuesday"
arrWB[2] = "Wednesday"
arrWB[3] = "Thursday"
arrWB[4] = "Friday"
arrWB[5] = "Saturday"
arrWB[6] = "Sunday"
udfArrayDisplayElements (arrWB, 3)


; Example 2.
; Create a WB Dim-2 array.
Message ("WB example for udfArrayDisplayElements.", "Next step:" : @LF : "Create Dim-2 WB array and display all elements in WB array.")
arrWB = ArrDimension (4, 2)
ArrInitialize (arrWB, "Dim-2")
udfArrayDisplayElements (arrWB, 2)


; Example 3.
; Create a WB Dim-3 array.
Message ("WB example for udfArrayDisplayElements.", "Next step:" : @LF : "Create Dim-3 WB array and display all elements in WB array.")
arrWB = ArrDimension (2, 2, 2)
ArrInitialize (arrWB, "Dim-3")
udfArrayDisplayElements (arrWB, 2)


; Example 4.
; Create a WB Dim-4 array.
Message ("WB example for udfArrayDisplayElements.", "Next step:" : @LF : "Create Dim-4 WB array and display all elements in WB array.")
arrWB = ArrDimension (2, 2, 2, 2)
ArrInitialize (arrWB, "Dim-4")
udfArrayDisplayElements (arrWB, 1)


; Example 5.
; Create a WB Dim-5 array.
Message ("WB example for udfArrayDisplayElements.", "Next step:" : @LF : "Create Dim-5 WB array and display all elements in WB array.")
arrWB = ArrDimension (2, 2, 2, 2, 2)
ArrInitialize (arrWB, "Dim-5")
udfArrayDisplayElements (arrWB, 1)

Exit