Page 1 of 3

EasyPTR APPMAN help

Posted: Wed Feb 05, 2020 3:17 pm
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.

Re: EasyPTR APPMAN help

Posted: Wed Feb 05, 2020 3:35 pm
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

Re: EasyPTR APPMAN help

Posted: Wed Feb 05, 2020 3:49 pm
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

Re: EasyPTR APPMAN help

Posted: Wed Feb 05, 2020 6:28 pm
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

Re: EasyPTR APPMAN help

Posted: Wed Feb 05, 2020 8:50 pm
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.

Re: EasyPTR APPMAN help

Posted: Thu Feb 06, 2020 9:13 am
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

Re: EasyPTR APPMAN help

Posted: Thu Feb 06, 2020 9:25 am
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.

Re: EasyPTR APPMAN help

Posted: Thu Feb 06, 2020 10:30 am
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..

Re: EasyPTR APPMAN help

Posted: Thu Feb 06, 2020 11:46 am
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.

Re: EasyPTR APPMAN help

Posted: Thu Feb 06, 2020 11:51 am
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.