home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Archive Magazine 1997
/
ARCHIVE_97.iso
/
text
/
hints
/
vol_02
/
issue_04
< prev
next >
Wrap
Text File
|
1995-02-16
|
5KB
|
140 lines
H & T are a bit thin on the ground this month because this issue is
being finished before Christmas so I get some time off and itæs only a
couple of weeks since I closed the December issue, so not much has come
in yet. Most of the H & T that we have got were sent in by Anton Carver.
Thanks Anton!
2.4
Å Using function keys Ö If you want to get the function keys to
produce ASCII codes, say, 200, 201, 202 etc, you use *FX 225,200 but
this only works for keys <f0> (the print key) to <f9>. If you want to
use <f10> upwards, you need to use *FX 221,200. This also makes <insert>
into the equivalent of <f13> i.e. it generates, in this case, ASCII 213.
2.4
Å Troubles with Mitsubishi Drives? Ö Yes, there are problems with some
of the new 5.25ò Mitsubishi drives with some of the 5.25ò disc inter
faces, but they can be solved. The problem is the use of pin 2 on the
interface. It was not used on the BBC micro, but on the new Mitsubishi
drives it is used for DC interrupt. The solution is to put a little bit
of masking tape on the edge connector inside the drive mechanism so that
it doesnæt make contact with the p.c.b. Pin 2 is on the top of the board
at the outside edge.
2.4
Å Programmable reset Ö A hang-over from the BBC micro is that if you
program function key 10, you will find that if you press <reset>,
function key 10 will be executed! If you donæt know about this, it can
come as something of a shock, but it could be that you would want to
make use of it if you were, say, developing a machine code program which
kept hanging up the machine and forcing you to press <reset>. You could
program it as *KEY 10 *BASIC|MOLD|MEDIT .|M and it would jump you back
into editing the program at the point where you were.
2.4
Å Is it still going? Ö If you are doing some heavy machine code
programming and want to know if the computer is still working or whether
you have locked it up completely, try pressing the caps lock and/or
scroll lock keys and if they are still responding, your computeræs not
dead yet! The caps and scroll lock LEDæs are controlled by the computer
in response to the key presses, so if they are working, it tells you
that the processor is still reponding to interrupts.
2.4
Å Using ARMBE Ö It is useful to be able to enter ARMBE at the point of
the last error. Here is a program which sets up function key 4 so that
it enters ARMBE at the point where the error occurred or, if no error
then it enters where you were last editing by using öEDIT .ò.
2.4
10 *set key$edit IF ERL=0 THEN OSCLI (|öKEY 4 *FIXKEY4||mEDIT . ||m|ò)
ELSE OSCLI(|öKEY 4 *FIXKE Y4||mEDIT |ò + STR$(ERL) + |ö||m |ò)|mMISTAKE
|m*FX138,0,132|m
2.4
20 *set alias$fixkey4 set key$4 |<key$edit>
2.4
30 *fixkey4
2.4
Å REMæs Ö Although the User Guide says that REM statements are ignored
by BASIC, this is not completely true in BASIC V. This is because the
block conditional IF╔THEN╔ELSE╔ ENDIF requires the THEN to be the last
statement on the line. Adding a REM to the end of the line will change
the flow of control, thus:
2.4
>LIST
2.4
10 OK%=TRUE
2.4
20 IF NOT OK% THEN
2.4
30 PRINT öWrong!ò
2.4
40 ELSE
2.4
50 PRINT öRightò
2.4
60 ENDIF
2.4
>RUN
2.4
Right
2.4
>LIST
2.4
10 OK%=TRUE
2.4
20 IF NOT OK% THEN :REM Danger!
2.4
30 PRINT öWrong!ò
2.4
40 ELSE
2.4
50 PRINT öRightò
2.4
60 ENDIF
2.4
>RUN
2.4
Wrong!
2.4
Å MODE3/6 gaps Ö There is an undocumented difference between the way
that the gaps between lines are coloured in the 25-row modes. In modes 3
and 6, the gaps are the border colour and in modes 11, 14 and 17, they
are the background colour.
2.4
By experimenting with SWIöOS_ReadMode Variableò, I discovered that bit 3
of variable 0 (Modeflags) indicates the condition. If the bit is set to
0, the gaps will be background colour and if 1 they are border colour,
thus:
2.4
10 For mode%=0 TO 17
2.4
20 MODE mode%
2.4
30 VDU 10,0,24,128,0|
2.4
40 SYSöOS_ReadModeVariableò
2.4
,MODE,0 TO ,,modeflag%
2.4
50 PRINT öMode= ò;MODE
2.4
60 IF (modeflag% AND (1<<3))
2.4
<>0 THEN t$=öBorderò ELSE t$=öBackgroundò
2.4
70 IF (modeflag% AND (1<<2))
2.4
<>0 THEN t$=öNoò
2.4
80 PRINT t$;ö gapsò
2.4
90 wait%=GET
2.4
100 NEXT
2.4
Å Auto linefeed Ö Some software packages, like First Word Plus for
instance, insist that you set your printer so that it does not generate
auto-matic linefeeds. This means that if you list a BASIC program with
lines that are longer than the carriage length, the line wraps round and
is overprinted. To avoid this and the difficulty of fiddling with dip
switches, use the BASIC command WIDTH before printing. To do this, type
WIDTH <carriage length> (e.g. WIDTH 80) before printing and WIDTH 0 to
reset to the default setting after printing.
2.4