home *** CD-ROM | disk | FTP | other *** search
/ Archive Magazine 1996 / ARCHIVE_96.iso / text / hints / volume_03 / issue_11 < prev    next >
Text File  |  1995-02-16  |  10KB  |  270 lines

  1. Å Blanking discs Ö (Iæm sure weæve had this before, but not everyong has
  2. picked it up and I couldnæt find a reference to it in the Archive
  3. database.)  If you have a disc that has lots of files on it and you try
  4. to clear them all off by deleting them, it can take ages Ö it would be
  5. quicker to reformat the disc.  Even quicker though is to get an existing
  6. blank disc and do a backup from that to the disc to be blanked Ö it
  7. takes just a couple of seconds.
  8. 3.11
  9. Å ChkSpr Ö In answer to Ray Dawsonæs plea for help about !ChkSpr
  10. supplied on shareware disc 19:  if you open up the !ChkSpr directory,
  11. amongst the files you will find one called Échkspræ and one called
  12. !BootÉ.  If these two files are copied into any Impression document
  13. directory and if you then rename the document directory, instead of the
  14. Impression sprite not appearing because the name no longer corresponds
  15. to the document name (as normally happens) it will appear correctly. 
  16. This is because the chkspr utility, when run by the new !Boot file,
  17. checks the name of the first sprite in the sprite file and changes it if
  18. the name is not the same as that of the document.  This utility can also
  19. be used to keep the correct sprites for applications.  For example, when
  20. developing an application, different versions may be kept, all with the
  21. right sprite file.  Simon Burrows and Emmet Spier.
  22. 3.11
  23. Å ColourTrans module Ö I have noticed that each of the printer drivers
  24. on the RISC OS extras disc contain their own copy of the Colours module! 
  25. This is at odds with the policy of storing all shared modules in the
  26. !System directory (you will probably already have a copy of the Colours
  27. module there Ö many applications use it).
  28. 3.11
  29. To avoid wasting disc space (though Colours uses little) you can remove
  30. this module from within each printer driversæ directory and edit the
  31. !Run file for each driver to call Colours from the !System folder.
  32. 3.11
  33. i.e. in each !Run file the line
  34. 3.11
  35.    RMEnsure ColourTrans 0.52 RMLoad <PDriver$Dir>.Colours
  36. 3.11
  37. should be replaced with
  38. 3.11
  39.    RMEnsure ColourTrans 0.52 System:Modules.Colours
  40. 3.11
  41. To be even more correct two extra lines should also be added (e.g. like
  42. the !Spark and !Draw applications).  The above on its own relies on the
  43. desktop having already seen your !System directory, you should therefore
  44. put the line
  45. 3.11
  46.    Ifö<System$Path>ò = öò Then Error 0 System resources cannot be found
  47. 3.11
  48. before the changed line above to check that this is the case.  You
  49. should also put the line
  50. 3.11
  51.    RMEnsure ColourTrans 0.52 Error You need ColourTrans 0.52 or later
  52. 3.11
  53. after the changed line Ö this will check that the module has been loaded
  54. satisfactorily.
  55. 3.11
  56. The Printer Drivers on the original RISC-OS Application Disc I did not
  57. load the Colours module when they were installed and so do not have this
  58. problem.  Simon Butler.
  59. 3.11
  60. Å Debugger/Dissassemble returns an incorrect length for SWI instructions
  61. Ö it returns the length as one too many Ö you get an extra null
  62. character on these instructions.  As all returned strings are null
  63. terminated, I found it easier to scan for the null in order to find the
  64. length.  The zero makes no difference to screen or printing, but if
  65. written to a text file looks ugly in !Edit.  Kevin Quinn.
  66. 3.11
  67. Å Desktop bug Ö There appears to be a fatal bug in the Window Manager of
  68. RISC-OS 2.00.  It occurs when you drag a menu, and whilst you are
  69. dragging it, press the <escape> key to remove it.  If you then stop
  70. dragging the menu, the system will report an ÉAddress exception at
  71. &386BCICæ, the application which created the menu will die fatally and
  72. most often, all the other applications will die as well, resulting in
  73. the computer Ébombing outæ of the desktop into the CLI.  Tom Lakofski.
  74. 3.11
  75. Å DXF files Ö Users of DXF files which are comprised only of BLOCKS and
  76. ENTITIES (or maybe just ENTITIES alone) will find that !Draw does not
  77. enable the use of its facility for specifying font types when the DXF
  78. file is just loaded.
  79. 3.11
  80. The inclusion of the code below (i.e. a TABLES section) appears to solve
  81. this problem.  Of course !Draw must have previously Éseenæ the relevant
  82. !Fonts directory.  The full sequences for the sections, if all are
  83. present is HEADER followed by TABLES, then BLOCKS + ENTITIES.  Jim
  84. Markland.
  85. 3.11
  86.    0
  87. 3.11
  88.    SECTION
  89. 3.11
  90.    2
  91. 3.11
  92.    TABLES
  93. 3.11
  94.    0
  95. 3.11
  96.    TABLE
  97. 3.11
  98.    2
  99. 3.11
  100.    STYLE
  101. 3.11
  102.    70
  103. 3.11
  104.    20
  105. 3.11
  106.    40
  107. 3.11
  108.    0
  109. 3.11
  110.    41
  111. 3.11
  112.    1
  113. 3.11
  114.    50
  115. 3.11
  116.    0
  117. 3.11
  118.    71
  119. 3.11
  120.    0
  121. 3.11
  122.    3
  123. 3.11
  124.    STANDARD
  125. 3.11
  126.    0
  127. 3.11
  128.    ENDTAB
  129. 3.11
  130.    0
  131. 3.11
  132.    ENDSEC
  133. 3.11
  134. Å Greek3 re-caching Ö To stop the Greek3 outline font supplied with
  135. Impression from recaching itself too often all you have to do is rename
  136. it from ÉGreek3æ to ÉGreekæ.  Michael Ben-Gershon.
  137. 3.11
  138. Å On/Off icons, for example option icons in windows, are implemented by
  139. using the ÉSæ command in the validation string of an icon with
  140. indirected text and sprites on.  FormEd will allow you to set these up Ö
  141. switch on indirected stuff, put text (if any) into the text item, and
  142. select sprite Ö donæt put anything in the sprite sub-menu writeable icon
  143. and put the sprite name(s) in the indirected validation string, e.g.
  144. Ésopton,optoffæ.  Then by inverting the iconæs inverted bit it will swap
  145. over the icons Ö see the calls Wimp_SetIconState and Wimp_GetIconState
  146. (pages 1211-1213 of PRM).  Details of validation strings are on pages
  147. 1184-1187 of the PRM.  Kevin Quinn.
  148. 3.11
  149. Å OS_Heap Ö While trying to use the Heap facility in RISC-OS, we found
  150. that OS_Heap 6, which returns the size of a heap block, returns the size
  151. including the word at the start containing length.  This is unexpected
  152. given the Abstract Data Type philosophy that appears to have been used
  153. for the rest of the system and means that the user knows where the
  154. length of a block is stored and can read it without using OS_Heap 6 Ö
  155. and incidentally, means Acorn canæt rewrite their Heap manager unless
  156. this word is left in the same place.  James Chong.
  157. 3.11
  158. Å RenderBender on SCSI hard disc drives.  As you will know, you cannot
  159. access the hard drive, by using the HARD 4 icon.  Some of you may have
  160. already tried unsuccessfully to alter the program, by altering the
  161. variable HD% to 1, to try to force the program into recognising the hard
  162. drive.  The following alterations should be made to the !Runfile, Render
  163. and Anirout in the utilities directory.  The code will save all pictures
  164. to the specified directory if you have not put the Render Bender
  165. directory in $...
  166. 3.11
  167. For the Render program :
  168. 3.11
  169.    15 *SET RendHard1 SCSIFS::4.$.!Render
  170. 3.11
  171.    40 curd$=ö4ò:moder%=FALSE
  172. 3.11
  173.    15890 A%=32
  174. 3.11
  175.    15940 IF A%=32 AND HA%>0 GOTO 15920
  176. 3.11
  177.    16020 IF A%=32 THEN curd$=ö4ò:*SET REdrive SCSIFS::4.$.!Render
  178. 3.11
  179. For the Anirout program:
  180. 3.11
  181.    6800 IF A%=BE% THEN *SET REdrive SCSIFS::4.$.!Render
  182. 3.11
  183. You should then use the edit program to alter the !Run file as follows:
  184. 3.11
  185. The line that begins *IF obey$dir... should be changed to...
  186. 3.11
  187.    *IFobey$dir=öadfs::Render.$.!Renderò THEN *SET RendHard1 SCSIFS::4.
  188. 3.11
  189.    $.!Render ELSE *SET RendHard1<Obey$Dir>
  190. 3.11
  191. The previous code may seem a bit long winded but I have unfortunately
  192. not been able to get the *KILLADFS command to work with my version. 
  193. Neil Berry.
  194. 3.11
  195. Å Screen size Ö The screen size in O.S. co-ordinates may be found using
  196. OS_ReadVduVariables and variable numbers 4 (XEigFactor),5(YEigFactor),11
  197. (XWindLimit) and 12 (YWindLimit).  The last two are hidden over the page
  198. and for a while I missed them (pages 345-348 and 350-352).  There is
  199. also a message that the Wimp broadcasts when the user changes mode,
  200. enabling your task to keep uptodate on screen sizes Ö important for drag
  201. boxes amongst other things.  See page 1259.  Kevin Quinn.
  202. 3.11
  203. Å System Variables for Filer Module Ö This little routine enables you to
  204. use RISC-OS variables with the Filer_OpenDir and Filer_CloseDir
  205. commands.  This means that you can do commands such as öFiler_OpenDir
  206. <Obey$Dir>.DataFilesò and make programs totally independent of where
  207. they are on the disc.  The module requires about 14k of free memory in
  208. the RMA.  The program has been written in such a way that it should work
  209. with all future versions of the Filer.
  210. 3.11
  211. REM >Filer
  212. 3.11
  213. *RMKill Filer
  214. 3.11
  215. *RMReInit Filer
  216. 3.11
  217. *RMFaster Filer
  218. 3.11
  219. SYS öXOS_Moduleò,18,öFiler%Baseò TO ,,,CodeBase%
  220. 3.11
  221. TableBase%=CodeBase%+CodeBase%!ñ18
  222. 3.11
  223. Info%=FN_LookupInfo(öFiler_OpenDirò)
  224. 3.11
  225. TableBase%!Info%=TableBase%!Info% OR &00000100
  226. 3.11
  227. Info%=FN_LookupInfo(öFiler_CloseDirò)
  228. 3.11
  229. TableBase%!Info%=TableBase%!Info% OR &00000100
  230. 3.11
  231. END
  232. 3.11
  233. :
  234. 3.11
  235. DEF FN_LookInfo(Text$)
  236. 3.11
  237. LOCAL Offset%,Command$
  238. 3.11
  239. Offset%=0
  240. 3.11
  241. REPEAT
  242. 3.11
  243. Command$=öò
  244. 3.11
  245. REPEAT
  246. 3.11
  247. Command$+=CHR$(TableBase%?Offset%)
  248. 3.11
  249. Offset%+=1
  250. 3.11
  251. UNTIL TableBase%?Offset%=0
  252. 3.11
  253. Offset%=(Offset%+16+3) AND NOT 3
  254. 3.11
  255. UNTIL Command$=Text$ OR TableBase%? Offset%=0
  256. 3.11
  257. IF Command$=Text$ THEN =Offset-12 ERROR 0, öI canæt find ò+Text$
  258. 3.11
  259. There is one slight problem with this routine due to the way that RISC-
  260. OS implements the *RMFaster command by re-initialising the module.  This
  261. means that the Filer icon disappears from the Desktop and cannot be
  262. recovered without restarting the desktop so the routine is probably best
  263. placed in a boot routine that subsequently starts up the desktop.  Simon
  264. Callan.
  265. 3.11
  266. Å TWIN 8000 Ö If you load TWIN at an address other than hex 8000 the
  267. <f10> key functions (goto, newtime, etc) do not work.  It caused me no
  268. end of problems and phone calls to Acorn before I realised this.
  269. 3.11
  270.