home *** CD-ROM | disk | FTP | other *** search
/ Archive Magazine 1996 / ARCHIVE_96.iso / text / hints / volume_02 / issue_04 < prev    next >
Text File  |  1995-02-16  |  5KB  |  140 lines

  1. H & T are a bit thin on the ground this month because this issue is
  2. being finished before Christmas so I get some time off and itæs only a
  3. couple of weeks since I closed the December issue, so not much has come
  4. in yet. Most of the H & T that we have got were sent in by Anton Carver.
  5. Thanks Anton!
  6.  
  7. 2.4
  8. Å   Using function keys Ö If you want to get the function keys to
  9. produce ASCII codes, say, 200, 201, 202 etc, you use *FX 225,200 but
  10. this only works for keys <f0> (the print key) to <f9>. If you want to
  11. use <f10> upwards, you need to use *FX 221,200. This also makes <insert>
  12. into the equivalent of <f13> i.e. it generates, in this case, ASCII 213.
  13. 2.4
  14. Å   Troubles with Mitsubishi Drives? Ö Yes, there are problems with some
  15. of the new 5.25ò Mitsubishi drives with some of the 5.25ò disc inter
  16. faces, but they can be solved. The problem is the use of pin 2 on the
  17. interface. It was not used on the BBC micro, but on the new Mitsubishi
  18. drives it is used for DC interrupt. The solution is to put a little bit
  19. of masking tape on the edge connector inside the drive mechanism so that
  20. it doesnæt make contact with the p.c.b. Pin 2 is on the top of the board
  21. at the outside edge.
  22. 2.4
  23. Å   Programmable reset Ö A hang-over from the BBC micro is that if you
  24. program function key 10, you will find that if you press <reset>,
  25. function key 10 will be executed! If you donæt know about this, it can
  26. come as something of a shock, but it could be that you would want to
  27. make use of it if you were, say, developing a machine code program which
  28. kept hanging up the machine and forcing you to press <reset>. You could
  29. program it as *KEY 10 *BASIC|MOLD|MEDIT .|M and it would jump you back
  30. into editing the program at the point where you were.
  31. 2.4
  32. Å   Is it still going? Ö If you are doing some heavy machine code
  33. programming and want to know if the computer is still working or whether
  34. you have locked it up completely, try pressing the caps lock and/or
  35. scroll lock keys and if they are still responding, your computeræs not
  36. dead yet! The caps and scroll lock LEDæs are controlled by the computer
  37. in response to the key presses, so if they are working, it tells you
  38. that the processor is still reponding to interrupts.
  39. 2.4
  40. Å   Using ARMBE Ö It is useful to be able to enter ARMBE at the point of
  41. the last error. Here is a program which sets up function key 4 so that
  42. it enters ARMBE at the point where the error occurred or, if no error
  43. then it enters where you were last editing by using öEDIT .ò.
  44. 2.4
  45. 10 *set key$edit IF ERL=0 THEN OSCLI (|öKEY 4 *FIXKEY4||mEDIT . ||m|ò)
  46. ELSE OSCLI(|öKEY 4 *FIXKE Y4||mEDIT |ò + STR$(ERL) + |ö||m |ò)|mMISTAKE
  47. |m*FX138,0,132|m
  48. 2.4
  49. 20 *set alias$fixkey4 set key$4 |<key$edit>
  50. 2.4
  51. 30 *fixkey4
  52. 2.4
  53. Å   REMæs Ö Although the User Guide says that REM statements are ignored
  54. by BASIC, this is not completely true in BASIC V. This is because the
  55. block conditional IF╔THEN╔ELSE╔ ENDIF requires the THEN to be the last
  56. statement on the line. Adding a REM to the end of the line will change
  57. the flow of control, thus:
  58. 2.4
  59. >LIST
  60. 2.4
  61.  10 OK%=TRUE
  62. 2.4
  63.  20 IF NOT OK% THEN
  64. 2.4
  65.  30   PRINT öWrong!ò
  66. 2.4
  67.  40 ELSE
  68. 2.4
  69.  50   PRINT öRightò
  70. 2.4
  71.  60 ENDIF
  72. 2.4
  73. >RUN
  74. 2.4
  75. Right
  76. 2.4
  77. >LIST
  78. 2.4
  79.  10 OK%=TRUE
  80. 2.4
  81.  20 IF NOT OK% THEN :REM Danger!
  82. 2.4
  83.  30   PRINT öWrong!ò
  84. 2.4
  85.  40 ELSE
  86. 2.4
  87.  50   PRINT öRightò
  88. 2.4
  89.  60 ENDIF
  90. 2.4
  91. >RUN
  92. 2.4
  93. Wrong!
  94. 2.4
  95. Å   MODE3/6 gaps Ö There is an undocumented difference between the way
  96. that the gaps between lines are coloured in the 25-row modes. In modes 3
  97. and 6, the gaps are the border colour and in modes 11, 14 and 17, they
  98. are the background colour.
  99. 2.4
  100. By experimenting with SWIöOS_ReadMode Variableò, I discovered that bit 3
  101. of variable 0 (Modeflags) indicates the condition. If the bit is set to
  102. 0, the gaps will be background colour and if 1 they are border colour,
  103. thus:
  104. 2.4
  105.  10 For mode%=0 TO 17
  106. 2.4
  107.  20   MODE mode%
  108. 2.4
  109.  30   VDU 10,0,24,128,0|
  110. 2.4
  111.  40   SYSöOS_ReadModeVariableò
  112. 2.4
  113. ,MODE,0 TO ,,modeflag%
  114. 2.4
  115.  50   PRINT öMode= ò;MODE
  116. 2.4
  117.  60   IF (modeflag% AND (1<<3))
  118. 2.4
  119. <>0 THEN t$=öBorderò ELSE t$=öBackgroundò
  120. 2.4
  121.  70   IF (modeflag% AND (1<<2))
  122. 2.4
  123. <>0 THEN t$=öNoò
  124. 2.4
  125.  80   PRINT t$;ö gapsò
  126. 2.4
  127.  90   wait%=GET
  128. 2.4
  129. 100 NEXT
  130. 2.4
  131. Å   Auto linefeed Ö Some software packages, like First Word Plus for
  132. instance, insist that you set your printer so that it does not generate
  133. auto-matic linefeeds. This means that if you list a BASIC program with
  134. lines that are longer than the carriage length, the line wraps round and
  135. is overprinted. To avoid this and the difficulty of fiddling with dip
  136. switches, use the BASIC command WIDTH before printing. To do this, type
  137. WIDTH <carriage length> (e.g. WIDTH 80) before printing and WIDTH 0 to
  138. reset to the default setting after printing.
  139. 2.4
  140.