Modify

Opened 8 days ago

Last modified 5 days ago

#3739 new Feature Request

Scripting.dictionary Keys/Items array support for _ArrayDisplay

Reported by: Beege Owned by:
Milestone: Component: Standard UDFs
Version: Severity: None
Keywords: _Arraydisplay scripting.dictionary Cc:

Description (last modified by mLipok)

I wanted to ask for this years ago but at the time _arraydisplay was stand alone function and I thought it was a bit much to ask to make it a sub function just to support this. I also couldn't see asking for _dictionarydisplay because where would it go? I see now that _arraydisplay has had an overhall and is using a shared sub function so this would be real easy to add by throwing the keys and items arrays together into a temp 2D array before calling shared function. Same idea could be done with maps as well.

#include <array.au3>

$oDi = ObjCreate('scripting.dictionary')
For $i = 0 to 10
        $oDi.Add('key' & $i,'item' & $i)
Next
ArrayDisplay($oDi)


Func ArrayDisplay(Const ByRef $aArray, $sTitle = Default, $sArrayRange = Default, $iFlags = Default, $vUser_Separator = Default, $sHeader = Default, $iMax_ColWidth = Default)
        #forceref $vUser_Separator

        If IsObj($aArray) And StringInStr(ObjName($aArray, 3), 'scripting.dictionary') Then

                Local $aTmp[$aArray.Count][2], $aK = $aArray.Keys, $aI = $aArray.Items
                For $i = 0 To $aArray.Count - 1
                        $aTmp[$i][0] = $aK[$i]
                        $aTmp[$i][1] = $aI[$i]
                Next

                If $sHeader = Default Then $sHeader = 'Keys|Items'
                If $sTitle = Default Then $sTitle = 'DictionaryDisplay'

                Local $iRet = __ArrayDisplay_Share($aTmp, $sTitle, $sArrayRange, $iFlags, Default, $sHeader, $iMax_ColWidth, 0, False)
        Else
                Local $iRet = __ArrayDisplay_Share($aArray, $sTitle, $sArrayRange, $iFlags, Default, $sHeader, $iMax_ColWidth, 0, False)
        EndIf
        Return SetError(@error, @extended, $iRet)
EndFunc   ;==>ArrayDisplay

Attachments (0)

Change History (2)

comment:1 Changed 8 days ago by Beege

Sorry the component should be Standard UDFs for this

comment:2 Changed 5 days ago by mLipok

  • Component changed from AutoIt to Standard UDFs
  • Description modified (diff)

Guidelines for posting comments:

  • You cannot re-open a ticket but you may still leave a comment if you have additional information to add.
  • In-depth discussions should take place on the forum.

For more information see the full version of the ticket guidelines here.

Add Comment

Modify Ticket

Action
as new The ticket will remain with no owner.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.