meant to read "REM f$ = 8 characters with max 10 files(can increase) ? because file names can only be 8 characters?REM f$ = 8 files with max 10 characters (can increase)
“Folders” on home screen?
-
- Posts: 113
- Joined: Tue Jan 03, 2023 10:03 pm
Re: “Folders” on home screen?
Martin, is this
- Martin
- Global Admin
- Posts: 423
- Joined: Mon Jan 02, 2023 5:18 pm
DIR$
Hi Daren
Well spotted and good thought process, you are correct about 8 character file names BUT with 2 for the device.. eg.. "B:FileName" = 10 characters
DIR$ returns the device and the file name "B:FileName"
You will see that later in the program when constructing the menu we strip out the device "B:" with...
f$(c%)=RIGHT$(f$(c%),LEN(f$(c%))-2)
Then you are right at this stage say f$() goes from "B:FileName" to "FileName " but still has space for two 'unused characters'.
It gets even more specific later when you're considering your file handling and backup program as you will use (LZ specific) DIRW$ which includes device:filename.extension which might look like "B:FileName.ODB" (14 characters)
It is good that you are questioning what you type. Sometimes (me included) it is just blind faith in someone elses programming ability.
Sincerely and in good faith
Martin
PS I didn't help matters by choosing a maximum of 8 files which can be confused with 8 character files names. AND it is that than can be increased to 10 or even 20 - f$(20,10) - if you think there might ne that many files.
Well spotted and good thought process, you are correct about 8 character file names BUT with 2 for the device.. eg.. "B:FileName" = 10 characters
DIR$ returns the device and the file name "B:FileName"
You will see that later in the program when constructing the menu we strip out the device "B:" with...
f$(c%)=RIGHT$(f$(c%),LEN(f$(c%))-2)
Then you are right at this stage say f$() goes from "B:FileName" to "FileName " but still has space for two 'unused characters'.
It gets even more specific later when you're considering your file handling and backup program as you will use (LZ specific) DIRW$ which includes device:filename.extension which might look like "B:FileName.ODB" (14 characters)
It is good that you are questioning what you type. Sometimes (me included) it is just blind faith in someone elses programming ability.
Sincerely and in good faith
Martin
PS I didn't help matters by choosing a maximum of 8 files which can be confused with 8 character files names. AND it is that than can be increased to 10 or even 20 - f$(20,10) - if you think there might ne that many files.
-
- Posts: 113
- Joined: Tue Jan 03, 2023 10:03 pm
Re: “Folders” on home screen?
Ah, I was wondering about the device prefix so that answers 2 questions, the explanation is very helpful, especially the additional information about the filetype, which I was conscious of but had not considered in this scope. Thanks very much for the detailed answer Martin.
I tried the program and it works very well, it correctly found all the files and I tried with a few datapaks too, I think eventually a modification to return to the Xfiles menu might be handy, similar to how Zac Schroff’s notepad enhancement works, so it might give me some clues, I will probably print both programs out to get a better idea.
The UDG at the top is something I was interested in adding, so that was nice to see
I think things like this add a degree of professionalism, along with other enhancements to make a program user friendly.
Great stuff Martin!
I tried the program and it works very well, it correctly found all the files and I tried with a few datapaks too, I think eventually a modification to return to the Xfiles menu might be handy, similar to how Zac Schroff’s notepad enhancement works, so it might give me some clues, I will probably print both programs out to get a better idea.
The UDG at the top is something I was interested in adding, so that was nice to see

Great stuff Martin!
- Martin
- Global Admin
- Posts: 423
- Joined: Mon Jan 02, 2023 5:18 pm
Back to xFiles
If at the end of the program you want to be in xFiles then..
(1) Change the line..
IF m%=0 :RETURN :ENDIF :REM [ON/CLEAR] quits
to
IF m%=0 :GOTO QUIT:: :ENDIF :REM [ON/CLEAR] quits
(2) After the last line GOTO TOP::
add...
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This will exit the program into xFiles with the last file you were inspecting 'open' and when you [ON/CLEAR] (twice) out of xFiles the RETURN above will return you to where you called the program from either top level menu or the prog menu
$C601 = see function 1 below
Further reading
Page 166 of the republished technical reference manual
xFiles: XF$ENTR
Provides an entry point to the XFILES application in the top-level menu.
> Function 0 - Initialises the current XFILES file to be MAIN.
> Function 1 - Enter the XFILES application as if from the top-level menu.
> Function 2 - Search files on all devices for a given string.
$C601=xFiles, $C604=Find $C605=Save
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
I've also added a CLS.. But before you do try this to see why..
Start your program > Choose a file from the menu > It will display "Find in (your file reference)" > Press EXE to bring up the 1st Record > (to modify this record) press MODE (change something) and press EXE... That is why we need a CLS before displaying the menu again.
I've changed the display menu section to
CLS :PRINT CHR$(0);REPT$(CHR$(2),14) :CLOCK(1) :AT 1,2
Don't you just love it..
Martin
PS that UDG stuff is usually in every program you write so is a prime candidate for it's own little routine/function that you call when needed.
(1) Change the line..
IF m%=0 :RETURN :ENDIF :REM [ON/CLEAR] quits
to
IF m%=0 :GOTO QUIT:: :ENDIF :REM [ON/CLEAR] quits
(2) After the last line GOTO TOP::
add...
Code: Select all
GOTO TOP::
STOP :REM just in case
QUIT::
A%(1)=$C601
A%(2)=$3FA8
A%(3)=$3901
USR(ADDR(A%()),0)
RETURN
This will exit the program into xFiles with the last file you were inspecting 'open' and when you [ON/CLEAR] (twice) out of xFiles the RETURN above will return you to where you called the program from either top level menu or the prog menu
$C601 = see function 1 below
Further reading
Page 166 of the republished technical reference manual
xFiles: XF$ENTR
Provides an entry point to the XFILES application in the top-level menu.
> Function 0 - Initialises the current XFILES file to be MAIN.
> Function 1 - Enter the XFILES application as if from the top-level menu.
> Function 2 - Search files on all devices for a given string.
$C601=xFiles, $C604=Find $C605=Save
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
I've also added a CLS.. But before you do try this to see why..
Start your program > Choose a file from the menu > It will display "Find in (your file reference)" > Press EXE to bring up the 1st Record > (to modify this record) press MODE (change something) and press EXE... That is why we need a CLS before displaying the menu again.
I've changed the display menu section to
CLS :PRINT CHR$(0);REPT$(CHR$(2),14) :CLOCK(1) :AT 1,2
Don't you just love it..
Martin
PS that UDG stuff is usually in every program you write so is a prime candidate for it's own little routine/function that you call when needed.
-
- Posts: 113
- Joined: Tue Jan 03, 2023 10:03 pm
Re: “Folders” on home screen?
Yep, fantastic!Don't you just love it..
I did the modification - typed in on Psion, but missed the very last % for the A variable, but once I realised the “Missing External” error, corrected and it works now.
I also experienced the issue with the same file name on A and on a rampack - what happened is both were shown in the menu but regardless which was chosen it always opened the A version as you pointed out - I think the easiest and most practical solution is to ensure that any files copied to datapaks have a slightly modified name to account for this, the other option of course is to exit to Xfiles and load the file from there. I guess a possible modification might be to add a B or C prefix to a file name when there is a duplicate?
It’s funny, this program feels like it should have been built into the LZ now, great work Martin!
-
- Posts: 113
- Joined: Tue Jan 03, 2023 10:03 pm
Re: “Folders” on home screen?
Regarding the CLS, at first I was puzzled because everything was working fine when editing a record, I then tried a few more times and saw what was happening - some remnants of the last line of the record were at the too of the display - the reason I couldn’t see it the first few tries were the records were only 2 lines, the last record where it did happen was 5 lines, ha!
- Martin
- Global Admin
- Posts: 423
- Joined: Mon Jan 02, 2023 5:18 pm
Duplicate files
Ah duplicate databases!!!Daren wrote: Fri Feb 28, 2025 1:20 am I also experienced the issue with the same file name on A and on a rampack - what happened is both were shown in the menu but regardless which was chosen it always opened the A version as you pointed out - I think the easiest and most practical solution is to ensure that any files copied to datapaks have a slightly modified name to account for this, the other option of course is to exit to Xfiles and load the file from there. I guess a possible modification might be to add a B or C prefix to a file name when there is a duplicate?
There is a lot and time an effort invested by 'organisations' to ensure data integrity. If you have two or more 'duplicate' databases who is to say which one has been updated or added to?
For we mere mortals it is best to only have one version (active) of any database any archive or backup should have a different name.. eg.. FileName active becomes with Fname02 as a backup.
Perhaps an addition to your file handling routine might be an archive/backup function
Martin
- Martin
- Global Admin
- Posts: 423
- Joined: Mon Jan 02, 2023 5:18 pm
Version 2?
Hi again Daren
I got to playing with a 'copy option' in the menu. I'll not post the listing here but have attached the OPL below.
It is getting too big now. The CLONE:: section could stand alone.
As it gets more sophisticated it needs an error recovery section. (NO PACK ERROR)
If you put the new listing along side the previous you will see how it is evolving.
Sincerely
Martin
I got to playing with a 'copy option' in the menu. I'll not post the listing here but have attached the OPL below.
It is getting too big now. The CLONE:: section could stand alone.
As it gets more sophisticated it needs an error recovery section. (NO PACK ERROR)
If you put the new listing along side the previous you will see how it is evolving.
Sincerely
Martin
You do not have the required permissions to view the files attached to this post.
-
- Posts: 113
- Joined: Tue Jan 03, 2023 10:03 pm
Re: “Folders” on home screen?
Hi Martin - yes indeed on your points about db management, for my own uses realistically I think the best approach will be to have any databases subject to change on preferably internal memory, or a rampack (that is regularly backed up) and any “static” databases where the data won’t change on eprom or flash datapacks.
I look forward to trying your new version later when at computer, many thanks as always!
I look forward to trying your new version later when at computer, many thanks as always!