Welcome! Log In Create A New Profile

Advanced

WDMap: Adding, modifying and deleting the data file records

Posted by Clarion Ghost 
In WDMap you can also delete ALL the records resetting the file numbering to 0.

How do you delete all the records and reset the file to 0 using code?

Many Thanks
Hello Ian

HCreation() will delete all the records and because it creates a new file, the autoid will be reset to 0

Regards
Al
Should have realised. Very Clarionesk!

Thanks Al
Hello.

Is there any way to select multiple records for deletion without having to o it one by one.

Thanks .
Al
Re: WDMap: Adding, modifying and deleting the data file records
January 09, 2024 10:15PM
Hello Gavin,

If you are still talking about WDMap it will will delete all the records displayed in the table so you can use Ctrl Q to select records based on field value matching or Ctrl R for an SQL query option to select records. Sometimes the deletion process in WDMap runs but does not actually delete all the records so it is a good idea to always check by running the selection again until it shows zero records found.

In code, if I have a lot of records to delete, I generally create a view containing just the primary key of the records to delete and then run through the view in a loop using the key in the view to hreadseekfirst() the record in the actual file and delete them one by one from the file.

Regards
Al
Author:

Your Email:


Subject:


Spam prevention:
Please, enter the code that you see below in the input field. This is for blocking bots that try to post this form automatically. If the code is hard to read, then just try to guess it right. If you enter the wrong code, a new image is created and you get another chance to enter it right.
Message: