XFILES always opens on :MAIN

Be clear with the topic titles to help members find the answers
Post Reply
Zzoom
Posts: 31
Joined: Thu Feb 22, 2024 12:58 pm
Location: Banbury=ish UK

XFILES always opens on :MAIN

Post by Zzoom »

Im using XFILES to view and edit a database and its working great .But everytime I access XFILES the default is :MAIN :x and I have to re-open the File im working on .is there a way to either change the default or open XFILES with a shortcut ??
Daren
Posts: 77
Joined: Tue Jan 03, 2023 10:03 pm

Re: XFILES always opens on :MAIN

Post by Daren »

No way to change the default, but you can add a file shortcut directly to top menu, for example you have a Xfile DB called “Addr” you can insert in main menu by pressing mode, type ADDR, enter, select Files option, now it will add to top menu and open the file directly.
Zzoom
Posts: 31
Joined: Thu Feb 22, 2024 12:58 pm
Location: Banbury=ish UK

Re: XFILES always opens on :MAIN

Post by Zzoom »

That would be ideal but how do I sellect the files option ? I should perhaps mention im doing this on a XP :shock:
Daren
Posts: 77
Joined: Tue Jan 03, 2023 10:03 pm

Re: XFILES always opens on :MAIN

Post by Daren »

Ah, what I wrote only works LZ machines. You might be able to write a OPL program which could do it, but maybe Martin Reid would know for sure.
MartinP
Posts: 54
Joined: Wed Jan 04, 2023 7:51 pm

Re: XFILES always opens on :MAIN

Post by MartinP »

XFILES for XP from Jaap's website has the default file set in XFILES.OPL just after the machine code section (all the MC% lines). The variable is: F0$="MAIN", the line before it reads the current pack using P%=PEEKB($A2), where $A2 is the memory location where the current pack is stored in the system variables.
Changing F0$ to your file and P% to 0,1 or 2 for A:, B: or C: should work to set the default. Then translate and save before running it.
Zzoom
Posts: 31
Joined: Thu Feb 22, 2024 12:58 pm
Location: Banbury=ish UK

Re: XFILES always opens on :MAIN

Post by Zzoom »

Yes that works great.Thanks :D
Post Reply