Jump to content

FULL _ArrayDisplay which contains another arrays


Recommended Posts

_ArrayDisplay function show content of the array variable in table (gui listview) but if any variable inside this array is another array too, then it will show "{Array}". I am looking for function to show another table in the table cell instead of "{Array}".

Link to comment
Share on other sites

  • Moderators

mandriospo,

Just use _ArrayDisplay on the element of the first array which shows "{Array}".

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

@mandriospo you would like this:

Local $a = [1, 2, 3]
Local $b = ["x", "y", $a, "z"]

_VarDump($b)

to return/display that:

Array[4]
      [0] => String (1)               'x'
      [1] => String (1)               'y'
      [2] => Array[3]
            [0] => Int32              1
            [1] => Int32              2
            [2] => Int32              3
      [3] => String (1)               'z'

Then the function _VarDump is for you. See

 

This wonderful site allows debugging and testing regular expressions (many flavors available). An absolute must have in your bookmarks.
Another excellent RegExp tutorial. Don't forget downloading your copy of up-to-date pcretest.exe and pcregrep.exe here
RegExp tutorial: enough to get started
PCRE v8.33 regexp documentation latest available release and currently implemented in AutoIt beta.

SQLitespeed is another feature-rich premier SQLite manager (includes import/export). Well worth a try.
SQLite Expert (freeware Personal Edition or payware Pro version) is a very useful SQLite database manager.
An excellent eBook covering almost every aspect of SQLite3: a must-read for anyone doing serious work.
SQL tutorial (covers "generic" SQL, but most of it applies to SQLite as well)
A work-in-progress SQLite3 tutorial. Don't miss other LxyzTHW pages!
SQLite official website with full documentation (may be newer than the SQLite library that comes standard with AutoIt)

Link to comment
Share on other sites

15 minutes ago, jchd said:

@mandriospo you would like this:

Local $a = [1, 2, 3]
Local $b = ["x", "y", $a, "z"]

_VarDump($b)

to return/display that:

Array[4]
      [0] => String (1)               'x'
      [1] => String (1)               'y'
      [2] => Array[3]
            [0] => Int32              1
            [1] => Int32              2
            [2] => Int32              3
      [3] => String (1)               'z'

Then the function _VarDump is for you. See

 

I would prefer "table" version but this is fine too.
Unfortunately I can't get _VarDump function. It says Sorry, we can't show this content because you do not have permission to see it.

Link to comment
Share on other sites

  • Developers
5 minutes ago, mandriospo said:

I would prefer "table" version but this is fine too.

What holding you back developing this option and proposing an update to the _ArrayDisplay() UDF? ;) 

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

21 minutes ago, mandriospo said:

I can't get _VarDump function

Yes, it is because the function is located in a restricted area.  Maybe @jchd could make it as a Script Example (if you ask politely) :)

Link to comment
Share on other sites

@mandriospo

#include <array.au3>
Local $a = ['a', 2, 3]
Local $b = ["x", "y", $a, "z"]
_ArrayDisplayMArray($b)
Func _ArrayDisplayMArray($var)
    Local $TMP[0]
    For $i = 0 to UBound($var) - 1
        _ArrayAdd($TMP, $var[$i])
    Next
    Return _ArrayDisplay($TMP)
EndFunc   ;==>_ArrayDisplayMArray

 

Edited by ad777

iam ِAutoit programmer.

best thing in life is to use your Brain to

Achieve

everything you want.

Link to comment
Share on other sites

  • Moderators

ad777,

And just how is that supposed to help? It now looks as if the $b array has 6 string elements rather than 3 of them plus an embedded array.

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

  • Moderators

ad777,

But it does not help him at all as it does not make clear that 3 of the elements displayed are actually from another array within the $b array. The display you produce is totally misleading.

M23 

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

11 minutes ago, Melba23 said:

ad777,

