QB64.org Forum

Active Forums => QB64 Discussion => Topic started by: ncc17o1a on August 06, 2021, 03:36:42 pm

Title: Is it possible to use 'Locate' command with x,y rather than y.x ?
Post by: ncc17o1a on August 06, 2021, 03:36:42 pm
Frustratingly, any basic I've used in the past, the 'Locate' command has always been used with the 'x' value first rather than the QB64 way of y,x which really annoying. Is it possible to change this or it a case of just having to work with it the way it is?
Title: Re: Is it possible to use 'Locate' command with x,y rather than y.x ?
Post by: Richard Frost on August 06, 2021, 04:15:55 pm
LOCATE uses row and column, and QB64 uses it the same way as QBASIC or QB4.5.

Use _PRINTSTRING for x & y positioning.
Title: Re: Is it possible to use 'Locate' command with x,y rather than y.x ?
Post by: bplus on August 06, 2021, 04:27:11 pm
Here try my locake sub:
Code: QB64: [Select]
  1. For i = 1 To 20
  2.     For j = 1 To 8
  3.         Locake j * 8, i: Print j * 8;
  4.     Next
  5. Sub Locake (col, row)
  6.     Locate row, col
  7.  
Title: Re: Is it possible to use 'Locate' command with x,y rather than y.x ?
Post by: OldMoses on August 08, 2021, 07:54:05 am
It's done for backwards compatibility. If it were switched, old QBasic/QuickBasic 4.5 code wouldn't render properly in QB64.

Yes, it is a PITA, but I take up my cross and follow QB64 because the advantages are legion.
Title: Re: Is it possible to use 'Locate' command with x,y rather than y.x ?
Post by: bplus on August 08, 2021, 10:55:13 am
Actually before QBasic, GW Basic was this way too
http://www.antonis.de/qbebooks/gwbasman/index.html