home *** CD-ROM | disk | FTP | other *** search
/ ARM Club 3 / TheARMClub_PDCD3.iso / hensa / documentation / documents / a252tip1 < prev    next >
Internet Message Format  |  1999-04-27  |  3KB

  1. From: pcolmer@acorn.co.uk (Philip Colmer)
  2. Subject: Useful hints and tips #1: !Run files
  3. Date: 14 Jun 93 15:17:23 GMT
  4.  
  5. 1. Loading modules from !System
  6. -------------------------------
  7.  
  8.  Often, applications that may or may not need to load modules from !System
  9. simply check System$Path before seeing whether or not anything does need to
  10. be loaded from !System. This is particularly annoying with RISC OS 3 since
  11. there currently shouldn't be any need for OS-originated modules.
  12.  
  13.  A way around this problem would be to use something along the lines of:
  14.  
  15. RMEnsure UtilityModule 3.00 If "<System$Path>" = "" Then Error 0 System
  16. resources cannot be found
  17.  
  18. Set System$Path_Message System resources cannot be found
  19.  
  20.  The first line basically states that if the machine hasn't got RISC OS
  21. 3.00 orlater, and System$Path isn't set, then complain. This would be the
  22. default action under RISC OS 2, so nothing has changed there.
  23.  
  24.  The second line uses a new feature of RISC OS 3. Basically what the line
  25. is saying is that if there is an access to System: and System$Path isn't
  26. defined, give the error 'System resources cannot be found'.
  27.  
  28. 2. Duplication of !Boot
  29. -----------------------
  30.  
  31.  If you look at a lot of applications, the !Run files fall into three categories:
  32.  
  33.  1. They run !Boot at some point
  34.  2. They include the commands in !Boot
  35.  3. There is no common ground at all.
  36.  
  37.  The third is obviously flawed since the !Boot file may not have been
  38. executed. It is therefore necessary, in some way, to execute the commands
  39. that the !Boot file contains. The best way to do this is to COPY the
  40. commands from the !Boot file and put them into the !Run file.
  41.  
  42.  Doing it this way is more network-friendly that running the !Boot file
  43. form the !Run file.
  44.  
  45.  An associated point is that if the !Boot file just contains:
  46.  
  47.  IconSprites <Obey$Dir>.!Sprites
  48.  
  49. then it is a waste of time and space. In the absence of a !Boot file, the
  50. Filer will do this anyway.
  51.  
  52. 3. Careful setting of slot sizes
  53. --------------------------------
  54.  
  55.  When setting the slot size for your application, exercise some caution and
  56. try to test your application on a small-paged machine. This is important
  57. because the page size varies from 8K up to 32K depending on the amount of
  58. memory that your machine has.
  59.  
  60.  It is also worth remembering that the Window Manager rounds the requested
  61. slot size UP to the nearest page size, which holds hidden perils if you
  62. have specified a slot size too small for an 8K page size machine but which,
  63. when rounded up, works fine on a 32K page size machine.
  64.  
  65. ---------------------------------------------------------------------
  66. "Now, I realise that, technically speaking, that's only one flaw, but
  67. I thought that it was such a big one, it was worth mentioning twice."
  68.  
  69.  
  70.