But it does not help him at all as it does not make clear that 3 of the elements displayed are actually from another array within the $b array. The display you produce is totally misleading.

M23 

test.png

iam ِAutoit programmer.

best thing in life is to use your Brain to

Achieve

everything you want.

Link to comment
Share on other sites

  • Moderators

ad777,

Yes, that is what you get when you use _ArrayDisplay on the original array, but your function produces an _ArrayDisplay dialog showing a 6-element 1D array, which is not the same thing and is misleading.

Here is a quick and dirty idea of how your script could be expanded to give an _ArrayDisplay dialog which offers some idea of what is going on:

#include <Array.au3>

Local $a = ['a', 2, 3]
Local $b = ["x", "y", $a, "z"]

_ArrayDisplayExpand($b)

Func _ArrayDisplayExpand($aArray)

    For $i = 0 to UBound($aArray) - 1
        ; Check if element is array
        If VarGetType($aArray[$i]) = "Array" Then
            ; Read array
            $aTemp = $aArray[$i]
            ; Insert elements of the inset array
            $k = $i + 1
            For $j = 0 To UBound($aTemp) - 1
                _ArrayInsert($aArray, $k, "---" & $aTemp[$j])
                $k += 1
            Next
        EndIf
    Next

    Return _ArrayDisplay($aArray)

EndFunc   ;==>_ArrayDisplayMArray

But it is far from perfect as it still shows a 7-element 1D array. And heaven knows how it could be expanded to a 2D version!

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

  • Moderators

Gianni,

Clever - missed it the first time round.

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

  • Moderators

pixelsearch,

Funny you should say that - it was one of the original reasons for including that button when I rewrote the function all those years ago!

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

@Melba23: glad it reminded you that, I recognized M23's touch in it since day #1
Please let me quote Larry, as found in help file, topic "AutoIt and Developer History"' :

"One of my frustrations with the AutoIt community, or just in freeware in general, I guess, is that the efforts and hours will never truly be appreciated. I am only fueled by pride in this endeavor."
Lar.

Sorry Larry, they are truly appreciated by many of us, with full respect to all these hours/days/months/years that you, with all other developers, spent on the AutoIt project :thumbsup:

Link to comment
Share on other sites

Sorry, didn't notice where the post I linked was sitting.

Here's the meat:

#AutoIt3Wrapper_UseUpx=n
#AutoIt3Wrapper_Compile_Both=n
;~ #AutoIt3Wrapper_UseX64=y
#AutoIt3Wrapper_Run_AU3Check=n

#include-once

#include <Math.au3>

Global Const $_TAB = '      '

; user-callable function, so that noone messes with __VarDump indentation
; $vVar is the variable to be dumped
; $iLimit is the max number of entries of an array, map or DllStruct array element to be displayed in full
Func _VarDump(ByRef $vVar, $iLimit = 20)
    If $iLimit < 3 Then $iLimit = 0
    Return(__VarDump($vVar, $iLimit))
EndFunc   ; =>_VarDump


