Mr.Dandy wrote: ↑Fri Jan 26, 2024 12:43 pm
I know listed all items but how can I retreive all keys?
For OpenOffice or LibreOffice. For Linux, MacOS, or Windows.
Sub HashTest
Dim Hash As Object : Dim Enum As Object
Dim Key As String : Dim Msg As String : Dim Sep As String
Hash = com.sun.star.container.EnumerableMap.create("string","string")
With Hash
.put("Angers","49000") : .put("Bordeaux","33000")
.put("Foix","09000") : .put("Cucugnan","11350")
Enum = .createKeyEnumeration(False)
While Enum.hasMoreElements
Key = Enum.nextElement
Msg = Msg & Sep & "Key=" & Key & ", Item=" & .get(Key)
Sep = Chr(10)
Wend
MsgBox Msg
End With
End Sub
- 202401262251.jpg (20.52 KiB) Viewed 1791 times
If this solved your problem please go to your first post use the Edit ☐ button and add [Solved] to the start of the Subject field. Select the green checkmark icon at the same time.
Mr. Programmer
AOO 4.1.7 Build 9800, MacOS 13.6.3, iMac Intel. The locale for any menus or Calc formulas in my posts is English (USA).