PE Programming for dummies

Anything QL Software or Programming Related.
User avatar
dilwyn
Mr QL
Posts: 2761
Joined: Wed Dec 01, 2010 10:39 pm

Re: PE Programming for dummies

Post by dilwyn »

I sincerely hope I'm missing something here (assuming I am, I apologise in advance, I did read through the comments rather hurriedly).

I rarely use the Appendix Manager if using only a single set of menus appended to a Easyptr extensions file, using Easymenu to append menus to an extensions file initially (in Easymenu, Files->Append to add a menu to an extensions file), then only use AppMan to make changes later, e.g. update menus or base extension files, or to do something which needs to access the menu definitions directly. If you append all menus to a single extension file (easymen_cde or ptrmen_cde), you can avoid the use of APPAn altogether in simple programs - this may be useful just for learning, testing an development as an alternative.

There seems to be an inconsistency in Easyptr's manual where is one place it says the directive is $$asmb=filename,0,60 and in another the 60 changes to 64 (pages 52 and 65). (Again, as I don't use AppMan much, I may be missing something here, or maybe one refers to a completely different thing?).


User avatar
mk79
QL Wafer Drive
Posts: 1349
Joined: Sun Feb 02, 2014 10:54 am
Location: Esslingen/Germany
Contact:

Re: PE Programming for dummies

Post by mk79 »

Andrew wrote:What APPMAN version are you using?
I use v4.02, latest version from EasyPtr4 package from Dilwyn's site - and it refuses to run on QPC2 in high colour modes!!!! It only runs in QL colors mode
Before going into any details you should sort out this problem. AppMan 4.02 absolute must run in QPC2 high colour mode, otherwise there are strange forces at work and debugging all the subsequent problems is probably moot.


User avatar
BSJR
Trump Card
Posts: 186
Joined: Sun Oct 18, 2015 12:53 pm
Location: Amsterdam
Contact:

Re: PE Programming for dummies

Post by BSJR »

dilwyn wrote:There seems to be an inconsistency in Easyptr's manual where is one place it says the directive is $$asmb=filename,0,60 and in another the 60 changes to 64 (pages 52 and 65). (Again, as I don't use AppMan much, I may be missing something here, or maybe one refers to a completely different thing?).
The 0,64 was probably true for EsyPv3 and made its way into the v4 documents but 0,60 is the correct offset for v4.
The biggest advantage of using the _app option is to have ptrmenr_cde loaded only once for all your EsayP applications, saving bytes in each one.
So far not all EasP based programs use this route, not even my own, but with it being free now it's easier and I know PJW is a strong supporter.

BSJR


User avatar
Andrew
Aurora
Posts: 796
Joined: Tue Jul 17, 2018 9:10 pm

Re: PE Programming for dummies

Post by Andrew »