Func __VarDump(ByRef $vVar, $iLimit, $sIndent = '')
    Local $ret, $len, $ptr

    Select

        Case IsString($vVar)
            $len = StringLen($vVar)
            Return 'String       (' & $len & ") " & __DumpStr($vVar)

        Case VarGetType($vVar) = "Double"
            Return 'Double       ' & $vVar & (IsInt($vVar) ? '.0' : '')

        Case IsInt($vVar)
            Return VarGetType($vVar) & '        ' & $vVar

        Case IsArray($vVar)
            Local $iDimensions = UBound($vVar, 0)
            Local $iCells = 1
            $ret = 'Array'
            $iDimensions -= 1
            For $i = 0 To $iDimensions
                $ret &= '[' & UBound($vVar, $i + 1) & ']'
                $iCells *= UBound($vVar, $i + 1)
            Next
            If $iCells = 0 Then
                Return $ret & $_TAB & '  (array is empty)'
            Else
                Return $ret & @CRLF & __VarDumpArray($vVar, $iLimit, $sIndent)
            EndIf

        Case IsBinary($vVar)
            $len = BinaryLen($vVar)
            $ret = 'Binary       (' & BinaryLen($vVar) & ') '
            Return($ret & (($len <= 32) ? $vVar : BinaryMid($vVar, 1, 16) & ' ... ' & StringTrimLeft(BinaryMid($vVar, $len - 15, 16), 2)))

        Case IsBool($vVar)
            Return 'Boolean      ' & $vVar

        Case IsKeyword($vVar)
            Return('Keyword      ' & ($vVar = Null ? 'Null' : ($vVar = Default ? 'Default' : 'Other keyword')))

        Case IsHWnd($vVar)
            Return 'HWnd         ' & $vVar

        Case IsPtr($vVar)
            Return 'Pointer      ' & $vVar

        Case IsObj($vVar)
            Return 'Object       ' & ObjName($vVar)

        Case IsFunc($vVar)
            Return StringFormat('%-13s', VarGetType($vVar)) & FuncName($vVar)

        Case IsDllStruct($vVar)
            $len = DllStructGetSize($vVar)
            $ptr = DllStructGetPtr($vVar)
            $ret = 'Struct       (' & $len & ') @:' & Hex($ptr) & ' (structure alignment is unknown)' & @CRLF
            Local $nbElem = 1, $idx, $incr, $data, $type, $indent = $sIndent & $_TAB, $oldvalue, $readvalue, $field, $elem
            While 1
                $data = DllStructGetData($vVar, $nbElem)
                If @error = 2 Then ExitLoop
                $type = VarGetType($data)
                $idx = 1
                $incr = 0
                ; determine max index of element
                While 1
                    DllStructGetData($vVar, $nbElem, 2 * $idx)
                    If @error = 3 Then ExitLoop
                    $incr = $idx
                    $idx *= 2
                WEnd
                ; index is in [$idx, (2 * $idx) - 1]
                $idx += $incr
                Do
                    DllStructGetData($vVar, $nbElem, $idx)
                    If @error = 3 Then
                        ; approach is asymetric (upper bound is too big)
                        $idx -= ($incr = 1) ? 1 : $incr / 2
                    Else
                        $idx += Int($incr / 2)
                    EndIf
                    $incr = Int($incr / 2)
                Until $incr = 0
                Switch $type
                    Case "Int32", "Int64"
                        $ret &= $indent
                        $data = DllStructGetData($vVar, $nbElem, 1)
                        DllStructSetData($vVar, $nbElem, 0x7777666655554433, 1)
                        $readvalue = DllStructGetData($vVar, $nbElem, 1)
                        Switch $readvalue
                            Case 0x7777666655554433
                                $elem = "int64"
                                ; alias: uint64
                                ; alias: int_ptr(x64), long_ptr(x64), lresult(x64), lparam(x64)
                                ; alias: uint_ptr(x64), ulong_ptr(x64), dword_ptr(x64), wparam(x64)
                            Case 0x55554433
                                DllStructSetData($vVar, $nbElem, 0x88887777, 1)
                                $readvalue = DllStructGetData($vVar, $nbElem, 1)
                                $elem = ($readvalue > 0 ? "uint" : "int")
                                ; int aliases: long, bool, int_ptr(x86), long_ptr(x86), lresult(x86), lparam(x86);
                                ; uint aliases: ulong, dword, uint_ptr(x86), ulong_ptr(x86), dword_ptr(x86), wparam(x86)
                            Case 0x4433
                                DllStructSetData($vVar, $nbElem, 0x8888, 1)
                                $readvalue = DllStructGetData($vVar, $nbElem, 1)
                                $elem = ($readvalue > 0 ? "ushort" : "short")
                                ; ushort alias: word
                            Case 0x33
                                $elem = "byte"
                                ; alias: ubyte
                        EndSwitch
                        DllStructSetData($vVar, $nbElem, $data, 1)
                        If $idx = 1 Then
                            $ret &= StringFormat('%-' & 9 + StringLen($len) & 's ', $elem) & $data & @CRLF
                        Else
                            $ret &= $elem & "[" & $idx & "]" & @CRLF
                            For $i = 1 To $idx
                                If $iLimit And $idx > $iLimit And $i > $iLimit Then
                                    $ret &= $indent & StringFormat('%-' & 9 + StringLen($len) & 's ', '') & '... there are ' & $idx - $iLimit & ' more ' & $elem & ' in this array' & @CRLF
                                    ExitLoop
                                Else
                                    $ret &= $indent & StringFormat('%-' & 9 + StringLen($len) & 's ', '') & DllStructGetData($vVar, $nbElem, $i) & @CRLF
                                EndIf
                            Next
                        EndIf
                    Case "String"
                        $oldvalue = DllStructGetData($vVar, $nbElem, 1)
                        DllStructSetData($vVar, $nbElem, ChrW(0x2573), 1)
                        $readvalue = DllStructGetData($vVar, $nbElem, 1)
                        DllStructSetData($vVar, $nbElem, $oldvalue, 1)
                        $elem = ($readvalue = ChrW(0x2573) ? "wchar" : "char")
                        If $idx > 1 Then $elem &= "[" & $idx & "]"
                        $ret &= $indent & StringFormat('%-' & 9 + StringLen($len) & 's ', $elem) & __DumpStr($data) & @CRLF
                    Case "Binary"
                        Local $blen = BinaryLen($data)
                        $elem = "byte"
                        If $idx > 1 Then $elem &= "[" & $idx & "]"
                        $ret &= $indent & StringFormat('%-' & 9 + StringLen($len) & 's ', $elem) & (($blen <= 32) ? $data : BinaryMid($data, 1, 16) & ' ... ' & StringTrimLeft(BinaryMid($data, $blen - 15, 16), 2)) & @CRLF
                    Case "Ptr"
                        $ret &= $indent
                        $elem = "ptr"
                        ; alias: hwnd, handle
                        If $idx = 1 Then
                            $ret &= StringFormat('%-' & 9 + StringLen($len) & 's ', $elem) & $data & @CRLF
                        Else
                            $ret &= $elem & "[" & $idx & "]" & @CRLF
                            For $i = 1 To $idx
                                $ret &= $indent & StringFormat('%-' & 9 + StringLen($len) & 's ', '') & DllStructGetData($vVar, $nbElem, $i) & @CRLF
                            Next
                        EndIf
                    Case "Double"
                        $ret &= $indent
                        $oldvalue = DllStructGetData($vVar, $nbElem, 1)
                        DllStructSetData($vVar, $nbElem, 10^-15, 1)
                        $readvalue = DllStructGetData($vVar, $nbElem, 1)
                        DllStructSetData($vVar, $nbElem, $oldvalue, 1)
                        $elem = ($readvalue = 10^-15 ? "double" : "float")
                        If $idx = 1 Then
                            $ret &= StringFormat('%-' & 9 + StringLen($len) & 's ', $elem) & $data & (IsInt($data) ? '.0' : '') & @CRLF
                        Else
                            $ret &= $elem & "[" & $idx & "]" & @CRLF
                            For $i = 1 To $idx
                                If $iLimit And $idx > $iLimit And $i > $iLimit Then
                                    $ret &= $indent & StringFormat('%-' & 9 + StringLen($len) & 's ', '') & '... there are ' & $idx - $iLimit & ' more ' & $elem & ' in this array' & @CRLF
                                    ExitLoop
                                Else
                                    $ret &= $indent & StringFormat('%-' & 9 + StringLen($len) & 's %s', '', DllStructGetData($vVar, $nbElem, $i)) & (IsInt(DllStructGetData($vVar, $nbElem, $i)) ? '.0' : '') & @CRLF
                                EndIf
                            Next
                        EndIf
                EndSwitch
                $nbElem += 1
            WEnd
            Return StringTrimRight($ret, 2)

        Case IsMap($vVar)
            Local $iCells = UBound($vVar)
            $ret = 'Map[' & $iCells & ']'
            If $iCells = 0 Then
                Return $ret & $_TAB & '  (map is empty)'
            Else
                Return $ret & @CRLF & __VarDumpMap($vVar, $iLimit, $sIndent)
            EndIf

        Case Else
            Return StringFormat('%-13s', VarGetType($vVar)) & $vVar

    EndSelect
