print at x,y equivalent

SYS 64738
satpro

Re: print at x,y equivalent

Post by satpro » Wed May 07, 2014 12:48 pm

Shaun_B wrote:Hi Bert, you say we drink too much but then I hear that you can't have too much of a good thing... so who is right?

AJordison, I'll do some testing later. Unfortunately I was woken up early this morning by my daughter so I'm not braining very well at the moment.

Regards,

Shaun.
Who is right? I would say whoever you get your information from. ;) I have this picture in my head of you in a big fur going beyond the 'Great Wall' looking for action!



User avatar
Shaun_B
Member
Member
Posts: 179
Joined: Tue May 06, 2014 12:12 pm
Location: UK
Contact:

Re: print at x,y equivalent

Post by Shaun_B » Wed May 07, 2014 12:52 pm

satpro wrote:Who is right? I would say whoever you get your information from. ;) I have this picture in my head of you in a big fur going beyond the 'Great Wall' looking for action!
Not today - way too tired for anything like that.

Regards,

Shaun.
BASIC Programming - making the mistakes so that you don't have to.
Circles and Squares.
Nothing I post here will stand up in a court of law.

satpro

Re: print at x,y equivalent

Post by satpro » Wed May 07, 2014 1:47 pm

Yeah, it seemed like both of you guys were up late last night. Hey, I didn't mean to snag this topic. Arthur makes a good point. Timing it is the way to go. I know you can use VICE to do that, but maybe one of us can come up with something in 65x code, perhaps a CIA timing or something like that.

User avatar
Shaun_B
Member
Member
Posts: 179
Joined: Tue May 06, 2014 12:12 pm
Location: UK
Contact:

Re: print at x,y equivalent

Post by Shaun_B » Wed May 07, 2014 2:11 pm

Hmm... you'd know better than I would on the 65x side of things. I'll see if the test I have in mind is reliable enough tonight.

Regards,

Shaun.
BASIC Programming - making the mistakes so that you don't have to.
Circles and Squares.
Nothing I post here will stand up in a court of law.

metalfoot
Member
Member
Posts: 56
Joined: Sun Apr 13, 2014 8:22 pm
Location: Manitoba, Canada

Re: print at x,y equivalent

Post by metalfoot » Wed May 07, 2014 2:13 pm

Isn't there a slightly quicker one again using zero-page locations 209-214 to force the location of the cursor? I'll look it up and see if I can remember that trick

User avatar
buzbard
Member
Member
Posts: 22
Joined: Sun Apr 13, 2014 9:06 pm
Location: Washington State

Re: print at x,y equivalent

Post by buzbard » Fri May 16, 2014 2:36 pm

If you're looking for a way to "print" to the last screen position without "poking", try printing your last character to the space just before the last followed by a cursor-left and an insert.
Ray...
It's Ok if you don't agree with me, I can't force you to be right.

User avatar
Shaun_B
Member
Member
Posts: 179
Joined: Tue May 06, 2014 12:12 pm
Location: UK
Contact:

Re: print at x,y equivalent

Post by Shaun_B » Fri May 16, 2014 2:52 pm

buzbard wrote:If you're looking for a way to "print" to the last screen position without "poking", try printing your last character to the space just before the last followed by a cursor-left and an insert.
Top tip - I'll give it a try thanks.

Regards,

Shaun.
BASIC Programming - making the mistakes so that you don't have to.
Circles and Squares.
Nothing I post here will stand up in a court of law.

ibitato
Member
Member
Posts: 1
Joined: Mon Feb 08, 2016 1:12 pm

Re: print at x,y equivalent

Post by ibitato » Mon Feb 08, 2016 1:16 pm

Shaun_B wrote:Here's a quick example of how to do print to position x, y in basic:

Code: Select all

0 x$="{home}{right*39}":y$="{down*24}"
10 x=10:y=7: rem x is across and y is down
20 print left$(x$,x)right$(y$,y)"hello";
Please note that you are not able to print to the last character of the screen without forcing a new line. If you want a character to be written to the last screen position, you'll need to poke it there, like poke 2023,81 - I don't know if there's an advanced trick in basic that will stop a new line when printing to the last character position. Someone here may be able to answer that.

Regards,

Shaun.

Code: Select all

10 PRINT CHR$(147)
20 SP = 20: ZE = 3: A$ = "Good Morning!": GOSUB 1000: GOSUB 2000
30 SP = 10: ZE = 3: A$ = "I'm the Commodore 64": GOSUB 1000: GOSUB 2000
40 SP = 12: ZE = 6: A$ = "And what is your name ?": GOSUB 1000
100 END
1000 REM cursor positioning and printing
1010 POKE 211,SP :POKE 214, ZE: SYS 58640 : PRINT A$
1020 RETURN
2000 REM delay-loop
2010 FOR X=0 TO 3000: NEXT X
2020 RETURN

User avatar
Gyro Gearloose
Member
Member
Posts: 112
Joined: Sun Nov 15, 2015 5:20 am

Re: print at x,y equivalent

Post by Gyro Gearloose » Sun Oct 30, 2016 3:59 pm

What's wrong with using the SPC command?
You do not have the required permissions to view the files attached to this post.
The price one pays for pursuing any profession, or calling, is an intimate knowledge of its ugly side.

Post Reply Previous topicNext topic

Who is online

Users browsing this forum: No registered users and 1 guest