Code: Select all
t_HostSystems = { ["AmigaOS3"] = {SystemType = "AOS", SystemSpecific = "AOS3"},
["AmigaOS4"] = {SystemType = "AOS", SystemSpecific = "AOS4"}
}
t_HostSystems = {}
Function AddHostSystem(versionname, SystemType, SystemSpecific)
t_HostSystems[versionname] = {SystemType = SystemType, SystemSpecific = SystemSpecific}
EndFunction
AddHostSystem("AmigaOS3", "AOS", "AOS3")
AddHostSystem("AmigaOS4", "AOS", "AOS4")
AddHostSystem("AROS", "AOS", "AROS")
AddHostSystem("MorphOS", "AOS", "MorphOS")
AddHostSystem("MacOS", "MacOS", "MacOS")
AddHostSystem("Win32", "W", "Win32")
Local Version = GetVersion().Platform
Local SystemType = "Unknown"
Local SystemSpecific = "Unknown"
If RawGet(t_HostSystems, Version)
SystemType = t_Hostsystems[Version].SystemType
SystemSpecific = t_HostSystems[Version].SystemSpecific
EndIf
DebugPrint("Detected system type:", SystemType)
DebugPrint("Detected specific system:", SystemSpecific)
Hollywood manual gives me an impression that HasItem and HaveItem can both be used instead of RawGet, but is this so or not? For at least in this case they didn't work interchangeably, but using HasItem or HaveItem makes this code not work properly.
Hollywood 10, Windows 11.