From: alan$@donor2.demon.co.uk (Alan Clifford)
Subject: OPL Reading of Settings "working days"
Date: 18 Apr 97 23:51:20 GMT

Hello Ronald

Replying to a message of Ronald Queloz to All:

RQ> how can I read the Clock settings of "Working Days" using OPL?

PROC main%:
 local ast%
 local coud$(40) rem country data
 rem get country info
 call($058B, addr(coud$), 0,0,0,0)
 ast% = peekb(uadd(addr(coud$), 29))
 print "Workdays"
 ast%:("Monday", (ast% and $1))
 ast%:("Tuesday", (ast% and $2))
 ast%:("Wednesday", (ast% and $4))
 ast%:("Thurday", (ast% and $8))
 ast%:("Friday", (ast% and $10))
 ast%:("Saturday", (ast% and $20))
 ast%:("Sunday", (ast% and $40))
 print "press a key"
 get
ENDP

proc ast%:(name$, status%)
 print name$;
 if status% = 0 : print " restday"
   else :print " workday"
 endif
endp

Alan
Please remove the '$' in the from line before reply via email. 
Anti-UCE filter in operation.


From: Ben Clifford <brenc@dass.prestel.co.uk>
Subject: Re: Help option on the menu
Date: Sun, 20 Apr 1997 20:50:48 +0200
To: RichieB <rbarber@demon.co.uk>

RichieB wrote:

> Does any one know, or have an app already that lets you add help to an
> application in a similar manner to the way its done in Windows ??

GET returns 291 when Help is pressed. 

Here's an example program which gives you the key code of a pressed key.
If you press help or choose Help from the menu, it brings up a help
dialog.

PROC g:
	local k%
	while 1=1
		k%=get
		print k%
		if k%=290
			mInit
			mCard "foo","bar",%b,"fubar",%u
			mCard "Help","Help",%h
			if menu=%h
				k%=291
			endif
		endif
		if k%=291
			dInit "Help"
			dText "","Press any key to see the code"
			dialog
		endif
	endwh
ENDP
 
http://www.geocities.com/SiliconValley/Lakes/7456

From: alanr@rd.bbc.co.uk (Alan Roberts)
Subject: Re: Help option on the menu
Date: 21 Apr 1997 08:41:12 GMT

RichieB wrote:
> Does any one know, or have an app already that lets you add help to an
> application in a similar manner to the way its done in Windows ??

The problem is that both ESC and HELP keys return zero in a menu. But
OPL keeps track of the actual key pressed, thus:

k%=DIALOG REM the usual exit from a dialogue
IF k%=0
  k%=SEND(PEEKW($38),23,kmod%) REM k% is the key code, kmod% the modifiers 
  IF k%=291
    REM whatever you want Help to do
  ELSEIF k%=27
    REM whatever you want ESC to do
  ENDIF
ENDIF

Hope that helps.
******* Alan Roberts ******* BBC Research & Development Department *******
* My views, not necessarily Auntie's, but they might be, you never know. *
**************************************************************************

From: alanr@rd.bbc.co.uk (Alan Roberts)
Subject: Re: Checking the status of a pixel?
Date: 21 Apr 1997 11:28:07 GMT

Dom Porter (richardp@dai.ed.ac.uk) wrote:

: I don't ask for much when I learn a programming language and the manual
: is quite good but can someone please tell me how to examine a pixel? 
: Their seems to be no reference to it in the manual.  Is it necessary to
: look directly into memory? 

Looking directly into memory won't help because the screen memory is
allocated dynamically. Have you tried using gPEEKLINE? It can read any
number of pixels from any window, or from the whole screen.
-- 
******* Alan Roberts ******* BBC Research & Development Department *******
* My views, not necessarily Auntie's, but they might be, you never know. *
**************************************************************************

From: alanr@rd.bbc.co.uk (Alan Roberts)
Subject: Re: LOADM
Date: 22 Apr 1997 08:40:43 GMT

Stephen Bedford (sbedford@patrol.i-way.co.uk) wrote:
: The LOADM command loads an OPO file from the OPO directory. This works
: fine for an OPL program program (containing the LOADM statement) is
: converted to an OPO file but when I make an OPA the LOADM fails to find
: the file. Where does an OPA look for OPOs that are loaded with LOADM? I
: have tried copying the file to the APP directory and other places, but
: it still fails

LOADM looks, by default, in the OPO directory on your default drive. So

	LOADM "routine"

will load the file LOC::M:\OPO\Routine.OPO assuming that you haven't set
your default drive to A or B (or C). If you want to load them from
elsewhere, or have different extensions, use as much of the full path
name as you need. Eg.

	LOADM "\APP\FILES\Routine.WIZ"

and so on. By the way, you aren't limited to the 3 or four files that
the OPL manual confusingly states. You can have up to 7 LOADMed files
load at the same time.

Hope that helps.
******* Alan Roberts ******* BBC Research & Development Department *******
* My views, not necessarily Auntie's, but they might be, you never know. *
**************************************************************************

From: Ben Clifford <brenc@dass.prestel.co.uk>
Subject: Re: LOADM
Date: Tue, 22 Apr 1997 17:55:07 +0200

Stephen Bedford wrote:
> 
> The LOADM command loads an OPO file from the OPO directory. This works
> fine for an OPL program program (containing the LOADM statement) is
> converted to an OPO file but when I make an OPA the LOADM fails to find
> the file. Where does an OPA look for OPOs that are loaded with LOADM? I
> have tried copying the file to the APP directory and other places, but
> it still fails

I successfully use LOADM in Ledger, my accounts program (available on my
web page).

I use full paths - eg

stylefn$="LOC:M:\APP\LED\NORMAL.OPO"
LOADM stylefn$

http://www.geocities.com/SiliconValley/Lakes/7456


From: Stephen Bedford <sbedford@patrol.i-way.co.uk>
Subject: Re: LOADM - resolved
Date: Wed, 23 Apr 1997 19:38:32 +0000

As suggested by various respondents (thank-you), when using LOADM in an
OPA it is necessary to specify the full path name of the module to be
loaded.

Whereas, as an OPO my program cab use:

LOADM "Mathlib1"

as an OPA, it must have:

LOADM "\OPO\Mathlib1.opo"
       ====
	 \_________ or other directory

Both the directory and extension must be included.

From: alanr@rd.bbc.co.uk (Alan Roberts)
Subject: Re: LOADM - resolved
Date: 25 Apr 1997 09:29:29 GMT

Stephen Bedford (sbedford@patrol.i-way.co.uk) wrote:
: As suggested by various respondents (thank-you), when using LOADM in an
: OPA it is necessary to specify the full path name of the module to be
: loaded.

Not quite true. By deault, LOADM looks in the directory that the calling
program resides, and expects the same extension. So, if you are running
an OPA file stored as LOC::A:\WIZO\Proglet.ZAP, then any LOADM will look
in LOC::A:\WIZO\ for a file with an extension .ZAP As I mentioned a post
or three ago, you need only supply those parts of the path that are
needed to prevent this begaviour.

******* Alan Roberts ******* BBC Research & Development Department *******
* My views, not necessarily Auntie's, but they might be, you never know. *
**************************************************************************


From: brendan@informatik.uni-bremen.de (Brendan W. Breede)
Subject: Clocks
Date: Tue, 22 Apr 1997 15:51:14 GMT

In article <w1g5kIAIO6WzEwgQ@on-the-train.demon.co.uk> "Clive D.W. Feather"
<clive@on-the-train.demon.co.uk> wrote:

>I don't remember enough the calls well enough, but assuming you're right
>about the lack of default, then I accept this is a deficiency in OPL you
>have to work around.

Some time ago Steve Godfrey (IIRC) enlightened me about how to get the 3c
typical round clocks via the following OS call (slightly modified for my
needs):

LIBPROC clockON%:(x%,y%,flags%,offset%)
  LOCAL id%
  id%=gINFO%:(31)
  id%=CALL($D38D,id%,flags%,x%,0,y%)
  CALL($548D,id%,offset%)
  RETURN(id%)
ENDP

the flags% parameter is to be used as follows:

REM 0 - S3 small digital
REM 1 - S3 medium (follows system setting)
REM 2 - S3 large analog
REM 3 - S3a medium (follows system setting)
REM 4 - S3a large analog
REM 5 - formatted
REM 6 - Siena/S3c medium (follows system setting on s3c)
REM 7 - S3c large
REM $10 - with date
REM $20 - add second hand
REM $40 - force analog type 3/6
REM $80 - force digital type 3/6
REM $F0 - with am/pm
REM $800 - draw in grey plane
REM $2000 - right align
REM $8000 - with box

So as I see it, there's neither a specific default value nor
anything OPL specific regarding the creation of the clock(s).

BTW, does anyone know the correct parameter for the digital clock
used in the Siena's World app?
___________________________________\____________________Brendan W. Breede
brendan@informatik.uni-bremen.de              \
http://www.informatik.uni-bremen.de/~brendan/  \


From: mbs as <mbs@sn.no>
Subject: Open a *.dbf twice in on process (to C-programmers)
Date: Wed, 23 Apr 1997 13:52:01 +0200

I could open a *.dbf once with the DbfOpen() function. Afterwards I 
closed the file with DbfClose(). Both calls were successful and returned 
0. Then I tried to open the same file a second time within the same 
process. Now I always receive an error (E_FILE_INVALID). Why and how can 
I work around ?
-- 
- mbs

From: "Keld Laursen" <kl@mse-dk.com>
Subject: Re: Open a *.dbf twice in on process (to C-programmers)
Date: 24 Apr 1997 06:20:20 GMT

hi, mbs (and all)

This is a worked example snipped from a current project. The function
closes all currently open databases (ISAM system),
and uses the DBF functions to compress the databases. After compressing
the databases are closed, the ISAM system is
used to reopen the databases, and the ISAM indices are rebuilt (The gt()
function gets a text from a text file):

VOID reindex(VOID)
{
UBYTE *buffer;
UINT pstate;
VOID *pFcb;
TEXT i;
DbfHeader pHead;
DbfOpenArgs pargs;
#define ANTNAMES 7
TEXT *names[]=3D
	{
	"m:\\opd\\tran0025.dbf",
	"m:\\opd\\tran0065.dbf",
	"m:\\opd\\tran0095.dbf",
	"m:\\opd\\tran0155.dbf",
	"m:\\opd\\tran0165.dbf",
	"a:\\opd\\tran0175.dbf",
	"m:\\opd\\tran0205.dbf"
	};

	wSetBusyMsg(gt(134),W_CORNER_BOTTOM_LEFT);
	closedb();
	buffer=3Dp_alloc(8192);
	if(!buffer)
		{
		okdial(gt(117),gt(100));
		}
	else
		{
		for(i=3D0;i<ANTNAMES;i++)
			{
			wInfoMsgCorner(names[i],W_CORNER_TOP_RIGHT);
			pstate=3DDbfStateDisabled;
			p_bcpy(pHead.fileType,gt(174),16);

			pargs.pFcb=3D&pFcb;
			pargs.fName=3Dnames[i];
			pargs.mode=3DP_FOPEN|P_FUPDATE;
			pargs.pHead=3D&pHead;

			if(DbfQuickOpen((INT *)&pstate,&pargs,buffer,8192,1))
				{
				okdial(gt(87),names[i]);
				continue;
				}
			pstate=3DDbfStateDisabled;
			DbfCompress(&pstate,*pargs.pFcb);
			DbfClose(*pargs.pFcb);
			}
		initdb();
		wSetBusyMsg(gt(199),W_CORNER_BOTTOM_LEFT);
		remake_ix(PROJEKT,0);
		wSetBusyMsg(gt(200),W_CORNER_BOTTOM_LEFT);
		remake_ix(PROJEKT,1);
		wSetBusyMsg(gt(201),W_CORNER_BOTTOM_LEFT);
		remake_ix(PROJEKT,2);
		wSetBusyMsg(gt(202),W_CORNER_BOTTOM_LEFT);
		remake_ix(PROJEKT,3);
		wSetBusyMsg(gt(203),W_CORNER_BOTTOM_LEFT);
		remake_ix(PROJEKT,4);
		wSetBusyMsg(gt(204),W_CORNER_BOTTOM_LEFT);
		remake_ix(LOEN,0);
		wSetBusyMsg(gt(345),W_CORNER_BOTTOM_LEFT);
		remake_ix(MELDING,0);
		wSetBusyMsg(gt(346),W_CORNER_BOTTOM_LEFT);
		remake_ix(MELDING,1);
		wSetBusyMsg(gt(205),W_CORNER_BOTTOM_LEFT);
		remake_ix(ART,0);
		wSetBusyMsg(gt(206),W_CORNER_BOTTOM_LEFT);
		remake_ix(AKT,0);
		wSetBusyMsg(gt(330),W_CORNER_BOTTOM_LEFT);
		remake_ix(ADR,0);
		wSetBusyMsg(gt(331),W_CORNER_BOTTOM_LEFT);
		remake_ix(ADR,1);
		wSetBusyMsg(gt(207),W_CORNER_BOTTOM_LEFT);
		remake_ix(VARE,0);
		wSetBusyMsg(gt(208),W_CORNER_BOTTOM_LEFT);
		remake_ix(VARE,1);
		}
	wCancelBusyMsg();
	p_free(buffer);
}

I have tried accessing the above code several times during one program
run, and have never had problems from either
the ISAM or the DBF system.

Hope this helps
Best regards,
Keld Laursen
--=20
MSE Mobile Systems Engineering A/S
Tel: +45 8680 5399
Fax: +45 8680 5339
E-mail: kl@mse-dk.com


From: alanr@rd.bbc.co.uk (Alan Roberts)
Subject: CMD$(5) and JBLaunch
Date: 25 Apr 1997 09:31:24 GMT

Hi chaps,
Just in case you've not noticed, if you use CMD$(5) to return the APP
name of an OPA file, and that file is being run from JBLaunch, you'll
get the name of the JBLaunch program and not that of your OPA.

Just thought you might like to know, it had me baffled for a while.
******* Alan Roberts ******* BBC Research & Development Department *******
* My views, not necessarily Auntie's, but they might be, you never know. *
**************************************************************************

From: brenc@dass.prestel.co.uk
Subject: Re: CMD$(5) and JBLaunch
Date: Sat, 26 Apr 1997 00:10:48 +0000

Alan Roberts <alanr@rd.bbc.co.uk> wrote:

: Just in case you've not noticed, if you use CMD$(5) to return the APP
: name of an OPA file, and that file is being run from JBLaunch, you'll
: get the name of the JBLaunch program and not that of your OPA.

And if you are running the app from an aliased list, then you get the list
name.

CMD$(5) specifies which list the file will appear under on the system
screen.
- -- 
http://www.geocities.com/SiliconValley/Lakes/7456/


From: alan$@donor2.demon.co.uk (Alan Clifford)
Subject: Determine which data file is USEd?
Date: 27 Apr 97 21:11:13 GMT

Hello "Fionn

Replying to a message of "Fionn Behrens" to All:

 "B> Is there any way in OPL to find out which data file is currently
 "B> active, last selected by USE ?

Here's a somewhat inelegant solution (the main: procedure is just to test it):

proc main:
 local filenum%
 trap mkdir "\temp"
 if not exist("\temp\temp1.odb")
  create "\temp\temp1.odb", a,a$
  a.a$ = "test"
  append
 else
  open "\temp\temp1.odb", a,a$
 endif
 if not exist("\temp\temp2.odb")
  create "\temp\temp2.odb", b,a$
 else
  open "\temp\temp2.odb", b,a$
 endif
 print "using A"
 use a
 filenum% = getused%:
 print "File being used is", filenum%
 print

 print "using B"
 use b
 filenum% = getused%:
 print "File being used is", filenum%
 print

 rem close the files
 print "files closed"
 use a :close
 use b :close
 filenum% = getused%:
 print "File being used is", filenum%
 print
 
 print "press a key to end"
 get
endp

proc getused%:
 rem This procedure examines the current record number of all 4 opl files
 rem to determine which one has been changed by next.
 rem It won't work on a read-only file that contains no records. Not a too
 rem onerous restriction
 rem returns 1 for file A, 2 for B, 3 for C, 4 for D
 rem returns 0 if no files open
 local info%(4), handle%, recnum%, recnums%(4), ctr%
 local pos%, apdflg%
 odbinfo info%()

 rem check for an open file, otherwise pos% will throw an error
 ctr% = 4
 while ctr% > 0
  handle% = peekw(info%(ctr%))
  if (handle% <> 0) :break :endif
  ctr% = ctr% - 1
 endwh
 
 if (ctr% <> 0)
  pos% = pos rem save position in file
  rem at least one record is required
  rem append a record if required.  I don't like this but I can't think
  rem of an alternative
  if (count = 0)
   append
   apdflg% = 1
  else
   apdflg% = 0
  endif
  last
  print "current records after last",
  ctr% = 4
  while ctr% > 0
   handle% = peekw(info%(ctr%))
   if (handle% <> 0)
    recnums%(ctr%) = call($15D8,handle%,0,0,0,0)
    print recnums%(ctr%); ":";
   else :print "*"; ":";
   endif
   ctr% = ctr% - 1
  endwh
  print
  next
  print "current records after next",
  ctr% = 4
  while ctr% > 0
   handle% = peekw(info%(ctr%))
   if (handle% <> 0)
    recnum% = call($15D8,handle%,0,0,0,0)
    print recnum%; ":";
    if recnum% <> recnums%(ctr%) :break :endif
   else :print "*"; ":";
   endif
   ctr% = ctr% - 1
  endwh
  print
  rem remove the dummy record if required
  if (apdflg% <> 0)
   last
   erase
  endif
  position pos%
 endif
 return ctr%
endp

Alan

From: "Jeff" <Harmed@btinternet.com>
Subject: Hotkeys - English/German equiv for 3a
Date: 28 Apr 1997 22:38:48 GMT

As a Psion programmer, would you like your products to be intuitive and
have the same feel as the other Psion standard modules? Would you like to
produce a product in other languages? If so, I have spreadsheet tables that
will be of interest to you.

They contain lists of English, German, French and Spanish equivalents of
the menus of the Standard modules in the 3a and 3c machines. Note and use
the common hotkeys where possible.

My thanks to Roland Linke for contributing the German equivalents from his
512K 3a.

I appeal to those with French and Spanish 3as and 3cs to complete and
return the remaining spreadsheets for public use.

Thanks
Jeff


From: alanr@rd.bbc.co.uk (Alan Roberts)
Subject: Re: Running standard applications
Date: 29 Apr 1997 09:00:11 GMT

Bernd Flikweert (b.flikweert@pi.net) wrote:
: Is there anybody who can tell me how I can start a standard application 
: from my OPL program, e.g. start the agenda file?

Here's an example of how to open a DATA file, it's very similar for any
other application:

app$="ROM::Data.app"+CHR$(0)
file$="OData"+CHR$(0)+".DAT"+CHR$(0)+file$+CHR$(0)
ret%=CALL($0187,UADD(ADDR(app$),1),ADDRR(file$),0,0,ADDR(id%))
CALL($0688,id%)

This launches DATA, using ".DAT" as standard file extension, and opens
the file file$. If ret% is negative, there was an error and it didn't
open. The call to $0688 is to make it "resume", ie. make it active since
the call to $0187 launches it in a dormant state.

Take a close look at the Psionics files for all the gory details.

Hope that helps.
******* Alan Roberts ******* BBC Research & Development Department *******
* My views, not necessarily Auntie's, but they might be, you never know. *
**************************************************************************


From: "Michael Kellett" <mk@sgriol.demon.co.uk>
Subject: Re: Tried OVAL Serial example, ERROR , Please Help ME
Date: Sun, 04 May 1997 20:04:14 GMT

Sitaraman.S <sitaram@206.62.39.57> wrote in 
>  I tried executing the OVAL serial example program on my PSION 3c,
>  when i tried to open the port it popedup the following error "Invalid
>  path or filename".
>  am i missing anything to run this example program, any run time files
>  etc...

It looks to me as if you have just hit the 'catch 22' of OVAL serial port
programming on the 3C. Before you can run an OVAL programme you must free
up the 3C serial port by setting the link port to 'none'.  This means that
you have no debugging support in any OVAL programme which uses the serial
port. I have managed to get it to work after a fashion but the poor
documentation, completely un Visual Basic like operation and 'blind'
debugging don't help.
Good luck!

Michael Kellett


From: "Martin N. Dunstan" <mnd@dcs.st-andrews.ac.uk>
Subject: Re: C Language Compiler for Psion 3a
Date: Mon, 12 May 1997 11:14:43 +0100
To: Anthony Abelaye <abelaye@netcom.com>

Anthony Abelaye wrote:
> 
> does anyone know if there's a c compiler available for the psion 3a? if
> so, where can i go to get a copy?

   There are two that run on the Psion itself: CPOC and SmallC:

      http://ourworld.compuserve.com/homepages/DaveWalker/CPOCmenu.htm
     
