Popular Post Gianni Posted September 25 Popular Post Posted September 25 (edited) A simple _MAPdisplay() function: displays the contents of a MAP variable in a TreeView handles nested MAPs if a MAP key contains an array (1D or 2D), it displays the contents in a draft form If an array element contains a sub-MAP, a sub-array or other "non printable" variables, it is indicated the VarType but not recursively expanded. I’ve uploaded a new version with some minor improvements, primarily regarding the preview display of the array draft. The layout is as follows: on the left side of the list, enclosed in square brackets, is the key name; on the right side is the key's content. The two elements are separated by a colon. If the key's content is a MAP, an Array, or a variable type that cannot be printed directly, it is indicated by a placeholder enclosed in curly braces. For MAPs or Arrays, you need to expand the corresponding TreeView item to view the content. I hope it is bug-free and proves useful. Any reports of errors or suggestions for improvements are welcome. Cheers and enjoy! P.S. The MAP used in the example is quite complex and likely unusual, but I intentionally designed it that way to stress-test the function. This is the UDF. Below there is a second script with example expandcollapse popup#include <TreeViewConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <Array.au3> ; #FUNCTION# ==================================================================================================================== ; Name ..........: _MapDisplay ; Description ...: Displays the content of a MAP variable ; Syntax ........: _MapDisplay($mMAP) ; Parameters ....: $mMAP - a variable of type MAP ; Return values .: None ; Author ........: Gianni Addiego ; Modified ......: ; Remarks .......: v 1.0 ; Related .......: ; Link ..........: ; Example .......: ; =============================================================================================================================== Func _MapDisplay(ByRef $mMain, $bPseudoParent = False) If Not IsMap($mMain) Then Return SetError(1, 0, '') ; Create and show the GUI Local $hGUI = GUICreate("Map Display", 850, 550) Local $idTreeView = GUICtrlCreateTreeView(10, 10, 830, 530, $TVS_HASBUTTONS + $TVS_HASLINES + $TVS_LINESATROOT, $WS_EX_CLIENTEDGE) GUICtrlSetFont($idTreeView, 8.5, 0, 0, "Courier New") GUISetState(@SW_SHOW) If $bPseudoParent Then ; (virtual root) Local $__mPseudoRoot[] $__mPseudoRoot['Root'] = $mMain _MapToTreeView($__mPseudoRoot, $idTreeView) Else _MapToTreeView($mMain, $idTreeView) EndIf ; Waiting loop Do Until GUIGetMsg() = $GUI_EVENT_CLOSE GUIDelete($hGUI) $idTreeView = 0 Return EndFunc ;==>_MapDisplay ; Ebhanced recursive function Func _MapToTreeView(ByRef $map, $idParent) Local $aKeys = MapKeys($map) Local $key, $value, $idNewParentNode Local $iDimensions, $idNodeArray1D, $idNodeArray2D Local $iRows, $iColumns, $sRowText, $vCheckType, $sArrayHeader, $aArrayFormatted Local $iColWidth = 10 If UBound($aKeys) = 0 Then ; Is an empty MAP $idNewParentNode = GUICtrlCreateTreeViewItem("{empty}", $idParent) Return EndIf For $i = 0 To UBound($aKeys) - 1 $key = $aKeys[$i] $value = $map[$key] ; --- Nested MAP If IsMap($value) Then $idNewParentNode = GUICtrlCreateTreeViewItem("[" & $key & "]: (MAP)", $idParent) _MapToTreeView($value, $idNewParentNode) ; --- Array (1D or 2D) ElseIf IsArray($value) Then ; Check the number of array dimensions $iDimensions = UBound($value, $UBOUND_DIMENSIONS) $idNodeArray = GUICtrlCreateTreeViewItem("[" & $key & "]: (" & $iDimensions & "D ARRAY)", $idParent) If $iDimensions < 3 Then $aArrayFormatted = _FormatArrayToColumns($value, $iColWidth) $sArrayHeader = StringFormat("%-" & StringLen(UBound($aArrayFormatted) - 1) + 4 & "s", "Row") For $c = 0 To UBound($value, $UBOUND_COLUMNS) - 1 $sArrayHeader &= StringFormat("%-" & $iColWidth + 3 & "s", "Col" & $c) Next If UBound($aArrayFormatted, 1) Then GUICtrlCreateTreeViewItem($sArrayHeader, $idNodeArray) For $ii = 0 To UBound($aArrayFormatted) - 1 GUICtrlCreateTreeViewItem("#" & StringFormat("%" & StringLen(UBound($aArrayFormatted) - 1) & "s", $ii) & " : " & $aArrayFormatted[$ii], $idNodeArray) Next Else GUICtrlCreateTreeViewItem("{empty}", $idNodeArray) EndIf Else ; --- MultiD Array ; Arrays with 3 or more dimensions (uncommon, showing a warning only) $sMsg = "Preview unsupported for " & $iDimensions & "D array. Subscripts: -> " For $s = 1 To $iDimensions $sMsg &= "[" & UBound($value, $s) & "]" Next GUICtrlCreateTreeViewItem($sMsg, $idNodeArray) ; MultiD Arrays Unsupported EndIf Else ; --- Standalone value $vCheckType = IsArray($value) ? '{Array}' _ : IsMap($value) ? '{MAP}' _ : IsObj($value) ? '{Object}' _ : IsDllStruct($value) ? '{DLLStruct}' _ : IsFunc($value) ? '{Function}' _ : ((Not IsBool($value)) And ($value = "")) ? '{empty}' _ : $value GUICtrlCreateTreeViewItem("[" & $key & "]: " & $vCheckType, $idParent) EndIf Next EndFunc ;==>_MapToTreeView ; Minimalist clone of _ArrayDisplay Func _FormatArrayToColumns(Const ByRef $aInput, $iColWidth, $bAlignLeft = True) Local $iDims, $iRows, $iCols, $sCellText, $sRowText, $sFormat ; check if is array If Not IsArray($aInput) Then Return SetError(1, 0, 0) $iDims = UBound($aInput, 0) ; array dimensions $iRows = UBound($aInput, 1) Local $aOutput[$iRows] $sFormat = "%-" & ($iDims = 1 ? '' : $iColWidth & ".") & $iColWidth & "s" ; Left align (default) If Not $bAlignLeft Then $sFormat = "%" & ($iDims = 1 ? '' : $iColWidth & ".") & $iColWidth & "s" ; Right align EndIf If Not $iRows Then Return $aOutput EndIf ; Array rows loop For $i = 0 To $iRows - 1 $sRowText = "" If $iDims = 1 Then ; Array 1D $sRowText = StringFormat($sFormat, String(IsArray($aInput[$i]) ? '{Array}' _ : IsMap($aInput[$i]) ? '{MAP}' _ : IsObj($aInput[$i]) ? '{Object}' _ : IsDllStruct($aInput[$i]) ? '{DLLStruct}' _ : IsFunc($aInput[$i]) ? '{Function}' _ : $aInput[$i])) ElseIf $iDims = 2 Then ; Array 2D $iCols = UBound($aInput, 2) For $j = 0 To $iCols - 1 $sCellText = StringFormat($sFormat, String(IsArray($aInput[$i][$j]) ? '{Array}' _ : IsMap($aInput[$i][$j]) ? '{MAP}' _ : IsObj($aInput[$i][$j]) ? '{Object}' _ : IsDllStruct($aInput[$i][$j]) ? '{DLLStruct}' _ : IsFunc($aInput[$i][$j]) ? '{Function}' _ : $aInput[$i][$j])) $sRowText &= StringLen($aInput[$i][$j]) > $iColWidth ? $sCellText & '>| ' : $sCellText & " | " Next EndIf $aOutput[$i] = $sRowText Next Return $aOutput EndFunc ;==>_FormatArrayToColumns This second script contains the UDF and an example that generates a rather complex map and displays it. expandcollapse popup#include <TreeViewConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <Array.au3> ; #FUNCTION# ==================================================================================================================== ; Name ..........: _MapDisplay ; Description ...: Displays the content of a MAP variable ; Syntax ........: _MapDisplay($mMAP) ; Parameters ....: $mMAP - a variable of type MAP ; Return values .: None ; Author ........: Gianni Addiego ; Modified ......: ; Remarks .......: v 1.0 ; Related .......: ; Link ..........: ; Example .......: ; =============================================================================================================================== Func _MapDisplay(ByRef $mMain, $bPseudoParent = False) If Not IsMap($mMain) Then Return SetError(1, 0, '') ; Create and show the GUI Local $hGUI = GUICreate("Map Display", 850, 550) Local $idTreeView = GUICtrlCreateTreeView(10, 10, 830, 530, $TVS_HASBUTTONS + $TVS_HASLINES + $TVS_LINESATROOT, $WS_EX_CLIENTEDGE) GUICtrlSetFont($idTreeView, 8.5, 0, 0, "Courier New") GUISetState(@SW_SHOW) If $bPseudoParent Then ; (virtual root) Local $__mPseudoRoot[] $__mPseudoRoot['Root'] = $mMain _MapToTreeView($__mPseudoRoot, $idTreeView) Else _MapToTreeView($mMain, $idTreeView) EndIf ; Waiting loop Do Until GUIGetMsg() = $GUI_EVENT_CLOSE GUIDelete($hGUI) $idTreeView = 0 Return EndFunc ;==>_MapDisplay ; Ebhanced recursive function Func _MapToTreeView(ByRef $map, $idParent) Local $aKeys = MapKeys($map) Local $key, $value, $idNewParentNode Local $iDimensions, $idNodeArray1D, $idNodeArray2D Local $iRows, $iColumns, $sRowText, $vCheckType, $sArrayHeader, $aArrayFormatted Local $iColWidth = 10 If UBound($aKeys) = 0 Then ; Is an empty MAP $idNewParentNode = GUICtrlCreateTreeViewItem("{empty}", $idParent) Return EndIf For $i = 0 To UBound($aKeys) - 1 $key = $aKeys[$i] $value = $map[$key] ; --- Nested MAP If IsMap($value) Then $idNewParentNode = GUICtrlCreateTreeViewItem("[" & $key & "]: (MAP)", $idParent) _MapToTreeView($value, $idNewParentNode) ; --- Array (1D or 2D) ElseIf IsArray($value) Then ; Check the number of array dimensions $iDimensions = UBound($value, $UBOUND_DIMENSIONS) $idNodeArray = GUICtrlCreateTreeViewItem("[" & $key & "]: (" & $iDimensions & "D ARRAY)", $idParent) If $iDimensions < 3 Then $aArrayFormatted = _FormatArrayToColumns($value, $iColWidth) $sArrayHeader = StringFormat("%-" & StringLen(UBound($aArrayFormatted) - 1) + 4 & "s", "Row") For $c = 0 To UBound($value, $UBOUND_COLUMNS) - 1 $sArrayHeader &= StringFormat("%-" & $iColWidth + 3 & "s", "Col" & $c) Next If UBound($aArrayFormatted, 1) Then GUICtrlCreateTreeViewItem($sArrayHeader, $idNodeArray) For $ii = 0 To UBound($aArrayFormatted) - 1 GUICtrlCreateTreeViewItem("#" & StringFormat("%" & StringLen(UBound($aArrayFormatted) - 1) & "s", $ii) & " : " & $aArrayFormatted[$ii], $idNodeArray) Next Else GUICtrlCreateTreeViewItem("{empty}", $idNodeArray) EndIf Else ; --- MultiD Array ; Arrays with 3 or more dimensions (uncommon, showing a warning only) $sMsg = "Preview unsupported for " & $iDimensions & "D array. Subscripts: -> " For $s = 1 To $iDimensions $sMsg &= "[" & UBound($value, $s) & "]" Next GUICtrlCreateTreeViewItem($sMsg, $idNodeArray) ; MultiD Arrays Unsupported EndIf Else ; --- Standalone value $vCheckType = IsArray($value) ? '{Array}' _ : IsMap($value) ? '{MAP}' _ : IsObj($value) ? '{Object}' _ : IsDllStruct($value) ? '{DLLStruct}' _ : IsFunc($value) ? '{Function}' _ : ((Not IsBool($value)) And ($value = "")) ? '{empty}' _ : $value GUICtrlCreateTreeViewItem("[" & $key & "]: " & $vCheckType, $idParent) EndIf Next EndFunc ;==>_MapToTreeView ; Minimalist clone of _ArrayDisplay Func _FormatArrayToColumns(Const ByRef $aInput, $iColWidth, $bAlignLeft = True) Local $iDims, $iRows, $iCols, $sCellText, $sRowText, $sFormat ; check if is array If Not IsArray($aInput) Then Return SetError(1, 0, 0) $iDims = UBound($aInput, 0) ; array dimensions $iRows = UBound($aInput, 1) Local $aOutput[$iRows] $sFormat = "%-" & ($iDims = 1 ? '' : $iColWidth & ".") & $iColWidth & "s" ; Left align (default) If Not $bAlignLeft Then $sFormat = "%" & ($iDims = 1 ? '' : $iColWidth & ".") & $iColWidth & "s" ; Right align EndIf If Not $iRows Then Return $aOutput EndIf ; Array rows loop For $i = 0 To $iRows - 1 $sRowText = "" If $iDims = 1 Then ; Array 1D $sRowText = StringFormat($sFormat, String(IsArray($aInput[$i]) ? '{Array}' _ : IsMap($aInput[$i]) ? '{MAP}' _ : IsObj($aInput[$i]) ? '{Object}' _ : IsDllStruct($aInput[$i]) ? '{DLLStruct}' _ : IsFunc($aInput[$i]) ? '{Function}' _ : $aInput[$i])) ElseIf $iDims = 2 Then ; Array 2D $iCols = UBound($aInput, 2) For $j = 0 To $iCols - 1 $sCellText = StringFormat($sFormat, String(IsArray($aInput[$i][$j]) ? '{Array}' _ : IsMap($aInput[$i][$j]) ? '{MAP}' _ : IsObj($aInput[$i][$j]) ? '{Object}' _ : IsDllStruct($aInput[$i][$j]) ? '{DLLStruct}' _ : IsFunc($aInput[$i][$j]) ? '{Function}' _ : $aInput[$i][$j])) $sRowText &= StringLen($aInput[$i][$j]) > $iColWidth ? $sCellText & '>| ' : $sCellText & " | " Next EndIf $aOutput[$i] = $sRowText Next Return $aOutput EndFunc ;==>_FormatArrayToColumns ; ----- Example zone ----- #include <date.au3> #include <InetConstants.au3> ; The functions Example1 and Example2 simply generate a rather complex MAP. ; Returned MAP is displayed by the _MapDisplay() function. _MapDisplay(Example2()) ; _MapDisplay(Example1()) Func Example1() ; --- Example 1 --- ; Create a MAP containing nested MAPs ; Read a file CSV containing european States, Regions, Provinces ; Read the file directly to a variable without saving it to a local file. Local $dData = InetRead("https://gisco-services.ec.europa.eu/distribution/v2/nuts/csv/NUTS_AT_2024.csv", BitAND($INET_FORCERELOAD, $INET_BINARYTRANSFER)) ; Convert the ANSI compatible binary string back into a string. Local $sData = BinaryToString($dData, $SB_UTF8) ; $SB_UTF8 (4) = binary data is UTF8 Local $a2D = _StringToArray2D($sData, ',') ; convert a CSV into a two-dimensional array ; _ArrayDisplay($a2D) Local $mContinents[] ; only Europe in this context Local $mCountries[] Local $mRegions[] ; Local $mProvinces[] Local $mMAP[] ; an empty MAP For $i = 1 To UBound($a2D) - 1 $a2D[$i][4] = StringLen($a2D[$i][1]) & $a2D[$i][2] $a2D[$i][5] = StringLeft($a2D[$i][1], 4) Next _ArraySort($a2D, 0, 1, 0, 4) ; create a nested MAP : Continents -> Countries -> Regions -> Provinces $mContinents['Europe'] = $mMAP ; first submap For $i = 1 To UBound($a2D) - 1 Switch StringLen($a2D[$i][1]) Case 2 ; State code $mContinents["Europe"][$a2D[$i][2]] = $mMAP $mCountries[$a2D[$i][1]] = $a2D[$i][2] ; <- populate the map of Countries Case 4 ; Region code $mRegions[$a2D[$i][1]] = $a2D[$i][2] ; <- populate the map of Regions ; We place the region within the map of its State $mContinents["Europe"][$mCountries[$a2D[$i][0]]][$a2D[$i][2]] = $mMAP Case 5 ; Province code ; We place the Province within the map of its Region $mContinents["Europe"][$mCountries[$a2D[$i][0]]][$mRegions[$a2D[$i][5]]][$a2D[$i][2]] = "" ; the last leaf on the branch EndSwitch Next Return $mContinents EndFunc ;==>Example1 ; --- Example 2 --- Func Example2() ; Create a MAP containing a nested MAP containing Arrays Local $mMyMAP[], $mMAP[] $mMyMAP["FirsKey"] = "Simple String" $mMyMAP["SecondKey"] = 150 ; a number $mMyMAP["Calendar"] = $mMAP ; Local $iYear = @YEAR For $iYear = @YEAR To @YEAR + 4 $mMyMAP["Calendar"][$iYear] = $mMAP ; Key "Calendar" subKey 2026 contains another empty MAP For $i = 1 To 12 ; Populate the 2026 map with 12 keys each named as a month. $mMyMAP["Calendar"][$iYear][_DateToMonth($i)] = _GenerateMonth($iYear, $i) ; <- Each 2D array contains the calendar for that month. ; _ArrayDisplay($mMyMAP["Calendar"][$iYear][_DateToMonth($i)]) ; Debug Next Next ; Add some 1D and 2D arrays to the MAP Local $aMonths[12] = [ _ "January", "February", "March", "April", _ "May", "June", "July", "August", _ "September", "October", "November", "December" _ ] $mMyMAP["Months"] = $aMonths Local $aMonthsMultiLang = [ _ ["English", "Italiano", "Español", "Français", "Deutsch", "Português", "Nederlands", "Polski"], _ ["January", "Gennaio", "Enero", "Janvier", "Januar", "Janeiro", "Januari", "Styczeń"], _ ["February", "Febbraio", "Febrero", "Février", "Februar", "Fevereiro", "Februari", "Luty"], _ ["March", "Marzo", "Marzo", "Mars", "März", "Março", "Maart", "Marzec"], _ ["April", "Aprile", "Abril", "Avril", "April", "Abril", "April", "Kwiecień"], _ ["May", "Maggio", "Mayo", "Mai", "Mai", "Maio", "Mei", "Maj"], _ ["June", "Giugno", "Junio", "Juin", "Juni", "Junho", "Juni", "Czerwiec"], _ ["July", "Luglio", "Julio", "Juillet", "Juli", "Julho", "Juli", "Lipiec"], _ ["August", "Agosto", "Agosto", "Août", "August", "Agosto", "Augustus", "Sierpień"], _ ["September", "Settembre", "Septiembre", "Septembre", "September", "Setembro", "September", "Wrzesień"], _ ["October", "Ottobre", "Octubre", "Octobre", "Oktober", "Outubro", "Oktober", "Październik"], _ ["November", "Novembre", "Noviembre", "Novembre", "November", "Novembro", "November", "Listopad"], _ ["December", "Dicembre", "Diciembre", "Décembre", "Dezember", "Dezembro", "December", "Grudzień"] _ ] $mMyMAP["MultiLangMonths"] = $aMonthsMultiLang Local $aZodiacSigns[12] = [ _ "Aries", "Taurus", "Gemini", "Cancer", _ "Leo", "Virgo", "Libra", "Scorpio", _ "Sagittarius", "Capricorn", "Aquarius", "Pisces" _ ] $mMyMAP["ZodiacSigns"] = $aZodiacSigns Local $aFamousScientists[6] = [ _ "Albert Einstein", "Isaac Newton", "Marie Curie", _ "Galileo Galilei", "Nikola Tesla", "Charles Darwin" _ ] $mMyMAP["Scientists"] = $aFamousScientists Local $aFamousPainters[6] = [ _ "Leonardo da Vinci", "Vincent van Gogh", "Pablo Picasso", _ "Claude Monet", "Michelangelo", "Rembrandt" _ ] $mMyMAP["Painters"] = $aFamousPainters Local $aFamousMusicians[6] = [ _ "Wolfgang Amadeus Mozart", "Ludwig van Beethoven", "Johann Sebastian Bach", _ "Frederic Chopin", "Pyotr Ilyich Tchaikovsky", "Jimi Hendrix" _ ] $mMyMAP["Musicians"] = $aFamousMusicians ; ------------------------------------- ; check for VarTypes output on TreeView ; ------------------------------------- ; Local $aArray[2] = [1, "Example"] Local $aArray[1][0][3][9][5] ; Exit MsgBox(0,'Debug',UBound($aArray,0) & @TAB & UBound($aArray,1) & @TAB & UBound($aArray,2)) Local $mMAP[] Local $dBinary = Binary("0x00204060A9FF003C") Local $bBoolean = False Local $pPtr = Ptr(-1) Local $hWnd = WinGetHandle(AutoItWinGetTitle()) Local $iInt = 1 Local $fFloat = 2.9 Local $oObject = ObjCreate("Scripting.Dictionary") Local $sString = "Some text" Local $tStruct = DllStructCreate("wchar[256]") Local $vKeyword = Default Local $fuFunc = ConsoleWrite Local $fuUserFunc = Example1 ; a 2D array containing also a sub array a MAP and other VarTypes ; Nested arrays, maps, and non-"printable" variables are enclosed in curly braces but not expanded. Local $aWorldCities = [["London", "New York", "Tokyo", $oObject], _ ["Rome", "Beijing", $aFamousPainters, "Moscow"], _ [MsgBox, "Munich", "Athens", "Lisbon"], _ [$mMAP, "Warsaw", "Prague", "Copenhagen"]] $mMyMAP["NestedArray"] = $aWorldCities $mMyMAP["VarTypes"] = $mMAP $mMyMAP["VarTypes"]["Array"] = $aArray $mMyMAP["VarTypes"]["Map"] = $mMAP $mMyMAP["VarTypes"]["Binary"] = $dBinary $mMyMAP["VarTypes"]["Boolean"] = $bBoolean $mMyMAP["VarTypes"]["Ptr"] = $pPtr $mMyMAP["VarTypes"]["Wnd"] = $hWnd $mMyMAP["VarTypes"]["Int"] = $iInt $mMyMAP["VarTypes"]["Float"] = $fFloat $mMyMAP["VarTypes"]["Object"] = $oObject $mMyMAP["VarTypes"]["String"] = $sString $mMyMAP["VarTypes"]["Struct"] = $tStruct $mMyMAP["VarTypes"]["Keyword"] = $vKeyword $mMyMAP["VarTypes"]["Func"] = MsgBox $mMyMAP["VarTypes"]["Func2"] = $fuFunc $mMyMAP["VarTypes"]["Func3"] = Example1 $mMyMAP["VarTypes"]["UserFunc"] = $fuUserFunc $mMyMAP["Geo"] = Example1() Return $mMyMAP EndFunc ;==>Example2 ; ======================== Func _StringToArray2D($sFile, $delim = ";") ; this function is extracted, adapted and slightly modified from the _FileReadToArray() function in file.au3 Local $aArray ; remove last line separator if any at the end of the file If StringRight($sFile, 1) = @LF Then $sFile = StringTrimRight($sFile, 1) If StringRight($sFile, 1) = @CR Then $sFile = StringTrimRight($sFile, 1) If StringInStr($sFile, @LF) Then $aArray = StringSplit(StringStripCR($sFile), @LF) ElseIf StringInStr($sFile, @CR) Then ;; @LF does not exist so split on the @CR $aArray = StringSplit($sFile, @CR) Else ;; unable to split the file If StringLen($sFile) Then Dim $aArray[2] = [1, $sFile] ; returns the whole file in one element Else Return SetError(2, 0, 0) ; File is empty EndIf EndIf ; now split 1D $aArray to 2D $aColumns according to delimiter Local $aColumns[$aArray[0]][1] ; create a new [2D] array with same nr. of lines of $aArray For $i = 1 To $aArray[0] ; scan all lines of the array $TempRow = StringSplit($aArray[$i], $delim, 2) ; split the line If UBound($TempRow) > UBound($aColumns, 2) Then ReDim $aColumns[$aArray[0]][UBound($TempRow)] For $ii = 0 To UBound($TempRow) - 1 $aColumns[$i - 1][$ii] = $TempRow[$ii] Next Next Return $aColumns EndFunc ;==>_StringToArray2D ;============================================== Func _GenerateMonth($iYear = @YEAR, $iMonth = @MON, $ISO = True) ; this function creates a month calendar into an 7x7 array Local $aMonth[7][7], $iDOW Local $iFirstDOW = $ISO ? _DateToDayOfWeekISO($iYear, $iMonth, 1) : _DateToDayOfWeek($iYear, $iMonth, 1) For $iDay = 1 To 7 $aMonth[0][$iDay - 1] = $ISO ? _DateDayOfWeek(Mod($iDay, 7) + $ISO, $DMW_LOCALE_SHORTNAME) : _DateDayOfWeek($iDay, $DMW_LOCALE_SHORTNAME) Next For $iDay = 1 To _DateDaysInMonth($iYear, $iMonth) $iDOW = $ISO ? _DateToDayOfWeekISO($iYear, $iMonth, $iDay) : _DateToDayOfWeek($iYear, $iMonth, $iDay) $aMonth[Int(($iFirstDOW + $iDay - 2) / 7) + 1][$iDOW - 1] = $iDay Next Return $aMonth EndFunc ;==>_GenerateMonth Edited 9 hours ago by Gianni code improvement argumentum, Parsix, ioa747 and 4 others 2 5 Chimp small minds discuss people average minds discuss events great minds discuss ideas.... and use AutoIt....
WildByDesign Posted September 25 Posted September 25 This visual representation of maps and nested maps in a TreeView is very beneficial. Thank you. I've always had difficultly trying to "visualize" map and nested map structure in my mind. So this is really helpful to visualize everything. Excellent work and thank you for sharing. Gianni and donnyh13 2
Gianni Posted 10 hours ago Author Posted 10 hours ago I’ve uploaded a new version to the first post with a few minor improvements—mainly regarding the array draft preview display—along with other small changes. P.S. Thanks for the "likes" and the comment. ioa747 and argumentum 2 Chimp small minds discuss people average minds discuss events great minds discuss ideas.... and use AutoIt....
water Posted 32 minutes ago Posted 32 minutes ago Just added your UDF to the Wiki My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now