Page 2 of 3
Re: EasyPTR APPMAN help
Posted: Thu Feb 06, 2020 12:16 pm
by JonS
Norman
Thanks, but it works fine if I add the menu to an extension file as per your example.
However, as I always have the extensions loaded, that's adding a large chunk of "duplicate" code so I am trying to create an _app file, with just the menus in.
Re: EasyPTR APPMAN help
Posted: Thu Feb 06, 2020 12:50 pm
by NormanDunbar
Disassembling the calc_cde from that old tutorial, I see the following:
Code: Select all
L0000 bra L0206
L0206 bsr L0612
L020A bne L03BE
L020E movea.w $110,a2 ; BI_INIPR/BP_INIT
L0212 lea L0052,a1
L0216 jmp (a2)
Label L0052 is $52 and equates to the decinmal '82 in the $$asmb line. So it looks fine from here.
Cheers,
Norm.
Re: EasyPTR APPMAN help
Posted: Thu Feb 06, 2020 12:53 pm
by NormanDunbar
JonS wrote:Norman
Thanks, but it works fine if I add the menu to an extension file as per your example. However, as I always have the extensions loaded, that's adding a large chunk of "duplicate" code so I am trying to create an _app file, with just the menus in.
Ah, right, sorry. To be honest, I'm not sure that you can actually do that. I might be wrong though. I am of the impression that if I want to compile a program, I'd love to have all its dependencies inbuilt - and that would include the PTRMEN_CDE and my menus etc as well.
I might have to dig out my manual and have a read!
By the way, we crossed in the post, please ignore my previous post.
Cheers,
Norm.
Re: EasyPTR APPMAN help
Posted: Thu Feb 06, 2020 1:03 pm
by NormanDunbar
Ok, I checked the EasyPTR 4 manual, it says this:
With APPMAN menus, sprites, blobs and patterns appended to the SuperBASIC extension files
'easyptr_cde', 'easymen_cde' or 'ptrmen_cde' can be managed.
(my emphasis)
This appears to say that you need an extensions file loaded. Further on it says:
7.1 Base file
The first extension file loaded with the option
[Extension (+Appendix)]
in the FILES menu is treated to be the base file, which is written out with the appendix when saved with
the same option.
Which seems to back it up, you need to load the extensions file as the base, then the menus on top.
That's what I've always done too.
I notice that the manual now states that
APPMAN's _app files can be included in Qliberated programs using
Whereas mine has worked in the past, with EasyPTR 3, with:
My EasyPTR 3 manual says nothing, in the APPMAN section, about how to link the files into Qliberated programs.
HTH
Cheers,
Norm.
Re: EasyPTR APPMAN help
Posted: Thu Feb 06, 2020 1:12 pm
by pjw
Try adding rem $$chan=4 at the top of the program..
Re: EasyPTR APPMAN help
Posted: Thu Feb 06, 2020 1:37 pm
by EmmBee
JonS wrote:Per,
Doing that allows it to show the menu in SBASIC. If I compile with it LRESPR'd and compile without the $$asmb directive, it runs okay as well.
However, linking in with $$asmb=filename,0,64 results in a message of "String is not numeric" (!!) on the line calling APPA0.
The Manual says ...
[ Command see → APPA ] [ n ]
Here the number of the APPAn command in an EASYAPP file is set. 'n' can be any number from '0'
through '9', i.e. ten different EASYAPP files with different commands APPA0 through APPA9 can be
generated.
So, you need to specify a number in the range 0 to 9, and not use ... adr = APPA0('qlib1') which is specifying a string.
Re: EasyPTR APPMAN help
Posted: Thu Feb 06, 2020 1:54 pm
by tofro
EmmBee wrote:
The Manual says ...
[ Command see → APPA ] [ n ]
Here the number of the APPAn command in an EASYAPP file is set. 'n' can be any number from '0'
through '9', i.e. ten different EASYAPP files with different commands APPA0 through APPA9 can be
generated.
So, you need to specify a number in the range 0 to 9, and not use ... adr = APPA0('qlib1') which is specifying a string.
The number 0..9 is part of the
function name, as any program can have up to 9 appendices that return their embedded ressources by string, so
returns the menu named "main_menu" from appendix 0, while
returns the sprite named "spaceship" from appendix 9. It's a bit complicated (also, explained in a weird way in the manual), but allows easy inclusion of WM resources into programs. A bit later in the manual, the APPAn function is explained a bit better.
Tobias
Re: EasyPTR APPMAN help
Posted: Fri Feb 07, 2020 9:33 am
by JonS
Well, true to form this was my mistake.
$$asmb=name,0,60 does work. As the QLiberator manual clearly states, the extension (in this case APPA0) must be loaded when compiled. However, I had QSAVE'd before loading it and compiling it. I always save code using QSAVE so never use the LIBERATE name, structure but use the interactive.
I'm updating my QLiberator manual to say
IT IS ESSENTIAL THAT SUCH EXTENSIONS ARE ALREADY LOADED WHEN THE PROGRAM IS SAVED/COMPILED. If this is not observed, the compiler will find ambiguous names or unpredictable runtime behaviour will result.
Thanks for all advice given.
Re: EasyPTR APPMAN help
Posted: Fri Feb 07, 2020 10:19 am
by RalfR
The problem with the SMSQ/E way of QSAVE/QLOAD is, that contrary to the original Liberation one, after loading a QSAVEd file and not having loaded the extensions first, then the Liberation one states "Extensions missing!", whereas the SMSQ/E one does not.
Those missing extensions may give problems, because QLiberator v3.36 then assumes externals or overlays and does not report an error during compile time ("ambiguous name").
Re: EasyPTR APPMAN help
Posted: Fri Feb 07, 2020 10:50 am
by dilwyn
JonS wrote:Well, true to form this was my mistake.
$$asmb=name,0,60 does work. As the QLiberator manual clearly states, the extension (in this case APPA0) must be loaded when compiled. However, I had QSAVE'd before loading it and compiling it. I always save code using QSAVE so never use the LIBERATE name, structure but use the interactive.
I'm updating my QLiberator manual to say
IT IS ESSENTIAL THAT SUCH EXTENSIONS ARE ALREADY LOADED WHEN THE PROGRAM IS SAVED/COMPILED. If this is not observed, the compiler will find ambiguous names or unpredictable runtime behaviour will result.
Thanks for all advice given.
Thanks for letting us know the outcome. With hindsight, probably obvious to regular users, but worth noting just the same. Ralf's comments about the difference between the way the original QLOAD/QSAVE work compared to the SMSQ/E version is also worth noting.