You can only LOCATE within the character cells of the screen.
One point of quirkiness which you may not be aware of, Bplus: That statement isn't correct in 100% of all cases.
LOCATE with a variable-width font, and there's no set character cells to reference. Instead, you LOCATE X-pixels width, Y-rows down. (It's not row/column, and it's not pixel/pixel reference; it's a hybrid pixel/row reference.)
Of course, SCREEN 0 (which is all that's referenced by default in the original code) won't even work with variable-width fonts at all, so for most folks it's a moot distinction. ;)
Title: Re: Problem with locate command
Post by: TempodiBasic on August 27, 2020, 01:21:36 pm
WHILE Bplus AND SMcNeill give the right tecnical informations I must add this one your code posted is a QBasic/QB way to use screen mode in console state or in other words your code
because in QBasic/QB if you don't specify the screen mode that , for default, it is the console screen only text 80x25, 31 foreground colors and 7 background colors (32 and 8 if you include the black). QB64 emulates QB so you get the same error! But this syntax must be deprecated if we must give more importance to QB64 than Qbasic/QB, in fact in QB64 you should write so
Title: Re: Problem with locate command
Post by: MWheatley on August 28, 2020, 10:54:10 am
I'd add that LOCATE has for me always been a difficult command in terms of code compatibility: different BASICs implement it in different ways. I once ported some regularly-used statistics calculations over to Liberty BASIC, in the days before QB64 (or at least, before I discovered QB64).
Liberty BASIC implements LOCATE the other way round -- ie, not LOCATE x, y but instead LOCATE y, x...! Which to me is crazy. When I gave up on Liberty BASIC (I felt ripped off on licensing too, which didn't help), I had to convert everything back.
So use LOCATE with caution, is my advice.
Malcolm
Title: Re: Problem with locate command
Post by: Petr on August 28, 2020, 11:46:21 am
None problems with LOCATE. First set your text screen to correct values. Locate use is LOCATE ROW, COLUMN