http://src.doc.ic.ac.uk/packages/psion/icdoc/development/s3c111.zip

Although the CPOC web site gives a link for the ANSI library it
doesn't actually work :( It is a nice package but perhaps a little
big and the lack of libraries is frustrating.

SmallC seems to be impossible to register (if anyone knows an
up-to-date address for the author I would be interested) and some
people don't like it because of its limited support for the C
language ... It is very compact and quite neat though.

Martin

From: JosipSagaj@bigfoot.com (Josip Sagaj)
Subject: Re: C Language Compiler for Psion 3a
Date: Mon, 12 May 1997 11:57:16 GMT

For the most actual version of the C-compiler (also avalible for
Windows 95/NT, Linux and Sinclair XL [it's not a joke it's still
alive]) goto "Dave Walker's Home Page":

http://ourworld.compuserve.com/homepages/davewalker/

Best greetings from
J. Sagaj
JosipSagaj@bigfoot.com


From: ali-manson@psion.com (Alasdair Manson)
Subject: Re: Multiple bitmaps files...
Date: Mon, 12 May 1997 13:41:28 GMT

On Mon, 12 May 1997 11:57:40 +0200, aurelien max <maxaurel@etu.utc.fr>
wrote:
>
>Once more, I try to get this so little information : is it possible to
>create in OPL mutiple bitmap files? If not, can anyone tell me some words
>about the .pic format? Thanks in advance.

The bitmap files used by the window server start with a fixed P_FSIG
header, followed by a WORD count of how many bitmaps are stored in the
file. This is then followed by one WS_PIC_HEADER structure for each
bitmap stored in the file.

Each WS_PIC_HEADER structure contains a checksum calculated by
applying the PLIB p_crc() function to the data containing the picture.
Note the checksum's are calculated individually for each bitmap within
the file. The size of the picture in pixels is next, followed by a
WORD containing the byte size of the picture data for the bitmap. 

Finally there is a ULONG specifying the relative offset from the end
of this header to the start of the picture data for the bitmap.
Each scan line consists of ((width+15)/16) words with 1 bit per pixel
starting with the left most pixel of the picture in bit 0 of the first
word with rest of the data following sequentially from left to right
and top to bottom.

typedef struct
    {
    UWORD checksum;
    P_POINT size;
    UWORD byte_size;
    ULONG offset;
    }WS_PIC_HEADER;

typedef struct
    {
    P_FSIG sig={"PIC",'P'+'I'+'C',0x30,0x30};
    UWORD count; /* Count of bitmaps in the file */
    WS_PIC_HEADER wspic; /* More copies of this structure may follow
*/
			 /* if there are multiple bitmaps in the file
*/
    } PIC_HEAD;

Fonts

A font file contains one font consisting of any selection of
characters from 0 to 255, the width table stores the offset data for
all characters from G_FONT_INFO.low_ch to G_FONT_INFO.high_ch. The
offset data is a WORD per character containing the doubled pixel
offset within the picture data of the character, the low bit of the
word is set to 1 if the character is missing from the font and left as
0 otherwise (the offset for a missing character must be stored as the
offset for the next existing character). An extra offset is stored at
the end of the file containing what would have been the offset of the
next character, this is because the width of a character is calculated
by subtracting the offset of the character from the offset of the
following character.

The Picture data is stored like the body of a bitmap containing the
characters as one long string in alphabetic order. The low level
graphics code literally bit copies the characters from the picture
data to the screen.

The size field in the header contains the byte size remaining in the
file after the size field. The checksum is calculated by applying
p_crc() to the offset table and picture data, but not the header.

typedef struct
    {
    UWORD low_ch;  /* lowest code in font */
    UWORD high_ch; /* highest code in font */
    UWORD height;  /* height of font */
    UWORD descent;   /* height of bottom part of character */
    UWORD ascent; /* height of top part of character */
    UWORD numeric_width; /* Width of numeric character */
    UWORD max_width; /* The width of the widest character in the font
*/
    UWORD flags;
    TEXT name[FONT_NAME_LEN];
    } G_FONT_INFO;

typedef struct
	{
	P_FSIG sig={"FON",'F'+'O'+'N',0x30,0x30};
	UWORD checksum;
	UWORD size;
	G_FONT_INFO info;
	}WS_FONT_FILE_HEADER;
struct
	{
	WS_FONT_FILE_HEADER header;
		{
		.
		.
		} UWORD Offset_table[high_ch-low_ch+2]

		{
		.
		.
		} UBYTE Picture_data[];
	}

Fast Fonts

Fast fonts are stored in an expanded form that uses more memory but
can be drawn faster. The window server automatically recognises the
difference between normal and fast fonts, window servers before
version 3.5 do not recognise fast fonts and will refuse to load them.
All characters in a fast font must be less than or equal to 8 pixels
wide, the offset table in a normal font is replaced with a width table
containing a byte per character for all characters from 0 to 255,
missing characters are simply stored as 0 pixels wide. The picture
data contains all 256 characters, all stored byte aligned and 8 pixels
wide.

The checksum is calculated by applying p_crc() to the width table and
picture data, but not the header.

