home *** CD-ROM | disk | FTP | other *** search
/ Archive Magazine 1995 / ARCHIVE95.iso / text / hints / volume_04 / issue_12 < prev   
Text File  |  1995-02-16  |  7KB  |  211 lines

  1. Hints and Tips
  2. 4.12
  3. Å   Basic line lengths revisited (Archive 4.10 p7) Ö The Basic line input
  4. buffer is 238 characters and so this is the most you can type in from
  5. the Basic prompt. Once entered, this line is tokenised before being
  6. stored as part of a program. Most of the keywords are reduced to only
  7. one byte, so the line ends up taking up much less room in a program. The
  8. maximum length for a line in a program is 255 bytes, but four of these
  9. bytes have special purposes (one is a line terminator, one the line
  10. length and two the line number). This leaves 251 bytes for the rest of
  11. the line. So whatæs the point in allowing bigger lines in the program if
  12. you canæt type them in? Well, you can by being devious. Try typing the
  13. following at the Basic prompt:
  14. 4.12
  15. 10E.:E.:E.: etc
  16. 4.12
  17. until you hit the line limit and then press Return. Listing your program
  18. now should reveal:
  19. 4.12
  20. 10ENDPROC:ENDPROC:ENDPROC: etc
  21. 4.12
  22. up to a length of about 790 characters! This line is perfectly valid and
  23. would run OK (although I canæt think of a program where 79 ENDPROCs in a
  24. row would be useful!) but is much too long to edit at the Basic prompt
  25. or in the Basic Editor. It wouldnæt be sensible for the Basic Editor to
  26. limit you to 251 characters since, once tokenised, your line would be
  27. much shorter, so it allows you to type up to 369 characters hoping that
  28. tokenising will bring it back to 251. It objects if you try to type in
  29. more than 369 characters; it also objects if you type a shorter line
  30. which would be longer than 251 characters once tokenised (try REM
  31. followed by 300 letters). As for solving the problem, if you have a copy
  32. of Twin, you could try loading your Basic program into it. Twin has no
  33. line length limit and will cope with anything. Returning to Basic will
  34. always work provided the resulting tokenised lines would be no longer
  35. than 251 characters. Lorcan Mongey
  36. 4.12
  37. Å   Citizen printer spare parts Ö You may be interested to know that you
  38. can get spare parts for Citizen printers from XMA Ltd, Ruddington Lane,
  39. Wilford, Nottingham, NG11 7EP. (0602 Ö818222) Rob Brown, Tadworth,
  40. Surrey.
  41. 4.12
  42. Å   Fatal error type = 5 Ö !Edit will report this error if you have too
  43. many outline fonts in your !Fonts folder. This will prevent you from
  44. editing any documents within !Edit. The following Basic program will
  45. solve this problem by hiding the !Fonts folder before running !Edit and
  46. then restoring it once !Edit has been run.
  47. 4.12
  48. 1. Rename the É!RunImageæ file inside the É!Editæ folder as ÉEditImageæ.
  49. 4.12
  50. 2. Type the following program in and then save it as É!RunImageæ in the
  51. É!Editæ folder.
  52. 4.12
  53. REM ><Edit$Dir>.!RunImage
  54. 4.12
  55. SYS öWimp_Initialiseò,200,&4B534154, öEditStartò TO ,taskid%
  56. 4.12
  57. *Set temp <Font$Prefix>
  58. 4.12
  59. *UnSet Font$Prefix
  60. 4.12
  61. *WimpSlot -min 160k -max 160k
  62. 4.12
  63. *WimpSlot -min 160k
  64. 4.12
  65. SYS öWimp_StartTaskò,öRun <Edit$Dir> .EditImage ò+FNenv_string
  66. 4.12
  67. *Set Font$Prefix <temp>
  68. 4.12
  69. *Unset temp
  70. 4.12
  71. SYS öWimp_CloseDownò,,taskid% ,&4B534154
  72. 4.12
  73. END
  74. 4.12
  75.  
  76. 4.12
  77. DEFFNenv_string
  78. 4.12
  79. LOCAL env$,x%
  80. 4.12
  81. SYS öOS_GetEnvò TO env$
  82. 4.12
  83. IF LEN(env$)<6 THEN =öò
  84. 4.12
  85. WHILE INSTR(env$,ö ò,x%)>0
  86. 4.12
  87. x%=INSTR(env$,ö ò,x%)+1
  88. 4.12
  89. ENDWHILE
  90. 4.12
  91. =RIGHT$(env$,LEN(env$)-x%+1)
  92. 4.12
  93. Å    Locating the I/O podule (a SWI number change) Ö Those writing code
  94. for the I/O podule for use on different machines should note that Acorn
  95. made a SWI number change between version 1.04 and 1.06 of the software
  96. (use *Help Modules to find what version you have). Earlier issues of the
  97. podule use &4043F for SWI öI/O _Podule_Hardwareò whereas the later
  98. versions use &40500. ARM code assembled on a machine with one version of
  99. the software will not work on another machine with a different version
  100. without changing this SWI number. Richard House, Surrey.
  101. 4.12
  102. Å   PC screen fonts Ö If you are not overly fond of the chunky IBM
  103. character set in the PC emulator, the following few lines of Basic will
  104. modify the emulator ROM file with the BBC font of your choice.
  105. 4.12
  106. REM >PCFONT
  107. 4.12
  108. REM Merge BBC FONT file into !PC ROM file
  109. 4.12
  110. REM N.B. *** COPY ORIGINAL ROM FILE BEFORE RUNNING THIS ***
  111. 4.12
  112. :
  113. 4.12
  114. DIM rom% &2000 : offset%=&166E
  115. 4.12
  116. R$=ö:4.$.!PC.ROMò
  117. 4.12
  118. OSCLI(öLoad ò+R$+ö ò+STR$~rom%)
  119. 4.12
  120. A%=OPENIN(R$) : r1%=EXT#A% : CLOSE#A%
  121. 4.12
  122. :
  123. 4.12
  124. F%=OPENIN(ö4:.BBCFONTS.NEWFONTò) : REM file of type &FF7
  125. 4.12
  126. REPEAT
  127. 4.12
  128. A%=BGET#F%
  129. 4.12
  130. IF A%<>23 THEN PRINT öThis is not a BBC font file!ò : END
  131. 4.12
  132. C%=BGET%F%
  133. 4.12
  134. FOR I%=0 TO 7
  135. 4.12
  136. rom%?(offset%+((C%+128) MOD 256) *8+ I%)=BGET#F%
  137. 4.12
  138. NEXT I%
  139. 4.12
  140. UNTIL EOF#F%
  141. 4.12
  142. CLOSE#F%
  143. 4.12
  144. :
  145. 4.12
  146. OSCLI(öSave ò+R$+ö òSTR$~rom%+ ö + ò+STR$~r1%)
  147. 4.12
  148. END
  149. 4.12
  150. This program has been used successfully on the ROM files supplied with
  151. version 1.33 and the latest 1.60 (large and small) Ö each version stores
  152. its VDU 23 character definitions from offset &166E onwards. Pete Bready,
  153. Glasgow.
  154. 4.12
  155. Å   Impression Junior styles? Ö In the June 1991 edition of Archive, it
  156. was pointed out that Impression Junior does not have styles. Although it
  157. does not have styles, it does have rulers. These are intended to define
  158. margins and tab-stops, but they can be used for other things.
  159. 4.12
  160. If you save a text story with effects, you will see the definition of a
  161. ruler, which looks like:
  162. 4.12
  163.  
  164. 4.12
  165. There will also be the definition of the BaseStyle, which contains a
  166. number of additional commands. By copying some of these to the ruler
  167. definition, you can create the equivalent of a style. As an example, a
  168. Éstyleæ that changes the font of the text subject to the ruler to greek,
  169. could be, for example:
  170. 4.12
  171.  
  172. 4.12
  173. As Impression Junior does not have the facility to create rulers with
  174. these extensions, they must be written using an ordinary text editor
  175. (such as !Edit) and imported into Impression where they become rulers.
  176. 4.12
  177. The commands that I know work are:
  178. 4.12
  179. font <font name>   Ö e.g. Greek, Trinity.Medium, etc
  180. 4.12
  181. fontsize <size>pt   Ö 8 to 20 is reasonable
  182. 4.12
  183. fontaspect <size>%      Ö
  184. 100 normal, 200 stretches to twice size
  185. 4.12
  186. fontcolour rgb = (<n>,<n>,<n>)  Ö n is from 0 to 1 or 0 to 100 (both
  187. appear to work)
  188. 4.12
  189. linecolour rgb = (<n>,<n>,<n>)  Ö as above
  190. 4.12
  191. justify [left, right, centre, full]  Ö full is to both margins
  192. 4.12
  193. underline [0,1]      Ö other
  194. values also work but give strange underline
  195. 4.12
  196. strikeout [on, off]      Ö
  197. writes É-æ over characters
  198. 4.12
  199. script [off, sub, super]      Ö
  200. sub and super-scripts
  201. 4.12
  202. leader ö<text>ò      Ö overwrites
  203. tab character
  204. 4.12
  205. By using these additional commands, it is possible to generate some very
  206. useful rulers.
  207. 4.12
  208. Simon Callan, Borehamwood.ááA
  209. 4.12
  210.    
  211.