Created
September 18, 2012 09:33
-
-
Save hoppfrosch/3742243 to your computer and use it in GitHub Desktop.
PROBLEM: Determine number of Array elements [#ahk #problem
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
test := GetTimeZones() | |
ExitApp | |
GetTimeZones() { | |
; Taken from: http://www.autohotkey.com/community/viewtopic.php?t=73951 | |
OutputDebug % "**** GetTimeZones START ****" | |
; Get the "Time Zones" entries from registry | |
RegRoot := "HKEY_LOCAL_MACHINE" | |
RegKey := "SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones" | |
RegTimeZones := {} | |
if (!RegTimeZones) | |
OutputDebug % "!RegTimeZones" | |
Loop, %RegRoot%, %RegKey%, 2 | |
{ | |
RegRead, DSP, %RegRoot%, %RegKey%\%A_LoopRegName%, Display | |
RegRead, TZI, %RegRoot%, %RegKey%\%A_LoopRegName%, TZI | |
RegTimeZones[A_LoopRegName] := [DSP, TZI] | |
OutputDebug % A_Index " - Display,:" RegTimeZones[A_LoopRegName][1] ", TimeZoneInformation" RegTimeZones[A_LoopRegName][2] | |
} | |
i := RegTimeZones.MaxIndex() | |
; Why is i not equal the number of elements within RegTimeZones? | |
OutputDebug % "GetTimeZones found " RegTimeZones.MaxIndex() "(" i ") Timezones" | |
OutputDebug % "**** GetTimeZones END ****" | |
Return RegTimeZones | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment