Business



* Spectrum 48K * C. Eyssautier



Business is a program written to help with statistics. It

has four separate routines - Block bars, three-dimensional

histogram where values can be entered and a graph drawn

from the data; Graphics, which is the same as Block bars

except that a more precise graphic chart is drawn; Pie

chart, giving values in percentages which enables the

figures to be compared as proportions; and Complex bars,

another 3D histogram which allows it to be divided into

several parts to analyse different sections in more detail

and compare them to the other parts of the graph.

  The program is fast and useful for anyone who works with

figures.



[This program was published in Your Computer in December

1986, at which time that publication had acquired the

charming habit of publishing only the Basic part of a

program, and leaving out any machine code which might be

needed. Obviously, this causes some problems; luckily, in

this case, the gaps were relatively easy to fill.

  The REM statement in line 5000 gives some useful clues.

"Save" and "Load" are routines which, it is clear from

their use, store and retrieve the screen. Well, there is

only one reasonable way to write such a routine, and that

way is, in fact, 12 bytes long, exactly as long as "Save"

and "Load" are supposed to be. So there is no doubt as to

the correctness of this part.

  "Fade Out", it appears, clears the screen, probably in a

fancy way. A quick search on World of Spectrum turned up

a routine published earlier that year in ZX Computing

which does exactly that, is called "Fade Out", and is also

precisely the required number of bytes long. It would have

been a bit naughty of Mr. Eyssautier to use someone else's

routine from ZX Computing in a program published under his

own name in Your Computer, but it fits exactly, so in Mr.

Waters' routine goes.

  The final bit is "Bold Screen". Unfortunately I can't

find an existing routine by that name. It wasn't hard to

write one, though, and what do you know, once I'd remem-

bered that RRA is one byte shorter than SRA A, that, too,

fit exactly into the required memory. It's still the bit

of whose authenticity I'm least certain, but at least it

does what it ought to do in the space it ought to take.



If none of this convinces, it's all easy to take out. All

of this machine code is only used for cosmetic effects. 

Calls to "Bold Screen" can be omitted altogether; those

to "Fade Out" can be replaced by CLS. The program will

be a bit less pretty, that's all. "Save" and "Load" are

used to quickly store and replace the main menu; if you

omit these, line 3045 will have to jump to 2000 to redraw

it entirely, but all that results in is a delay, nothing

worse.

                               Richard Bos, October 2012. ]