Author Topic: locate statments  (Read 4255 times)

0 Members and 1 Guest are viewing this topic.

Offline badger

  • Forum Regular
  • Posts: 148
    • View Profile
locate statments
« on: September 25, 2020, 07:36:10 pm »
Hello

i am writing some code learning qb64 from qb4.5. I noticed that to make the locate statements to work as needed i have to put a simi colon at the end of each print statement. is this correct

Badger

Offline bplus

  • Global Moderator
  • Forum Resident
  • Posts: 8053
  • b = b + ...
    • View Profile
Re: locate statments
« Reply #1 on: September 25, 2020, 07:43:46 pm »
LOCATE is actually a different statement from PRINT

PRINT allows: nothing, semi-colon and comma depending if you want the cursor on the next line (nothing), the cursor right where it left of (semi colon) and tabbed (on same line if fits) use comma. By cursor I mean the start of the next PRINT unless LOCATE redirects the cursor = next print location.

Usually good to use semi colon with allot of LOCATE and PRINT statements to avoid scrolling near end of screen or font changing to _FONT 8 from default 16.

Welcome to the forum! @badger
« Last Edit: September 25, 2020, 07:46:41 pm by bplus »

Offline badger

  • Forum Regular
  • Posts: 148
    • View Profile
Re: locate statments
« Reply #2 on: September 25, 2020, 07:48:31 pm »
Hello

Thanks for the fast response. I went crazy tying to figure out what was happing i use locate statement to put the curser ware i wanted but it all went to the next line. just put in a semi colon and it worked just saying

Badger

Offline SMcNeill

  • QB64 Developer
  • Forum Resident
  • Posts: 3972
    • View Profile
    • Steve’s QB64 Archive Forum
Re: locate statments
« Reply #3 on: September 25, 2020, 07:49:21 pm »
Hello

i am writing some code learning qb64 from qb4.5. I noticed that to make the locate statements to work as needed i have to put a simi colon at the end of each print statement. is this correct

Badger

This is correct, if you’re printing down onto the bottom two rows of the screen.  Without that semi-colon, the screen will automatically scroll up for you.

For anywhere else, it’s not really necessary, unless you just wish for your print position to be directly at the end of your last print command; otherwise it’ll move automatically to the next line.
https://github.com/SteveMcNeill/Steve64 — A github collection of all things Steve!

Offline badger

  • Forum Regular
  • Posts: 148
    • View Profile
Re: locate statments
« Reply #4 on: September 25, 2020, 07:53:05 pm »
Hello

yes you may smack me i did read the fact that you said the last rows i see now that answers some questions i have had since my days with quick basic .

Thank you very very much.

Badger

Offline SpriggsySpriggs

  • Forum Resident
  • Posts: 1145
  • Larger than life
    • View Profile
    • GitHub
Re: locate statments
« Reply #5 on: September 26, 2020, 12:37:24 pm »
Hello @badger
Welcome to the forum!
Shuwatch!

Offline badger

  • Forum Regular
  • Posts: 148
    • View Profile
Re: locate statments
« Reply #6 on: September 26, 2020, 01:17:25 pm »
Hello

Thanks for the welcome.

Badger