Forum:  Psion                        Section:  Programming
Subj:  OPL Question / Frage
To   :  ALL                                13/04/97 15:46 
From :  Robert Mueller, 106265,1047        #293185
 
Hallo,
ich mchte gerne einen Dialog programmieren, in dem die Vorgaben von Elementen
vom Inhalt des ersten Element, das eine Liste als Vorgaben enthlt, abhngt.
Wird das erste durch die Pfeil-Tasten gendert, soll sich der Inhalt der
anderen Elemente entsprechend den Vorgaben ndern. Wie kann man so etwas
realsieren? Ein Beispiel wren verschiedene Termin-Dialoge in der Agenda.
 
I want to program a dialog simular to different dialogs in the agenda, where
the content of some elements depends on the selected item of the lost of 
the first element.
Changing the first element by the arrow-keys should change the content of the
other elements. How can I do this?
 
Gru & Danke
Robert 

Forum:  Psion                        Section:  Programming
Subj:  OPL Question / Frage
To   :  Robert Mueller, 106265,1047        13/04/97 16:07 
From :  John Boyce (Sysop), 100014,1240        #293187
 
Robert
>> the content of some elements depends on the selectet item
 
This is only possible in the Psion dialogs by programming in HWIM (the Psion
Object code) - this requires access to the 'C' SDK and it is a very steep
learning curve. There is no other way of doing it I'm afraid.
 
Best wishes
John  (United Kingdom)

Forum:  Psion                        Section:  Programming
Subj:  OPL Question / Frage
To   :  Ajai Khattri, 104127,3257        16/04/97 23:38 
From :  Konstantin Saliy, 106062,203        #293953
 
Ajai,
<< You can't do this in OPL. You need to use Psion's OOP library and code the
app in C to get this functionality. >>
 
There is a APPMAN.ZIP file in both forum library and NWT FTP site which allows
to do exactly this in OPL.
 
 Best wishes
 Konstantin @ MOCKBA 16/04/97 12:14 [Trying Megahertz P2144 pocket modem]

Forum:  Psion                        Section:  Programming
Subj:  OPL Question / Frage
To   :  Konstantin Saliy, 106062,203        17/04/97 22:52 
From :  Daniel Pfund, 101743,775        #294141
 
 >> There is a APPMAN.ZIP file in both forum library and NWT FTP site which
 >> allows to do exactly this in OPL.
 
I don't recall it did dynamic dialogs! I certainly had some surprises when I
saw APPMAN running, but man, have you got to be Einstein to understand that
code! :-(
 
Regards,
Daniel Pfund (Geneva, Switz.)
 http://www.planet-pfund.com/pp/

Forum:  Psion                        Section:  Programming
Subj:  OPL Question / Frage
To   :  Daniel Pfund, 101743,775        18/04/97 02:12 
From :  Konstantin Saliy, 106062,203        #294198

Daniel,
<< I don't recall it did dynamic dialogs! >>
 
At least it could be implemented similar way, learning OOP manual before. ;-)
 
<< but man, have you got to be Einstein to understand that code!  >>
 
Somebody has written it <g>
Best wishes
 Konstantin @ MOCKBA 18/04/97 03:55
 [Trying Megahertz P2144 pocket modem]

Forum:  Psion                        Section:  Programming
Subj:  OPL Question / Frage
To   :  Konstantin Saliy, 106062,203        18/04/97 15:12 
From :  Mark Esposito (SYSOP), 72662,3050#294299
 
Konstantin,
>> Somebody has written it <g> <<

 That's Jezar. I think he's related to Einstein.<g>

 -Mark Esposito http://www.pelicansoft.com mark@pelicansoft.com


Forum:  Psion                        Section:  Programming
Subj:  Workabout & Barcodes
To   :  all                                15/04/97 21:25 
From :  Simon Kerr, 100337,1214                #293676
 
I've just purchased a 1mb Workabout with a TTL interface and a CCD scanner,
along with the OPL SDK.  The problem is there appears to be no "example"
program to get the barcode scanner working with this configuration.  Does
anyone out there have any sample code for this config?????
 
TIA
Simon Kerr

Forum:  Psion                        Section:  Programming
Subj:  Workabout & Barcodes
To   :  Simon Kerr, 100337,1214                16/04/97 14:38 
From :  Ali Manson [Psion], 73733,32        #293824
 
Hello
The TTL port can be accessed a serial port as long as you open the port with
the correct letter. Once the port is open, you can use the library functions 
in the SIBO OPL LIBRARY to manipulate data at this port.
 
Bye
Ali

Forum:  Psion                        Section:  Programming
Subj:  All I want...GIF<>PIC
To   :  ALL                                15/04/97 21:34 
From :  Richard van 't Riet, 100271,1615#293683
 
Indeed it is :)
I'm just a beginner and have played arround with some sounds (thanks Mark :)
and for my intended program I also need to display and scroll a large PICture
file on the screen, together with a small changing icon/sprite.
 
I'm Mac based, but also have an ancient PC (IBM296) and have made the picture
file on my Mac using Adobe Photoshop.
All I need to do now is to convert it to a PIC format to use it on the Psion.
 
How do I do this ? registering Pic Poc is one way I guess, but it seems a bit
overkill, cause I just want a conversion util and not a drawing program.
I also prefer to convert the file on my Mac or PC instead of the Psion.
 
Any help ?
Thanks,
Richard van 't Riet, Hoorn - NL

Forum:  Psion                        Section:  Programming
Subj:  All I want...GIF<>PIC
To   :  Richard van 't Riet, 100271,161516/04/97 17:54 
From :  Krinzner, 100414,661                #293865
 
Richard,
one way on the PC would be:
 
Use Paintshop from Jasc (anywhere in CIS, shareware) to transform from GIF to
PCX, and then WSPCX.EXE (anywhere here in the forum lib) to change from PCX to
PIC. And remember to change your 'color depth' to black&white before. (Another
way would be to dither the PCX before, I think Micrografix Picture Publisher
does this ...).
 
If you can't manage all this, I can try to help you, if the graphic file isn't
too big to mail.
 
CU,
Ulrich


Forum:  Psion                        Section:  Programming
Subj:  PSION DBS
To   :  all                                16/04/97 08:12 
From :  Roland Brezina, 100430,252        #293776
 
Hi,
I want to create a databasetable with the C-Compiler, SIBO-SDK and the
Psion Database Server (DBS).
Following code create a table with one field after input of a filename
.
.
LOCAL_C VOID FileNew()
        {
        TEXT                buf[50];
        INT                res;        
 
        DBS_DBASE            hDBase;
        DBS_TABLE            hTable;
        DBS_FIELDDEF         FieldDef = {DBS_TYPE_STRING, 10, DBS_NOTNULL,"Name"};
        DBS_TABLEDEF         RecordDef;
 
        TEXT                 fname[P_FNAMESIZE + 2];
        H_DI_FSEL            fsel;
 
        RecordDef.count = 1;
        RecordDef.fields[0] = FieldDef; 
 
        fname[0] = 0;
        fsel.fname = (&fname[0]);
        fsel.flags = H_FILE_NEW_EDITOR | H_FILE_ALLOW_DIRS;
        
        if (uOpenDialog("New Data-File"))
                return;
        if (uAddDialogItem(H_DIALOG_FSEL, "", &fsel))
                return;
        if (uRunDialog())
                {
                fname[1 + fname[0]] = 0;
                if (DbsConnect(0) >= 0)
                        {
                        if (DbsDatabaseOpen(&hDBase, DBF_TYPE, &fname[1], DBS_CREATE) >= 0)
                                {
                                if ((res = DbsTableCreate(hDBase, &hTable, &fname[1], NULL, &RecordDef)) >= 0)
                                        {
                                        DbsTableClose(hTable);
                                        }
                                else
                                        {
                                        /* Errorhandling */
                                        }
                                DbsDatabaseClose(hDBase);
                                }
                        DbsDisconnect();
                        }
                }
        return;
        }