EndFunc   ;==>__VarDump


Func __VarDumpArray(ByRef $aArray, $iLimit, $sIndent = $_TAB)
    Local $sDump, $sArrayFetch, $sArrayRead, $iDone = 0, $iElements = 1
    Local $iDimensions = UBound($aArray, 0)
    Local $aUBounds[$iDimensions]
    Local $aIndices[$iDimensions]
    $iDimensions -= 1
    For $i = 0 To $iDimensions
        $aUBounds[$i] = UBound($aArray, $i + 1) - 1
        $iElements *= $aUBounds[$i] + 1
        $aIndices[$i] = 0
    Next
    $sIndent &= $_TAB
    While $iDone < ($iLimit ? _Min($iLimit, $iElements) : $iElements)
        $sArrayFetch = ''
        For $i = 0 To $iDimensions
            $sArrayFetch &= '[' & $aIndices[$i] & ']'
        Next
        $sArrayRead = Execute('$aArray' & $sArrayFetch)
        $sDump &= $sIndent & $sArrayFetch & ' => ' & __VarDump($sArrayRead, $iLimit, $sIndent) & @CRLF
        $iDone += 1
        If $iLimit And $iDone = $iLimit Then
            $sDump &= $sIndent & '... there are ' & $iElements - $iDone & ' more elements in this array' & @CRLF
            ExitLoop
        EndIf

        For $i = $iDimensions To 0 Step -1
            $aIndices[$i] += 1
            If $aIndices[$i] > $aUBounds[$i] Then
                $aIndices[$i] = 0
            Else
                ExitLoop
            EndIf
        Next
    WEnd
    Return(StringTrimRight($sDump, 2))