typedef struct
	{
	P_FSIG sig={"FN1",'F'+'N'+'1',0x10,0x10};
	UWORD checksum;
	UWORD size;
	G_FONT_INFO info;
	}WS_FONT_FILE_HEADER;
struct
	{
	WS_FONT_FILE_HEADER header;
	UBYTE Width_table[256];
	UBYTE Picture_data[256*height];
	}


From: "Keld Laursen" <kl@mse-dk.com>
Subject: XMD: Example (hope Psion don't get mad at me)
Date: 13 May 1997 07:00:14 GMT

I've had a lot of requests for the XMD: example, so I have now made the
XMD example from the SDK into a ready-to-compile OPL module, including all 
the #defines and so on.
If you are translating on the Psion, you will have to manually insert
the #define statements in the relevant places
in the code.

I think I forgot to remove a LOADM/UNLOADM set around the call to
DVATTACH:, please remove them yourself.

I hope that this code fragment is not too much property of Psion, or
I'll be in trouble.

Here it is (attached):

Best regards,
Keld Laursen

MSE Mobile Systems Engineering A/S
Tel: +45 8680 5399
Fax: +45 8680 5339
E-mail: kl@mse-dk.com

/* Xmodem/Ymodem read examples given in I/O Devices Reference manual */

rem #include <l_xmodem.oph>
rem #include <l_file.oph>
rem #include <l_err.oph>
rem for shortness, the relevant #defines are included here:
#define XMDM_CRCORCHECKSUM    0
#define XMDM_ACCP 0 /* want link as acceptor */
#define XMDM_INIT 1 /* want link as initiator */
#define E_FILE_EOF       -36     /* Read past end of file */
#define FCONNECT 10 /* Queue a link connect request */
#define FDISCONNECT 11 /* Disconnect the link */
#define FREAD 1 /* Read */
#define FWRITE 2 /* Write */
#define FCLOSE 3 /* Close */
#define FCANCEL 4 /* Cancel io */
#define FSTREAM $0000 /* Stream access to a binary file */
#define FREPLACE $0002 /* Replace file */
#define FUPDATE $0100 /* Read and write access */

PROC test:
rem  loadm "l_link"
rem  lkterm%:(0)
  xmd:
rem  lkstart%:
rem  unloadm "l_link"
ENDP

PROC xmd:
  global xmdHand%
  local ret%
  local ch$(1)

  onerr Exit0                     /* close nothing on error */
  ret%=3Dioopen(xmdHand%,"TTY:A",-1)
  if ret%<0
    ret%=3Dioopen(xmdHand%,"TTY:B",-1)
    if ret%<0
      exitErr:(ret%,"Serial open failed")
    endif
  endif
  onerr exTTY                     /* close TTY: on error */

  loadm "l_dev"
  ret%=3Ddvattch%:(xmdHand%,"XMD:",-1)
  unloadm "l_dev"
  if ret%
    exitErr:(ret%,"Attaching XMD: failed")
  endif
  onerr exXMD                       /* close XMD: and TTY: on error */

  print "XMD: attached OK"
  while 1
    print "(C)ontinue (Q)uit>"
    cursor on
    do
      ch$=3Dupper$(get$)
    until ch$=3D"C" or ch$=3D"Q"
    cursor off
    if ch$=3D"Q"
      break
    endif
    print "Starting Xmodem session"
    ret%=3DxmdR%:                     /* XMODEM session */
    if ret%
      exitErr:(ret%,"Xmodem session failed")
    endif
    print "Xmodem session finished"
  endwh
  raise 0                           /* clear error for ERR */

exXmd::
  onerr off
  ioclose(xmdHand%)                 /* close XMD: */
exTty::
  onerr off
  ioclose(xmdHand%)                  /* close serial channel */
exit0::
  if err
    print "Unexpected error"
    print err$(err)
    get
  endif
ENDP

/* =
-------------------------------------------------------------------------=
-
    Name        : DVATTCH%:
    Description : Attach a device to an existing device channel
    (Note that IOOPEN erroneously does not use the value in the
    handle argument so that attaching a device with IOOPEN is
    not possible and, on error, IOOPEN also sets the handle to
    the error number so IOCLOSEing it panics, but is otherwise
    functionally the same as DVATTCH%:)
    Parameters  : handle% =3D channel of open device to attach to
		  inName$ =3D name of driver to attach to handle%
		  mode%   =3D mode as specified by attached driver documentation
    Returned    : 0 or negative error code
    Conditions  : None
    Effects     : None
    Errors      : E_FILE_ALLOC  failed to allocate memory for control block
		  E_FILE_DEVICE the device does not exist
		  E_GEN_ARG     value of mode% is invalid
		  Device specific errors (see description of device)
    Panics      : None
 =
-------------------------------------------------------------------------=
- */


PROC exitErr:(err%,msg$)
/*
  Report error message
  Assumes an error handler has been established with ONERR
  Raises error 0 - signifying error dealt with
*/
  print msg$
  print err$(err%)
  print "Press key to continue"
  get
  raise 0                    /* go to error handler in calling procedure */
ENDP

PROC xmdR%:
  local type%,mode%
  local ret%,filHand%,buf%(512)
  local len%

  type%=3DXMDM_INIT
  mode%=3DXMDM_CRCORCHECKSUM
  ret%=3Diow(xmdHand%,FCONNECT,type%,mode%)
  if ret%<0
    print "Failed to connect"
    return ret%
  endif
  /* Xmodem connect completed */
  ret%=3Dioopen(filHand%,"temp.tmp",FUPDATE or FSTREAM or FREPLACE)
  while 1
    ret%=3Diow(xmdHand%,FREAD,buf%(),len%)
    if ret%<0
      break
    endif
    ret%=3Diowrite(filHand%,addr(buf%()),len%)
    if ret%
      break
    endif
  endwh
  ioclose(filHand%)
  iow(xmdHand%,FDISCONNECT,#0,#0)
  if ret%=3DE_FILE_EOF
    ret%=3D0            /* no error if eof */
  endif
  return ret%
ENDP

PROC dvattch%:(handle%,inName$,mode%)
/*
Attach a driver to open channel handle%
To be called in the same way as IOOPEN
*/
#define _AX OSax%
#define _BX OSbx%
#define _CX OScx%
#define _DX OSdx%
#define _SI OSsi%
#define _DI OSdi%
#define _CARRY OScar%

#define intDevManager $85
#define OS_C(_INT,_FUNC256) _AX=3D_FUNC256 :OSINT_C(_INT)
#define osIoOpen OS_C(intDevManager,$0000)
#define DECL_OS _AX,_BX,_CX,_DX,_SI,_DI,_CARRY
#define DECL_UADD douadd&,dousub&,pUadd%,pUsub%
#define INIT_UADD \
  douadd&=3D&90cbc303 :dousub&=3D&90cbc32b :\
  pUadd%=3Daddr(doUadd&) :pUsub%=3Daddr(doUsub&)
#ifdef _OPLLINT
	#define USE_REGS _AX=3D_BX=3D_CX=3D_DX=3D_SI=3D_DI=3D_CARRY
#else
	#define USE_REGS
#endif
#define ADDR_TEXT(_str) INT(_UADD(addr(_str),1))
#define _UADD(_arg1,_arg2) usr(pUadd%,_arg1,_arg2,0,0)
/*call interrupt _INT ; no function ; sets _CARRY and _AX on error*/
#define _CARRY_MASK 1
#define OSINT_C(_INT) _CARRY=3Dos(_INT,addr(_AX)) and _CARRY_MASK : \
 if _CARRY :_AX=3D_AX or $ff00 :endif

	LOCAL DECL_OS
    LOCAL name$(20)
	LOCAL DECL_UADD = 09
	INIT_UADD
    USE_REGS
	name$=3DinName$+CHR$(0)  /* need to get address of zero-terminated name*/
    _DX=3Dhandle%            /* handle of previously opened device */
    _CX=3Dmode%              /* open mode */
    _BX=3DADDR_TEXT(name$)   /* skip leading count byte */
    osIoOpen
    if _CARRY
	RETURN _AX         /* error */
    endif
/*  RETURN 0 implied */
ENDP

From: "Peter E. Ottermann" <9521933@narga.sun.ac.za>
Subject: Re: Multiple bitmaps files...
Date: Tue, 13 May 1997 15:25:39 -0700

> aurelien max (maxaurel@etu.utc.fr) wrote:
> :
> : Once more, I try to get this so little information : is it possible to
> : create in OPL mutiple bitmap files? If not, can anyone tell me some words
> : about the .pic format? Thanks in advance.
> 
> gSAVEBIT will save both black and grey planes, if both exist, to one
> file. Other than that, I know of no way to save multiple bitmaps.

The file format of PIC files is in one of the Psionics textfiles. It is
quite easy to merge single bitmaps into one file.

Here is a little program to do just that. I use this program to merge
bitmaps into one PIC file but cannot guarantee it to work under your
circumstances.
I'm sorry for not using nice dialog boxes etc. If someone decides to
make a full proggy from this code, please send me a copy!!!

Cut the following piece of OPL source from the message and transfer it
to your Psion. BEFORE you translate and run it, edit the program and change
nameout$ to the output file, bitnum% to the number of SINGLE bitmaps you would like
to merge and names$(?) to the filenames of these source files.

Hope this helps!

Regards.
Peter

------------------------------------- SNIP
-------------------------------------------
PROC PicMerge:
	GLOBAL nameout$(255), names$(16,255)
	GLOBAL buffer$(255), adr%
	GLOBAL chanout%, chan%(16)
	GLOBAL L%, A$(2), K%, R%, bitnum%
	GLOBAL records$(16,16), Z&
	:
	nameout$="\SCREEN.PIC"
	bitnum%=2
	names$(1)="\TEMP0.PIC"
	names$(2)="\TEMP1.PIC"
	:
	adr%=ADDR(buffer$)+1
	:
	PRINT "             BITMAP FILE MERGER (MULTI-FORMAT)"
	PRINT
	:
	PRINT "Loading descriptor records."
	L%=1
	DO
		IOOPEN(chan%(L%),names$(L%),$0000)
		IOREAD(chan%(L%),ADDR(records$(L%)),8)
		IOREAD(chan%(L%),ADDR(records$(L%)),12)
		L%=L%+1
		UNTIL L%>bitnum%
		:
	PRINT "Calculating bitmap data offsets."
	Z&=12*(bitnum%-1)
	POKEL ADDR(records$(1))+8,Z&
	L%=2
	DO
		Z&=Z&-12
		Z&=Z&+PEEKW(ADDR(records$(L%-1))+6)
		POKEL ADDR(records$(L%))+8,Z&
		L%=L%+1
		UNTIL L%>bitnum%
		:
	IOOPEN(chanout%,nameout$,$0102)
	:
	buffer$="PIC"+CHR$($DC)+CHR$($30)+CHR$($30)
	POKEW adr%+6,bitnum%
	IOWRITE(chanout%,adr%,8)
	:
	PRINT "Writing records to new file."
	L%=1
	DO
		IOWRITE(chanout%,ADDR(records$(L%)),12)
		L%=L%+1
		UNTIL L%>bitnum%
		:
	PRINT
	PRINT "Appending bitmap data:"
	PRINT
	:
	L%=1
	DO
		PRINT names$(L%)
		K%=PEEKW(ADDR(records$(L%))+6)
		DO
			IOREAD(chan%(L%),ADDR(buffer$),256)
			IF K%<256
				IOWRITE(chanout%,ADDR(buffer$),K%)
				ELSE
				IOWRITE(chanout%,ADDR(buffer$),256)
				ENDIF
			K%=K%-256
			UNTIL K%<=0
		L%=L%+1
		UNTIL L%>bitnum%
		:
	L%=1
	DO
		IOCLOSE(chan%(L%))
		L%=L%+1
		UNTIL L%>bitnum%
	IOCLOSE(chanout%)
	:
	PRINT
	PRINT "Finished."
	GET
ENDP
------------------------------------- SNIP
-------------------------------------------


From: "DArren Simons" <Darren_Simons@caradon.com>
Subject: Re: Using TTY device function 10 (reading buffer length) in OVAL.
Date: Tue, 13 May 1997 17:01:50 GMT

I have used the OVAL serial object to interface to a WorkAbout with a bar
code head fitted, the terminator for the character stream is ascii 13. I
assume that you have managed to read the bar code?

Darren_Simon@caradon.com
 
Stefan <mb502@hi.ft.hse.nl> wrote in article
<33785428.2CA5@hi.ft.hse.nl>...
> Hello
> 
> Question About:Using TTY device function 10 (reading buffer length) in
> OVAL.
> 
> Does anyone knows how to use this function? I want to use it to read the
> length 
> of a barcode that has been read, before the processing of the function
> 10.
> The result is supposed to be returned in the param1 variable, but is
> doesn't 
> seem to work.
>  
> 
> I included the folowing source to my Oval program:
> 
> ******Begin  of source
> Dim func As Integer
> Dim param1 As Integer
> Dim param2 As Integer
> Dim Drive As String
> Dim mode As Integer
> 
> Drive = "tty:e"
> mode = 0
> DeviceIO1.open Drive, mode
> 
> ***
> Scanning a barcode.
> ***
> 
> 
> func = 10
> DeviceIO1.IOsync func, param1, param2
> editbox1.text = CStr(param1)
> DeviceIO1.ReadAsync param1
> *******End of source
> 
> Param1 only returns '0'.
> The oval program is runned on a Workabout with a barcode reader. 
> Function 09 (flush) seems to work perfectly.
> 
> 
> 
> Every suggestion is welcome.
>                                       Stefan Burgers 
>                                       CAD/CAE pth contract
>                                       Eindhoven, the Netherlands
> 

From: support@registerline.com (Patrick Miller)
Subject: Programming Assistance
Date: Tue, 13 May 1997 18:51:36 GMT

The following files are available for download via Regi$ter 
Online:  http://registerline.com/progmmrs.htm

FREEWARE
How to Copyright Your Shareware (TEXT - SIZE: 35.9KB)
Explains the importance of copyright and the proper way to 
legally protect your creations.

SHAREWARE
Win3.x Password Program (SHAREWARE - SIZE: 145KB)
Random Password Generator as the name implies will randomly 
select from a group of number, letters or both and select 
passwords. Requires Window 3.X

SHAREWARE
Pinnacle Help Me System (DOS - SIZE: 70.1KB)
The Pinnacle Help System equips the software developer with 
a method of providing new users with the information they 
need to get started.

FREEWARE
Corporate Software Policy (TEXT - 41.6KB)
Provides a framework within which a company can not only 
learn more about the copyright laws and how they apply to 
software, but also as a starting point which can be used to 
develop a similar policy for your own business.

SHAREWARE
The Shareware Installer (DOS - SIZE: 54.3KB)
Intro, Install, Exit messages; partial installs, upgrades, 
etc.; Checks disk space, conv. and ext. memory, DOS ver., 
CPU, video card and monitor; supports multiple disks and 
files; optionally modify AUTOEXEC.BAT & CONFIG.SYS; installs 
self-extracting EXE, ZIP files, and /or copy files.

PUBLIC DOMAIN
Shareware License Example (TEXT - 6.41KB)
Example of how to create a Shareware License file.

FREEWARE
Copy Protection Example (TEXT - SIZE: 4.76)
THIS IS AN EXAMPLE OF A SECURITY TYPE PROGRAM. IT RANDOMLY 
PICKS A CODE THAT MUST BE ENTERED BY THE USER. IF THE CODE 
IS WRONG, IT WILL GIVE AN ERROR MESSAGE.

REGI$TER ONLINE! http://registerline.com
Charge shareware registration fees to your Phone Bill!
No credit cards, checks, or money orders needed!
Home of Design-YOURware Programming Proposal and Creativity Tool