.
.
.

Function call to create a table follow: (see als0 CAPI.TXT of DBS)
 
   INT DbsTableCreate(DBS_DBASE hDBase,DBS_TABLE *phTable,TEXT *table, INT flags,DBS_TABLEDEF *pDef)
 
with the prototypes defined in dbs.h
 
   typedef struct DbsTableDef_tag
       {
       UWORD count;                      // number of fields
       DBS_FIELDDEF *fields[1];        // pointers to field data
       } DBS_TABLEDEF;
 
   typedef struct DbsFieldDef_tag
       {
       UBYTE type;                       // field type
       UBYTE size;                       // size of field for fixed length strings only
       UBYTE attributes;              // field attributes
       TEXT name[DBS_NAMESIZE+1];        // ZTS field name
       } DBS_FIELDDEF;
 
  Create a table in a database with name table, as a ZTS. The table name has
  a default extension applied if no extension is given.  If flags specifies
  DBS_TEMPORARY then the name is ignored and a unique name is used, the table
  will be deleted automatically when closed.
 
  The field definition pointed to by pDef is used to define the new tables
  structure.  The field definition structure contains a count word giving
  the number of fields, and an array pointing to a DBS_FIELDDEF structure
  for each field in the table.  name gives the ZTS name of the field up to
  DBS_NAMESIZE bytes long, though the maximum length supported is database
  dependent and over-long names are truncated.  type gives the field type,
  size gives the size of the field - this is ignored for all but text
  fields - and attributes which indicate what the attributes of the field
  are. This can be either/both of DBS_NOUPDATE or DBS_NOTNULL which
  indicate whether once set, the value of a field can be altered or not and
  whether records with a null (zero) value in the field can be added to the
  table.
 
  flags can also specify DBS_EXCLUSIVE, DBS_APPENDONLY, DBS_LOCKREAD or
  DBS_LOCKWRITE.  These have the same effect as for DbsDatabaseOpen except
  they only apply to the table being opened.
 
  The new table's handle is written back to *phTable.
 
The statement DBS_FIELDDEF *fields[1] only allow to create one field in a
table.
How can I create more then one field in a table ?
 
Thank you
R. Brezina

Forum:  Psion                        Section:  Programming
Subj:  PSION DBS
To   :  Roland Brezina, 100430,252        16/04/97 11:35 
From :  John Boyce (Sysop), 100014,1240        #293802
 
Roland
To create more than one field you must create an BYTE array of that size and
put the field type in the appropriate section of the array for each field.
 
I don't use the DBS server but this is how 'C' does the job.
 
Best wishes
John  (United Kingdom)


Forum:  Psion                        Section:  Programming
Subj:  Showing files/dirs
To   :  R.A. RYERSON, 105533,3115        21/04/97 19:24 
From :  John Boyce (Sysop), 100014,1240        #294861
 
Richard
To adjust PsiWin to allow access to the PC from the Psion, edit the
PSIONPRC.INI file in the \Windows directory and delete the "-x" bit from the
ENGINE=PRCENWIN.EXE line.
 
Best wishes
John  (United Kingdom)
 
Forum:  Psion                        Section:  Programming
Subj:  Showing files/dirs
To   :  John Boyce (Sysop), 100014,1240        21/04/97 22:42 
From :  R.A. RYERSON, 105533,3115        #294909
 
<To adjust PsiWin to allow access to the PC from the Psion, edit the
PSIONPRC.INI file in the \Windows directory and delete the "-x" bit from the
ENGINE=PRCENWIN.EXE line.>
 
John you are a genius, it worked perfectly, however, it is slow to print 
files and directories to the 3a screen I guess it is because of the baud rate 
at only 19200.
I would hate to trouble you one more time, but I have 1 more question. So far 
I have used only a screen full of info because I do not know how to scroll 
the files\dir I have printed to the screen. Although this is childs play to 
you and some of the other programmers here., I have still to figure this out.
I have tried to use gscroll but as you know it clears anything left behind. I
guess it is a matter of moving the window as opposed to the graphics in it, 
but I have yet to figure out how to scroll up and down through graphics
(and print) that are too big to fit on one screen.
I realize this section is for help and not for other people to write my
programs for me, so I will understand if I have gone too far with my 
questions.
 
Thanks again, Richard

Forum:  Psion                        Section:  Programming
Subj:  Showing files/dirs
To   :  R.A. RYERSON, 105533,3115        22/04/97 05:01 
From :  John Boyce (Sysop), 100014,1240        #294959
 
Richard
>> it is slow to print files and directories to the 3a screen I guess it
>> is because of the baud rate at only 19200.
 
Yes, that does create quite a bottleneck as there is a lot of data to 
transport across.
 
 >> So far I have used only a screen full of info because I do not know how
 >> to scroll the files\dir I have printed to the screen.
 
You are a little unclear if the display is showing graphics or text - for
graphics you would need to keep the whole thing in a bitmap and then gCOPY 
the relevant bits as necessary. If text you would need to reprint the screen 
which could involve keeping the data in some form of array and keeping a 
pointer to what is being displayed. Up and Down would just mean altering 
the pointer and doing a screen reprint.
 
Best wishes
John  (United Kingdom)

Forum:  Psion                        Section:  Programming
Subj:  Showing files/dirs
To   :  John Boyce (Sysop), 100014,1240        22/04/97 12:13 
From :  R.A. RYERSON, 105533,3115        #295022
 
Thanks John for all your help,
I will sit down and figure it all out, graphics or text scrolling Hmmm, 
no easy way to do it.
Regards Richard

Forum:  Psion                        Section:  Programming
Subj:  Assistance with dCHOICE
To   :  All                                24/04/97 20:47 
From :  Robert Lenz, 101753,2157        #295525
 
Hi everybody,
I have been working on a program which I want to prompt me to choose a country
from a pre-defined .dbf database and then use the rest of the information of
the record which corresponds with that country for other purposes.
 
I thought I had found a solution by using the following:
 
dCHOICE country%,"Which country","Africa, Anchorage, Argentina etc."
DIALOG
OPEN "\dat\daggeld.dbf",A,country$,rate$
POSITION country%
PRINT a.country$,a.rate$
 
This works fine UNTIL I got stuck when I went over the max. string length of
255 characters in entering the choices list (as I have got 62 countries to
choose from in the database).
 
I would really appreciate any help I can get with this.
 
TIA,
 Robert Lenz

