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 / Text Problem

Author
Message
Halo Man
18
Years of Service
User Offline
Joined: 5th Nov 2005
Location:
Posted: 3rd Dec 2005 04:53 Edited at: 3rd Dec 2005 04:54
Hello,

I'm writing an application where the text is constantly re-changing, and it is in the middle of the main loop. When its in the loop, it just constantly re-writes over it self and you cant see a thing. When i place it out of the loop it only shows the first digits. It would probably make since if i showed you the code



Does anyone know the answer to this? Thank you.


Dieses ist meine Unterschrift, sehr langweilig ist nicht es?
Grog Grueslayer
Valued Member
19
Years of Service
User Offline
Joined: 30th May 2005
Playing: Green Hell
Posted: 3rd Dec 2005 05:05 Edited at: 3rd Dec 2005 05:06
The command you're looking for is "set cursor" instead of "set text" (which doesn't exist by itself).

You can also make the text overwrite itself with "set text opaque" before the do/loop. It's better to use "str$(variable)" so it's easy to add blank spaces at the end... so if the number is lower than 3 digits you see it. If you don't add spaces it'll still have the numbers from the last number so it always looks like it's a 3 digit number.

TDK
Retired Moderator
21
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 3rd Dec 2005 06:45
Also, you might consider using the Text X,Y,String method rather than Print too.

I believe it's faster than print too...

TDK_Man

Sven B
19
Years of Service
User Offline
Joined: 5th Jan 2005
Location: Belgium
Posted: 3rd Dec 2005 09:27
Quote: "I believe it's faster than print too..."




Immunity and Annihalation makes Immunihalation...
Antidote
19
Years of Service
User Offline
Joined: 18th Mar 2005
Location: San Francisco, CA
Posted: 3rd Dec 2005 14:58
Although the print command is faster the text command has a lot more flexibility. set text font, set text size, etc... Also instead of having to do this


You just do this



Better yet this





SimSmall
20
Years of Service
User Offline
Joined: 7th Aug 2004
Location: United Kingdom
Posted: 3rd Dec 2005 15:59 Edited at: 3rd Dec 2005 16:00
Sven B has indeed proved that at least on my machine - it makes absolutely no difference



...maybe one day I'll finish a project
Sven B
19
Years of Service
User Offline
Joined: 5th Jan 2005
Location: Belgium
Posted: 3rd Dec 2005 16:15


Immunity and Annihalation makes Immunihalation...
SimSmall
20
Years of Service
User Offline
Joined: 7th Aug 2004
Location: United Kingdom
Posted: 3rd Dec 2005 16:28
perhaps I would get better results if run on my far better offlien machine, not this one that's built out of reject parts...

but seriously, your machine did 1000 loops autosync'd in 0.18 seconds? perhaps I need to upgrade my offline machine...

...maybe one day I'll finish a project
Halo Man
18
Years of Service
User Offline
Joined: 5th Nov 2005
Location:
Posted: 3rd Dec 2005 18:34
Oh sorry, i meant to put "set cursor"

Thank you everyone, it works great now!


Dieses ist meine Unterschrift, sehr langweilig ist nicht es?
TDK
Retired Moderator
21
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 4th Dec 2005 05:51
It does depend on the machine.

Sven's code gives me 94 for both Print and Text.

But Antidote is correct, Text is far more flexible and what's more, you can't use fonts with Print - only Text.

TDK_Man

Sven B
19
Years of Service
User Offline
Joined: 5th Jan 2005
Location: Belgium
Posted: 4th Dec 2005 12:35
Quote: "But Antidote is correct, Text is far more flexible and what's more, you can't use fonts with Print - only Text."


Only in DB Classic. DBP's print displays also the font and size of the text.

Quote: "but seriously, your machine did 1000 loops autosync'd in 0.18 seconds? perhaps I need to upgrade my offline machine..."


I dunno. Just copy/pasted my own code in the editor and run it. But I might've found why. I tested it on DBP and DBC and DBP is definately running alot faster. DBC was running it 20 sec and it was still not finished.

Immunity and Annihalation makes Immunihalation...
TDK
Retired Moderator
21
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 4th Dec 2005 16:29
Quote: "Only in DB Classic. DBP's print displays also the font and size of the text."


I happily stand corrected!

I'm still a noob myself with DBP and wasn't aware that had changed.

TDK_Man

Antidote
19
Years of Service
User Offline
Joined: 18th Mar 2005
Location: San Francisco, CA
Posted: 4th Dec 2005 16:53
I wasn't either because when I made the transition from DBC to DBP I had learned to treat the print commands with loathing. Even though they are faster I still like center text and will use text more often since it is not required to use the set cursor command before it.



headcrab 53
19
Years of Service
User Offline
Joined: 14th Jul 2005
Location:
Posted: 4th Dec 2005 17:48
Hey, look! Another Halo fan.

Windows XP Service Pack 2 -- Pentium 4 HT 3.0 ghz
1 GB DUAL DDR RAM -- NVIDIA GeForce 6600 GT 128 MB (PCI Express)
SimSmall
20
Years of Service
User Offline
Joined: 7th Aug 2004
Location: United Kingdom
Posted: 4th Dec 2005 19:42
Quote: "I tested it on DBP and DBC and DBP is definately running alot faster. DBC was running it 20 sec and it was still not finished"


There we go... I don't (yet) own DBP So I'm still trying with DBC.

...maybe one day I'll finish a project

Login to post a reply

Server time is: 2024-09-24 09:34:37
Your offset time is: 2024-09-24 09:34:37