Table field 1 not initialized
Posted: Thu Oct 12, 2023 8:26 pm
Am I doing something wrong here or could this be a bug?
This code will quit with the following error:
Error in line 8 (Unnamed4.hws): Table field 2 was not initialized!
To reproduce, select and ban first user on the list, then do the same for the second user. Then select first user again and remove ban.
This code will quit with the following error:
Error in line 8 (Unnamed4.hws): Table field 2 was not initialized!
To reproduce, select and ban first user on the list, then do the same for the second user. Then select first user again and remove ban.
Code: Select all
bannedlist$ = {}
playerlist$ = {"Tom", "Peter", "Adrian"}
Repeat
If (ListItems(playerlist$) = 0) Then r = -1 Else r = ListRequest("Playerlist", "BAN player", playerlist$)
receivername$ = playerlist$[r]
alreadybanned = False
For i = 0 To ListItems(bannedlist$) -1
If receivername$ = bannedlist$[i]
alreadybanned = True
sel = SystemRequest("Banned user", receivername$.." is already banned\nDo you want to remove the ban?", "Remove|Cancel")
Switch sel
Case 1:
RemoveItem(bannedlist$, i)
EndSwitch
EndIf
Next
If alreadybanned = False
InsertItem(bannedlist$, receivername$); add user to bannedlist
EndIf
VWait()
Forever