Forum:  Psion                        Section:  Programming
Subj:  Asisstance with dCHOICE
To   :  Robert Lenz, 101753,2157        24/04/97 21:15 
From :  Eitan Gilboa, 100135,2720        #295529
 
Robert,
Please download and read LONGLI.ZIP from LIB 18. (I am almost sure of the 
name <g>). It has a text file and programming explanation & example for just 
your problem. Not easy though.
 
OTOTH, you might consider shortening the country names? or separate the 
dialog to continents then a second dialog for countries in the continent?
 
Best Wishes,
Eitan (-FRANCE-)    24-Apr-97 at 22:06:05 CET

Forum:  Psion                        Section:  Programming
Subj:  dCHOICE-long lists HELP!
To   :  All                                25/04/97 09:22 
From :  Robert Lenz, 101753,2157        #295601
 
Hi everyone,
I have just downloaded LONGLI.ZIP to help me with my long list problem. Just
read the documentation and feel completely puzzled considering the limited
amount of programming I have done.
 
QUESTION 1:
Exactly where, which line in STRLIST.OPL (I figured this was the best choice
for my application) can I enter my list of countries? I think it must be
somewhere in the PROC Array%:, possibly behind buf$?
 
QUESTION 2:
Do I enter the list of countries as strings like in dCHOICE, i.e. "Argentina,
England, France" etc. OR
Can I create the list from the database I am using? If so, how would I go about
that?
 
I hope I am fairly clear with my questions? <G>
Hope someone can help me out here.
 
TIA,
Robert
-Robert Lenz

Forum:  Psion                        Section:  Programming
Subj:  dCHOICE-long lists HELP!
To   :  Robert Lenz, 101753,2157        25/04/97 11:30 
From :  Eitan Gilboa, 100135,2720        #295620
 
Robert,
>> QUESTION 1:
I never used the LONGLI, so cannot answer the first question.
Anybody else ???

>> QUESTION 2:
As for the second, you can create a list from the .dbf with a simple loop like
so: (assuming country is in A.CTR$)
 
 Open ... A, ...
 
 L$=A.CTR$
 NEXT
 While not EOF
   L$=L$+","+A.CTR$
   NEXT
 EndWh
 
You need to take care of the resulting length of the string, eventually doing
this loop twice on 2 different strings.
 
 Best Wishes,
Eitan (-FRANCE-)    25-Apr-97 at 12:12:21 CET

Forum:  Psion                        Section:  Programming
Subj:  dCHOICE-long lists HELP!
To   :  Eitan Gilboa, 100135,2720        26/04/97 17:01 
From :  Robert Lenz, 101753,2157        #295830

Eitan,
Thanks for the description of how to create a list from a .dbf file, but 
can I also display this list as a choice list in or like the dCHOICE command?
 
I see it also still limited to the max string length of 255 which means I 
would still have to create several lists somehow to cover all 62
destinations/countries in my database.
 
At the moment I am trying to tackle my problem via your suggestions and from
the LONGLI way and this is taking some time. Combine this with the fact that 
I am back at work again for the next 2 weeks and the result is that progress
is/will be slow.
I am keeping at it though.

KG,
Robert

Forum:  Psion                        Section:  Programming
Subj:  dCHOICE-long lists HELP!
To   :  Robert Lenz, 101753,2157        27/04/97 21:49 
From :  Konstantin Saliy, 106062,203        #296091

Robert,
<< Exactly where, which line in STRLIST.OPL (I figured this was the best 
choice for my application) can I enter my list of countries? I think it must 
be somewhere in the PROC Array%:, possibly behind buf$?
>>
 
I send you my own variant of this function. It is more flexible. It was
preprocessed, so not much comments, sorry! But the main function LCFill gets 
as a parameter a name of the function which returns the next string to add 
into choice list. So you don't need to understand it so much <g>
 
