Should RawGet HasItem and HaveItem be interchangeable?
Posted: Mon Jan 20, 2025 1:26 pm
I made this short code as a reply on another topic here:
Strange thing was that instead of using RAWGET, I first used HASITEM, and tried HAVEITEM as well, but they failed to work. Only RawGet works.
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.
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.