home *** CD-ROM | disk | FTP | other *** search
/ Archive Magazine 1997 / ARCHIVE_97.iso / text / hints / vol_10 / issue_02 < prev    next >
Text File  |  1997-08-11  |  15KB  |  360 lines

  1. Hints and Tips
  2. 10.2
  3. Acorn Toolbox from Assembler Ö Using the Acorn Toolbox from Assembler is
  4. easy Ö even easier than from ÉCæ. Writing a WIMP application in
  5. assembler must now be about as easy as it can ever get.
  6. 10.2
  7. By way of a demonstration, the !SoundTest application on this monthæs
  8. disc assembles to less than 900 bytes and will run in a 2Kb wimpslot,
  9. even though it supports an iconbar, a menu, info window, and a window
  10. with three sliders, three display fields, a stringset and a button. Oh,
  11. and of course thereæs interactive help everywhere as well!
  12. 10.2
  13. The header file defines the data areas required. The toolbox needs two
  14. additional data areas Ö IDBlock which returns information about where
  15. events have occurred, and FileDescriptor which holds information about
  16. the messages file.
  17. 10.2
  18. Initialisation is straightforward. The WimpSlot size is checked, data
  19. initialised, and then a call to Toolbox_Initialise:
  20. 10.2
  21. Setting r2 to zero ensures that the only Énormalæ wimp message returned
  22. is Message_Quit. All other messages returned will be toolbox events, and
  23. a pointer to a null terminated list of the required events is passed in
  24. r4. Registers r5 and r6 point to FileDescriptor and IDBlock
  25. respectively.
  26. 10.2
  27. The program then falls into a standard Wimp_Poll loop. If the message
  28. returned is a toolbox event, the program looks up the event in the list
  29. that was passed to Toolbox_Initialise, and then jumps to the associated
  30. handler.
  31. 10.2
  32. Handling the events is very similar to pre-toolbox programs, except that
  33. an abstract handle is returned in the IDBlock rather than the actual
  34. window/icon causing the event.
  35. 10.2
  36. The trickiest part is initialising gadgets before theyære displayed for
  37. the first time. This is achieved during the Toolbox_ObjectAutoCreated
  38. event, when we can check the name of the object raising the event Ö
  39. i.e.áöIconbarò, öMenuò, öProgInfoò or öWindowò in this case.
  40. 10.2
  41. Dave Appleby, York
  42. 10.2
  43. Alternative wastebin Ö I used to use a PD wastebin application, but
  44. always begrudged the space on the iconbar. So, when I found it was
  45. clashing with another application, I binned my bin.
  46. 10.2
  47. As a very effective alternative, I now use a directory on my hard disc
  48. that is called up onto my desktop at boot-time, occupies very little
  49. space, and makes a very effective waste bin. I start it up with:
  50. 10.2
  51. Filer_OpenDir scsi::SQ270.$.zzz 2348
  52. 10.2
  53.  1160 166 186 -sd -si
  54. 10.2
  55. This ensures that, whatever I have as the current filer display
  56. settings, this particular directory has small icons (si) and is sorted
  57. by date (sd) That means that the latest file created is at the top of
  58. the directory and hence easily visible, despite the tiny size of the
  59. filer window allocated to it.
  60. 10.2
  61. So, to delete a file or directory, I shift-drag it into zzz and then
  62. when, finally, it tells me the directory is full, I open it up and
  63. delete the lower two-thirds of the items (sorted by date, remember).
  64. Itæs simple but effective.
  65. 10.2
  66. I use a similar startup for my RAMdisc:
  67. 10.2
  68. Filer_OpenDir RAM::RamDisc0.$ 1860
  69. 10.2
  70.  1156 134 156 -sd -si
  71. 10.2
  72. I actually use this more for my temporary files than the zzz directory Ö
  73. because it empties automatically on switch-off!
  74. 10.2
  75. Ed <paul.NCS@paston.co.uk>
  76. 10.2
  77. Compression with the PC card Ö Aálot of people seem to be having trouble
  78. using DoubleSpace and DriveSpace. These compression utilities work by
  79. compressing the data written to your hard disc Éon the flyæ, so it
  80. appears that your data is written normally when in fact it isábeing
  81. stored in a highly compressed format.
  82. 10.2
  83. The compressed data is actually being stored in a very large hidden file
  84. (called drvspace.001) which resides in the root directory of your PC
  85. partition.
  86. 10.2
  87. The problem with this method of compression is that if this drvspace.001
  88. file is accidentally deleted or corrupted, youæve lost all of your data.
  89. The chances of this happening, however, are about the same odds as your
  90. hard discs crashing which, in the long run, are very slim.
  91. 10.2
  92. There is no incompatibility that I know of, but because the program is
  93. not being run on a 100% compatible PC, there could be complications. The
  94. most reliable way of running DriveSpace is under Windows 95. To be even
  95. more secure, there is a version on the MS Plus pack for Windows 95
  96. called DriveSpace 3.
  97. 10.2
  98. If you really want to be on the safe side, stick with good old PKZIP.
  99. With this, you can create nicely packed ZIP files with the ability to
  100. access them with SparkFS.
  101. 10.2
  102. Anthony Wheeler <tech.NCS@paston.co.uk>
  103. 10.2
  104. DOS files from the PC card Ö I received two responses to my plea for
  105. help (9.12 p27).
  106. 10.2
  107. First of all Dennis Aldcroft very kindly explained how I can actually do
  108. this with PCExchange, although it is a bit of a fiddle. Basically,
  109. Windows is loaded and then you go into DOS from there, save your file to
  110. a floppy disc, which is then re-accessed from within Windows and saved
  111. to the ClipBoard by associating the file to the Windows Notepad. PC
  112. Exchange can then be used as before.
  113. 10.2
  114. Secondly, Jim Nottingham offered a simpler approach: save any DOS file
  115. to the hard disc, and then Éfreezeæ the PC card. This does not interfere
  116. with the application running in DOS but allows the file to be accessed
  117. from within RISC OS by opening up the PC hard drive directory. Once the
  118. file is found, it will need to have its type set to ÉTextæ, and it can
  119. then be moved or copied to any RISC OS application.
  120. 10.2
  121. I am very grateful for these tips, and pass them on in the hope that
  122. they might be useful for others.
  123. 10.2
  124. Colin Randall <carandall@argonet.co.uk>
  125. 10.2
  126. Double-click-hold Ö Alisdair McDiarmid (10.1 p18) points out a feature
  127. of Larger, whereby if you double click and hold on a file, it is treated
  128. as if shift were held down. Anyway, StrongED also provides this feature,
  129. and jolly useful it is too! The latest version of StrongED (4.14 at the
  130. time of typing) can be downloaded from:
  131. 10.2
  132. http://login.eunet.no/~guttorvi/strong.html
  133. 10.2
  134. Ian Clark <se96ic@dmu.ac.uk>
  135. 10.2
  136. EasyFont3 Ö When using EasyFont3, if you load an Impression file and get
  137. a Éfont not foundæ message, drag the file onto Easyfont3, and the fonts
  138. will be loaded and drawn, with no need to reload the file.
  139. 10.2
  140. Robert Lytton, Leeds
  141. 10.2
  142. Large Impression files Ö If you have a large Impression file and a large
  143. amount of memory, Impression will try to load as much as possible into
  144. memory. Most can then be removed by using ÉMinimise memoryæ (if it is a
  145. document and not a file) but this process can take time when using 8Mb
  146. on an older machine! By creating a RAMdisc to use up most of the surplus
  147. memory (click <select> on Acorn, to bottom of Task window, click and
  148. drag out a red bar ÉRAMdiscæ) less of the document will be able to be
  149. loaded and so loading will be quicker! You can then menu ÉQuitæ the
  150. RAMdisc to reclaim the memory.
  151. 10.2
  152. Robert Lytton, Leeds
  153. 10.2
  154. MoirΘ patterns on scanning Ö In last monthæs Help!!!! feature (10.1
  155. p41), John Molyneux described how he used ImageMaster to minimise MoirΘ
  156. patterns when using his Mustek scanner. There is a more Éscientificæ way
  157. that I used with my Epson that ought to work with his scanner too:
  158. 10.2
  159. 1) Scan at high resolution, ideally the highest true resolution of the
  160. scanner.
  161. 10.2
  162. 2) If there is MoirΘ patterning, set ImageMasteræs Alias Filter to
  163. ÉLanczosæ. (Iconbar menu, use Choices.General, then set and OK or Save)
  164. 10.2
  165. 3) Resample (ImageMasteræs main menu, use Edit.Scale then click the
  166. Resample radio icon, set to 90/90 and Click OK).
  167. 10.2
  168. After a few seconds delay, even the worst MoirΘ patterning will entirely
  169. disappear.
  170. 10.2
  171. It appears to be necessary to Resample with a fairly wide variance from
  172. the original scanning resolution. The closest numbers I have found
  173. satisfactory have been: original scan at 600 dpi and resample at
  174. 200ádpi.
  175. 10.2
  176. It is worth experimenting with a variety of numbers. The MoirΘ
  177. patterning isnæt just reduced when this technique is employed Ö it
  178. totally disappears and the improvements can be truly amazing.
  179. 10.2
  180. Malcolm Knight <malcolm@digidark.demon.co.uk>
  181. 10.2
  182. OCR Ö If you wish to use OCR with a Scanlight Professional, I have found
  183. Sleuth2 works very well when using Twain set with maximum brightness.
  184. Before, I used Sleuth1.5 which did a poor job and Iáhad trouble
  185. preparing dark enough scans from the scanner.
  186. 10.2
  187. Robert Lytton, Leeds
  188. 10.2
  189. PC partitions Ö While I was working at NCS, a number of PC card users
  190. called to ask how they could create more space on their Édrive_cæ
  191. partitions. Attempts to copy DOS/Windows system files to another
  192. partition and recreate drive_c, invariably end in tears and hair loss.
  193. 10.2
  194. To make life easier, the !PCConfig application allows you to create a
  195. second partition, called drive_d. You create this in the same way that
  196. you created the first drive_c partition, and DOS and Windows identify it
  197. as drive ÉDæ.
  198. 10.2
  199. We recommend that you keep DOS and Windows on drive_c, making sure that
  200. there is a little spare capacity, and create a drive_d on which you then
  201. keep your applications and data. You should allocate around 25-30Mb for
  202. DOS and Windows on drive_c.
  203. 10.2
  204. Richard Hesketh <NJ108@lamp.ac.uk>
  205. 10.2
  206. Printer driver problems Ö Some months ago, I read a article about
  207. difficulties using !Printer 1.52 regarding a problem about page-formats
  208. when using a image-setter.
  209. 10.2
  210. Iæve installed version 1.53 on a RiscPC connected to an image-setter,
  211. and the problem disappears if you proceed as follows:
  212. 10.2
  213. Define a page-format in the printer driver of a size 10╫10 mm Ö
  214. obviously too small for all your documents.
  215. 10.2
  216. Configure your PostScript driver to use this page-format. When using
  217. ArtWorks, be sure that ÉSet page formatæ is on. When using Publisher,
  218. the program will complain about the small page size. Click OK and not
  219. Cancel.
  220. 10.2
  221. If you use landscape and portrait the correct way, you can save a lot of
  222. bromide/film. Another advantage is that you never have to select a page-
  223. format again in your printer driver.
  224. 10.2
  225. I donæt know what happens in other programs like Ovation Pro because I
  226. donæt own this program (yet).
  227. 10.2
  228. Martijn Claassen <martijn.argos@pi.net>
  229. 10.2
  230. RiscPC special characters Ö In Archive 6.3, Gabriel Swords produced a
  231. very useful display showing where the special alt-characters are on the
  232. Archimedes keyboards. I have updated this for the RiscPC keyboard.
  233. 10.2
  234. Eddie Lord <72046.251@CompuServe.COM>
  235. 10.2
  236. (Thanks, Eddie! I find it most useful. I keep it above my desk. Iæve put
  237. both that drawfile, and the original Archimedes one, on the monthly
  238. program disc. Ed.)
  239. 10.2
  240. Tablemate and OLE Ö When using a Tablemate file and Impressionæs OLE
  241. feature, the tablemate file is exported as a drawfile. If you save the
  242. file and change the filetype to öBCFò or ötblmateò you can then reload
  243. it into Tablemate to edit it before dragging it back into your
  244. Impression document.
  245. 10.2
  246. Robert Lytton, Leeds
  247. 10.2
  248. TechWriter tips Ö Here are a number of tips from Jim Lesurf. If you have
  249. any more, please send them in to Jim.
  250. 10.2
  251. Extending Ésmart quotesæ Ö Versions 2.17 and later of TechWriter Pro
  252. (and recent editions of EasiWriter) offer Ésmart quotesæ and these are
  253. jolly useful. One tap on the ` key gives É, two gives ö, three gives `
  254. itself. Similarly, one tap on É gives æ, two ò, and three gives æ
  255. itself. If you donæt like this feature, you can turn it off. Load the
  256. Messages file into a text editor and find the lines:
  257. 10.2
  258.   x35:`Éö`
  259. 10.2
  260.   x35:ÉæòÉ
  261. 10.2
  262. x35: denotes these triple action commands. The first character after É:æ
  263. is the key it is assigned to, and the following three characters appear
  264. on pressing that key once, twice or three times. Usefully, you can add
  265. extra keys to this list. For example:
  266. 10.2
  267.   x35:ÿùÿ
  268. 10.2
  269.   x35:..╖î
  270. 10.2
  271. Now theá-ákeyágivesá-á,áùáoráÿá, and the . key gives . or ╖ or î
  272. (ellipsis). You can include up to seven x35 commands in the Messages
  273. files, giving you access to up to 14 characters that are otherwise
  274. awkward to get.
  275. 10.2
  276. Print button-bar icon Ö The defaults on TechWriter (may work on
  277. EasiWriter too) are, for me, the wrong way around. To swap the defaults
  278. on the print icon, proceed as follows: Load the Resources file into an
  279. editor and change the line
  280. 10.2
  281.   w1:icbr Isave!11 10,68,4
  282. 10.2
  283. to
  284. 10.2
  285.   w1:icbr Isave!11 68,10,4
  286. 10.2
  287. This swaps the actions of select and adjust on this icon. If you look at
  288. this file, you can see that the other button-bar icons work in a similar
  289. way and, if you want, you can fiddle around with them, too. However,
  290. proceed with care!
  291. 10.2
  292. Stationery and default choices Ö When using TechWriter (may work on
  293. EasiWriter too) I keep myástationery in a directory called Stationery
  294. inside !TechWriter. To tell the program where it is, Iáinclude a line in
  295. the !Run file:
  296. 10.2
  297. Set TechWriter$Path <TechWriter$Dir>.Stationery.
  298. 10.2
  299. (Note the trailing full stop.) This command sets a path.
  300. 10.2
  301. You can then tell TechWriter which piece of stationery to use by default
  302. by adding the É-uæ switch to the run command at the bottom of the run
  303. file, e.g. in my case this reads Run .!RunImage %*0 -d  -ustyle_def -
  304. r1600, so my default stationery is the file Éstyle_defæ inside the
  305. !TechWriter.Stationery directory.
  306. 10.2
  307. Other useful switches: the É-r1600æ switch tells TechWriter to keep the
  308. current document wholly in memory unless it gets bigger than 1600Kb.
  309. i.e. it sets the file size below which TechWriter avoids any disc-
  310. swapping and keeps the current file Éclosedæ unless youære loading/
  311. saving. You can use É-ræ to set any size you find convenient.
  312. 10.2
  313. The -b switch followed by a font name, causes that font to be displayed
  314. and printed Éback to frontæ. This is useful if you want to write in
  315. languages like Hebrew which read/write from right to left. It means you
  316. can mix a right-to-left language with a left-to-right one in the same
  317. document and each will come out the correct way around.
  318. 10.2
  319. The -o switch sets the Éeasy save directoryæ. That means it sets where a
  320. file will be saved if you give a plain name (what Acorn call a
  321. leafname). e.g. if you set this to
  322. 10.2
  323. -oADFS::HardDisc4.$
  324. 10.2
  325. and then save a file as fred it will be saved to the file
  326. 10.2
  327. ADFS::HardDisc4.$.fred .
  328. 10.2
  329. Modern Choices! Ö Acorn have decided that instead of putting default
  330. settings in the run command of TechWriteræs (and perhaps EasiWriteræs)
  331. !Run file, they should be saved in a ÉChoicesæ file elsewhere in the
  332. machine. This is to facilitate the Net machines which have the
  333. applications in ROM. Try looking for it inside !TechWriter or the !Boot
  334. application on the main hard disc. Specifically, look for a file
  335. !Boot.Choices.TechWriter.Choices. If it exists, it over-rules anything
  336. you may set on the run line, so you should make any changes in the
  337. !Choices file.
  338. 10.2
  339. Jim Lesurf <jcgl@st-and.demon.co.uk>
  340. 10.2
  341. The characters shown in bold are produced by pressing the relevant key
  342. in conjunction with either the Alt key on its own or both the Shift and
  343. Alt keys:-
  344. 10.2
  345. e.g.   to type ó hold down Alt and press the C key
  346. 10.2
  347.   to type ⌐ hold down Shift and Alt and press the C key.
  348. 10.2
  349. The characters indicated by an arrow are intended to be used in
  350. conjunction with other keys to produce accented letters; in each case
  351. the accent is only produced if the Alt-key combination is followed by an
  352. appropriate letter: e.g. to produce Θ you first type Alt-[ then type e.
  353. If you want the accent on its own, follow the Alt-key combination by
  354. pressing the spacebar.
  355. 10.2
  356. Alt-<hyphen> produces a öhard hyphenò (character 173)
  357. 10.2
  358. Alt-<spacebar> produces a öhard spaceò (character 160)
  359. 10.2
  360.