     Subj:  OVAL - DATABASES                 Section: Programming
       To:  All                              11 March 1997 20:04:24
     From:  Bill Stevenson, 100112,2164      #285915

     I'm using OVAL on the WorkAbout and am trying to use Psion and/or dBASE
     III Files. This is what I'm doing:

             Dim MyDB as Database

             Set MyDB = OpenDatabase("M:\OPD\", False, False, "dBASE III;")

     But get the error:

             SYS$DATA.$10 (Sometimes .$11 or .$13)
             Process Exited
             Exit Number 48

             Continue...

     Any ideas ???
     Bill.

     Subj:  OVAL - DATABASES                 Section: Programming
       To:  Bill Stevenson, 100112,2164      12 March 1997 15:27:24
     From:  Carl Alderton, 100536,3502       #286085

     Hi Bill,
     Yeah I had the same problem so I phoned Psion support and they sent me
     the following reply.

     =================================================================
     You are not doing anything wrong I have been asked this a few times now
     and this is the answer the developers (Psion Software) gave me:

     This is a known problem with the DBS server. To get round this problem,
     please install the files:

     DBASE.DYL
     SYS$DATA.CFG
     ISAM3_01.DYL

     in any \DBS directory on your Psion. These files should be in the
     DBSPATCH directory in your OVAL directory.

     You may redistribute these files with your OVAL application.
     =================================================================
     I didn't have the DBSPATCH directory with my install so I had to get the
     files direct from psion support. If you don't have the files then e-mail
     them at:-

             uk-ovalsupport@psion.com

     Regards,
     Carl Alderton


     Subj:  conversion from BASIC            Section: Programming
       To:  All                              22 March 1997 19:03:18
     From:  Kish Woolmore, 106154,3475       #288366

     I have recently converted some programs from Qbasic to OPL. The OPL
     program appears to function correctly but gives different results to the
     BASIC program, I have narrowed the problem down to  a couple of lines of
     code which appear to be identical for both langauges but gives different
     results.

     proc normdeg:
     REM NORMALIZE DEGREES
     Q=Q/360 :Q=Q-INT(Q) :Q=Q*360
     endp

     the problem seems to be when ever Q starts of as negative number, the
     same result can be achieved with both versions if in the OPL version 1
     subtracted from the INT(Q) value.

     Can anybody please verify which , BASIC or OPL is giving the correct
     results or should OPL be modified to give the same results as BASIC.

     I look forward to your help
     regards
     Kish Woolmore
     106154.3475@Compuserve.com


     Subj:  conversion from BASIC            Section: Programming
       To:  Kish Woolmore, 106154,3475       22 March 1997 20:18:16
     From:  Eitan Gilboa, 100135,2720        #288379

     Kish,
     >> Q=Q/360 :Q=Q-INT(Q) :Q=Q*360

     From the OPL prog. manual:

      INT(-5.9)=-5
      INT(2.9)=2

     I don't know about QBasic. But if you want to round the INT to the
     nearest integer, replace above with:

      INT(-5.9 -0.5) and
      INT(2.0 +0.5)

     What is  >> BASIC or OPL is giving the correct results << Is up to you.
     Check the QBasic results and change the code accordingly.

      Best Wishes,
      Eitan (-FRANCE-)    22-Mar-97 at 21:14:28 CET


     Subj:  conversion from BASIC            Section: Programming
       To:  Eitan Gilboa, 100135,2720        23 March 1997 22:43:21
     From:  Kish Woolmore, 106154,3475       #288584

     Eitan,
     thanks for replying to my message regarding integer conversion
     from my original message:
     >>> Q=Q/360 :Q=Q-INT(Q) :Q=Q*360

     if the first part gives a result of say -5.8

     then int(Q) is -6 inQBASIC
     and                 -5 in OPL

     whereas if result was 5.8 then OPL and QBASIC appear to return same
     answer of 5

     adding .5 in OPL doesn't appear to help either

     this is why I need to know whether QBASIC is correct mathematically or
     OPL

     regards
     Kish Woolmore
     London, UK
     106154.3475@Compuserve.com


     Subj:  conversion from BASIC            Section: Programming
       To:  Kish Woolmore, 106154,3475       23 March 1997 23:17:06
     From:  Eitan Gilboa, 100135,2720        #288591

     Kish,
     >> adding .5 in OPL doesn't appear to help either

     You need *subtracting* for negative numbers. <g>

     I don't know the 'mathematically' correct answer. I think as a practical
     program, you need to see which works for you. Since you said QBqsic was
     ok, then I think you should write it to give QBqsic's result.

      Best Wishes,
      Eitan (-FRANCE-)    24-Mar-97 at 00:08:44 CET


     Subj:  conversion from BASIC            Section: Programming
       To:  Kish Woolmore, 106154,3475       25 March 1997 16:45:00
     From:  Jeff Siegel, 75344,1732          #288874

     I think what you may be seeing is a truncation in OPL rather
     than a rounding in QBASIC. Absolute truncation of -5.8 is -5 rather than
     -6, and +5.8 also becomes +5.


     Subj:  Open file dialog problem         Section: Programming
       To:  all                              29 March 1997 22:45:04
     From:  ANDREW THOMAS, 101735,3054       #289816

     I've been having trouble with a dialog for opening existing files. The
     problem is that I can't seem to stop it listing files which don't have a
     '.chs' extension. This is the code I'm using:

             TFName$="\app\chessrec\*.chs"
             dinit "Open file"
             dfile TFName$,"Filename",64
             dbuttons "Cancel",27,"Open",13
             men%=dialog
             if men%=0 : return : endif

     I will be grateful for any tips.
     Andrew.

     Subj:  Open file dialog problem         Section: Programming
       To:  ANDREW THOMAS, 101735,3054       30 March 1997 00:37:27
     From:  Konstantin Saliy, 106062,203     #289841

     Andrew,
     << The problem is that I can't seem to stop it listing files which don't
     have a '.chs' extension >>

     Use 64+8. But if you press tab key, all the files will be listed anyway.

      Best wishes
      Konstantin @ MOCKBA 30/03/97 02:15


     Subj:  OPL Preferences                  Section: Programming
       To:  All                              29 March 1997 21:36:06
     From:  Paul Robinson, 101741,2122       #289803

     The 'Show Tabs' setting in OPL preferences on the 3c is not preserved
     across sessions. Is this usual or am I doing something wrong?

     TIA
     Paul.

     Subj:  OPL Preferences                  Section: Programming
       To:  Paul Robinson, 101741,2122       30 March 1997 05:06:25
     From:  John Boyce (Sysop), 100014,1240  #289872

     Paul

      >> The 'Show Tabs' setting in OPL preferences on the 3c is not
     preserved

     This sort of thing is stored in the template so this would need to be
     edited for the process to work seamlessly (remember to only have the
     bare bones of a program in when saving as a Template as text is saved as
     well).

     Best wishes
     John  (United Kingdom)

     Subj:  OPL Preferences                  Section: Programming
       To:  John Boyce (Sysop), 100014,1240  30 March 1997 21:44:04
     From:  Paul Robinson, 101741,2122       #289990

     John
     > >> The 'Show Tabs' setting in OPL preferences on the 3c is not
     preserved
     >This sort of thing is stored in the template so this would need to be
     edited for the process to work >seamlessly

     Thanks John - I hadn't even noticed the 'Save as template' menu item
     <sheepish grin>

     Regards,
     Paul
     (UK)

     Subj:  Getevent                         Section: Programming
       To:  All                              29 March 1997 19:20:27
     From:  colin shearing, 100570,1201      #289772

     Hi All,
     I wonder if anyone can help. I would like to be able to test for 2
     events in a programme (Machine turn on and Date change) so that the
     programme will only run if both these events are true. I understand how
     to test for one of these events with the Getevent statement but I am not
     sure how to test for both events in the same programme. Can anyone help
     please.

     Colin 29/03/97

     Subj:  Getevent                         Section: Programming
       To:  colin shearing, 100570,1201      29 March 1997 19:56:27
     From:  John Boyce (Sysop), 100014,1240  #289787

     Colin
      >> Machine turn on and Date change

     Keep the date in a variable and then, on ON, check to see if the date
     agrees with the current one - if not you have your circumstances you
     require. The GETEVENT for date change will be overwritten when you
     switch the machine on as the date change is only detected if the machine
     is on anyway.

     Best wishes
     John  (United Kingdom)


     Subj:  Getevent                         Section: Programming
       To:  John Boyce (Sysop), 100014,1240  30 March 1997 23:06:19
     From:  colin shearing, 100570,1201      #290012

     John, Thanks very much for your reply and the information. I should of
     been able to work that one out<g>.

     BTW I wonder if you or anyone else could tell me if it is possible to
     bring Agenda to the front from OPL and if so how.

     I know how to start Agenda but not what to do if it is already running.

     Best Wishes Colin 30/03/97

     Subj:  Getevent                         Section: Programming
       To:  colin shearing, 100570,1201      31 March 1997 05:56:03
     From:  John Boyce (Sysop), 100014,1240  #290077

     Colin
      >> if it is possible to bring Agenda to the front from OPL and if so
     how.

     In essence you need to identify the PID (Process IDentity) and this can
     then be used to bring to the foreground. The pid is available after
     launching Agenda from OPL and this would need to be stored and then used
     as CALL($198D,0,pid%) to bring Agenda to the foreground.

     Best wishes
     John  (United Kingdom)


     Subj:  Macsys                           Section: Programming
       To:  all                              29 March 1997 17:45:31
     From:  Alexander Grund, 100106,1351     #289771

     Hello,
     I would like to write a macro which starts (using server application)
     the program jbreset onece a week. I have tried the following:

     Proc Jbreset:
      Runapp:("OPO","m:\OPO\Jbresetm.opo") endP

     But when I try to start the macro I am told : Error in Jbreset, program
     not found.

     I have also tried starting other applications using the runapp-command,
     (like runapp:("agenda","agenda.agn") and it doesn't work.

     My RAM ssd is set to the current directory, but all the files (Macsys,
     Agenda,Macro) are on the internal disk.

     Bye,
       >>> Alex <<<<

     Subj:  Macsys                           Section: Programming
       To:  Alexander Grund, 100106,1351     29 March 1997 19:56:25
     From:  John Boyce (Sysop), 100014,1240  #289786

     Alex
      >> Runapp:("OPO","m:\OPO\Jbresetm.opo") endP

     This should be...
        RunApp:("m:\opo\jbresetm.opo","")

      >> I have also tried starting other applications using the
     runapp-command,
      >> (like runapp:("agenda","agenda.agn") and it doesn't work.

     It may be that it can't find agenda.agn - try expanding this with the
     path as well.

     Best wishes
     John  (United Kingdom)


     Subj:  Macsys                           Section: Programming
       To:  John Boyce (Sysop), 100014,1240  31 March 1997 09:04:10
     From:  Alexander Grund, 100106,1351     #290091

     Hello John,
     >> This should be...   RunApp:("m:\opo\jbresetm.opo","") <<

     Thanks, it works fine.

     Bye,
         >>> Alex <<


     Subj:  Macsys                           Section: Programming
       To:  Alexander Grund, 100106,1351     30 March 1997 15:49:01
     From:  Robert Mann, 74723,1066          #289926

     << I would like to write a macro which starts (using server application)
     the program jbreset onece a week. I have tried the following:

     Proc Jbreset:
      Runapp:("OPO","m:\OPO\Jbresetm.opo") endP

     But when I try to start the macro I am told : Error in Jbreset, program
     not found. >>

     Try this:

     PROC Macro: Runapp:("RunOpl","LOC::M:\OPO\Jbresetm.opo") ENDP

     << I have also tried starting other applications using the
     runapp-command, (like runapp:("agenda","agenda.agn") and it doesn't
     work. >>

     Try this:

     PROC Macro: Runapp:("Agenda","LOC::M:\AGN\Agenda.agn") ENDP

     Cheers!
      Robert
      30/03/97  16:44 CET    *   74723.1066@compuserve.com


     Subj:  Time change                    Section: Programming
       To:  Christopher Farwell, 101766,3243 31 March 1997 16:36:07
     From:  Bob Munson, 106424,2412          #290159

     Hi Chris
     <<my Psion ... had gained a few (well actually a lot of) minutes, ... I
     was wondering if its possible to change the time from within OPL.
     .. what commands are required. >>

     I believe we spoke about the need for a prog like this a while back.

     Yes it can be done from OPL using a system call. The call is $89 sub $03
     to set it. Something like

     Proc settime:(offset%)
       local cx%, dx%, time&
       time& = offset& + DATETOSECS(year, month, day, hour, minute, second)
       cx% = peekw( addr(time&)+2 )
       dx% = peekw( addr(time&) )
       call( $0389, 0, cx%, dx%) endp

     should work.

      Bob Munson (-:
      3a Read/JBcis in DE @ 16:00 on 31/03/97


     Subj:  Clearing file attributes         Section: Programming
       To:  All                              05 April 1997 17:43:07
     From:  Jochen Siegenthaler, 100127,3167 #291358

     Hi all,
     I want to clear the Modified file attribute from OPL
     Here is what I am doing...

      proc test:
      local f$(128)
      f$="loc::m:\dat\atest.dbf"+chr$(0)
      attSet:(ADDR(f$))
      print "done"
      get
      endp

      PROC attSet:(fadr%)
      REM sets attributes for file f$
      LOCAL ax%, bx%, cx%, si%, di%
      LOCAL mask%, new%
      mask%=32
      new%=0

      ax%=$0900          REM set AX = 9 for "FilStatusGet" sub call
      bx%=UADD(fadr%,1)  REM set BX = pointer to cstr file name
      cx%=mask%    REM set CX = mask of attr to change
      di%=new%     REM set DI = new attr values
      REM dx%,si% are all 0

      OS($87,ADDR(ax%))  REM call Function
      IF ax%<>0 :RAISE ax% :ENDIF

      RETURN
      ENDP

     ..but the problem is I can only SET the attributes, not clear them. I
     tried the different masks (bits 0,1,2,5 = Not read only, hidden, system,
     modified respectively) and I can SET the appropirate attribute, but I
     cannot seem to CLEAR it!

     I tried new%=0, and then di%=new%, as well as di%=ADDR(new%), but have
     had no success in CLEARING the attribute.

     What am I doing wrong?
      --
      Regards, Jochen @ Zurich, Switzerland, 05/04/97 18:20


     Subj:  Clearing file attributes         Section: Programming
       To:  Jochen Siegenthaler, 100127,3167 05 April 1997 17:51:05
     From:  John Boyce (Sysop), 100014,1240  #291365

     Jochen

     Set cx%=$27 and di% to the new attributes and it should work - it does
     for me <g>.

     Best wishes
     John  (United Kingdom)


     Subj:  Clearing file attributes         Section: Programming
       To:  John Boyce (Sysop), 100014,1240  05 April 1997 20:44:17
     From:  Jochen Siegenthaler, 100127,3167 #291406

     << Set cx%=$27   >>

     Which enables changing Read only, Modified, Hidden & System - more than
     I need, but that is irrelevant.

     << and di% to the new attributes   >>

     But even if I set di%=0 (and cx%=$27), I get...

      Read only=No
      Modified=Yes
      Hidden=Yes
      System=Yes

     ..which is what I would expect for di%=$27. Using di%=$27 and di%=0
     yields the same result. Why?

     I wish to be able to set Modified=No (bit 5=0); but no matter what I do
     I can only set Modified=Yes (bit 5=1).

     << it should work - it does for me <g>.  >>

     Did you try setting Modified=No? If it worked, how did you do it?
      --
      Regards, Jochen @ Zurich, Switzerland, 05/04/97 21:42


     Subj:  Clearing file attributes         Section: Programming
       To:  Jochen Siegenthaler, 100127,3167 05 April 1997 21:11:10
     From:  John Boyce (Sysop), 100014,1240  #291415

     Jochen
      >> But even if I set di%=0 (and cx%=$27), I get...  Read only=No
      >> Modified=Yes Hidden=Yes System=Yes

     I don't understand why this should be - JBTree uses the system to set
     attributes and it doesn't fail for me - I use a small procedure with
     global ax% etc..

       PROC attrr:(a%, f$)
       LOCAL fx$(128)
       fx$=f$+chr$(0)
       ax%=$0900
       bx%=ADDR(fz$)+1
       cx%=$27
       di%=a%
       OS($87,ADDR(ax%))
       ENDP

     where a% is made up as follows

        a%=0
        if Read/Write then a%=a%+1
        if Modified then a%=a%+$20
        if Hidden then a%=a%+2
        if System then a%=a%+4
        attrr:(a%,f$)

     Best wishes
     John  (United Kingdom)


     Subj:  Clearing file attributes         Section: Programming
       To:  Jochen Siegenthaler, 100127,3167 06 April 1997 01:08:18
     From:  Konstantin Saliy, 106062,203     #291454

     Jochen,
     << Did you try setting Modified=No? If it worked, how did you do it? >>

     RShell sets and clears any attributes. It is written exactly as John
     said - with cx%=$27.

      Best wishes
      Konstantin @ MOCKBA 06/04/97 03:58


     Subj:  Clearing file attributes         Section: Programming
       To:  Jochen Siegenthaler, 100127,3167 06 April 1997 02:00:15
     From:  Bob Munson, 106424,2412          #291473

     Johen
     As well as what John said you missed DX%, in the line
      <<  LOCAL ax%, bx%, cx%,>> dx%, << si%, di%  >>
      You must declare it and in the right order even if you don't use it
     with OS.

      Bob Munson (-:
      3a in Germany at 02:19 on 06/04/97


     Subj:  Clearing file attributes         Section: Programming
       To:  Bob Munson, 106424,2412          06 April 1997 20:40:10
     From:  Jochen Siegenthaler, 100127,3167 #291659


     Bob,
     << you missed DX%, in the line  >>

     Thank you! This was my problem - I knew I had to declare it, but I must
     have overlooked it!!!

     That explains the unpredicatble results I was getting (because of no dx%
     declaration) - now all is OK. Thank you John, Konstantin and Bob.
      --
      Regards, Jochen @ Zurich, Switzerland, 06/04/97 10:11


     Subj:  Loading Bitmaps                  Section: Programming
       To:  all                              03 April 1997 17:04:21
     From:  Andy Cook, 100332,651            #290870

     Hi all,
     I'm writing a program (for Psion 3a 2meg) where I load in a .pic file
     and use it as a background.  The OPL program fragment below does the
     job.

     However, to get it working, I loaded the bitmap in twice (once for black
     plane, once for grey).  It doesn't feel right to me (loading an image
     twice and copying it to the display twice).

     Is this the correct way to do it or are there commands that load the
     bitmap all in one?

     Thanks,
     Andy.


     PROC loadbg:
     REM LOAD BACKGROUND IMAGE

             IF EXIST ("\PIC\bg.pic")
                     gGREY 0
                     pic%=gLOADBIT("\PIC\bg.pic",0,0)
                     pic2%=gLOADBIT("\PIC\bg.pic",0,1)
                     id%=gCREATE(0,0,480,160,1,1)
                     gCOPY pic%,0,0,480,160,3
                     gGREY 1
                     gCOPY pic2%,0,0,480,160,3
                     gUSE id%
             ELSE
                     rem DRAW BOX
                     gAT x%,y%
                     gBORDER $203, 300, 150

             ENDIF

     ENDP


     Subj:  Loading Bitmaps                  Section: Programming
       To:  Ajai Khattri, 104127,3257        07 April 1997 16:30:18
     From:  John Boyce (Sysop), 100014,1240  #291878

     Aj
      >> I don't know if there's a system call that will do it.

     No, you have to remember that the grey plane and black plane are
     actually two different pictures and the effect is caused by overlaying
     one with the other. Loading both though is very rapid and it shouldn't
     cause too much of a delay unless the picture is very large.

     Best wishes
     John  (United Kingdom)


     Subj:  Loading Bitmaps                  Section: Programming
       To:  Andy Cook, 100332,651            04 April 1997 10:05:04
     From:  Konstantin Saliy, 106062,203     #291045

     Andy,
     << It doesn't feel right to me (loading an image twice and copying it to
     the display twice). >>

     Black/Grey bitmap is actually 2 bitmaps in one file (PIC file may
     contain even more than 2 bitmaps). So you have to load and display both.

     However your program can be optimized to save memory, if you need
     bitmaps only once: you can load and draw black plane, release bitmap
     (gCLOSE pic%), load and draw grey plane using the same variable pic% and
     then gCLOSE pic% again. Even with your code it is worth to add
        gCLOSE pic%
        gCLOSE pic2%
      if you use them only once to draw background.

      Best wishes
      Konstantin @ MOCKBA 04/04/97 11:59


     Subj:  Loading Bitmaps                  Section: Programming
       To:  Konstantin Saliy, 106062,203     05 April 1997 07:23:01
     From:  Mark H J Fitzpatric, 100026,2452 #291258

     This is the way I think it aught to go... you select the plane of the
     drawable AFTER you select (or create) the drawable it is in.

     PROC loadbg:
     REM LOAD BACKGROUND IMAGE
             IF EXIST ("\PIC\bg.pic")
                     rem LOAD BLACK PLANE
                     pic%=gLOADBIT("\PIC\bg.pic",0,0) Rem Load 1st Image 
                     id%=gCREATE(0,0,480,160,1,1)     Rem Create Window to copy Image into
                     gGREY 0                          Rem Select Black plane of window
                     gCOPY pic%,0,0,480,160,3        Rem Copy Image
                     gCLOSE(pic%)                    Rem Release Bitmap

                     rem LOAD GREY PLANE
                     pic%=gLOADBIT("\PIC\bg.pic",0,1)   Rem Load 2nd Image
                     gUse id%                           Rem Select Window to copy to
                     gGREY 1                         Rem Select Grey plane of Window
                     gCOPY pic%,0,0,480,160,3        Rem Copy image
                     gCLOSE(pic%)                    Rem Release Bitmap
             ELSE
                     rem DRAW MAIN BOX
                     gAT x%,y%
                     gBORDER $203, 300, 150
             ENDIF
     ENDP


     Subj:  Loading Bitmaps                  Section: Programming
       To:  Mark H J Fitzpatric, 100026,2452 05 April 1997 15:51:26
     From:  Konstantin Saliy, 106062,203     #291337

     Mark,
     << you select the plane of the drawable AFTER you select (or create) the
     drawable it is in. >>

     Oh, yes, this is too <g> Hope it works now <g>

      Best wishes
      Konstantin @ MOCKBA 05/04/97 16:38


     Subj:  Loading Bitmaps                  Section: Programming
       To:  Konstantin Saliy, 106062,203     07 April 1997 09:47:09
     From:  Andy Cook, 100332,651            #291781

     It works! Hurrah!
     Thanks, Konstantin and everyone else who made suggestions.

     Now if I can just figure out WHY it works... (g)

     Andy.


     Subj:                        Section: Programming
       To:  John Boyce (Sysop), 100014,1240  07 April 1997 12:04:12
     From:  Jonathan S Forsyth, 100142,1665  #291806

     John
     You may be able to answer the problem I was referring to in the 3c and
     IRDA thread.

     I have copy protected my program to run only from SSD, but at the moment
     I can only run it from a specified location i.e. either A or B.

     How can I load modules from the SSD without having to specify the Drive
     location in the load command.  It would be tidier if I could allow the
     SSD to be put in either SSD slot before the program is installed in the
     system screem.

     The SDK implies that programs can be loaded from the "default" disk,
     which I initially interpreted as the one you load the initial module
     from, but this seems to mean "default" as you set it up in the Main Menu
     using Psion-Shift-H, which most people will leave set as "Internal"

     Regards
     Jon, Leeds, UK


     Subj:                            Section: Programming
       To:  Jonathan S Forsyth, 100142,1665  07 April 1997 13:34:01
     From:  John Boyce (Sysop), 100014,1240  #291829

     Jon

      >> How can I load modules from the SSD without having to specify the Drive
      >> location in the load command.

     If the modules are on the same disk as the main program then you could
     use CMD$(1) and parse that to get the drive etc. for the source of the
     files. There is then no need to hard code the drive in the program. You
     could also put the modules in the same directory and drive as the main
     program and then LOADM will try to load from there by default if you
     don't put a path in.

     >> The SDK implies that programs can be loaded from the "default" disk

     Whenever Psion talk about "default" they mean the drive set on the front
     screen.

     Best wishes
     John  (United Kingdom)


     Subj:                        Section: Programming
       To:  Jonathan S Forsyth, 100142,1665  07 April 1997 14:53:03
     From:  John Boyce (Sysop), 100014,1240  #291854

     Jon
      >> I've tried parsing as you suggested but that wasn't working either.

     I think the way I would approach it is, on start-up, get the drive from
     which the file was launched and store this is a variable - you can then
     just add this variable to the path required by each command so that the
     drive will remain constant throughout the program.

     This means you can have files dotted around the SSD but only that SSD
     will be checked for the files. Of course any protection built in to make
     sure it isn't an illegal copy will have to work before you get to this
     point though.

      >> With the program on SSD when you gLOADBIT it still tries to load from
      >> Internal and not from the drive the SSD is in.
      >> Its the same with runapp%

     This could only be the case if you are not specifying the drive in the
     filename.

     Best wishes
     John  (United Kingdom)


     Subj:                        Section: Programming
       To:  Jonathan S Forsyth, 100142,1665  08 April 1997 15:03:15
     From:  Ian Pinkard, 106255,1266         #292125

     Hi Jonathan,

     this is what I use to find the files for a program. It can be set to
     look only on specific drives or directories. It works well for me as I
     can set it to look for files where the user has installed them perhaps
     incorrectly. ie under \upoker\ instead of the specied \app\upoker.

     For your app just leave out the M: bits.

     Regards Ian.

     IF EXIST("m:\APP\UPOKER\POKER.PIC")
             WHERE$="m:\APP\UPOKER\"
     ELSEIF EXIST("A:\app\upoker\POKER.PIC")
             WHERE$="A:\APP\UPOKER\"
     ELSEIF EXIST("B:\APP\UPOKER\POKER.PIC")
             WHERE$="B:\APP\UPOKER\"
     elseIF EXIST("m:\UPOKER\POKER.PIC")
             WHERE$="m:\UPOKER\"
     ELSEIF EXIST("A:\upoker\POKER.PIC")
             WHERE$="A:\UPOKER\"
     ELSEIF EXIST("B:\UPOKER\POKER.PIC")
             WHERE$="B:\UPOKER\"
     ELSE
             DINIT "Where is it?"
             dtext "","I can't find the file poker.pic"
             dtext "","It should be in directory \app\upoker"
             dtext "","on any drive. Create this directory from"
             dtext "","system screen and copy poker.pic to it."
             dialog
             stop
     ENDIF
     ID2%=GLOADBIT(WHERE$+"POKER.PIC") 


     Subj:                        Section: Programming
       To:  Ian Pinkard, 106255,1266         08 April 1997 17:20:31
     From:  Jonathan S Forsyth, 100142,1665  #292145

     Ian
     <<this is what I use to find the files for a program>>

     Nice one Ian.
     You've just killed two birds with one stone.

     1.  Solved my problem, for which I shall remain eternally gratefull.

     2.  Made me feel a right Wally for going round the houses for so long.

     Regards
     Jon, Leeds, UK

     PS I think I'll still play with John Boyces' Parsing solution in the
     long term because its the way I tried to tackle it initially

     PPS If you're reading this John, I found my original code in the program
     I'd just REM ed it out.


Sound play a/s
Richard van 't Riet
100271,1615
Programming     
102212,3506

 >> you have to add these lines:
 >> Local playwav$(128),test

Tried it last night, but only got the first 1/4 second of the file played.
The problem also is that I don't understand all the Call's variables.
Can you help me any further ?

Regards, Richard van 't Riet, Hoorn - NL

Sound play a/s
Mark Barnett
106026,1727
Programming     
100271,1615
Richard,

 << Tried it last night, but only got the first 1/4 second of the file played. The problem also is that I don't understand all the Call's variables.  >>

 Right, here are the call variables:

 CALL($1F86,uadd(addr(name$),1),ticks%,vol%)

 Where...

 name$ is the file name (must be zero terminated, ie name$=name$+CHR(0)
 ticks% is the length to be played in whatever unit Psion use, it's not given in the manuals. If ticks% is negative, longer files are trunctuaued and shorter files are padded out with silence. If it is zero, it plays the file without trunctuating or paddin
 And Vol% is a number between 0 and 5 inclusive, where 0 is the loudest

 You probably had ticks% set as 1 right? (I use one for the system alarm trumpet because I only want 1 blow, the full file is about 4 blows)

 Hope it helps,
 Muppet in Edinburgh , on a Psion 3a

Sound play a/s Konstantin Saliy
106062,203
Programming     
Mark Barnett
106026,1727

Mark,

<<  I have a feeling 1 tick% = 1/20 second. >>

1/32 on Psion.

 Best wishes
 Konstantin @@ MOCKBA 11/04/97 05:59

Sound play a/s
Richard van 't Riet
100271,1615
Programming     
Mark Barnett
106026,1727

 >> You probably had ticks% set as 1 right? (I use one for the system alarm
 >> trumpet because I only want 1 blow, the full file is about 4 blows)

Indeed, I did had ticks% set to 1, hence the short burst of sound, BUT!
In your original message (#290548) this was the call line:

CALL(7814,UADD(ADDR(playwav$),1),48,0)

Now I have found that the adres "7814" doesn't work ?!? I have to use $1F86 
to get the routine working. (I own a 3C1MBUK)

If I use the 7814 address I also get the short burst.

Any thought on this
I also would like to know any other sound names located in ROM, can you help 
me to these names ?

Regards, Richard van 't Riet, Hoorn - NL


Sound play a/s
Eitan Gilboa
100135,2720
Programming     
100271,1615

PMFJI,

>> that the adres "7814" doesn't work ?!? I have to use $1F86

I hope you meant $1E86 ? this is equivalent to "7814"

 Best Wishes,

 Eitan (-FRANCE-)    11-Apr-97 at 22:28:16

Sound play a/sRichard van 't Riet
100271,1615
Programming     
Eitan Gilboa
100135,2720

>> I hope you meant $1E86 ? this is equivalent to "7814"

No, listen carfully:  Mark's original message had: CALL(7814,UADD ........
I tried this, but only got a short soundbyte.
Then Mark wroe an other message with: CALL($1F86,UADD ......
I tried this and got the sound working.

I just wanted to relay to mark that his original message contained a 
faulty adress call (7814) and I was wondering if he could get it working 
with this call adress.

Well did you mark ??

Regards, Richard van 't Riet, Hoorn - Netherlands


Sound play a/s
Mark Barnett
106026,1727
Programming     
100271,1615
Richard,

 << Now I have found that the adres "7814" doesn't work ?!? I have to use 
 $1F86 to get the routine working. (I own a 3C1MBUK) >>

 Mighty strange! This is the command line which is used to play a sound in 
 the "About" dialog of my Intro program, letter for letter as you saw it in 
 my post. Intro has been tested fully on a 3C1MBUK and works fine. You did 
 zero-terminate the string, right?
 If that doesn't work, I give up. 
 Maybe Mr.Boyce could offer guidance? <s>

 If you would like to know some more names of ROM sound files, have a look 
 at THIEF. It's a small program (which I'm sure I uploaded) to copy 
 ROM files into RAM. If I didn't upload it, here's some code which would 
 probably work:

 PROC copy:
 trap mkdir ("LOC::M:\TEMP\")
 copy ("ROM::*.WVE"),("LOC::M:\TEMP\")
 ENDP

 BTW, if you're thinking that you can copy APP files from ROM and run them 
 in RAM; you can't. This is a shame, because I would have liked to "borrow" 
 the sound app for use on my 3a.

 All the best,
 Muppet in Weybridge , on a Psion 3a


Sound play a/s
John Boyce (Sysop)
100014,1240
Programming     
Mark Barnett
106026,1727

 >> Maybe Mr.Boyce could offer guidance? <s>

$1E86 is OsIoPlaySoundA and $1F86 is OsIoPlaySoundW - the difference is that 
the first one plays sound asyncronously and requires a couple of extra 
parameters to be sent (SI% should equal 0 and DI% should have the address of 
an integer for a completion word - this integer should be GLOBAL because the 
system call will need to access it sometime after the sound starts playing 
and the program goes off to do something else).

Best wishes

John  (United Kingdom)


Sound play a/s
Richard van 't Riet
100271,1615
Programming     
Mark Barnett
106026,1727

 >>  Mighty strange!.......You did zero-terminate the string.......If that 
 >> doesn't work, I give up.....

I just tripple checked, and here's the faulty line:

:   local playwav$(128), test
:   playwav$ = "rom::sys$al01.wve" + chr$(0)
:   call(7814,uadd(addr(playwav$),1),0,2)

Now if I replace the '7814' with $1F86 then the whole sound play's.
With the 7814 I just get 1/20th of a second playing sound.

I have a 3c/1Mb/UK system software 5.20F-English serialnumber JBC4401081.

Now what ? it leafs me puzzled.

I'll also try your suggestion for the *.wve
Thanks!
Btw. is there also a fast and handy way to display and scroll bitmaps ?

Regards,
Richard van 't Riet, Hoorn - Netherlands


Mark Esposito (SYSOP)
72662,3050
Programming     
100271,1615

    >>  :   call(7814,uadd(addr(playwav$),1),0,2)

    Now if I replace the '7814' with $1F86 then the whole sound play's.
    With the 7814 I just get 1/20th of a second playing sound. <<


 The problem is that you are calling an asynchronous service, but not giving 
 the address of a status word. All asunchronous services need a status word, 
 or there is no way for the OS to alert you that the service completed, or 
 failed.

    call($1e86,uadd(addr(sound$),1),ticks%,vol%,statwrd%)

 This call tells the OS to play the sound now, and let the program flow 
 continue, while the sound is playing. statwrd% *MUST* be a global variable. 
 It will be -46 while the service is pending, and some other number when 
 finished, or failed.

    call($1f86,uadd(addr(sound$),1),ticks%,vol%)

 This plays a sound synchronously, which means that the program sits at this 
 line of code waiting for the sound to finish playing. No need for a status 
 word, since you're going to wait for it to finish.

 Hope this helps.
 Mark Esposito http://www.pelicansoft.com mark@@pelicansoft.com


Sound play a/s
Jochen Siegenthaler
100127,3167
Programming     
Mark Barnett
106026,1727

<<  If you would like to know some more names of ROM sound files, 
have a look at THIEF.   >>

Why write a OPL program for something you can do from any file dialog?

 1. Start Record
 2. Select File | Open file
 3. Press Control-Tab
 4. Move to lower line and enter ROM::
 5. Press Control-Shift-Enter
 6. All ROM files will appear. *.wve files will have no extension shown. 
    Eg, on a 3a 2MB the file Carddn.wve appears as "Carddn"
 7. Press Enter, and lay the file as desired.

You can use a similiar procedure to copy a file from ROM to the local disk.
 --
 Jochen @@ Cologne, Germany, 14/04/97 22:15
 http://ourworld.compuserve.com/homepages/Jochen_Siegenthaler/


Closing down .agn files
Mark Esposito (SYSOP)
72662,3050
Programming     
Paul R.Law
100411,2311

    Shutting down Agenda is a bit complex, since it can have a Word file 
    open. I may put up the code to do this on my web page, but for now the 
    easiest and safest way to send the app a shutdown message.

    First you'll need to get the process ID of the Agenda app that is 
    running. Next, to shut it down, use the following lines of code...

    m$="x"
    call($da8d,AGENDA_PID,uadd(addr(m$),1),1)

    AGENDA_PID needs to be the PID of the running Agenda process.


 Here's some code that will generate a list of PID's for the application 
 name you are looking for.

 Proc pids:
 global runagn%(10)
 if getpids:("Agenda.*")
    REM there is at least one running.
    REM do something
    REM runagn%(1) = PID of first running agenda
    REM runagn%(2) = PID of second running agenda (since there can more than one)
 endif
 Endp

 Proc getpids:(name$)
 local ax%,bx%,cx%,dx%,si%,di%
 local buf%(10),proc$(12),fl%,ct%,maxpid%
 proc$=name$+chr$(0)
 maxpid%=10
 bx%=0 :si%=addr(buf%())
 di%=uadd(addr(proc$),1)
 ct%=1
 while 1
     ax%=$0b00
     fl%=OS($88,addr(ax%))
     if (fl% and 1) or ct%>maxpid% :break :endif
     bx%=ax%
         runagn%(ct%)=ax%
         ct%=ct%+1
 Endwh
 if ct%=1
     return 0
 endif
 return ct%-1
 Endp

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


Paul R.Law
100411,2311
Programming     
72662,3050
Mark,

Thanks a lot for the help closing down the agenda app from within an OPA. 
The code is great.

See Ya,

 Paul! @@ Kempston, UK (10/04/97 23:12 GMT)
 http://ourworld.compuserve.com/homepages/paul_law


72662,3050
Programming     
Paul R.Law
100411,2311

    >> Thanks a lot for the help closing down the agenda app from within an 
    OPA. The code is great. <<

 You're welcome. Glad I could help.

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


