[net.micro.hp] Graphics bug in series 200 Basic

carlc@teklabs.UUCP (Carl Clawson ) (03/28/84)

<munch munch>

Okay, okay!  Please excuse the flame.  I have since discovered
the proper place for such.  And I WAS a bit too hard on HP Basic.
It is a reasonably powerful language, but with that power comes
a level of debugging difficulty that far exceeds that of generic
Basic.  And, let's face it, software is easy to hate; documentation
even more so.

Now how about some positive information content?  The noxious bug
in BASIC 2.0 which triggered my splenetic venting is as follows.
(Not to imply we haven't had other problems...)  The program

	10  OPTION BASE 1
	20  GINIT
	30  GRAPHICS ON
	40  GCLEAR
	50  MOVE 65,50
	60  RPLOT 50,50,-1
	70  END

works fine and draws a nice line on our CRT.  Now we merely insert
the line

	31  DIM X(100),Y(100),Z(100)

(which would not appear to be related to anything else in this program);
no line gets drawn and we get the message:

	"ERROR 16 IN 60  Improper dimensions"

It seems simple, but this is a distilled version of a glitch that
ate up more programmer's time than I care to remember.

Now, for fun, just change line 31 so the array names are "A,B,C" rather
than "X,Y,Z" and it works!  It would appear that the names "X,Y,Z"
are somehow sacred to the graphics package.  I can't believe
this was intended and I certainly haven't seen it mentioned
in the manuals.  Has anyone else seen this or similar stuff?

carlc@teklabs.UUCP (Carl Clawson ) (04/03/84)

< ouch >
I should add the following info to my previous note:

1) It was found on an HP9816 with 768K memory.
2) The BASIC system disk is "98611A Opt 630".

Further distillation of the bug has resulted in a 3-liner:

	10 DIM Z(100)
	20 RPLOT 50,50,-1
	30 END

So it's "Z" that's the culprit!  Of course the lack of GINIT, etc
could make this program behave erratically, but it does demonstrate
the bug.  We have also reproduced this bug on another 9816 running
BASIC 2.1.  We will be informing HP about this in case they aren't
REALLY listening.