The easiest way to 'delete' a record in a random file is to write (put)
for RN&=Record&+1 to NR& (number of records)
Get #1,RN&,UDT
PUT #1,RN&-1,UDT
next
then have some way of controlling what the total records are (NR&) and reduce it by 1, such as a separate file containing the number of records or
as another UDT of the same length in Record 1 (so that the actual data
records exist in records 2 to NR&+1).
I do this as well as insert records in my Client Writeup for CPAs program.
If you clear the entire file, then you can rewrite records 1 to Record&-1
first.
UDT of course, stands for a User-defined Type.
in QB if you have a large file and are putting the entire UDT records in an array, you might run into memory problem. With PowerBasic for windows, you shouldn't have that problem.