home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Archive Magazine 1997
/
ARCHIVE_97.iso
/
text
/
hints
/
vol_04
/
issue_12
< prev
Wrap
Text File
|
1995-02-16
|
7KB
|
211 lines
Hints and Tips
4.12
Å Basic line lengths revisited (Archive 4.10 p7) Ö The Basic line input
buffer is 238 characters and so this is the most you can type in from
the Basic prompt. Once entered, this line is tokenised before being
stored as part of a program. Most of the keywords are reduced to only
one byte, so the line ends up taking up much less room in a program. The
maximum length for a line in a program is 255 bytes, but four of these
bytes have special purposes (one is a line terminator, one the line
length and two the line number). This leaves 251 bytes for the rest of
the line. So whatæs the point in allowing bigger lines in the program if
you canæt type them in? Well, you can by being devious. Try typing the
following at the Basic prompt:
4.12
10E.:E.:E.: etc
4.12
until you hit the line limit and then press Return. Listing your program
now should reveal:
4.12
10ENDPROC:ENDPROC:ENDPROC: etc
4.12
up to a length of about 790 characters! This line is perfectly valid and
would run OK (although I canæt think of a program where 79 ENDPROCs in a
row would be useful!) but is much too long to edit at the Basic prompt
or in the Basic Editor. It wouldnæt be sensible for the Basic Editor to
limit you to 251 characters since, once tokenised, your line would be
much shorter, so it allows you to type up to 369 characters hoping that
tokenising will bring it back to 251. It objects if you try to type in
more than 369 characters; it also objects if you type a shorter line
which would be longer than 251 characters once tokenised (try REM
followed by 300 letters). As for solving the problem, if you have a copy
of Twin, you could try loading your Basic program into it. Twin has no
line length limit and will cope with anything. Returning to Basic will
always work provided the resulting tokenised lines would be no longer
than 251 characters. Lorcan Mongey
4.12
Å Citizen printer spare parts Ö You may be interested to know that you
can get spare parts for Citizen printers from XMA Ltd, Ruddington Lane,
Wilford, Nottingham, NG11 7EP. (0602 Ö818222) Rob Brown, Tadworth,
Surrey.
4.12
Å Fatal error type = 5 Ö !Edit will report this error if you have too
many outline fonts in your !Fonts folder. This will prevent you from
editing any documents within !Edit. The following Basic program will
solve this problem by hiding the !Fonts folder before running !Edit and
then restoring it once !Edit has been run.
4.12
1. Rename the É!RunImageæ file inside the É!Editæ folder as ÉEditImageæ.
4.12
2. Type the following program in and then save it as É!RunImageæ in the
É!Editæ folder.
4.12
REM ><Edit$Dir>.!RunImage
4.12
SYS öWimp_Initialiseò,200,&4B534154, öEditStartò TO ,taskid%
4.12
*Set temp <Font$Prefix>
4.12
*UnSet Font$Prefix
4.12
*WimpSlot -min 160k -max 160k
4.12
*WimpSlot -min 160k
4.12
SYS öWimp_StartTaskò,öRun <Edit$Dir> .EditImage ò+FNenv_string
4.12
*Set Font$Prefix <temp>
4.12
*Unset temp
4.12
SYS öWimp_CloseDownò,,taskid% ,&4B534154
4.12
END
4.12
4.12
DEFFNenv_string
4.12
LOCAL env$,x%
4.12
SYS öOS_GetEnvò TO env$
4.12
IF LEN(env$)<6 THEN =öò
4.12
WHILE INSTR(env$,ö ò,x%)>0
4.12
x%=INSTR(env$,ö ò,x%)+1
4.12
ENDWHILE
4.12
=RIGHT$(env$,LEN(env$)-x%+1)
4.12
Å Locating the I/O podule (a SWI number change) Ö Those writing code
for the I/O podule for use on different machines should note that Acorn
made a SWI number change between version 1.04 and 1.06 of the software
(use *Help Modules to find what version you have). Earlier issues of the
podule use &4043F for SWI öI/O _Podule_Hardwareò whereas the later
versions use &40500. ARM code assembled on a machine with one version of
the software will not work on another machine with a different version
without changing this SWI number. Richard House, Surrey.
4.12
Å PC screen fonts Ö If you are not overly fond of the chunky IBM
character set in the PC emulator, the following few lines of Basic will
modify the emulator ROM file with the BBC font of your choice.
4.12
REM >PCFONT
4.12
REM Merge BBC FONT file into !PC ROM file
4.12
REM N.B. *** COPY ORIGINAL ROM FILE BEFORE RUNNING THIS ***
4.12
:
4.12
DIM rom% &2000 : offset%=&166E
4.12
R$=ö:4.$.!PC.ROMò
4.12
OSCLI(öLoad ò+R$+ö ò+STR$~rom%)
4.12
A%=OPENIN(R$) : r1%=EXT#A% : CLOSE#A%
4.12
:
4.12
F%=OPENIN(ö4:.BBCFONTS.NEWFONTò) : REM file of type &FF7
4.12
REPEAT
4.12
A%=BGET#F%
4.12
IF A%<>23 THEN PRINT öThis is not a BBC font file!ò : END
4.12
C%=BGET%F%
4.12
FOR I%=0 TO 7
4.12
rom%?(offset%+((C%+128) MOD 256) *8+ I%)=BGET#F%
4.12
NEXT I%
4.12
UNTIL EOF#F%
4.12
CLOSE#F%
4.12
:
4.12
OSCLI(öSave ò+R$+ö òSTR$~rom%+ ö + ò+STR$~r1%)
4.12
END
4.12
This program has been used successfully on the ROM files supplied with
version 1.33 and the latest 1.60 (large and small) Ö each version stores
its VDU 23 character definitions from offset &166E onwards. Pete Bready,
Glasgow.
4.12
Å Impression Junior styles? Ö In the June 1991 edition of Archive, it
was pointed out that Impression Junior does not have styles. Although it
does not have styles, it does have rulers. These are intended to define
margins and tab-stops, but they can be used for other things.
4.12
If you save a text story with effects, you will see the definition of a
ruler, which looks like:
4.12
4.12
There will also be the definition of the BaseStyle, which contains a
number of additional commands. By copying some of these to the ruler
definition, you can create the equivalent of a style. As an example, a
Éstyleæ that changes the font of the text subject to the ruler to greek,
could be, for example:
4.12
4.12
As Impression Junior does not have the facility to create rulers with
these extensions, they must be written using an ordinary text editor
(such as !Edit) and imported into Impression where they become rulers.
4.12
The commands that I know work are:
4.12
font <font name> Ö e.g. Greek, Trinity.Medium, etc
4.12
fontsize <size>pt Ö 8 to 20 is reasonable
4.12
fontaspect <size>% Ö
100 normal, 200 stretches to twice size
4.12
fontcolour rgb = (<n>,<n>,<n>) Ö n is from 0 to 1 or 0 to 100 (both
appear to work)
4.12
linecolour rgb = (<n>,<n>,<n>) Ö as above
4.12
justify [left, right, centre, full] Ö full is to both margins
4.12
underline [0,1] Ö other
values also work but give strange underline
4.12
strikeout [on, off] Ö
writes É-æ over characters
4.12
script [off, sub, super] Ö
sub and super-scripts
4.12
leader ö<text>ò Ö overwrites
tab character
4.12
By using these additional commands, it is possible to generate some very
useful rulers.
4.12
Simon Callan, Borehamwood.ááA
4.12