I had a letter recently in which the writer was discussing TorQLiB, our QL Library. One thing he was asking was if it was necessary to have “C”ontinue and also “N”ext in the catalogue MENU presentation, and this gave me the thought it might be worth mentioning in this column.
NEXT is an Archive command, where typing this in will take you to the next record of the current file.
CONTINUE will continue previous SEARCH or FIND from the record following the displayed record in the current file.
For example:-
Say you have records A, B, C, D, E, F. And records A, D, F, have the word CLOCK in them.
Say you are at record “A” on the screen, if you now type NEXT you will go to record “B”, and so on through the file displaying each record in rotation.
If you use the FIND “CLOCK” command, you will see record “A” on screen. Now if you type CONTINUE, you will be taken to record D, CONTINUE once again and you will see record F displayed. Thus placing on display only the records containing CLOCK.
Now can you see the difference?
NEXT goes to the next record on file.
CONTINUE goes to the next record of the string selection made by FIND or SEARCH.
In the TorQLib Catalogue, it is not necessary to type next or continue – only the initial letter of the word (c or n) and [ENTER] is necessary.
Please note:- “find” is case independant. “search” is case dependant.
CLOSE – NEW – QUIT
Now to the difference in the above Archive commands.
CLOSE will close the file in use, making the file safe, and saving any changes you may have made to the file.
NEW will close the file AND the program in use, but leaving you in Archive ready for another program to be run.
QUIT closes the file in use, the program in use, and returns you from Archive back into SuperBasic.
In all the above cases, the file is saved back to the device in use. That is why it is important to ALWAYS close an Archive file properly.
Now, should you just happen to try loading a file and get the message that the file is “not known” or “duplicate name” it is possible you have a file which is already open or has not been closed properly. In the latter case, there is a neat little program in the library called DBF_CLOSE_BAS written by Howard Clase. This program will close those files you failed to close yourself.
At this point I should mention that there is a difference between a file which has been left OPEN from the OPEN command, and one which has been left OPEN from the LOOK command.
When you are referring to a file it is usually in the LOOK state, in which there is not much damage done to a file left open that cannot be repaired by DBF_CLOSE_BAS. You have just been LOOKING at the file.
If you have been adding to, or making changes to a file such as editing records, or inserting new records, then you will have been in the OPEN state. In which case if you remove the disk, or leave the program without using the proper CLOSE or QUIT, then you are in all probability going to lose a whole stack of stuff, which can’t always be recovered without a lot of work.
The moral of the story is :——–
KEEP A CURRENT BACK-UP
and
CLOSE THAT FILE – PROPERLY –
930103