home *** CD-ROM | disk | FTP | other *** search
/ The Datafile PD-CD 3 / PDCD_3.iso / pocketbk / utilsu / utils2 / DEVBOOK.ZIP / DEVBOOK.TXT < prev    next >
Text File  |  1994-03-29  |  9KB  |  810 lines

  1. UTILS3a Developers' Handbook
  2.  
  3. Introduction
  4. Utils3a is a program which is expandable by third parties.  The core program was written by Graham Tappenden at Psion GmbH between November 1993 and March 1994.  The proposal for this 'plug-in' option came from Bruno Neeser in CompuServe.
  5.  
  6. This document explains how to expand Utils3a with your own utilities.  This creates several advantages:
  7.  
  8. 1.    You do not have to write a 'front-end' for your software.
  9.  
  10. 2.    There are already a lot of people using the 'front-end' software, so they will not have
  11.     to learn a completely new product.
  12.  
  13. 3.    The 'front-end' is now known to be relatively 'bug-free', and any even if bugs are found
  14.     they are not your problem.
  15.  
  16. How to get your software to interact with Utils3a
  17.  
  18. Your program should take the following form:
  19.  
  20. PROC Main:
  21.     mINIT
  22.     UtilMenu:
  23.     MENU
  24. ENDP
  25.  
  26. PROC UtilMenu:
  27.     mCARD ...,...,...
  28.         ...
  29.     mCARD ...,...,...
  30. ENDP
  31.  
  32. PROC UtilSel:(k%,f$)
  33.     IF k%=%p
  34.         ...
  35.     ELSEIF
  36.         ...
  37.     ENDIF
  38. ENDP
  39.  
  40. Main is a dummy procedure, which allows us to place mCARDs in a sub-procedure.
  41.  
  42. UtilMenu is where you place the menu items which apply to your software.  These will be added to the Utils main menu.
  43.  
  44. UtilSel is where you decide upon the actions to take.  k% is the key pressed, and f$ is the filename selected.  See a later note about the choice of hotkeys.
  45.  
  46. You can then add your own procedures.  It is recommended that you do NOT duplicate any of the library procedures mentioned in this document, unless you specifically wish to alter the way they work.
  47.  
  48. Finally, you should translate the program, and move the .OPO file to \APP\UTILS3A on the same drive as UTILS3A.APP.  The file should also be given the extension .UTL.
  49.  
  50. Some basic rules to follow
  51.  
  52. 1.    If you need to save any settings, save them in the \INI\ directory on the internal drive.
  53.     Do NOT use the names UTILS3A.INI or ASSOC.INI.
  54.  
  55. 2.    Start all temporary filenames with a tilde (~).
  56.  
  57. 3.    Do NOT alter any of the variables which you may reference from the main program.  If
  58.     you do, then it is at your own risk.
  59.  
  60. 4.    Make your programs as multi-lingual as possible.  More about this later.
  61.  
  62. Selecting the Hotkeys
  63.  
  64. 1.    You should select the hotkeys so as not to conflict with those already in use in the main
  65.     program, since these will be given priority.  Different languages use different hotkeys.
  66.  
  67. 2.    Try to stick to the conventions used in the System screen, eg. C for Copy.
  68.  
  69. Making your program Multi-lingual
  70.  
  71. Making a program fully multi-lingual is a complex process.  This has been made slightly easier here, since the main program does all of this for you.
  72.  
  73. You can reference an array r$ to call the translation of your word, and r% for the associated hotkey, eg. Instead of writing "File" in a program, write r$(2).  On a German 3a, this will then appear as "Datei".
  74.  
  75. Here is a list of the words you can access, along with their hotkeys in English and German.
  76.  
  77. 001
  78. <DIR>
  79.  
  80.  
  81.  
  82.  
  83.  
  84.  
  85.  
  86.  
  87. 002
  88. File
  89.  
  90.  
  91.  
  92. 003
  93. Copy
  94. c
  95. k
  96.  
  97. 004
  98. Delete
  99. d
  100. l
  101.  
  102. 005
  103. Rename
  104. r
  105. u
  106.  
  107. 006
  108. Attribute
  109. a
  110. a
  111.  
  112. 007
  113. Make Directory
  114. +
  115. +
  116.  
  117. 008
  118. Remove Directory
  119. -
  120. -
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127. 009
  128. Options
  129.  
  130.  
  131.  
  132. 010
  133. Sort
  134. s
  135. s
  136.  
  137.  
  138.  
  139.  
  140.  
  141.  
  142. 011
  143. Utils
  144.  
  145.  
  146.  
  147. 012
  148. DBF Utils
  149. f
  150. f
  151.  
  152. 013
  153. Hex Editor
  154. h
  155. h
  156.  
  157.  
  158.  
  159.  
  160.  
  161.  
  162. 014
  163. Extras
  164.  
  165.  
  166.  
  167. 015
  168. New Window
  169. N
  170. N
  171.  
  172. 016
  173. Move Window
  174. M
  175. V
  176.  
  177. 017
  178. Size Window
  179. S
  180. G
  181.  
  182. 018
  183. Close Window
  184. L
  185. S
  186.  
  187. 019
  188. Zoom +
  189. z
  190. z
  191.  
  192. 020
  193. Zoom -
  194. Z
  195. Z
  196.  
  197. 021
  198. Exit
  199. x
  200. x
  201.  
  202.  
  203.  
  204.  
  205.  
  206.  
  207. 022
  208. No more windows
  209.  
  210.  
  211.  
  212. 023
  213. Busy
  214.  
  215.  
  216.  
  217.  
  218.  
  219.  
  220.  
  221.  
  222. 024
  223. New Window
  224.  
  225.  
  226.  
  227. 025
  228. Path
  229.  
  230.  
  231.  
  232. 026
  233. File Attributes
  234.  
  235.  
  236.  
  237. 027
  238. Read Only
  239.  
  240.  
  241.  
  242. 028
  243. Modified
  244.  
  245.  
  246.  
  247. 029
  248. Hidden
  249.  
  250.  
  251.  
  252. 030
  253. System
  254.  
  255.  
  256.  
  257.  
  258.  
  259.  
  260.  
  261.  
  262. 031
  263. No
  264. n
  265. n
  266.  
  267. 032
  268. Yes
  269. y
  270. j
  271.  
  272.  
  273.  
  274.  
  275.  
  276.  
  277.  
  278.  
  279. 033
  280. Not available
  281.  
  282.  
  283.  
  284. 034
  285. Copy File
  286.  
  287.  
  288.  
  289. 035
  290. From
  291.  
  292.  
  293.  
  294. 036
  295. To
  296.  
  297.  
  298.  
  299. 037
  300. Copied
  301.  
  302.  
  303.  
  304. 038
  305. Delete File
  306.  
  307.  
  308.  
  309. 039
  310. Cancel
  311.  
  312.  
  313.  
  314. 040
  315. Confirm
  316.  
  317.  
  318.  
  319. 041
  320. Deleted
  321.  
  322.  
  323.  
  324. 042
  325. Rename File
  326.  
  327.  
  328.  
  329. 043
  330. Renamed
  331.  
  332.  
  333.  
  334.  
  335.  
  336.  
  337.  
  338.  
  339. 044
  340. Select Sort
  341.  
  342.  
  343.  
  344. 045
  345. Order
  346.  
  347.  
  348.  
  349. 046
  350. None
  351.  
  352.  
  353.  
  354. 047
  355. Name
  356.  
  357.  
  358.  
  359. 048
  360. Extension
  361.  
  362.  
  363.  
  364. 049
  365. Size
  366.  
  367.  
  368.  
  369. 050
  370. Date
  371.  
  372.  
  373.  
  374. 051
  375. Sorting
  376.  
  377.  
  378.  
  379.  
  380.  
  381.  
  382.  
  383.  
  384. 052
  385. Directory
  386.  
  387.  
  388.  
  389. 053
  390. Created
  391.  
  392.  
  393.  
  394. 054
  395. Removed
  396.  
  397.  
  398.  
  399.  
  400.  
  401.  
  402.  
  403.  
  404. 055
  405. Insert Field
  406. i
  407. f
  408.  
  409. 056
  410. Sort File
  411. s
  412. s
  413.  
  414. 057
  415. Break at line
  416.  
  417.  
  418.  
  419. 058
  420. Entry
  421.  
  422.  
  423.  
  424. 059
  425. of
  426.  
  427.  
  428.  
  429. 060
  430. Sort on field
  431.  
  432.  
  433.  
  434. 061
  435. Ascending
  436.  
  437.  
  438.  
  439. 062
  440. Descending
  441.  
  442.  
  443.  
  444.  
  445.  
  446.  
  447.  
  448.  
  449. 063
  450. HexEdit
  451.  
  452.  
  453.  
  454. 064
  455. Overlay not found
  456.  
  457.  
  458.  
  459. 065
  460. Move
  461.  
  462.  
  463.  
  464. 066
  465. Size
  466.  
  467.  
  468.  
  469. 067
  470. Open
  471. o
  472. o
  473.  
  474. 068
  475. Search
  476.  
  477.  
  478.  
  479. 069
  480. Address
  481. a
  482. a
  483.  
  484. 070
  485. String
  486. s
  487. k
  488.  
  489. 071
  490. Protection
  491. p
  492. t
  493.  
  494. 072
  495. Address
  496. w
  497. d
  498.  
  499. 073
  500. On
  501.  
  502.  
  503.  
  504. 074
  505. Off
  506.  
  507.  
  508.  
  509. 075
  510. Open File
  511.  
  512.  
  513.  
  514. 076
  515. Not found
  516.  
  517.  
  518.  
  519.  
  520.  
  521.  
  522.  
  523.  
  524.  
  525.  
  526. 077
  527. Application
  528.  
  529.  
  530.  
  531. 078
  532. Associate
  533. t
  534. v
  535.  
  536. 079
  537. Command
  538.  
  539.  
  540.  
  541. 080
  542. Alias
  543.  
  544.  
  545.  
  546. 081
  547. Move
  548. m
  549. b
  550.  
  551. 082
  552. Tag
  553. T
  554. M
  555.  
  556. 083
  557. Refresh
  558. R
  559. K
  560.  
  561. 084
  562. Directory Tree
  563. Y
  564. Y
  565.  
  566. 085
  567. Cannot close this window
  568.  
  569.  
  570.  
  571. 086
  572. Reset
  573.  
  574.  
  575.  
  576. 087
  577. Move File
  578.  
  579.  
  580.  
  581. 088
  582. Tagged
  583.  
  584.  
  585.  
  586. 089
  587. Moved
  588.  
  589.  
  590.  
  591.  
  592.  
  593.  
  594.  
  595.  
  596. 090
  597. File Search
  598. H
  599. U
  600.  
  601. 091
  602. Current Path
  603.  
  604.  
  605.  
  606. 092
  607. Current Drive
  608.  
  609.  
  610.  
  611. 093
  612. Local Drives
  613.  
  614.  
  615.  
  616. 094
  617. All Drives
  618.  
  619.  
  620.  
  621.  
  622.  
  623.  
  624.  
  625.  
  626. 095
  627. Change Drive
  628. y
  629. y
  630.  
  631. 096
  632. Drive
  633.  
  634.  
  635.  
  636. 097
  637. found
  638.  
  639.  
  640.  
  641. 098
  642. Searching
  643.  
  644.  
  645.  
  646.  
  647.  
  648.  
  649.  
  650.  
  651. 099
  652. Write Protected
  653.  
  654.  
  655.  
  656. 100
  657. Dynamic
  658.  
  659.  
  660.  
  661. 101
  662. Internal
  663.  
  664.  
  665.  
  666. 102
  667. Dual Density
  668.  
  669.  
  670.  
  671. 103
  672. Hard Disk
  673.  
  674.  
  675.  
  676. 104
  677. Floppy Disk
  678.  
  679.  
  680.  
  681. 105
  682. Disk Info
  683. *
  684. *
  685.  
  686. 106
  687. Size
  688.  
  689.  
  690.  
  691. 107
  692. Free
  693.  
  694.  
  695.  
  696. 108
  697. Total files
  698.  
  699.  
  700.  
  701. 109
  702. Modified files
  703.  
  704.  
  705.  
  706. 110
  707. Backed up
  708.  
  709.  
  710.  
  711. 111
  712. files
  713.  
  714.  
  715.  
  716.  
  717. Library Procedures
  718. You can call any of the following procedures, to save time in writing your code:
  719.  
  720. PROC getk%:        Returns the value of a key pressed
  721.  
  722. PROC Size&:(f$)    Returns the size of the specified file as a long integer
  723. PROC Modst&:(f$)    Returns the date and time stamp of the file specified
  724. PROC FileDir%:(f$)    Returns 0 if f$ is a file, and 1 if it is a directory
  725. PROC DiskTtl%:(f$)    Returns 0 if f$ is a file, and 1 if it is a disk title, as found of
  726.             remote PC drives
  727. PROC Lang$:        Returns the language code for the machine being used
  728.             eg. 01 for English, 03 for German
  729.  
  730. PROC NextWin:    Moves to the next window
  731. PROC PrevWin:    Moves to the previous window
  732.  
  733. PROC Attrib:(f$)    Calls the attribute dialog
  734. PROC AttGet%:(f$)    Returns the attributes of the file specified as an integer
  735. PROC AttSet%:(f$,m%)
  736.             Sets the attributes of the file specified
  737.  
  738. PROC Error:(err%)    Raises an error message
  739. PROC SaveIni:    Saves the utils3a.ini file with the current settings
  740.  
  741. PROC RunProg:(app$,com$,f$,ext$,als$,opa$)
  742.             Runs another program
  743.  
  744. PROC StatWin:(s%)    Sets the status window to a particular size, and re-positions the
  745.             other windows accordingly
  746.  
  747. PROC DirList$:    Returns a list of the available directories in the other windows
  748.  
  749. PROC CopyFile:(f$)    Calls the copy dialog
  750. PROC DelFile:(f$)    Deletes the file with confirmation
  751. PROC RenFile:(f$)    Calls the rename dialog
  752. PROC MoveFile:(f$)    Calls the move dialog
  753.  
  754. PROC MakeDir:    Calls the make directory dialog
  755. PROC RemDir:    Calls the remove directory dialog
  756.  
  757. PROC CopyDir:(s$,d$)
  758.             Copies a directory including sub-directories
  759. PROC DelTree:(s$)    Does a recursive delete
  760.  
  761. PROC Assoc:(f$)    Calls the association dialog
  762.  
  763. PROC Refresh:    Refreshes all windows
  764.  
  765. PROC Windows%:    Returns the number of open windows
  766.  
  767. Advanced Functionality
  768. There are several arrays which you can access to determine where you are in the system, each array has elements one to six, ie. one element per window.
  769.  
  770. WDir$        The currently selected directory
  771. Wfont%    The currently selected font
  772. Wsort%    The currently selected order to be sorted
  773.  
  774. A further variable, AppPfad$ (this is NOT an array) contains the location of the utils3a.app file, thus allowing the location of the program files to be determined.
  775.  
  776. Two further arrays contain pointers to the data in each window.
  777.  
  778. Wptr%        this is the pointer to the top of the file list
  779. Wcurr%    this is the pointer to the currently selected file
  780.  
  781. At the address pointed to, is the following structure:
  782.  
  783.         The length of the filename    (one byte)
  784.         The filename            (variable)
  785.         A pointer to the previous file    (two bytes)
  786.         A pointer to the next file    (tw