Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
BritLion's Putchars
#23
boriel Wrote:Having a standard is almost mandatory if you want your libraries easier to learn and adopt. I suggest you to use x, y (col, row) standard. PRINT uses y, x for Sinclair BASIC compatibility.
The "standard" (ok, there isn't any), is (x, y) for graphics, and (y, x) for text. Since your routines are graphic oriented, it's better to use (x, y) I think.

The thing is, in the Microsoft dialect, the one which QB, Visual Basic, freeBASIC and mostly ZX Basic follow also use (y, x) for character positioning and (x, y) for graphics positioning. Why is it? I've always found it strange.

I mean, the standard "LOCATE y, x: PRINT ..." works exactly like Sinclair's "PRINT AT y, x; ...". In the MS Basic dialect, the SCREEN function (somewhat equivalent to Sinclair BASIC's SCREEN$, but returning an integer value instead of a string) also takes (y, x) rather than (x, y). So the reversed order for text positioning is not the Sinclair BASIC interpreter designers' fault. It's common practice in all BASIC dialects.

Maybe this is reminiscent of the old teletype days. Maybe LOCATE was translated "on the fly" to control chars, so first Y, then X was more convenient. When BASIC was extended with graphical functions, maybe they considered it better to follow the cartesian order most used in maths by most scientists, that's (x, y).

Who knows? Big Grin
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 9 Guest(s)