EasyPTR APPMAN help

Anything QL Software or Programming Related.
User avatar
JonS
Bent Pin Expansion Port
Posts: 77
Joined: Fri Nov 11, 2011 3:54 pm
Location: Cumbria

EasyPTR APPMAN help

Post by JonS »

I am trying to add a menu to an "appendix" prior to compiling a program.

Normally, I would add the menu to a copy of the ptrmen_cde file and add the $$asmb command. However, as I always have the EasyPTR extensions loaded I thought I would create an _app type file. Having never done this before I may be totally misunderstanding the manual, as I can't get it to work.

What I've done is created an _app file with just one menu (at the moment). This was created as APPA0 in AppMan4.

Next, how to include in compiled code...Appendix Manager chapter of the manual says REMark $$asmb=filename,0,60 but the APPAn command says REMark $$asmb=filename,0,64 (I've tried both).

Finally, I've added adr=APPA0("menu") to my code to get the address of the menu so I can use that with MDRAW.

I can't get this to work.

Have I misunderstood the EasyPTR manual? Any help would be welcome.


User avatar
tofro
Font of All Knowledge
Posts: 2701
Joined: Sun Feb 13, 2011 10:53 pm
Location: SW Germany

Re: EasyPTR APPMAN help

Post by tofro »

Code: Select all

10 REMark %%dos8_qjewels_qjewels0_app,0,60
....
10000 MDRAW #winw%, APPA0("main_l")
Works for me in Turbo-compiled basic (the REM is basically the same thing as $$asmb in QLiberator)

Tobias


ʎɐqǝ ɯoɹɟ ǝq oʇ ƃuᴉoƃ ʇou sᴉ pɹɐoqʎǝʞ ʇxǝu ʎɯ 'ɹɐǝp ɥO
User avatar
JonS
Bent Pin Expansion Port
Posts: 77
Joined: Fri Nov 11, 2011 3:54 pm
Location: Cumbria

Re: EasyPTR APPMAN help

Post by JonS »

Maybe it's an issue with QLiberator…

1400 REMark $$asmb=WIN1_DEV_QLIB_QLIBPTR_app,0,60

14591 a=APPA0("menu1")
14595 MDRAW#c%,a

When running the compiled program I get "Indices wrong" on line 14591


User avatar
tofro
Font of All Knowledge
Posts: 2701
Joined: Sun Feb 13, 2011 10:53 pm
Location: SW Germany

Re: EasyPTR APPMAN help

Post by tofro »

You can check your _app file with a hex editor (There's a quite nice one named hexedit on Dilwyn's site) or a disassembler - You should be seeing a BP.INIT-compatible extension table (1 word number of procs (1), 1 word pointer to routine ($xxx), 1 byte (5), 6 Bytes "APPA0",.....) at offset 60. If not, something's wrong with your _APP file. If the offset is not (decimal) 60, use the offset you find.

Tobias


ʎɐqǝ ɯoɹɟ ǝq oʇ ƃuᴉoƃ ʇou sᴉ pɹɐoqʎǝʞ ʇxǝu ʎɯ 'ɹɐǝp ɥO
User avatar
RalfR
Aurora
Posts: 872
Joined: Fri Jun 15, 2018 8:58 pm

Re: EasyPTR APPMAN help

Post by RalfR »

tofro wrote:You can check your _app file with a hex editor (There's a quite nice one named hexedit on Dilwyn's site) or a disassembler - You should be seeing a BP.INIT-compatible extension table (1 word number of procs (1), 1 word pointer to routine ($xxx), 1 byte (5), 6 Bytes "APPA0",.....) at offset 60. If not, something's wrong with your _APP file. If the offset is not (decimal) 60, use the offset you find.
A little program would be helpful for all people, who have problems finding the two parameters of $$asmb to check the extension.
Last edited by RalfR on Thu Feb 06, 2020 9:50 am, edited 1 time in total.


4E75 7000
User avatar
JonS
Bent Pin Expansion Port
Posts: 77
Joined: Fri Nov 11, 2011 3:54 pm
Location: Cumbria

Re: EasyPTR APPMAN help

Post by JonS »

Tobias

Looks like it is at offset 64.

I am going to try a cut-down program to just display the menu screen and nothing else and work from there, using the $$asmb=name,0,64 directive, and see how it goes


User avatar
JonS
Bent Pin Expansion Port
Posts: 77
Joined: Fri Nov 11, 2011 3:54 pm
Location: Cumbria

Re: EasyPTR APPMAN help

Post by JonS »

Hmm...still the same.

141 REMark $$asmb=WIN1_DEV_Qlibptr_app,0,64
165 REMark $$i
170 :
1000 chan3=3 : adr=APPA0('qlib1')
1010 OPEN#chan3;'con_'
1020 MDRAW#chan3,adr
1030 REPeat loop
1040 a=MCALL(#chan3)
1050 IF a=0 THEN EXIT loop
1060 END REPeat loop
1070 CLOSE#chan3

Still get an error when running...."Indices wrong" on the call to APPA0

I'll try running in an environment that has no extra toolkits loaded other than the QLiberator ones and see if something is causing a clash.


User avatar
pjw
QL Wafer Drive
Posts: 1300
Joined: Fri Jul 11, 2014 8:44 am
Location: Norway
Contact:

Re: EasyPTR APPMAN help

Post by pjw »

Jon,
You should be able to LRESPR the _app file and RUN or EXecute the SBASIC file to test your program. That should give a clearer idea of where the problem lies..


Per
dont be happy. worry
- ?
User avatar
JonS
Bent Pin Expansion Port
Posts: 77
Joined: Fri Nov 11, 2011 3:54 pm
Location: Cumbria

Re: EasyPTR APPMAN help

Post by JonS »

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.


User avatar
NormanDunbar
Forum Moderator
Posts: 2274
Joined: Tue Dec 14, 2010 9:04 am
Location: Leeds, West Yorkshire, UK
Contact:

Re: EasyPTR APPMAN help

Post by NormanDunbar »

getting APPMAN to work always gave me nightmares. The following is taken from my EasyPTR Tutorials from 1994 in Quanta and were originally written for EasyPTR 3:

Code: Select all

EXEC appman_obj

Hit FILES, LOAD, EXTENSION(+APPENDIX), OK.
Locate PTRMEN_CDE and DO it.

Hit FILES, MENU, OK.
Locate your _MEN file, and DO it.
Repeat as necessary to add all your menus.

Hit FILES, SAVE, EXTENSION(+APPENDIX), OK
F3 to edit the default name.
Hit OK to save the renamed file.

Add this to your SuperBASIC program which is to be compiled:

REMark $$asmb=flp1_filename,4,82


HTH

Cheers,
Norm.


Why do they put lightning conductors on churches?
Author of Arduino Software Internals
Author of Arduino Interrupts

No longer on Twitter, find me on https://mastodon.scot/@NormanDunbar.
Post Reply