From: pcolmer@acorn.co.uk (Philip Colmer) Subject: Useful hints and tips #1: !Run files Date: 14 Jun 93 15:17:23 GMT 1. Loading modules from !System ------------------------------- Often, applications that may or may not need to load modules from !System simply check System$Path before seeing whether or not anything does need to be loaded from !System. This is particularly annoying with RISC OS 3 since there currently shouldn't be any need for OS-originated modules. A way around this problem would be to use something along the lines of: RMEnsure UtilityModule 3.00 If "" = "" Then Error 0 System resources cannot be found Set System$Path_Message System resources cannot be found The first line basically states that if the machine hasn't got RISC OS 3.00 orlater, and System$Path isn't set, then complain. This would be the default action under RISC OS 2, so nothing has changed there. The second line uses a new feature of RISC OS 3. Basically what the line is saying is that if there is an access to System: and System$Path isn't defined, give the error 'System resources cannot be found'. 2. Duplication of !Boot ----------------------- If you look at a lot of applications, the !Run files fall into three categories: 1. They run !Boot at some point 2. They include the commands in !Boot 3. There is no common ground at all. The third is obviously flawed since the !Boot file may not have been executed. It is therefore necessary, in some way, to execute the commands that the !Boot file contains. The best way to do this is to COPY the commands from the !Boot file and put them into the !Run file. Doing it this way is more network-friendly that running the !Boot file form the !Run file. An associated point is that if the !Boot file just contains: IconSprites .!Sprites then it is a waste of time and space. In the absence of a !Boot file, the Filer will do this anyway. 3. Careful setting of slot sizes -------------------------------- When setting the slot size for your application, exercise some caution and try to test your application on a small-paged machine. This is important because the page size varies from 8K up to 32K depending on the amount of memory that your machine has. It is also worth remembering that the Window Manager rounds the requested slot size UP to the nearest page size, which holds hidden perils if you have specified a slot size too small for an 8K page size machine but which, when rounded up, works fine on a 32K page size machine. --------------------------------------------------------------------- "Now, I realise that, technically speaking, that's only one flaw, but I thought that it was such a big one, it was worth mentioning twice."