mk79 wrote:Before going into any details you should sort out this problem. AppMan 4.02 absolute must run in QPC2 high colour mode, otherwise there are strange forces at work and debugging all the subsequent problems is probably moot.
I am using QPCII 5.02 and I boot from your qpc demo win. APPMAN works in QL mode, but would not run in high colour mode :(
Reinstalling QPCII didn't changed anything.
I have no clue what's going on

LATER EDIT:
I found out what the problem is: APPMAN will run in high color mode only if resolution is at least 640x480!
But it would not run in 512x256 High colour mode!
All other Easyptr programs work in 512x256, in all colour modes.
As I only use a BBQL, my QPC is also set to run in 512x256, hence the issue


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

Re: PE Programming for dummies

Post by NormanDunbar »

many years ago, I wrote a tutorial series for Quanta, based on EasyPointer 3. I wrote up some stuff about APPMAN as it was such a PITA to unedrstand from the manual. I've scoured my hard drive and found the following, hopefully still useful.

Cheers,
Norm.

APPMAN_OBJ - THE APPENDIX MANAGER.

This program allows you to create a single extension file which has all of your
menus etc contained in it. This file can then be compiled into your final
program and only slight modification is required to make it work.

Once you have EXECed APPMAN_OBJ, you need to first of all load in an extensions
file as your base file.

HIT 'FILES' and the 'FILES MENU' appears, now HIT 'LOAD' and then HIT
'EXTENSION (+APPENDIX)' then hit 'OK'. You now get up a FILE_SELECT menu
similar to that in EASYMENU when you loaded and saved files. Find the file
PTRMENR_CDE and DO it. The main screen returns showing the filename in a little
box. You now have loaded the base file containing all the required extensions
to make your program work.

Now the menu(s) can be appended to the base file. HIT 'FILES' again, now HIT
'MENU' to select only menu files, then HIT 'OK' to get the FILE_SELECT screen
again. Find the 'CALC_MEN' file and DO it. When the main screen is displayed
again, there is a line of details about 'CALC_MEN' added. Keep adding menus as
required until all menus used in your program are added to the base file.

If you wish to see a particular menu, just to make sure it is the correct one,
HIT 'SHOW', now DO the number in the 'NO' column that corresponds to the menu
you want to see and it will appear. ESC, HIT or DO to remove it from the
display and return to the main screen again.

If you have really made a mess of it, HIT 'CLEAR' to start again.

If you wish to remove one of the menus, or move it to a new position in the
list, HIT the 'TYPE + NO' column for that menu and you can then enter a new
position number or enter zero to delete that one menu.

Once you have loaded everything you need, HIT 'FILES' again, HIT 'SAVE' and HIT
'EXTENSION (+APPENDIX)' and finally HIT 'OK'. The FILE_SELECT menu appears once
again with a default name showing. Press F3 to edit this name as it will
OVERWRITE the base file if you don't.

Change the name to your program and give it an extension of '_CDE', so our
filename will be 'CALC_CDE' and then HIT 'OK' to save it. The main screen will
be shown again.

If, at some point in the future, you change the design of your program's
screen, simply load the 'CALC_CDE' as the base file, delete the appropriate
changed menu, append in the new version and save it as above. This time you can
overwrite the old file.

This is a handy program to use, but the manual is very bad.


CHANGING YOUR PROGRAM.

Now that all the code and menus are held in one single extensions file, how do
you get at them ?

All you need to do, is find the MDRAW command in your program and remove the
device name and the '_men' extension. Our program will now be :

1234 MDRAW #3, 'calc',0,0

And because there is no device name, the EP code in the file CALC_CDE can find
the menu in memory. This is much quicker and better, especially if you are
going to sell your programs.

Compiling with Qliberator, you will also have to insert a line such as :

100 REMark $$asmb=flp1_calc_cde,4,82

which will cause the compiler to include the file 'CALC_CDE' into your final
program. Note that these lines should go at the start of your program before
any line that is not a REMark line. There should be no spaces before or after
the '=' nor should there be any before and after the commas.

The numbers 4 and 82 are taken from the actual CALC_CDE file. If you copy it to
a SCR channel, it will have a bit of text in it that tells you what the actual
$$asmb command line should be. The manual is wrong when explaining this - it
gives the wrong numbers.


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.
User avatar
Andrew
Aurora
Posts: 796
Joined: Tue Jul 17, 2018 9:10 pm

Re: PE Programming for dummies

Post by Andrew »

I found the bug.

Code: Select all

1070 IF Q_MYJOB <> 0 THEN
1080    OPEN #0,'con' : OPEN #1,'con' : OPEN #2,'con'
1090    mainch%=3
1100    md$ = '' : mx$ = ''
1110 ELSE
1120    mainch%=3
1130    md$ = HOME_DIR$ : mx$ = '_men'
1140 END IF
In line 1080 i have a Open#0, 'con'
That is causing the errors - and the errors were misleading:

Code: Select all

Line 1880 CHAR_USE  invalid parameter
Line 1890 MAWCLEAR Invalue out of range 
etc.
Well, after I removed the Open#0, 'con" the compiled program works perfectly.
I always compile with all channels closed - so why it is Open#0 causing problems?

QLiberator manual says (page 27, word version):
-WINDS If this option is present then a compiled program will have channels 10, II and 12 already open when it starts. If the option is off then the program must open all its own windows.
Is this a typo? Should it say "channels 0, I and 2 already open" ?


User avatar
mk79
QL Wafer Drive
Posts: 1349
Joined: Sun Feb 02, 2014 10:54 am
Location: Esslingen/Germany
Contact:

Re: PE Programming for dummies

Post by mk79 »

Andrew wrote:LATER EDIT:
I found out what the problem is: APPMAN will run in high color mode only if resolution is at least 640x480!
But it would not run in 512x256 High colour mode!
All other Easyptr programs work in 512x256, in all colour modes.
As I only use a BBQL, my QPC is also set to run in 512x256, hence the issue
Ah, I see. That's interesting. Glad you could solve the main problem!
-WINDS If this option is present then a compiled program will have channels 10, II and 12 already open when it starts. If the option is off then the program must open all its own windows.

Is this a typo? Should it say "channels 0, I and 2 already open" ?
Either type or bad OCR, winds opens 0, 1 and 2.


User avatar
dilwyn
Mr QL
Posts: 2761
Joined: Wed Dec 01, 2010 10:39 pm

Re: PE Programming for dummies

Post by dilwyn »

mk79 wrote:
Andrew wrote:LATER EDIT:
I found out what the problem is: APPMAN will run in high color mode only if resolution is at least 640x480!
But it would not run in 512x256 High colour mode!
All other Easyptr programs work in 512x256, in all colour modes.
As I only use a BBQL, my QPC is also set to run in 512x256, hence the issue
Ah, I see. That's interesting. Glad you could solve the main problem!
-WINDS If this option is present then a compiled program will have channels 10, II and 12 already open when it starts. If the option is off then the program must open all its own windows.

Is this a typo? Should it say "channels 0, I and 2 already open" ?
Either type or bad OCR, winds opens 0, 1 and 2.
Confirmed, all versions of the manual for v3.xx on my website by the various contributors all have this OCR error/typo in for the WINDS command (although it occurs correctly later in the manual).

It'll be an OCR error - looking at the same in my old printed manual, the '#' is pretty solid black, little wonder it scanned as a '1' (assuming whoever did the original scan had a manual of same print quality as me). Quite amazing the number of people who contributed to getting this done and NONE of us saw that error! (I'm going into hiding in case Andrew comes looking for me after the grey hairs it's caused him).

If anyone is aware of any further typos/OCR errors in the manuals, now would be a good time to let me know so I can fix them today while I'm home.

I'll need to correct them all DOCs, DOCXs and PDFs, may take a while, should be updated versions on my site later today.


User avatar
BSJR
Trump Card
Posts: 186
Joined: Sun Oct 18, 2015 12:53 pm
Location: Amsterdam
Contact:

Re: PE Programming for dummies

Post by BSJR »

Andrew wrote:LATER EDIT:
I found out what the problem is: APPMAN will run in high color mode only if resolution is at least 640x480!
But it would not run in 512x256 High colour mode!
All other Easyptr programs work in 512x256, in all colour modes.
As I only use a BBQL, my QPC is also set to run in 512x256, hence the issue
Interesting observation.
I had a quick look at the AppMan4 sources but so far cannot find anything that would cause this.
As v4 was adapted to High Colours and Resolutions it was probably not fully tested at the standard QL size.
Can you show me a screenshot of your mode 4 AppMan?
I will have a further look at the way the screen is checked in AppMan.

BSJR


User avatar
dilwyn
Mr QL
Posts: 2761
Joined: Wed Dec 01, 2010 10:39 pm

Re: PE Programming for dummies

Post by dilwyn »

BSJR wrote:
Andrew wrote:LATER EDIT:
I found out what the problem is: APPMAN will run in high color mode only if resolution is at least 640x480!
But it would not run in 512x256 High colour mode!
All other Easyptr programs work in 512x256, in all colour modes.
As I only use a BBQL, my QPC is also set to run in 512x256, hence the issue
Interesting observation.
I had a quick look at the AppMan4 sources but so far cannot find anything that would cause this.
As v4 was adapted to High Colours and Resolutions it was probably not fully tested at the standard QL size.
Can you show me a screenshot of your mode 4 AppMan?
I will have a further look at the way the screen is checked in AppMan.

BSJR
Although I can get AppMan4.02 to work on 512x256 mode 32, its outline seems set to full screen rather than the visible area of appman, presumably so that it can show menus to the full screen size (larger than AppMan's own display). This makes it hard to see what's going on, especially if you change the display resolution AFTER starting AppMan 4.02 (the only version I tried). Conclusion: Appendix Manager 4.02 always seems to fill the QPC2 display, even though its own menu only takes a fraction of the screen).

If I set Launchpad or another program to fill the screen, and then start AppMan 4 it only part fills the screen, but I don't see anything around it in the background(Launchpad edges or SBASIC windows, just a blue backing which is probably the blue colour theme I use). However, trying to load and show a larger menu into AppMan than will fit a 512x256 screen, it then correctly produces an out of range report. But once you click on [OK] it then gives a bad parameter error message and stops with the red QLib screen (no line numbers I'm afraid to let you know where the error occurred).
appman4a.jpg
appman4b.jpg
appman4c.jpg


Post Reply