home *** CD-ROM | disk | FTP | other *** search
/ The Datafile PD-CD 3 / PDCD_3.iso / pocketbk / developmen / lib24 / TECHREF.TXT < prev   
Encoding:
Text File  |  1994-07-12  |  17.8 KB  |  517 lines

  1. ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»
  2. º SysLib 2.45                                                                º
  3. ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ
  4.  
  5. SysLib 2.45 is an application framework designed to provide all the 
  6. neccessary functionality which you like to have for your applications 
  7. without any extra programming! This leaves only the applicatoric 
  8. dependent procedures in your applications, reducing complexity and size 
  9. and even reduces the time for testing all the basics.
  10.  
  11. ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿
  12. ³ Terms of usage                                                             ³
  13. ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ
  14.  
  15. SysLib 2.45 may be used freely within your applications, even if you 
  16. supply them as shareware. The only thing you are asked to do is to name 
  17. the author in your applications documentation.
  18. The fee for this applications should not be higher because of the usage 
  19. of the SysLib. Please, if possible, avoid to include the SysLib itself 
  20. in your packages because of it's continous further development and 
  21. enhancements. Simply refer to it's name in the CompuServe Forum.
  22. The author will do (almost) anything to keep the interface absolutely 
  23. stable, but if there are any troubles with your application using it, 
  24. ask for assistance!
  25. As some kind of gratification please make an offer for a free 
  26. registration for any shareware using SysLib to the author!
  27.  
  28. ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿
  29. ³ About this reference                                                       ³
  30. ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ
  31.  
  32. Please consider this paper as a constantly growing thing, because on one 
  33. hand the SysLib was not thought of to be a public use library and 
  34. therefore all the related documentation has to be written after the 
  35. programming, and on the other hand the library is far from being perfect
  36. and to be extended and enhanced which does not make the documentation 
  37. work very much easier!
  38.  
  39. ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿
  40. ³ About the author                                                           ³
  41. ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ
  42.  
  43. If you have any questions, please contact the author:
  44.  
  45. Thomas Nemec
  46. Gladbeckstraáe 1/12a/10
  47. 2320 Schwechat, Austria
  48. CIS: 100024,3461
  49.  
  50. ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿
  51. ³ A minimum application using the SysLib                                     ³
  52. ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ
  53.  
  54. See the following application skeleton as a template for an absolute 
  55. minimal application (simply try to translate this application thing and
  56. watch what it is doing!):
  57.  
  58. Rem --------------- application source starts here --------------------------
  59. App Template
  60. Type Type $1003
  61. Ext "ext"
  62. Path "\template"
  63. Enda
  64.  
  65. Rem your application start procedure should only load the SysLib and
  66. Rem enter the event loop
  67. Proc Main:
  68. LoadM dir$:("Sys$Lib2.opo")
  69. Events:("\template","ext","1.0","",0)
  70. Endp
  71.  
  72. Rem try to find the SysLib on any local drive and in \opo or \syslib
  73. Proc dir$:(fn$)
  74. Local i%,d$(6),r$(7)
  75. d$="ABMABM" :r$="OPO\"
  76. Do
  77.   i%=i%+1
  78.   If i%=4 :r$="SYSLIB\" :EndIf
  79.   If Exist(Mid$(d$,i%,1)+":\"+r$+fn$)
  80.     Return (Mid$(d$,i%,1)+":\"+r$+fn$)
  81.   EndIf
  82. Until i%=6
  83. Return fn$
  84. Endp
  85.  
  86. Rem be ready to receive all the messages
  87. Rem 0=initialize application (special message, called only once)
  88. Rem 1=come to foreground
  89. Rem 2=go to background and so on (see the psion programmers manual)
  90. Proc Message:(t%)
  91. Print "Message:",t%
  92. Endp
  93.  
  94. Rem each time there has a file open to be performed
  95. Proc Open%:
  96. Print "Open:",f$
  97. Endp
  98.  
  99. Rem or a create is neccessary
  100. Proc Create%:
  101. Print "Create:",f$
  102. Endp
  103.  
  104. Rem close a file on exit or before any file change
  105. Proc Close%:
  106. Print "Close"
  107. Endp
  108.  
  109. Rem ignore [ctrl][menu] keypresses
  110. Proc SetWidth:(w%)
  111. Endp
  112.  
  113. Rem catch all the simple key presses, return 1 if to exit
  114. Proc Key%:(k%,s%)
  115. Print "Key:",k%,"Mod:",s%
  116. Endp
  117.  
  118. Rem react on special key combinations (including diamond key), 
  119. Rem return 1 if to exit
  120. Proc CtrlKey:(k%,s%)
  121. Print "CtrlKey:",k%,"Mod:",s%
  122. Endp
  123.  
  124. Rem perform menu and hotkey operations, return 1 if to exit
  125. Proc Action%:(k%)
  126. If k%=%x
  127.   Return 1
  128. EndIf
  129. Endp
  130.  
  131. Rem make a menu on request, return the result on exit
  132. Proc Menu%:
  133. Local i%
  134. mInit
  135. mCard "Special","Exit",%x
  136. Lock On
  137. i%=Menu
  138. Lock Off
  139. Return i%
  140. Endp
  141. Rem --------------- application source ends here ----------------------------
  142.  
  143.  
  144. ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»
  145. º Minimum application needings                                               º
  146. ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ
  147.  
  148. The above application example does the following basic things for you:
  149.  
  150. 1.  Your application will be renamed from something like "Sys$prgo.$09" to
  151.     "TEMPLATE.$09"
  152. 2.  On startup there will be a logo shown in the lower right edge of the
  153.     screen, naming the application and it's version 
  154.     (here: "Template 1.0")
  155. 3.  The applications data path and file extension is stored and can be 
  156.     retrieved by a function Mask$:
  157. 4.  The applications actual working file name is stored within a 
  158.     global variable called f$
  159. 5.  The country data is read from the system and provided in global 
  160.     variables
  161. 6.  Your application will be initialized by a message 0
  162. 7.  The working file will be created or opened by the applications
  163.     create/open functions
  164. 8.  The text "bring" mechanism will be initialized
  165. 9.  The timer will be initialized
  166. 10. Now the message loop will be entered and can only be exited if a 
  167.     termination signal is encountered (which means return 1 on key 
  168.     and action procedures)
  169.  
  170. ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿
  171. ³ Event loop handling                                                        ³
  172. ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ
  173.  
  174. All the messages and events are handled by an event loop, which is to be 
  175. called on application entry:
  176.  
  177. Events:( datadir$, ext$, ver$, rsc$, flags% )
  178.  
  179. datadir$        specifies the data directory for the application e.g. "\data"
  180.  
  181. ext$            specifies the extension string e.g. "ext"
  182.  
  183. ver$            is the applications version number string (max 4 chars)
  184.                 e.g. "1.1a"
  185.  
  186. rsc$            specifies the ressources name (description to follow)
  187.  
  188. flags%          states configuration flags (description to follow)
  189.  
  190. This event loop will only be left on an exit request, usually from a
  191. hotkey or menu item call.
  192.  
  193. ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿
  194. ³ Message handling                                                           ³
  195. ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ
  196.  
  197. Every time when a message is encountered from the system, the 
  198. applications message handler call back procedure "Message" will be 
  199. called:
  200.  
  201. Message:(msg%)
  202.  
  203. msg%            Message type identifier,
  204.                 msg%=0 for the application initialization
  205.                 msg%=1 for "come to foreground"
  206.                 msg%=2 for "go to background" and so on
  207.  
  208. ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿
  209. ³ File creation, file open and file close                                    ³
  210. ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ
  211.  
  212. Every time when a file has to be created, opened or changed by request from 
  213. the system screen or on startup, this call back procedures are executed 
  214. (before opening or creating a new file any currently open file will be 
  215. closed)
  216.  
  217. Create%:
  218. Open%:
  219. Close%:
  220.  
  221. These procedures should return 0 on success, otherwise 1.
  222. File creation should try to delete any existing file having the same 
  223. name.
  224. The global variable f$ consists of the full filename.
  225.  
  226. ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿
  227. ³ Key processing                                                             ³
  228. ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ
  229.  
  230. Whenever a (normal) key is to be processed, the applications call back 
  231. procedure Key%: will be called: 
  232.  
  233. Key%:( key%, mod% )
  234.  
  235. key%            is the value of the pressed key, e.g. %a or %O or anything
  236.  
  237. mod%            is the modifier, e.g. $02 if only [shift] is pressed
  238.  
  239. This function has to return 1 if an exit is to perform afterwards, 
  240. otherwise 0.
  241.  
  242. ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿
  243. ³ Special key processing                                                     ³
  244. ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ
  245.  
  246. Whenever a special key is to be processed, the applications call back 
  247. procedure CtrlKey%: will be called:
  248.  
  249. CtrlKey%:( key%, mod% )
  250.  
  251. For the parameters and return code see the procedure Key%:
  252.  
  253. The code will be subtracted by 256, providing: 0 for cursor up, 1 for 
  254. cursor down, 4 for page up, 36 for the diamond key and so on!
  255.  
  256. ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿
  257. ³ Menu handling                                                              ³
  258. ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ
  259.  
  260. Every time when the menu key is pressed, the applications call back 
  261. procedure Menu%: is called:
  262.  
  263. Menu%:
  264.  
  265. This procedure should build up a menu in the usual manner, providing the 
  266. result of the OPL statement MENU as the procedures result.
  267.  
  268. ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿
  269. ³ Hotkey processing and menu element selection                               ³
  270. ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ
  271.  
  272. Each selected menu element and any (additional) hotkey has to be 
  273. processed in the applications call back procedure Action%:
  274.  
  275. Action%:( hotkey% )
  276.  
  277. hotkey%         stands for the hotkey or menu element selection, e.g. %o
  278.  
  279. This procedure should return 1 if an exit is to be made, otherwise 0.
  280.  
  281.  
  282. ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»
  283. º Enhanced functionality                                                     º
  284. ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ
  285.  
  286. There are lots of functions available in the SysLib, some of them are 
  287. listed below:
  288.  
  289. ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿
  290. ³ [Ctrl][Menu] state window change                                           ³
  291. ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ
  292.  
  293. To react correct on a [ctrl][menu] key press you have to use the 
  294. SetWidth: call back procedure in such a way:
  295.  
  296. Proc SetWidth:(width%)
  297. gSetWin gOriginX,gOriginY,gWidth+w%,gHeight     Rem change the window size
  298. Rem include here your applications reaction to the size change
  299. Return 1                                Rem signal a "size change accepted"
  300. Endp
  301.  
  302. ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿
  303. ³ Include an "About" message                                                 ³
  304. ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ
  305.  
  306. To show your initials on startup and provide an about box you have to 
  307. provide a call back procedure About$: like this one:
  308.  
  309. Proc About$:(i%)
  310. Vector i%
  311.   a1,a2,a3,a4
  312. Endv
  313. a1:: Return "(c)1994"
  314. a2:: Return "Your Name"
  315. a3:: Return "Your email address"
  316. a4:: Return "Your initials"
  317. Endp
  318.  
  319. To show the about box by reacting on the SysLib hotkey [shift]A include 
  320. the following source fragment in your Action%: procedure:
  321.  
  322. .....
  323. ElseIf hotkey%=k0%:(17)
  324.   About:
  325. ElseIf ......
  326.  
  327. ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿
  328. ³ Date and time formatting                                                   ³
  329. ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ
  330.  
  331. Format a date number d& by using the procedure 
  332.  
  333. date$:(days&)
  334.  
  335. or a time number t& by using the procedure
  336.  
  337. time$:(time&,0)
  338.  
  339. ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»
  340. º  SysLib's screen updating and cursor management                            º
  341. ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ
  342.  
  343. Since most of the applications on the S3a are line and column oriented, 
  344. a large number of procedures are related to this type of screen output.
  345. To use this functionality, follow the below described guidelines (shown 
  346. on basis of a simple example):
  347.  
  348.  
  349. Rem --------------- application source starts here --------------------------
  350. App Template
  351. Type Type $1003
  352. Ext "ext"
  353. Path "\template"
  354. Enda
  355.  
  356. Rem enter the event loop
  357. Proc Main:
  358. LoadM dir$:("Sys$Lib2.opo")
  359. Events:("\template","ext","1.0","",0)
  360. Endp
  361.  
  362. Rem try to find the SysLib on any local drive and in \opo or \syslib
  363. Proc dir$:(fn$)
  364. Local i%,d$(6),r$(7)
  365. d$="ABMABM" :r$="OPO\"
  366. Do
  367.   i%=i%+1
  368.   If i%=4 :r$="SYSLIB\" :EndIf
  369.   If Exist(Mid$(d$,i%,1)+":\"+r$+fn$)
  370.     Return (Mid$(d$,i%,1)+":\"+r$+fn$)
  371.   EndIf
  372. Until i%=6
  373. Return fn$
  374. Endp
  375.  
  376. Rem handle messages
  377. Proc Message:(t%)
  378. If t%=0                         Rem initialize application
  379.   ttl%=1                        Rem use a title line
  380.   sld%=1                        Rem use a slider bar
  381.   Zoom:(0)                      Rem use the standard font selection
  382.   SetStat:(2)                   Rem use the big status window on startup
  383.   SetFnc:("Lne","PrtIdx")       Rem use the standard index output proc's
  384.   SetFnc:("Pos","pSeek")        Rem use this positioning procedure
  385.   SetFnc:("Hdr","Head")         Rem use this title output procedure
  386.   SetFnc:("Fld","Field")        Rem use this field output procedure
  387.   Count%=3                      Rem let us assume there are 3 lines to draw
  388.   poll%=3                       Rem signal: redraw the whole screen
  389. EndIf
  390. Endp
  391.  
  392. Rem call back proc for the field values
  393. Proc Field$:(f%,n%)
  394. Return Num$(n%,3)+","+Num$(f%,3)        Rem simply print line and column #
  395. Endp
  396.  
  397. Rem call back proc for the title identifiers
  398. Proc Head$:(i%)
  399. Return Num$(i%,3)               Rem simply print the column #
  400. Endp
  401.  
  402. Rem call back proc for doing a seek on item n%
  403. Proc pSeek%:(n%)
  404. Endp
  405.  
  406. Proc Create%:
  407. Endp
  408.  
  409. Proc Open%:
  410. Endp
  411.  
  412. Proc Close%:
  413. Endp
  414.  
  415. Rem react on [ctrl][menu] key combinations
  416. Proc SetWidth:(w%)
  417. gSetWin gOriginX,gOriginY,gWidth+w%,gHeight
  418. SetCW:(-1,g%(6)*28,2)   Rem the first column is 28 chars wide
  419. SetCW:(0,g%(6)*8,1)     Rem the second column is 8 chars wide
  420. poll%=3                 Rem redraw the screen
  421. Return 1                Rem signal "ok"
  422. Endp
  423.  
  424. Rem catch all the simple key presses, return 1 if to exit
  425. Proc Key%:(k%,s%)
  426. Endp
  427.  
  428. Rem react on special key combinations (including diamond key), 
  429. Rem return 1 if to exit
  430. Proc CtrlKey:(k%,s%)
  431. If MoveCur:(k%)                 Rem process cursor movement
  432.   giPrint "Key not valid"       Rem process any non cursor movement keys
  433. EndIf
  434. Endp
  435.  
  436. Rem perform menu and hotkey operations, return 1 if to exit
  437. Proc Action%:(k%)
  438. If k%=%x
  439.   Return 1
  440. EndIf
  441. Endp
  442.  
  443. Rem make a menu on request, return the result on exit
  444. Proc Menu%:
  445. Local i%
  446. mInit
  447. mCard "Special","Exit",%x
  448. Lock On
  449. i%=Menu
  450. Lock Off
  451. Return i%
  452. Endp
  453. Rem --------------- application source ends here ----------------------------
  454.  
  455. ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿
  456. ³ Zoom the working font                                                      ³
  457. ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ
  458.  
  459. To increase the current font by 1 use
  460.  
  461. Zoom:(1)
  462.  
  463. To decrease the current font by 1 use
  464.  
  465. Zoom:(-1)
  466.  
  467. To force a redraw use afterwards:
  468.  
  469. SetWidth:(0)
  470.  
  471.  
  472. ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»
  473. º SysLib's global variables                                                  º
  474. ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ
  475.  
  476. The following variables may be changed by the application:
  477.  
  478. Global fnt%     Rem font number (default=7)
  479. Global esc%     Rem exit by escape (1=yes, 2=no)
  480. Global frm%     Rem use framed output (1=yes, 2=no)
  481. Global cm%      Rem cursor mode (1=arrow, 2=line)
  482. Global sld%     Rem use a slider bar on the right side (1=yes, 2=no)
  483. Global ttl%     Rem use a title line (1=yes, 2=no)
  484. Global Count%   Rem number of items (records)
  485. Global poll%    Rem refresh signal, refresh:
  486.                 Rem 1=full screen w/o title
  487.                 Rem 2=full screen w title
  488.                 Rem 3=full screen w cls
  489.                 Rem 4=only current line
  490.                 Rem 5=only current and next line
  491.                 Rem 6=only current and previous line
  492.                 Rem 7=only title and current line
  493.                 Rem 8=only title
  494. Global top%     Rem number of first index line (top line)
  495. Global cp%      Rem number of current index line on screen 
  496.  
  497. The following variables may be checked by the application:
  498.  
  499. Global o%       Rem current file message %O, %C or %X
  500. Global f$(128)  Rem current file name (including path)
  501. Global Pos%     Rem current line position
  502. Global lg$(2)   Rem current language code ("01" is english)
  503. Global pid%     Rem current process id
  504.  
  505.  
  506. ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»
  507. º Further documentation                                                      º
  508. ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ
  509.  
  510. Since the above description is only a fraction of the functionality, 
  511. please look out for the next versions of SysLib to include more 
  512. specification documentation!
  513.  
  514.  
  515. (c)1994 by Thomas Nemec, Vienna, Austria
  516.  
  517.