EndFunc   ;==>__VarDumpArray


Func __VarDumpMap(ByRef $mMap, $iLimit, $sIndent = $_TAB)
    Local $i = 0, $sDump
    $sIndent &= $_TAB
    For $key In Mapkeys($mMap)
        $sDump &= $sIndent & StringFormat('%-16s => ', _
                                            "[" & (IsString($key) ? __DumpStr($key) : $key) & "]")
        $sDump &= __VarDump($mMap[$key], $iLimit, $sIndent) & @CRLF
        If $iLimit And $i = $iLimit - 1 Then
            $sDump &= $sIndent & '... there are ' & UBound($mMap) - $i - 1 & ' more elements in this map' & @CRLF
            ExitLoop
        EndIf
        $i += 1
    Next
    Return(StringTrimRight($sDump, 2))
EndFunc   ;==>__VarDumpMap


Func __DumpStr($vVar)
    Local $len = StringLen($vVar)
    $vVar = Execute("'" & StringRegExpReplace(StringReplace($vVar, "'", "''"), "([\p{Cc}])", "<0x' & Hex(AscW('$1'), 2) & '>") & "'")
    Return "'" & (($len <= 64) ? $vVar : StringMid($vVar, 1, 32) & ' ... ' & StringTrimLeft(StringMid($vVar, $len - 31, 32), 2)) & "'"
EndFunc   ;==>__DumpStr


; example use

