home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Archive Magazine 1997
/
ARCHIVE_97.iso
/
text
/
hints
/
vol_03
/
issue_02
< prev
next >
Wrap
Text File
|
1995-02-16
|
9KB
|
226 lines
Å *RMTidy and ADFS Ö If you perform a *RMTidy any discs will be
dismounted and any directory settings (*DIR) will be lost. This is
because this function re-initialises all the modules including the
FileCore%ADFS and ADFS modules.
3.2
Å Acorn DTP Ö if you want to import text that has a return at the end
of each line e.g. spooled BASIC programs, poetry, songs, etc then if you
import them directly Acorn DTP will ignore the returns and give you a
continuous block of text. There is a way around this problem:
3.2
1) In Acorn DTP define a new style say PROGRAM or SONG, etc
3.2
2) Set the space above parameter to 0
3.2
3) Load your text into !Edit
3.2
4) Select the find window of the !Edit menu i.e. press <f4>
3.2
5) Select the Émagic charactersæ option
3.2
6) Type: \x0A into the find box and /x0a/x0a in the replace box
3.2
7) Select the GO option and then select the Éreplace end of fileæ option
3.2
The effect is that each line is treated as a new paragraph with its
style defined as PROGRAM.
3.2
Å Alphabase RISC-OS compatible? I read Gerald Fittonæs tale of woe
(Archive 2.12 p43) just two days after encountering exactly the same
problem myself with Alphabase. The ÉReadmeæ file on the program disc
states that hard disc installation can be done in Éthe usual RISC-OS
manneræ rather that using the ÉInstallæ file. It seems to me that it
must be done in the former way! Apart from messing up the configure
settings as Gerald describes, ÉInstallæ fails to copy the !Alphabase
application directory to drive 4 (it canæt, since the *COPY command
issued at line 160 has no R option). Remedying this doesnæt help: the
program still crashes with a Écanæt findæ message when you attempt to
boot via the Library. After wasting many hours in debugging attempts, I
scrubbed the lot and simply copied !Alphabase to :4.$, whence the
program is run without problems by clicking on the desktop. Inciden
tally, again contrary to what is said on the ÉReadmeæ file, the floppy
disc stubbornly refused to boot on Shift-Break. Bill Templeton.
3.2
Å Archimedes Fans Ö Ray Maidstone of Norwich has been investigating
Archimedes fans (the cooling kind). He says that if you plug in any
extensions on to your Archimedes e.g. backplanes, RAM upgrades, etc then
you really should be using a fan. This keeps the temperature of the
Archimedes at an acceptable level, thereby extending the life of the
components.
3.2
Å Binary-Chop Ö Michael Sawle sent in this routine which can be used
for locating an item in an array Ö one of the beauties of this routine
being that it only needs enough characters to uniquely identify the
string being searched for. The routine requires data to be stored
alphabetically in a matrix M$(1),M$(2),...,M(NR%) where NR% is the
number of records currently stored. The routine returns the matrix
element number of the desired record (or nearest available).
3.2
DEFFNbinarychop(find$)
3.2
LOCAL A%,B%,R%
3.2
where=0 : A%=0 : B%=NR%
3.2
REPEAT
3.2
R%=INT((A%+B%)/2)
3.2
IF M$(R%)>find$ THEN
3.2
B%=R%
3.2
ELSE
3.2
IF M$(R%)<find$ THEN A%=R%
3.2
ELSE
3.2
where=R%
3.2
ENDIF
3.2
ENDIF
3.2
UNTIL where>0 OR B%-A%=1
3.2
IF where=0 THEN where=A%+1
3.2
=where
3.2
In fact this routine should be called a binary search routine. It chops
the list of records in two and then checks which half of the data set
the search string should appear. It then chops this half in two and so
on until finds the string or it realises the string does not exist. This
means that the computer can significantly reduce the number of checks it
has to make before reaching a result e.g. if you have 32768 (i.e. 2^15)
records then the computer will make a maximum of 15 checks. The price
that must be paid for this efficiency is that the data set must be
sorted in some recognisable order e.g. alphabetically, numerically,
ASCII, etc. The best versions of this technique are usually recursive.
(Perhaps someone might like to have a go at writing one?)
3.2
Å Colour TVæs as monitors Ö Several times in Hints & Tips, connection
of the Archimedes to colour TVæs has been mentioned. I have succeeded in
doing just this. In Archive 2.7 p11, Oliver Cornes says that plugging
the Archimedesæ SCART into a video recorder doesnæt work Ö this is
because a VCR only deals with composite signals, not RGB. However, if
your TV has a SCART socket, and many new ones do, then connection may
well be possible direct to the TV. You will have to tell the TV to use
RGB input, not the composite (it only uses composite then for timing).
There may be (indeed, it would be odd if there wasnæt) a way of doing
this with the TV controls. My TV has two sockets and if you tell it to
use socket 0 it uses socket one with RGB.
3.2
However, I didnæt find this out until I found out that one of the pins
on the SCART standard is for just this type of use Ö pin 16 must be
between +1V and +3V with respect to pin 18 (i.e. connect a 1.5V battery
between them Ö the Öve end to pin 18, the +ve end to pin 16). The TV
then automatically switches to SCART RGB input. Note that this overrides
any channel selection made, so you should put a switch in line so you
can switch the signal off, otherwise you canæt watch TV. Connection to
the SCART plug is often maligned as difficult, but it is only a case of
knowing how to do it. The proper way is to remove the pin you wish to
make connection to, connect it up and then put it back. The pins have
barbs to prevent them from falling out, so use a pair of narrow pliers
to squeeze the barb back and push the pin out through the rear of the
plug. Also make sure that you re-insert the pin the right way round Ö
just copy the other pins. They only go in properly one way round anyway.
Kevin Quinn
3.2
Å FileCore in use remedy Ö If the Archimedes Éseesæ too many ADFS
directories then a ÉFilecore in useæ error may occur and you will be
unable to save any data in your machine. You can overcome this by typing
the following four lines after the error has occurred:
3.2
*RmReInit FileCore (this will fail giving a Bad number error)
3.2
*RmReInit FileCore
3.2
*RmReInit ADFS
3.2
*RmReInit HardDisc (A300æs and A3000æs only)
3.2
Å MaxGammon update Ö The MaxGammon game on Careware 2 cannot be played
in mode 15. In order to over come this you should:
3.2
1) Load in the BASIC !RunImage file in the !MaxGammon directory.
3.2
2) Type the following:
3.2
10840colour%=FNmg_Colour(mg_red
3.2
_player%)
3.2
11230tc%=mgc_grey_point%
3.2
3) Save the program.
3.2
Å Oak MS-DOS SCSI as Drive D Ö I use the PC emulator occasionally for
my work. It therefore did not take very long to use up all 10M of the
MS-DOS drive C partition on my 47M SCSI drive. The obvious thing to do
would be to create another MS-DOS partition for drive D. However on the
version of the PC emulator that I am using (Emulate121) the Archimedes
hard discs 4 and 5 are mapped to MS-DOS discs C and D. Therefore drive C
and D cannot both exist on the same hard disc (on the emulator) and two
hard disc drives are required for two partitions.
3.2
On the OAK SCSIFS each winchester drive has the following information:-
3.2
a) filing system drive number (e.g. :4 or :5)
3.2
b) SCSI hardware address (each device on the SCSI bus has a unique
address)
3.2
c) logical unit number (SCSI Ésoftwareæ address)
3.2
If you are lucky enough to have an OAK SCSI (::SCSIDisk4) with an MS-DOS
partition (Drive _C) then hereæs how to create MS-DOS drive D.
3.2
1. Run ÉSCSIFormæ
3.2
2. Note that drive :4 is SCSI ID = 0, LUN = 0
3.2
3. Add drive 5 with SCSI with SCSI ID = 0, LUN = 0 (same as drive :4)
3.2
4. Exit SCSIForm and enter the desktop. There should be an additional
hard disc icon ÉSCSI 5æ
3.2
5. Start up the PC emulator (version 1.20 or greater?)
3.2
6. Type FDISK. An extra option should appear (5 Ö select next fixed disc
drive). Select this and the disc drive should now become number 2. Then
select option 1 ÉCreate DOS Partitionæ
3.2
7. Type Format D:
3.2
8. Type CHKDSK D: (this checks partition is OK)
3.2
9. When using the desktop always us SCSIFS::SCSIDisc4. Ignore disc 5
3.2
Ralph Barrett
3.2
(We have not had a chance to try this out yet, so you follow these
suggestions at your own peril. Ed)
3.2
Å Recursive directory move bug Ö one reader noted that while in the
desktop, if you moved a directory into itself (by holding the shift
button down while copying) the files in the directory will be moved
further and further down a directory tree until your whole disc has been
filled with directories! The problem with this bug is that you canæt
move your files back to their original position because the disc is
already full. You must copy the other files onto another disc and then
remove the offending directory.
3.2
Å To scroll or not to scroll? The strange behaviour mentioned in the
BASIC V Forum (Archive 3.1 p36) is actually caused by the *Configure
Scroll or *Configure NoScroll setting. This setting allows us to control
the behaviour of the ends of lines. *Configure Scroll should be used for
compatibility with earlier machines. The RISC-OS desktop, however, has a
habit of countermanding the configured values and in this case it
decides that it prefers NoScroll. If you have a program which relies on
the behaviour of the ends of lines, then you can execute VDU 23,16,&FE,1
|| to temporarily obtain the Scroll option, or VDU 23,16,&FE,0 || to
obtain NoScroll behaviour.
3.2