Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers DBPro Corner / How to make the print command scroll down each line without going off screen

Author
Message
Zuluguy
15
Years of Service
User Offline
Joined: 3rd Aug 2009
Location:
Posted: 7th Aug 2009 15:45
Hello. I am having troubles with the print command. What happens is if i use one print command then if the text goes on for too long it will go off the screen. What i would like to do is to use the print command to scroll donw when it gets to the end of the screen or even near the end of the screen if possible, without using multiple print commands.

I have not posted any code because i believe this does not need code to be solved. If it needs code to be posted please tell me >.<
thanks
=PRoF=
21
Years of Service
User Offline
Joined: 17th Mar 2003
Location: Milton Keynes, UK
Posted: 7th Aug 2009 16:56
this might work (not at my pc at the mo to check)

Print "hello "+chr$(13)+"world"

Hope that helps

Without Music or Love the world would be a very empty place... Thank god I still have music.. --'-<@
Zuluguy
15
Years of Service
User Offline
Joined: 3rd Aug 2009
Location:
Posted: 7th Aug 2009 17:56
No unfortunatly it just printed it as it normaly would "Hello world"

I am guess it was meant to read..

"hello
World"

?
=PRoF=
21
Years of Service
User Offline
Joined: 17th Mar 2003
Location: Milton Keynes, UK
Posted: 7th Aug 2009 19:24
my bad, I just tried it on the laptop, and its sposed to be chr$(10)

That breaks the line in 2 lines

Was this not what u were trying to do?

Without Music or Love the world would be a very empty place... Thank god I still have music.. --'-<@
Grog Grueslayer
Valued Member
19
Years of Service
User Offline
Joined: 30th May 2005
Playing: Green Hell
Posted: 7th Aug 2009 20:23
You can use TEXT instead. It allows you to put in the specific x and y coordinates where you want the text to appear. There is also a CENTER TEXT command that will do the same thing but center the text on the x coordinate.

If you want to overwrite the previous text you can use SET TEXT OPAQUE at the top of your code and it'll write the background color of the text also.



Zuluguy
15
Years of Service
User Offline
Joined: 3rd Aug 2009
Location:
Posted: 7th Aug 2009 20:45
@ pRoF it was what i was trying to do thanks with the (13) it did not work but with the (10) it works great. although im not quite sure why. Can you tell me what this number means? does it mean 10 spaces or somthing?

@ Grog Grueslayer ahh yes this is good it will help me a little later with what im trying to do. it will make it so the text is not boring and in the same palce each time

Cheers to both of you >.<
=PRoF=
21
Years of Service
User Offline
Joined: 17th Mar 2003
Location: Milton Keynes, UK
Posted: 8th Aug 2009 00:02
chr$(10) and chr$(13) are both special characters, meaning line feed and carriage return. Altho I often get them the wrong way round! Lol

I'm sure someone more knowledgable than me can give you a better explanation.

Without Music or Love the world would be a very empty place... Thank god I still have music.. --'-<@
Zuluguy
15
Years of Service
User Offline
Joined: 3rd Aug 2009
Location:
Posted: 8th Aug 2009 02:45
Lol thanks again prof you have helped me a lot now.
Rudolpho
18
Years of Service
User Offline
Joined: 28th Dec 2005
Location: Sweden
Posted: 8th Aug 2009 10:46
I always use both; new line = chr$(13) + chr$(10) (the order is important too). That works with all text outputing commands I've encountered so far, while only using one of the two does not always.

Grog Grueslayer
Valued Member
19
Years of Service
User Offline
Joined: 30th May 2005
Playing: Green Hell
Posted: 8th Aug 2009 19:03
The control characters were mainly used for computers to talk to printers or other devices. Carriage Return would cause the printer to go to the next line and move the print head to the beginning of the line. Linefeed would just move to the next line without moving the print head. Printing most of the first 32 characters of the Ascii chart produce weird results because they really weren't meant for screen output.

The whole ascii chart:
http://mysite.verizon.net/grueslayer/AsciiChart.png

Zuluguy
15
Years of Service
User Offline
Joined: 3rd Aug 2009
Location:
Posted: 8th Aug 2009 19:51
ah ok thanks guys you have all been great to help me understand that

cheers
Indicium
16
Years of Service
User Offline
Joined: 26th May 2008
Location:
Posted: 23rd Aug 2009 01:01
This function helps me a great deal, please note it is not my code, i found it on the codebase, but i cant remember for the life of me who wrote it, but its very helpful.


Omricon W.I.P

Login to post a reply

Server time is: 2024-11-25 03:07:10
Your offset time is: 2024-11-25 03:07:10