Function dbmovefirst
Imagine that: you opened a table in the database, started reading something, moving through the rows... and then suddenly you had to go back to the beginning.
No, do not manually migrate back, do not recreate the request. Just go back. That's what the dbmovefirst(table) function is for..
You hit the button and you're back at the start.
Everything works pretty clearly.: you're passing the table variable to the function, which is essentially,
an "open" table obtained earlier via opentable.
That's it — dbmovefirst moves the read/write pointer to the very first record. It's like you've just opened a spreadsheet from scratch.
What's going on under the hood? In short:
The function first checks whether everything is OK with the table: whether it exists at all, and whether it is empty. If something is wrong, it immediately crashes so as not to do anything stupid.
Next: to "turn the page" back to the first one, the function first closes the table — frees up the resources associated with the current position.
After that, he carefully opens it again — from the beginning. The pointer ends up on the first element. Just like in a good editor — Ctrl+Home and you're at the top.
No magic, just a clear tool that is convenient to use when you need to quickly start reading the table from the beginning.
It helps out especially in situations when something went wrong and you need to look at the data again, from beginning to end. Or start all over again, as if honestly. From zero.
Where table is the variable returned by the functionopentable
This function moves the read/write pointer in the database table to the beginning.
Help on built-in functions
The rules of programming scripts
Programm options
Color constants