Author Topic: Is it possible to use 'Locate' command with x,y rather than y.x ?  (Read 2282 times)

0 Members and 1 Guest are viewing this topic.

Offline ncc17o1a

  • Newbie
  • Posts: 2
    • View Profile
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?

Offline Richard Frost

  • Seasoned Forum Regular
  • Posts: 316
  • Needle nardle noo. - Peter Sellers
    • View Profile
Re: Is it possible to use 'Locate' command with x,y rather than y.x ?
« Reply #1 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.
It works better if you plug it in.

Offline bplus

  • Global Moderator
  • Forum Resident
  • Posts: 8053
  • b = b + ...
    • View Profile
Re: Is it possible to use 'Locate' command with x,y rather than y.x ?
« Reply #2 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.  

Offline OldMoses

  • Seasoned Forum Regular
  • Posts: 469
    • View Profile
Re: Is it possible to use 'Locate' command with x,y rather than y.x ?
« Reply #3 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.

Offline bplus

  • Global Moderator
  • Forum Resident
  • Posts: 8053
  • b = b + ...
    • View Profile
Re: Is it possible to use 'Locate' command with x,y rather than y.x ?
« Reply #4 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