HINTS & TIPS

David Spencer rounds up another collection of hints and tips.

BASIC TEXT SAVE (for non-Twin users)

The operating system alias given below allows a text version of a Basic program to be saved directly, simply by typing TWIN. This works because when you execute TWIN (or TWINO) from Basic, the current program is detokenised, and the command *TWIN executed with parameters indicating where the text version of the program is stored. The alias picks up the TWIN command, strips out the addresses and saves the text file with the name 'TextProg'. The *BASIC is necessary because Basic doesn't expect the *TWIN command to return. Incidentally, don't add any spaces to the alias when entering it, as it will then be too long when the operating system expands it.

*Set Alias$Twin SetEval x1 ("%*0"RIGHT(LEN "%*0"-1))LEFT8|MSetEval x2 "%*0"RIGHT(LEN" %*0"-10))LEFT8|MSet Alias$x Save TextProg |<x1> |<x2>||MSetType TextProg Text||MBasi c @|<x1>,|<x2>|Mx

To revert the TWIN command to its real function, use:
*UNSET Alias$Twin

To load a text file back into Basic, the corresponding command to use is:
*BASIC -load <filename>

Thanks to Roger Wilson of Acorn for this idea.

PRINTER PROBLEM

When using certain early Archimedes with particular printers, occasional characters can be lost. This is particularly apparent when performing screen dumps on an Integrex 132 colour printer, causing blank lines to appear. This symptom is caused by a minor hardware problem with the computer, and it can be corrected by taking the machine to an Acorn dealer and asking them to perform Acorn field change order 2002, which they should do free of charge.

GET THE LINGO RIGHT

Do you know how to pronounce RISC OS? According to Acorn it should be Risk Oh Ess, and not anything else you might think of. And while they are about it, gone are graphics and text windows. Instead, these are now called Viewports - presumably to avoid confusion with WIMP windows. And just to round things off, the beloved Podule has been wiped off the surface of the earth. From now on, things that plug into the backplane are to be referred to as plain boring expansion cards. Is the name Archimedes safe we ask?

DEFECTIVE DISCS

With the new E format discs offered by RISC OS, it is no longer necessary in most cases to throw away, or even reformat, a disc which develops a defective sector. Instead, the defect can be mapped out by using the command *DEFECT. This takes two parameters, the first being the drive number or name, and the second the disc address of the defect in hex. For example:
*DEFECT :0 24800
The easiest way to find out this address is to use *VERIFY which will report the disc address of each defect.

If the specified defect is on an unused portion of the disc, then it will be mapped out. On the other hand, if the defect lies within a file, then the name of that file is printed. It is then up to you to delete the file if you wish, and issue the *DEFECT command again. If the defect lies in the disc allocation map, then you will get the message 'Can't map out defect', and the disc will have to be reformatted.

PSEUDO FILING SYSTEMS

Under RISC OS (and indeed Arthur), it is possible to direct any star command to a particular module. The two main uses of this are for executing a command on one filing system while another is selected, and for resolving problems when two modules use the same command name (for example *MEMORY is in both the debugger and Clares Toolkit Plus). To do this, prefix the command with the module name thus:
*Adfs:Info * or
*Debugger:Memory 10000

SILENT NETWORK

By default, RISC OS pops up the hourglass when performing lengthy operations on an Econet Network. If for any reason you want to stop this, simply execute:
*RMKILL NetStatus

ASSEMBLER BUG

A nasty bug in Basic's built-in assembler can lead to some very hard-to-find problems. The problem arises because each mnemonic expects to be followed by a space. If, however, no space is present, then the assembler doesn't generate an error, but instead ignores the character where the space should have been. Consider the legal instruction:
ADD R1,R2,R3
This is perfectly valid, and is assembled as expected. Now omit the space:
ADDR1,R2,R3
The assembler 'reads' this as:
ADD 1,R2,R3
This does however work, because register names do not have to be preceded by an 'R'. But, consider:
SWI&140
This is assembled as:
SWI 140
The & has been lost, changing the SWI to print an '@' into an illegal one.

The moral is, always leave a space between a mnemonic and its operands.

PERSONALISING THE DESKTOP BASIC HANDLER

The extended version of the Desktop Basic handler featured on last month's magazine disc offers the option to load a program and enter Basic by holding down the Shift key while dragging the file. By default, this enters Basic and leaves you with a blank screen. You can, however, customise the action simply by changing the function key definition in line 2640. The first part of this must be left unchanged, but it can be followed by any commands you wish. Currently, a mode change is used, but you could for, example, add the command 'EDIT' in order to enter the Basic Editor.