Local $tTest = DllStructCreate("byte;byte[3];char;char[3];wchar;wchar[3];short;short[3];ushort;ushort[3];int;int[3];uint;uint[3];int64;int64[3];uint64;uint64[3];float;float[3];double;double[3];handle;handle[3];boolean;bool;hwnd;handle;int_ptr;long_ptr;lresult;lparam;uint_ptr;ulong_ptr;dword_ptr;wparam")
DllStructSetData($tTest, 2, '€')
DllStructSetData($tTest, 6, '€')
_ConsoleWrite('Test structure types' & @LF & _VarDump($tTest) & @LF & @LF)

Local $struct = DllStructCreate("char[3];handle[3];uint[35];byte[128];wchar[190000]; double[3];int64[3];char[3];float;double;byte;byte;short;ushort;int;uint;char")
DllStructSetData($struct, 1, 'sos')
DllStructSetData($struct, 2, Ptr(123456789))
DllStructSetData($struct, 3, 8, 1)
DllStructSetData($struct, 3, 0x87654321, 2)
DllStructSetData($struct, 3, 256, 5)
DllStructSetData($struct, 4, Binary('sos'))
DllStructSetData($struct, 5, 'gno' & @CRLF & 'j''i' & @TAB & 'o')
DllStructSetData($struct, 6, 3.1415926, 2)
DllStructSetData($struct, 7, 17, 1)
DllStructSetData($struct, 7, -1, 2)
DllStructSetData($struct, 8, 'end')
DllStructSetData($struct, 9, 2.7182818284590452353602874713527)
DllStructSetData($struct, 10, 2.7182818284590452353602874713527)
DllStructSetData($struct, 11, 107)
DllStructSetData($struct, 12, -108)
DllStructSetData($struct, 13, 109)
DllStructSetData($struct, 14, 110)
DllStructSetData($struct, 15, 111)
DllStructSetData($struct, 16, 112)


Local $f = _VarDump

Local $c[2][0]
Local $e = [[Null, Default], [__DumpStr, MsgBox]]
Local Enum $p = 33333333333333
Opt("WinTitleMatchMode", 2)
Local $a[3][4] = [ _
    [$c, $e, ObjCreate("shell.application"), WinGetHandle("Dump.au3")], _
    ['zzz', 1/3, True, 0x123456], _
    [$struct, 93, Null, $p] _
]

_ConsoleWrite('Test example of moderate complexity' & @LF & $f($a) & @LF)

Func _ConsoleWrite($s)
    ConsoleWrite(BinaryToString(StringToBinary($s, 4), 1))
EndFunc

 

This wonderful site allows debugging and testing regular expressions (many flavors available). An absolute must have in your bookmarks.
Another excellent RegExp tutorial. Don't forget downloading your copy of up-to-date pcretest.exe and pcregrep.exe here
RegExp tutorial: enough to get started
PCRE v8.33 regexp documentation latest available release and currently implemented in AutoIt beta.

SQLitespeed is another feature-rich premier SQLite manager (includes import/export). Well worth a try.
SQLite Expert (freeware Personal Edition or payware Pro version) is a very useful SQLite database manager.
An excellent eBook covering almost every aspect of SQLite3: a must-read for anyone doing serious work.
SQL tutorial (covers "generic" SQL, but most of it applies to SQLite as well)
A work-in-progress SQLite3 tutorial. Don't miss other LxyzTHW pages!
SQLite official website with full documentation (may be newer than the SQLite library that comes standard with AutoIt)

Link to comment
Share on other sites

@mandriospo  I have made a first draft of a recursive _ArrayDisplay that allows you to show arrays within array.  You can embed any level of arrays within arrays as you wish to.  Only limitation is that you cannot display more than 1 array per depth level.  You just need to click on an {array} cell to show a new _ArrayDisplay window.

LMK what you think.  It is pre-alpha, so it is not fully tested.  But with the example it is working quite fine.

Made an UDF out of it see my signature or next post...

 

Edited by Nine
remove obsolete code
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...