home *** CD-ROM | disk | FTP | other *** search
/ The Datafile PD-CD 3 / PDCD_3.iso / pocketbk / developmen / oplexamp / RUNOPA.TXT < prev    next >
Text File  |  1993-02-03  |  2KB  |  43 lines

  1.  
  2.                 Pelican Software Inc.
  3.  
  4.  
  5.  
  6. RunOpa is an example of how to start an Opa from within your own procedure.
  7. This info was obtained from David Wood at Psion in a message on Cix. Thanks
  8. again to David for making it available. You may have to experiment with this
  9. code, although this is a working example. I didn't spend a lot of time figuring
  10. the command line, but I think I've got it right.
  11.  
  12. The cmdl$ seems to have five important segments:
  13.  
  14.         1. O for Open, C for Create
  15.         2. Appname declared by App keyword
  16.         3. Default Extension
  17.         4. Path name for file used by app (cmd$(2))
  18.         5. Path name used to start app (cmd$(1))
  19.  
  20. Here's the procedure:
  21.  
  22. Proc RunOpa:
  23. local ret%
  24. local pid%
  25. local cmdl$(128),appname$(128)
  26.   appname$="ROM::SYS$PRGO"+chr$(0)
  27.         Rem Opo  cmdl$="ORunOpl"+chr$(0)+chr$(0)+"LOC::M:\OPO\Myproc.OPO"+chr$(0)
  28.         Rem use this Command line to run an Opo procedure
  29.         Rem change drive locations per your setup
  30.   cmdl$="ONotepad"+chr$(0)+".PAD"+chr$(0)+"LOC::B:\Note\Notepad.pad"+chr$(0)
  31.   cmdl$=cmdl$+"LOC::B:\APP\Notepad.OPA"+chr$(0)
  32.         Rem use this command line to run an Opa procedure
  33.         Rem "ORunOpl" is O, not 0 - Use O for open, C for Create
  34.         Rem if using C for create, change Notepad.pad to the name to create
  35.   ret%=call($0187,addr(appname$)+1,addr(cmdl$),0,0,addr(pid%))
  36.         Rem this is the Filexec call
  37.   if ret%<0
  38.    giprint err$(err)
  39.   else
  40.    call($0688,pid%,0,0,0,0) Rem Procresume
  41.   endif
  42. Endp
  43.