How are you trying to use it/What are you expecting?
It works thusly under Classic 2020.04.30c :
// Project: DeleteAllObjects
// Created: 2020-10-01
// Version: Classic 2020.04.30c
SetErrorMode(2)
// set window properties
SetWindowTitle( "DeleteAllObjects" )
SetWindowSize( 1080, 720, 0 )
SetWindowAllowResize( 1 ) // allow the user to resize the window
// set display properties
SetVirtualResolution( 1080, 720 ) // doesn't have to match the window
SetOrientationAllowed( 1, 1, 1, 1 ) // allow both portrait and landscape on mobile devices
SetSyncRate( 30, 0 ) // 30fps instead of 60 to save battery
SetScissor( 0,0,0,0 ) // use the maximum available screen space, no black borders
UseNewDefaultFonts( 1 ) // since version 2.0.22 we can use nicer default fonts
SetPrintSize(24)
GLOBAL TheseObjects as Integer []
CreateObjects() `Add 10 Boxes
do
If GetRawKeyState(90) then CreateObjects() `[Z] to Add 10 Boxes
If GetRawKeyPressed(88) then Survivors = DeleteObjects() `[X] to Delete All Objects
Print("[Z] Add 10 Boxes | [X] Delete All")
AllPolys = GetPolygonsDrawn()
Print( STR(AllPolys) + " Polys | " + STR(AllPolys/12) + " Boxes" )
Print(STR(Survivors) + " Survivors" + " | TheseObjects: " + STR(TheseObjects.Length+1))
Sync()
loop
Function CreateObjects()
For x = 1 to 10
ThisObj = CreateObjectBox(10,10,10)
SetObjectRotation(ThisObj, Random(0,359), Random(0,359), Random(0,359))
SetObjectColor(ThisObj, Random(20,255), Random(20,255), Random(20,255), 255)
TheseObjects.Insert(ThisObj)
Next x
EndFunction
Function DeleteObjects()
DeleteAllObjects()
TotalObjects = TheseObjects.Length
NotDeleted = 0
If TotalObjects > -1
For x = TotalObjects to 0 Step -1
If GetObjectExists(TheseObjects[x]) = 1 then INC NotDeleted Else TheseObjects.Remove()
Next x
Endif
EndFunction NotDeleted
(i don't think i've ever used "thusly" before

)
add, from the
help file:
Quote: "DeleteAllObjects
Deletes all objects created with an ID."
interestingly, if you
CreateObjectBox(11,11,11)
IE, no ObjectID, it still gets deleted with DeleteAllObjects(), contrary to the Command description. i thought that might have been your issue.