A function to test:
 
 PROC Test:
  local currec%,ret%
  dINIT "Country list"
  dCHOICE currec%,"Select country:"," "
  dBUTTONS "Add/Modify",13,"Delete",8
 rem 1 - dCHOICE is the line number 1 (starting from 0
 rem currec% - item that will be selected by default
  ret%=CntList:(1,currec%)
  if ret%=0 :return :endif
  ret%=DIALOG
  if ret%=0 :return :endif
  print "Country #";currec%,"was selected"
 ENDP
 
 rem This function opens data base and fills the list
 PROC CntList:(index%,first%)
  LOCAL ret%
  OPENR "MYDATA.ODB",A,country$
  USE A
  ret%=LCFill:(index%,first%,"GetStr")
  CLOSE
  return ret%
 ENDP
 
 rem This function returns the next string for the list
 PROC GetStr$:(index%)
  local res$(255)
  if index%=0
    return "<Add New>"
  elseif EOF
    return ""
  else
    res$=A.country$+chr$(0)
    NEXT
    return res$
  endif
 ENDP
 
 rem This functioin builds choice list
 PROC LCFill:(index%,first%,getstr$)
  LOCAL set%(3)
  LOCAL vastr%
  LOCAL buf$(255), pbuf%
  LOCAL gran%
  LOCAL ohand%
  LOCAL ret%, num%
  BUSY "Generating list"
  ONERR error
  gran% = 16
  pbuf% = uadd(addr(buf$),1)
  ret% = FINDLIB(ohand%, "OLIB.DYL")
  IF (ret% <> 0) :RAISE ret% :endif
  vastr% = NEWOBJH(ohand%, 6)
  IF (vastr% = 0)
    RAISE -10
  ELSE
    ret% = ENTERSEND0(vastr%, 17, #gran%)
    IF (ret% <> 0) :RAISE ret% :endif
  ENDIF
  do
 rem The following line gets the next string for choice list
    buf$=@$(getstr$):(num%)
    num%=num%+1
    if buf$="" :break :endif
    ret% = ENTERSEND0(vastr%, 7, #pbuf%)
    IF (ret% <> 0) :RAISE ret% :endif
  until 0
  set%(1) = (2) OR (1) OR (4)
  set%(2) = vastr%
  set%(3) = first%-1
  ret% = ENTERSEND0(PEEKW($36), 10, #index%, #addr(set%()))
  IF (ret% <> 0) :RAISE ret% :endif
  ONERR OFF
  BUSY OFF
  return -1
 error::
  ONERR OFF
  BUSY OFF
  Alert(err$(err))
  return 0
 ENDP
 
 Best wishes
 Konstantin @ MOCKBA 28/04/97 00:43
 [Trying Psion Travel Modem]
 
 
Forum:  Psion                        Section:  Programming
Subj:  dCHOICE-long lists HELP!
To   :  Eitan Gilboa, 100135,2720        28/04/97 20:20 
From :  Konstantin Saliy, 106062,203        #296312

Eitan,
<< Thank you for giving _me_ homework to do...<vbg> >>
 
In that code fragment currec% variable must have correct value, from 1 to
number of strings. Instead it causes panic 137.
 
Best wishes
Konstantin @ MOCKBA 28/04/97 22:50

Forum:  Psion                        Section:  Programming
Subj:  Truncating binary files
To   :  ALL                                25/04/97 18:47 
From :  Graham Brand, 100776,1075        #295688
 
Hi,
Is it possible to truncate a binary file while it is open?
 
I want to shuffle all the data to the beginning then lop off the unused space,
but I'd prefer not to have to write a temporary file, then delete and rename,
etc.
 
Can I write some EOF character to my new 'end', and if so, will that leave 
file fragments floating about taking up memory/SSD space?
 
All the best,
Graham
Chiswick, London: 18:44 , on  25 April 1997

Forum:  Psion                        Section:  Programming
Subj:  Truncating binary files
To   :  Graham Brand, 100776,1075        26/04/97 17:52 
From :  Jochen Siegenthaler, 100127,3167#295840

<< Is it possible to truncate a binary file while it is open?>>
 
    REM truncate file to offset&
    IOW(fileHa%,11,offset&,#0)
 --
 Jochen @ Zurich, Switzerland, 25/04/97 22:09
 http://ourworld.compuserve.com/homepages/Jochen_Siegenthaler/

Forum:  Psion                        Section:  Programming
Subj:  Truncating binary files
To   :  Jochen Siegenthaler, 100127,316728/04/97 12:38 
From :  Graham Brand, 100776,1075        #296221
 
>   REM truncate file to offset&
>   IOW(fileHa%,11,offset&,#0)
 
Many thanks Jochen, that's perfect. Just what I was looking for. Saves reams 
of code!
 
All the best,
Graham
Chiswick, London: 12:23 , on  28 April 1997

Forum:  Psion                        Section:  Programming
Subj:  Dates in opl
To   :  all                                27/04/97 13:17 
From :  Peter Downer, 100625,3275        #295995
 
Hello everyone,
 Its me again with another basic ( to some of you but not me ) question.
 I use the following to give me a string representation of todays date,:
 d.date2&=days(day,month,year)
 d.date&=d.date2&
 d.date$=d.date2$
 day$=num$(day,2)
 mont$=num$(month,2)
 year$=num$(year,4)
 d.date2$=day$+"-"+mont$+"-"+year$
 If I am using a dialog with ddate to give me a date& representation, how can 
 I convert the date& to the same format as d.date2$?
 Thanks in advance for your help.
 
 Regards Peter Downer
 Using ReadCIS & JBCIS
 @ 12:27 pm on 27/04/97
 Portsmouth, (UK)

Forum:  Psion                        Section:  Programming
Subj:  Dates in opl
To   :  Peter Downer, 100625,3275        27/04/97 16:41 
From :  Eitan Gilboa, 100135,2720        #296018
 
Peter,
There's something unclear (to me) in your code. What's the value of d.date2$ 
in line 3?
 
Anyway, here is a proc to do what you want - I hope: It receives a number of
days float, and returns a date string dd-mm-yyyy. Days and months get a 
leading zero if less than 10, year has 4 digits (think of 2000).
 
 PROC Dat2Str$:(DtF&)
   LOCAL eDateF, NumDay%
   LOCAL yr%,mo%,dy%,hr%,mn%,sc%,yrday%
   eDateF=(DtF&-days(1,1,1970))*86400
   SECSTODATE eDateF, yr%,mo%,dy%,hr%,mn%,sc%,yrday%
   IF dy%<10
      eDate$="0"+FIX$(dy%,0,2)
   ELSE
      eDate$=FIX$(dy%,0,2)
   ENDIF
   eDate$=eDate$+"-"
   IF mo%<10
      eDate$ = eDate$ +"0" + FIX$(mo%,0,2)
   ELSE
      eDate$ = eDate$ +FIX$(mo%,0,2)
   ENDIF
   eDate$ = eDate$ + "-" + FIX$(yr%,0,4)
   RETURN (eDATE$)
 ENDP
 
Hope this helps.
Best Wishes,
Eitan (-FRANCE-)    27-Apr-97 at 16:28:19 CET

Forum:  Psion                        Section:  Programming
Subj:  How to Clear an Alarm?
To   :  C. E. Steuart Dewar, 71165,1115        30/04/97 00:36 
From :  Ali Manson [Psion], 73733,32        #296557
 
Hello
Assuming the alarm is just an outstanding asynchronous request on the ALM:
device, execute a P_FCANCEL (and don't forget p_waitstat() or IOWAITSTAT to
'use up' the signal). Remember that cancelling an asynchronous request does 
not nullify it - it precipitates its completion.
 
Ali

Forum:  Psion                        Section:  Programming
Subj:  How to Clear an Alarm?
To   :  David Joyce, 101520,1250        01/05/97 01:45 
From :  Ali Manson [Psion], 73733,32        #296766
 
Hello
IOCANCEL(h%)
        IOWAITSTAT stat%
 
where h% was the pointer to the channel as written by IOOPEN(h%, "ALM:", -1)
and stat% is the status word of the request in question.
 
Clear enough ?
Ali

Forum:  Psion                        Section:  Programming
Subj:  How to Clear an Alarm?
To   :  Ali Manson [Psion], 73733,32        03/05/97 19:46 
From :  C. E. Steuart Dewar, 71165,1115        #297276
 
Thanks Ali - that's most helpful!
Question - is this information anywhere in the documentation (I have both the
2-vol OPL and the 4-vol C set) - I just couldn't find any specific information
on it. Also, the code fragment i used to set the alarm (taken from the OPL help
file in the ODE) uses:         r%=IOOPEN(h%,"ALM:",0)
 i.e. with a 0 rather than a -1. 
 
The documentation I have gives generic descriptions of IOOPEN and IOC but I
have trouble finding specific information for a particular device as to what
particular arguments do...
 
Cheers!
CESD

Forum:  Psion                        Section:  Programming
Subj:  How to Clear an Alarm?
To   :  C. E. Steuart Dewar, 71165,1115        04/05/97 21:29 
From :  Ali Manson [Psion], 73733,32        #297430
 
>The documentation I have gives generic descriptions of IOOPEN and IOC but I
have trouble finding specific 
>information for a particular device as to what particular arguments do
 
The documentation for specific devices is in the IO Devices Reference in the
SDKs. Once you understand the generic method of accessing devices, broadly
speaking, the same principles apply to all devices (e.g. if you can work out
how to handle, say, the serial port, you should easily be able to handle a
timer.
 
Ali

Forum:  Psion                        Section:  Programming
Subj:  How to Clear an Alarm?
To   :  Ali Manson [Psion], 73733,32        04/05/97 01:54 
From :  C. E. Steuart Dewar, 71165,1115        #297331
 
Ok, I think I'm in a better position now to formulate the question I have after
reading your reply and finally locating at least some of the documentation I
was looking for. However, the documentation is just so vague on how this thing
works, and I have been spending ages testing myriads of combinations in an
attempt to reverse engineer how this function actually works.
 
The cancel alarm function that is in chapter 6 of the I/O Devices section of
the C SDK appears to indicate that the channel must still be open to the alarm
server. I assume from this then that the example given in the help file for the
OPL Reference sets an alarm that can NOT be canceled because the IOCLOSE call
is made, right? The cancel function does not reference an alarm, so I assume it
cancels ALL (or just the last) alarm set on the channel that is presumed to be
open? 
 
The documentation says that the P_FCANCEL call will "Cancel any outstanding
alarm request" but does not clarify what that means. Since there is no argument
on the call OTHER than the channel to the Alarm services, I assume that it is
not possible to cancel an alarm that is "outstanding" when the channel to the
alarm services has been closed. It seems they should say "Cancel any alarm set
on a channel that has not been closed"? And if it is possible to do that, how
DOES one do that? I've thought of running a test to see if the handle returned
by IOOPEN could be written to a file and retrieved on the next run of the
program on the off-chance that the Psion O/S does not close the channel when
the program exits, but there are so MANY things like this, that it would be
great if someone who already knows the answers could clarify this!
 
I keep on thinking of the Agenda application - clearly agenda knows how to
locate an alarm and delete it even after the program has exited and restarted.
On the other hand I did notice that in the TIME application, alarms set in
agenda cannot be deleted, while alarms set in the example in the help file have
a DEL option to remove them when you press Psion/V to display a list of
upcoming alarms. Presumably Agenda has some special trick up its sleeve? Is
that documented anywhere?
 
Also, two other quick questions - is there a master list somewhere of the
"Processed Exited" errors? And does Psion ever plan on releasing their
documentation in CD-Rom format? It's a bit archaic to have to sit there
flipping through page after page of huge volumes of printed documentation when
(a) it would be cheaper for Psion and (b) you could find things in a few
seconds!
 
Cheers and thanks again for the responses!
CESD

Forum:  Psion                        Section:  Programming
Subj:  How to Clear an Alarm?
To   :  C. E. Steuart Dewar, 71165,1115        04/05/97 06:43 
From :  Cade Roux (New Orleans), 73733,1014#297336
 
Re. cancelling alarms - your interpretation is correct - this is precisely the
reason Mark wrote the Alarm Server - because Time and Agenda work together to
be able to cancel alarms.
 
Cade

Forum:  Psion                        Section:  Programming
Subj:  Printing from OPL
To   :  all                                03/05/97 19:53 
From :  C. E. Steuart Dewar, 71165,1115        #297281
 
My understanding of using LOPEN/LPRINT/LCLOSE to print to a local parallel
printer is that the following should work:
 
LOPEN "PAR:A"
LPRINT "This is a test line"
LCLOSE
 
However, I have a couple of people who say that the print routines in QuikNote
and XPensEZ (both OPL programs which use those OPL commands))  generate the
message "Device PAR:A not available"   when they try and print.
 
Presumably I am missing something obvious, but the documentation that I had
looked at specifically said that the parallel port was 'PAR:A' and the serial
port was 'TTY:A'  - is this not true?
 
Thanks in advance!
CESD

Forum:  Psion                        Section:  Programming
Subj:  Printing from OPL
To   :  C. E. Steuart Dewar, 71165,1115        04/05/97 11:08 
From :  Jochen Siegenthaler, 100127,3167#297365

<< "Device PAR:A not available"     >>
 
Is this on a 3c or a 3a?
The 3c parallel port is implented differently to a 3a - the 3c uses the serial
port, and the parallel connecter has a built in serial-parallel converter.
 --
 Jochen @ Zurich, Switzerland, 04/05/97 08:03
 http://ourworld.compuserve.com/homepages/Jochen_Siegenthaler/
 
Forum:  Psion                        Section:  Programming
Subj:  Printing from OPL
To   :  C. E. Steuart Dewar, 71165,1115        05/05/97 17:42 
From :  Jochen Siegenthaler, 100127,3167#297636

<< So on the 3c, a "parallel" printer would actually be driven as a serial
device then?   >>
 
Yes, that is how I understand it.
 --
 Jochen @ Zurich, Switzerland, 05/05/97 07:27
 http://ourworld.compuserve.com/homepages/Jochen_Siegenthaler/

Forum:  Psion                        Section:  Programming
Subj:  Printing from OPL
To   :  C. E. Steuart Dewar, 71165,1115        05/05/97 17:48 
From :  Daniel Pfund, 101743,775        #297643
 
 >> Presumably I am missing something obvious, but the documentation that I
 >> had looked at specifically said that the parallel port was 'PAR:A'
 >> and the serial port was 'TTY:A'  - is this not true?
 
Unfortunately not! On the 3c, you need to set an environment variable first. 
I don't have the details at hand, but I suppose someone knows (JB?) around
here...
 
Regards,
Daniel Pfund (Geneva, Switz.)
 http://www.planet-pfund.com

Forum:  Psion                        Section:  Programming
Subj:  Printing from OPL
To   :  Daniel Pfund, 101743,775        07/05/97 15:57 
From :  John Boyce (Sysop), 100014,1240        #298203
 
Daniel
The environment variables are set by the normal dialogs - so, if you choose
Parallel then the variable is set accordingly and the same for File or Serial.
There is no way other than this of setting the variable without writing a
program to do so.
 
Best wishes
John  (United Kingdom)

Forum:  Psion                        Section:  Programming
Subj:  Printing from OPL
To   :  John Boyce (Sysop), 100014,1240        07/05/97 20:57 
From :  Daniel Pfund, 101743,775        #298298
 
 >> There is no way other than this of setting the variable without writing
 >> a program to do so.
 
I agree with this. This is why I said (initially) it was up to the programmer
to change his program in order to work on the 3c.
 
I remember Ali gave the details in comp.sys.psion.programmer a couple weeks
ago. You may find his post with DejaNews or some other News archive.
 
Regards,
Daniel Pfund (Geneva, Switz.)
 http://www.planet-pfund.com

Forum:  Psion                        Section:  Programming
Subj:  Printing from OPL
To   :  Daniel Pfund, 101743,775        07/05/97 22:32 
From :  Andrew Clarkson, 100661,2440        #298323
 
You can look at the environment variables P$D, P$S and P$F to
determine what the user has entered into the "Control->Printer"
menu option on the Psion System screen. Using this technique you
can let the user configure where print output goes from your OPL
program (serial/parallel ports or a file).
 
Here is some sample code...
 
PROC einitp$:
        local a$(3),b%(6),r%,d%,f$(128)
        a$="P$D"
        r%=call($218b,0,0,3,addr(b%()),uadd(addr(a$),1))
        if b%(1)=48
                lopen "par:a"
                f$="parallel port"
        elseif b%(1)=49
                lopen "tty:a"
                a$="P$S"
                r%=call($218b,0,0,3,addr(b%()),uadd(addr(a$),1))
                if r%=12
                        iow(-1,7,b%(1),d%)
                endif
                f$="serial port"
        else
                a$="P$F"
                r%=call($218b,0,0,3,uadd(addr(f$),1),uadd(addr(a$),1))
                if r%>0 and r%<129
                        pokeb addr(f$),r%
                else
                        f$="\p.lis"
                endif
                lopen f$
        endif
        return f$
ENDP

Forum:  Psion                        Section:  Programming
Subj:  Printing from OPL
To   :  Andrew Clarkson, 100661,2440        08/05/97 17:13 
From :  Daniel Pfund, 101743,775        #298534
 
 >> Using this technique you can let the user configure where print output
 >> goes from your OPL program (serial/parallel ports or a file).
 
Neat trick! Thanks Andy!
 
 >>                 lopen "par:a"
 
This is exactly what doesn't work the on the 3c. Do you have a 3c to test?
 
Regards,
Daniel Pfund (Geneva, Switz.)
 http://www.planet-pfund.com

Forum:  Psion                        Section:  Programming
Subj:  Printing from S3c
To   :  Alle                                22/05/97 16:57 
From :  Rolf-Peter Stockmey, 100653,2600#301746
 
I have several programs which use the OPL-Command OPEN" PAR:A" to print
directly to a printer via the parallel port. They worked all  well on the 
Psion 3a, but on my new Psion 3c I get the error message "Einheit existiert 
nicht" (Device doesn't exist) everytime when this command is performed.
 
Can anyone give me a hint how to solve this problem ?

Forum:  Psion                        Section:  Programming
Subj:  Printing from S3c
To   :  Rolf-Peter Stockmey, 100653,260022/05/97 21:42 
From :  Andrew Clarkson, 100661,2440        #301819
 
<<I have several programs which use the OPL-Command OPEN" PAR:A"
to print directly to a printer via the parallel port.>>
 
I have had the same problem with my own software on the S3c.
 
It would appear that on the S3C instead of opening the parallel
port to print via a parallel printer cable you have to open the
serial port in a specific way.
 
The following code should open the port using the settings from
the Psion System Screen "Printer->Control" menu option as well
as handling the differences between the S3a and S3c...
 
PROC einitp$:
        local a$(3),b%(6),r%,d%,f$(128)
        rem get printer->control menu settings
 
        a$="P$D"
        r%=call($218b,0,0,3,addr(b%()),uadd(addr(a$),1))
 
        if b%(1)=48
                rem use parallel port
                trap lopen "par:a"
                if err=-41
                        rem device does not exist so
                        rem assume S3c and open as follows...
                        lopen "tty:a"
                        b%(1)=4112
                        b%(2)=3
                        b%(3)=4381
                        b%(4)=19
                        b%(5)=0
                        iow(-1,7,b%(1),d%)
                endif
                f$="parallel port"
        elseif b%(1)=49
 
 
Forum:  Psion                        Section:  Programming
Subj:  Printing from S3c
To   :  Andrew Clarkson, 100661,2440        26/05/97 19:48 
From :  Rolf-Peter Stockmey, 100653,2600#302366
 
Nachrichttext wurde geschrieben von Andrew Clarkson
><<I have several programs which use the OPL-Command OPEN" PAR:A" to print
directly to a printer via the parallel port.>>
 
<<I have had the same problem with my own software on the S3c.>>
 
Hi Andrew,
 
 it works and it's much easier than the solution I got meanwhile from the
Customer Service of Psion, which is as follows:
 
     PROC doLprint:
        lopen "tty:a"  :rem instead of  PAR:A !
        print "LOPENed ok"
        loadm "rsset"
        rsset:(16,0,8,1,$1d,&0) 
        print "Characteristics set ok"
        lprint "1..."
        lprint "2..."
        lprint "3..."
        lprint "4..."
        lprint "5..."
        lprint chr$($c) rem formfeed
        pause 2 
        lclose
        print "Finished ok. Press a key to exit..."
        get
     ENDP
 
     PROC rsset:(baud%,parit%,daten%,stop%,handsh%,term&)
        local frame%,srchar%(6),dummy%,err%
        frame%=daten%-5
        if stop%=2 :frame%=frame% or 16 :endif
        if parit% :frame%=frame% or 32: endif
        srchar%(1)=baud% or (baud%*256)
        srchar%(2)=frame% or (parit%*256)
        srchar%(3)=(handsh% and 255) or $1100
        srchar%(4)=13
        pokel addr(srchar%(5)),term&
        err%=iow(-1,7,srchar%(1),dummy%)
        if err% :raise err% :endif
     endp
 
Forum:  Psion                        Section:  Programming
Subj:  Printing on 3c...
To   :  Andy Clarkson, 100661,2440        27/05/97 21:55 
From :  Daniel Pfund, 101743,775        #302566
 
Andy,
Last week you posted on how to print from the 3c. Your code works fine, but
there is one problem: OPEN "TTY:A" works *all* the time, regardless if you've
got a cable in your 3c or not.
 
So when you get to LPRINT, the 3c just hangs there doing nothing!
 
Try this without anything connected:
 
 LOPEN "TTY:A"
 Print "LOPEN ok"
 LPRINT "Test"
 PRINT "LPRINT ok"
 
You never get to that last line :-(
 
Does anyone have a solution to this problem? If I liberally assumed the user
would have his parallel link in his 3c, I'd be ok... but I'm sure to get many
problems with this approach as some users may exactly *not* have their cable in
there.
 
Regards,
 Daniel Pfund (Geneva, Switz.)
 http://www.planet-pfund.com
 
Forum:  Psion                        Section:  Programming
Subj:  Printing on 3c...
To   :  Daniel Pfund, 101743,775        28/05/97 07:46 
From :  Konstantin Saliy, 106062,203        #302626
 
Daniel,
<< Does anyone have a solution to this problem?  >>
 
Use async I/O, i.e. IOOPEN("TTY:A"...), then IOA or IOC and timer for
reasonable timeouts and KEYA to check if a user want to interrupt printing.
 
Something like this (using OPP defines):
 
 proc SWrite:(buf%,size%,timeout&)
  local len%,serstat%,timstat%,timeval&
  local keystat%,key%(2)
  len%=size%
  IOC(hSerial%,P_FWRITE,serstat%,#buf%,len%)
  timeval&=timeout&
  IOC(hTimer%,P_FREAD,timstat%,timeval&,#0)
  KEYA(keystat%,key%())
  do
    IOWAIT
    if serstat%<>PendingErr
      IOCANCEL(hTimer%)
      IOWAITSTAT timstat%
      KEYC(keystat%)
      if serstat%<0
        RAISE serstat%
      else
        return
      endif
    elseif timstat%<>PendingErr
        IOCANCEL(hSerial%)
        IOWAITSTAT serstat%
        KEYC(keystat%)
        RAISE TimeoutErr
    elseif keystat%<>PendingErr
      if key%(1)=ESC
        IOCANCEL(hSerial%)
        IOWAITSTAT serstat%
        IOCANCEL(hTimer%)
        IOWAITSTAT timstat%
        RAISE UserAbortedErr rem define yourself
      endif
      KEYA(keystat%,key%())
    endif
  until 0
 endp
 
and
   IOOPEN(hTimer%,"TIM:",-1)
   IOOPEN(hSerial%,"TTY:A",-1) with appropriate checks and port settings before
(IOW(hSerial%,....) instead of (IOW(-1...)).
 
Note 1: the code above was never even compiled! Note 2: check if IOWAITSTAT is
needed after KEYC - it seems that it isn't, but I never used it. Note 3: use
large enough timeout for slow printers.
 
You may also try to check DTR signal state before printing - it is high if
printer is connected and switched on (which prevents 3c to auto-switch off).
 
Anyway LOPEN/LPRINT is always blind for serial I/O and thus good only for test
purpose.
 
 Best wishes
 Konstantin @ MOCKBA 28/05/97 04:27
 
Forum:  Psion                        Section:  Programming
Subj:  Printing on 3c...
To   :  Konstantin Saliy, 106062,203        28/05/97 18:58 
From :  Daniel Pfund, 101743,775        #302701
 
 >> You may also try to check DTR signal state before printing - it is high
 >> if printer is connected and switched on (which prevents 3c to
 >> auto-switch off).
 
Thanks Konstantin! I'm beginning to wonder if this solution is not easier? I
never had done any async things before, so I'd prefer a simple approach ;-)
 
How do I check the DTR signal state?
 
Regards,
 Daniel Pfund (Geneva, Switz.)
 http://www.planet-pfund.com
 
Forum:  Psion                        Section:  Programming
Subj:  Printing on 3c...
To   :  Daniel Pfund, 101743,775        29/05/97 09:30 
From :  Konstantin Saliy, 106062,203        #302832
 
Daniel,
<<  I'm beginning to wonder if this solution is not easier? >>
 
In programming there is no special way for kings <g>
 
<< never had done any async things before  >>
 
And never programmed in OPL two years ago <g> The example shows how to do it.
 
<< How do I check the DTR signal state?   >>
 
IOW with P_FCTRL maybe - I have no manual in hands, sorry! Maybe in the OPL 
ODE manual there is some info?
 
 Best wishes
 Konstantin @ MOCKBA 29/05/97 03:57
 
Forum:  Psion                        Section:  Programming
Subj:  Printing on 3c...
To   :  Daniel Pfund, 101743,775        28/05/97 21:46 
From :  Andrew Clarkson, 100661,2440        #302732
 
<<there is one problem: OPEN "TTY:A" works *all* the time, regardless
if you've got a cable in your 3c or not>>
 
The following modification to the code should raise an error when
the connection cannot be established...
 
PROC einitp$:
        local a$(3),b%(6),r%,d%,f$(128),err%
        a$="P$D"
        r%=call($218b,0,0,3,addr(b%()),uadd(addr(a$),1))
        if b%(1)=48
                trap lopen "par:a"
                if err=-41
                        rem assume S3c so open as follows...
                        lopen "tty:a"
                        b%(1)=4112
                        b%(2)=3
                        b%(3)=4381
                        b%(4)=19
                        b%(5)=0
                        err%=iow(-1,7,b%(1),d%)
                        if err% :raise err% :endif
                endif
                f$="parallel port"
        elseif b%(1)=49
                lopen "tty:a"
                a$="P$S"
                r%=call($218b,0,0,3,addr(b%()),uadd(addr(a$),1))
                if r%=12
                        err%=iow(-1,7,b%(1),d%)
                        if err% :raise err% :endif
                endif
                rem check other end ready
                b%(1)=0
                err%=iow(-1,11,b%(1),d%)
                if err% :raise err% :endif
                if b%(1)=0 :raise -41 :endif
                f$="serial port"
        else
                a$="P$F"
                r%=call($218b,0,0,3,uadd(addr(f$),1),uadd(addr(a$),1))
                if r%
 
 
Forum:  Psion                        Section:  Programming
Subj:  Printing on 3c...
To   :  Andrew Clarkson, 100661,2440        29/05/97 19:03 
From :  Daniel Pfund, 101743,775        #302916
 
Andrew,
 
Thanks for the OPL sample! I suppose you must simply add the
>>err%=iow(-1,7,b%(1),d%)<< line?
 
Regards,
 Daniel Pfund (Geneva, Switz.)
 http://www.planet-pfund.com
 
 
Forum:  Psion                        Section:  Programming
Subj:  Printing on 3c...
To   :  Daniel Pfund, 101743,775        29/05/97 22:02 
From :  Andrew Clarkson, 100661,2440        #302950
 
<<I suppose you must simply add the >>err%=iow(-1,7,b%(1),d%)<< line?>>
 
The above sets the baud rate etc for the serial port.
 
To check whether there is something plugged into the other end of the
cable you need the lines...
 
        local b%(1)
        rem check other end ready...
        b%(1)=0
        err%=iow(-1,11,b%(1),d%)
        if err% :raise err% :endif
        rem check something at other end of cable...
        if b%(1)=0 :raise -41 :endif
 
The above checks the state of the serial cable. Here is the
definition from the Psionics files:
 
Function        : 11
Argument 1        : 2 byte control block
 
The first byte of the control block is set to indicate the state of
the modem control limes:
        Bit 0: set if CTS active
        Bit 1: set if DSR active
        Bit 2: set if DCD active
 
The second byte specifies the new setting for the DTR line:
        0 = leave unchanged
        1 = set DTR active
        2 = set DTR inactive
 
Regards,
Andy
 
Forum:  Psion                        Section:  Programming
Subj:  Printing on 3c...
To   :  Andrew Clarkson, 100661,2440        30/05/97 20:07 
From :  Daniel Pfund, 101743,775        #303109
 
As usual, I must thank you.
You are an OPL wiz Andy! Thanks for your awesome programs.
 
Best wishes,
 Daniel Pfund (Geneva, Switz.)
 http://www.planet-pfund.com
 
Forum:  Psion                        Section:  Programming
Subj:  Printing on 3c...
To   :  Daniel Pfund, 101743,775        28/05/97 21:46 
From :  Andrew Clarkson, 100661,2440        #302733
 
<<Your code works fine, but there is one problem: OPEN "TTY:A" works
*all* the time, regardless if you've got a cable in your 3c or not>>
 
OK, I have modified the code to fix this problem, it now raises
an error if no device is attached...
 
PROC einitp$:
        local a$(3),b%(6),r%,d%,f$(128),err%
        a$="P$D"
        r%=call($218b,0,0,3,addr(b%()),uadd(addr(a$),1))
        if b%(1)=48
                trap lopen "par:a"
                if err=-41
                        rem assume S3c so open as follows...
                        lopen "tty:a"
                        b%(1)=4112
                        b%(2)=3
                        b%(3)=4381
                        b%(4)=19
                        b%(5)=0
                        err%=iow(-1,7,b%(1),d%)
                        if err% :raise err% :endif
                endif
                f$="parallel port"
        elseif b%(1)=49
                lopen "tty:a"
                a$="P$S"
                r%=call($218b,0,0,3,addr(b%()),uadd(addr(a$),1))
                if r%=12
                        err%=iow(-1,7,b%(1),d%)
                        if err% :raise err% :endif
                endif
                f$="serial port"
        else
                a$="P$F"
                r%=call($218b,0,0,3,uadd(addr(f$),1),uadd(addr(a$),1))
                if r%>0 and r%<129
                        pokeb addr(f$),r%
                else
                        f$="\p.lis"
                endif
                lopen f$
        endif
        return f$
ENDP
 
Forum:  Psion                        Section:  Programming
Subj:  PSIZIP
To   :  all                                01/06/97 17:59 
From :  Peter Downer, 100625,3275        #303434
 
Serge,
Would it be possible to launch PSIZIP from another opa? I have written a prog
which stores names and addresses of customers and their account details. This
takes up a fairly large amount of memory, It would be handy if, when The opa
is shut down I could have the option of Zipping up these *.odb files ( even 
better with Password encryption ) without having to go back into psizip after 
saving the files as they are.
If I could just launch into psizip from the menu it would be great but if all
details could be passed to psizip and the zipping done automatically, so much
the better.
 
 Peter Downer (100625.3275@compuserve.com)
 @ 01:42 pm on 01/06/97
 From Portsmouth (UK) in United Kingdom
 
Forum:  Psion                        Section:  Programming
Subj:  PSIZIP
To   :  Peter Downer, 100625,3275        02/06/97 17:52 
From :  Jochen Siegenthaler, 100127,3167#303600
 
<< Serge,  Would it be possible to launch PSIZIP from another opa? >>
 
I'll answer for Serge as I have examined the same topic in some detail.
You can launch Psizip.app from another .OPA just as easily as launching any
other application.
 
<<  If I could just launch into psizip from the menu it would be great but if
all details could be passed to psizip and the zipping done automatically, so
much the better.   >>
 
As PsiZip is a HWIM app, it supports ATS and you can send it messages and key
strokes. This is very easy and an example is enclosed below. This example is
programmed in OPP, if you don't have OPP I can send you the OPL equivalent.
 
#include <os\io> #include <os\mess>
 
PROC main:
 GLOBAL status%
 LOCAL prog$(128), zipfile$(128), cmdl$(255)
 LOCAL pid%
 
 zipfile$="\ZIP\*.zip"
 
 PRINT "Test program to automate PsiZip"
 dINIT "Choose a zip file"
 dFILE zipfile$, "File:", 64+8
 IF DIALOG=0 :STOP :ENDIF
 
 REM exact file spec of PsiZip program
 REM change as required
 prog$="LOC::B:\APP\PSIZIP.APP"
 
 REM format is always modeName0ext0filename0
 REM mode= "O" or "C" (open or create)
 REM Name = app name, case sensitive
 REM 0 = CHR$(0)
 REM ext = file extension for this app
 REM filename = file to open/create
 cmdl$="OPsiZip" + CHR$(0) + ".ZIP" + CHR$(0) + zipFile$ + CHR$(0)
 
 REM launch app, returns pid%, raises error if it fails
 PRINT "Launching PsiZip"
 pid%=launch%:("PsiZip",ADDR(prog$), ADDR(cmdl$))
 
 REM show a message on the app
 RemMsg:(pid%,"Wow! It worked!")
 PAUSE 20
 
 REM automate something
 RemMsg:(pid%,"How about some info?")
 SendKey:(512+%i, 8, pid%) REM Psion-I
 PAUSE 60
 SendKey:(13, 0, pid%) REM Enter
 
 RemMsg:(pid%,"Here's the About dialog...")
 SendKey:(512+%v, 2+8, pid%) REM Psion-V
 PAUSE 20
 RemMsg:(pid%,"Remember, hands off!")
 PAUSE 40
 SendKey:(13, 0, pid%) REM Enter
 
 RemMsg:(pid%,"That's all folks!")
 PAUSE 60
 RemMsg:(pid%,"Exiting...")
 SendKey:(512+%x, 8, pid%) REM Psion-X
 
 REM loop until status%<>-46
 REM status=-46 if PsiZip is running
 REM loop exits when PsiZip is closed
 REM use this to detect when the user exits PsiZip
 DO
  IOWAIT
 UNTIL status%<>-46
 
 BUSY OFF
 PRINT "PsiZip has ended."
 PRINT "All's well that ends well"
 PRINT "Press a key to exit"
 GET ENDP
 
PROC launch%:(name$, appadr%, cdladr%)
 LOCAL pid%, OSREGS
 
 REM launch app
 GIPRINT "Launching " + name$, 1
 ONERR ErrTrap
 
 REM execute app
 BX=UADD(appadr%,1)
 CX=cdladr%
 DX=ADDR(status%)
 DI=ADDR(pid%)
 OSSUB(FilManager,FilExecute)
 
 REM set up an async request so we're notified when app dies.
 BX=pid%
 DI=ADDR(status%)
 OSSUB(IoManager,IoSignalKillAsynchronous)
 
 REM Resume process
 BX=pid%
 OSSUB(ProcManager,ProcResume)
 BUSY name$ + " running"
 RETURN pid%
 
ErrTrap::
 ONERR OFF
 BUSY OFF
 PRINT "Cannot launch",Name$, "Error",ERR,ERR$(ERR)
 PRINT "Press a key"
 GET ENDP
 
PROC SendKey:(a%,b%,c%)
 REM a%=key, b%=modifier, c%=process pid
 LOCAL OSREGS
 LOCAL k%,m%,p%,f% /*struct indeed */
 k%=a%
 m%=b%
 p%=c%
 BX=p%
 CX=$31
 SI=addr(k%)
 OSSUB(MessManager,MessSend) ENDP
 
PROC RemMsg:(a%,b$)
 /* uses MessManager & MessSend
 p% = pid%
 t$ = text$ to display, max 64 chars
 highly optimised for size 17.5.97 */
 LOCAL x$(65), i%
 x$ = LEFT$(b$,64)
 i% = UADD(ADDR(x$),1)
 CALL($0483, a%, $33, 0, ADDR(i%)) ENDP
 
 --
 Jochen @ Berlin, Germany, 02/06/97 18:39
 http://ourworld.compuserve.com/homepages/Jochen_Siegenthaler/
 
Forum:  Psion                        Section:  Programming
Subj:  PSIZIP
To   :  Jochen Siegenthaler, 100127,316702/06/97 18:52 
From :  Peter Downer, 100625,3275        #303629
 
Jochen,
 Thank you for your reply, I will be writing it into my opa soon and will let
you know how it goes. I do use OPP and find it very good. Thanks again.
 
 Peter Downer (100625.3275@compuserve.com)
 @ 06:42 pm on 02/06/97
 From Portsmouth (UK) in United Kingdom

      
     Forum:  Psion                        Section:  Workabout & HC
     Subj:  FilManager problem
     To   :  ALL                                09/06/97 19:19 
     From :  Richard Watt, 100334,3266        #304828
      
     After using the $0A subfunction of function $87 to determine the free
     space on a drive on a Workabout, I suddenly find that I am getting an
     "Invalid name" error after calling the OS OPL function to execute the
     call.
      
     The routine I have written checks the program's data drive, set up as a
     global variable, and set to "M:". The flags returned from the OS() call
     have the hex value F283, or 1111001001000011 in binary.
      
     Can anyone tell me what has happened, and what I can do? The routine I
     wrote is based on the call87.opl file uploaded to this library by Ian W.
     Smith. The data drive can be changed by the user using a setup module,
     but this feature has been disabled just now until I get it working.
      
     Also, how can I determine the drive from which a program is started?
      
     Thanks in advance,
     Richard Watt
      
     P.S. I would appreciate a quick response, as I need to have this program
     ready for a show in Japan near the end of the month at the latest.
      
     Forum:  Psion                        Section:  Workabout & HC
     Subj:  FilManager problem
     To   :  Richard Watt, 100334,3266        09/06/97 19:33 
     From :  John Boyce (Sysop), 100014,1240        #304832
      
     Richard
      
      >> I suddenly find that I am getting an "Invalid name" error after
     calling
      >> the OS OPL function to execute the call.
      
     You are obviously doing something wrong with the call or setting it up
     incorrectly - without sight of your code it will be impossible to be
     sure what you are doing wrong. I always use "LOC::" in front of the
     drive letter and colon which may be part of your problem but it may not,
     you might be doing something else wrong with the setup.
      
     The only bit of the binary output that matters is the first bit, if set
     then the call failed. The reason for the failure will be in the AX
     register.
      
     Best wishes
      
     John  (United Kingdom)
