You are cobbling together code snippets from something else…
For example…
Your array ents2 is NOT predefined in your example.
The line
e.erase! if filled==(db(“No”))
will not work because filled is not defined,
AND you are then using db(“No”) as a test, which is an old debabelizer [translation] method called from within some of my older plugins.
It’d not be too hard to recast it into your own working code - but you must understand what each steps does !