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 do i clear the screen

Author
Message
Coding Beast
7
Years of Service
User Offline
Joined: 13th Dec 2012
Location:
Posted: 11th Jan 2013 17:38
i am a total beginner and i want to know how to clear my title sceen. Help would be greatly needed. Thank you

if i fail i try again

Attachments

Login to view attachments
TheComet
12
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 11th Jan 2013 20:17
You attached a .dbpro file. Those don't contain any code, only information about your project. You have to attach the .dba file for us to look at the code (but don't do that either).

Instead, copy/paste your code into your message between code snippet tags:

[[b]code lang=dbp][/b]paste your code here[[b]/code][/b]

The following command will clear the screen:



TheComet

http://blankflankstudios.tumblr.com/
Quote: ""
- Randomness 128
MrValentine
AGK Backer
9
Years of Service
User Offline
Joined: 5th Dec 2010
Playing: FFVII
Posted: 11th Jan 2013 20:45
I do believe however, cls will not delete media loaded into memory... worth considering to delete those as well before loading in say the main world...

You could minimise the window and restore it to gain that effect too...

Just a thought...

TheComet
12
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 11th Jan 2013 21:35
Do you even lift?

http://blankflankstudios.tumblr.com/
Quote: ""
- Randomness 128
MrValentine
AGK Backer
9
Years of Service
User Offline
Joined: 5th Dec 2010
Playing: FFVII
Posted: 11th Jan 2013 22:14
Lift?

Chris Tate
DBPro Master
11
Years of Service
User Offline
Joined: 29th Aug 2008
Location: London, England
Posted: 11th Jan 2013 22:57 Edited at: 11th Jan 2013 23:03
This thread is a classic; wow. This is comedy.


Quote: "i am a total beginner and i want to know how to clear my title sceen. Help would be greatly needed."


Attaches a file with no programming.

TheComet replys

Quote: "You attached a .dbpro file. Those don't contain any code"


Quote: "The following command will clear the screen: cls"


Valentine replys

Quote: "I do believe however, cls will not delete media loaded into memory... worth considering to delete those as well before loading in say the main world...

You could minimise the window and restore it to gain that effect too..."


TheComet
Quote: "Do you even lift?"


MyValentine:
Quote: "Lift?"



Welcome to TGC Coding Beast. Check out the examples in your help and documentation; and also my basic articles and the Code Corner, they will show you how to handle many common issues such as TheComet's suggestion clearing the screen.

MrValentine
AGK Backer
9
Years of Service
User Offline
Joined: 5th Dec 2010
Playing: FFVII
Posted: 12th Jan 2013 00:12
I should probably use more basic commands more often lol...

WLGfx
12
Years of Service
User Offline
Joined: 1st Nov 2007
Location: NW United Kingdom
Posted: 17th Jan 2013 03:11
@MrValentine - I lifted this one out for you:
Something I used until I read the destructions...



Mental arithmetic? Me? (That's for computers) I can't subtract a fart from a plate of beans!
Warning! May contain Nuts!
MrValentine
AGK Backer
9
Years of Service
User Offline
Joined: 5th Dec 2010
Playing: FFVII
Posted: 17th Jan 2013 07:51
AHAHAHAHAHA that is beautiful man!

Phaelax
DBPro Master
17
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 17th Jan 2013 12:44
@WLGfx,

Lock the backbuffer and place dots using a pointer to access it. It'll speed up that dead fast function for ya

"You're not going crazy. You're going sane in a crazy world!" ~Tick
Agent
15
Years of Service
User Offline
Joined: 7th Sep 2004
Location: Sydney, Australia
Posted: 11th Feb 2013 00:49
I like to draw a filled black box of dimensions equal to the screen size

Sometimes I for...next and draw a horizontal black line across the width of the screen, pause for a fraction of a second, then NEXT to draw another line immediately below that one, to 'wipe' the screen clear from top to bottom

Also you can create an array full of the positions of every pixel on the screen, scramble the array, and then run through the array drawing a dot to each location as you go, to get that oldschool fade out effect

Or, get a real fadeout effect by drawing my big black box to the screen 255 times, each one a shade of alpha darker than the last

Or, uh, type CLS.

<scratches head> Change the screen resolution?... ummm... poke zero values directly into screen memory... let's see... what happens if you delete bitmap 0? Or maybe load a big black square into it? I wonder if that would blank the screen?

Ummmmmm ok I'm out of ideas

Also this thread is pure gold.

TheComet
12
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 11th Feb 2013 17:48
Waaaiiit, you forgot something WLGFx!



TheComet

http://blankflankstudios.tumblr.com/
"ZIP files are such a retarded format!" - Phaelax
Libervurto
14
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 14th Feb 2013 08:17
I managed to dramatically increase the speed guys!


^ That's what she said.
TheComet
12
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 14th Feb 2013 10:13 Edited at: 14th Feb 2013 10:38
Quote: "I managed to dramatically increase the speed guys!"


Let me fix that.



TheComet

http://blankflankstudios.tumblr.com/
"ZIP files are such a retarded format!" - Phaelax
Libervurto
14
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 14th Feb 2013 22:29 Edited at: 14th Feb 2013 22:34
I thought it was getting a bit complicated so I added some helpful annotations:


^ That's what she said.
TheComet
12
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 14th Feb 2013 22:57 Edited at: 14th Feb 2013 22:58
Oh yes, those annotations are extremely helpful, I think I now know what this code is doing.

I think I found a solution!



TheComet

http://blankflankstudios.tumblr.com/
"You're all wrong. You're all idiots." - Fluffy Rabbit
"Bottom line, people are retarded." - Fluffy Rabbit
Libervurto
14
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 15th Feb 2013 00:51
@TheComet
Can you update the version number please? Let's keep this professional and organised.

^ That's what she said.
Ortu
DBPro Master
12
Years of Service
User Offline
Joined: 21st Nov 2007
Location: Austin, TX
Posted: 15th Feb 2013 05:48 Edited at: 15th Feb 2013 05:53
But wait guys, we need reach out to our better halves and make our functions more female friendly.

I have fixed this one for my wife to use, and have inadvertantly improved it's speed vastly



TheComet
12
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 15th Feb 2013 12:37 Edited at: 15th Feb 2013 13:15
Placing the woman's new shoe rule at the top of the program? What were you thinking?

Now I updated it with woman's intuition.



http://blankflankstudios.tumblr.com/
"You're all wrong. You're all idiots." - Fluffy Rabbit
"Bottom line, people are retarded." - Fluffy Rabbit
Chris Tate
DBPro Master
11
Years of Service
User Offline
Joined: 29th Aug 2008
Location: London, England
Posted: 15th Feb 2013 18:42
Erm... Why would you do that?

I can't believe what I am actually seeing here from you guys. This is the newcomers forum, you should know better than to tell new users to be using point and dot commands to clear the screen! People might take what you are implying seriously and will struggle to learn.

The MODs should lock this thread IMHO, this is disrespectful; the thought of using point and dot commands to clear the screen, a better way to be helpful is to tell them the correct way, which is to convert each pixel into a memblock, then set its byte value to zero; that way there is less risk messing with GPU memory.

Chris Tate
DBPro Master
11
Years of Service
User Offline
Joined: 29th Aug 2008
Location: London, England
Posted: 17th Feb 2013 16:40
I hope nobody took the above comment seriously

WLGfx
12
Years of Service
User Offline
Joined: 1st Nov 2007
Location: NW United Kingdom
Posted: 22nd Feb 2013 01:27
I forgot all about this thread and its useful insight in how to clear the screen dead fast using a new woman's intuition and shoe algorithm. Even down to checking that the screen has actually been cleared too! Wow! That's just amazing. Well done guys!

It's a damn good job DBP isn't an interpreted language!

Mental arithmetic? Me? (That's for computers) I can't subtract a fart from a plate of beans!
Warning! May contain Nuts!
Ortu
DBPro Master
12
Years of Service
User Offline
Joined: 21st Nov 2007
Location: Austin, TX
Posted: 22nd Feb 2013 07:52
Quote: " Even down to checking that the screen has actually been cleared too!"


how can we sleep at night unless we are sure it's really been done?

It's like getting to work and wondering if you left the garage door up.

You don't know unless you know

Libervurto
14
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 26th Feb 2013 02:05
I found a new approach!



Chris Tate
DBPro Master
11
Years of Service
User Offline
Joined: 29th Aug 2008
Location: London, England
Posted: 26th Feb 2013 05:04 Edited at: 26th Feb 2013 05:05
Beat this;



MrValentine
AGK Backer
9
Years of Service
User Offline
Joined: 5th Dec 2010
Playing: FFVII
Posted: 26th Feb 2013 09:13
Beat this



I win!

Ortu
DBPro Master
12
Years of Service
User Offline
Joined: 21st Nov 2007
Location: Austin, TX
Posted: 26th Feb 2013 20:58 Edited at: 26th Feb 2013 21:00
WLGfx
12
Years of Service
User Offline
Joined: 1st Nov 2007
Location: NW United Kingdom
Posted: 27th Feb 2013 15:39
Could change the name "FUNCTION my_dead_fast_clear_screen_made_even_faster_by_TheComet_using_the_shoe_rule_for_women( colour ) to "FUNCTION use_tippex_instead( )"...

Mental arithmetic? Me? (That's for computers) I can't subtract a fart from a plate of beans!
Warning! May contain Nuts!
Dragon slayer
13
Years of Service
User Offline
Joined: 3rd Nov 2006
Location: Bourbonnais Illinois
Posted: 13th Mar 2013 01:06
WOW I just saw this post! This poor guy never even came back! You all scared him, he probably quit!
pcRaider
13
Years of Service
User Offline
Joined: 30th May 2007
Location:
Posted: 13th Mar 2013 08:26
A question.
A difference of wait_command and sleep_command?
Dragon slayer
13
Years of Service
User Offline
Joined: 3rd Nov 2006
Location: Bourbonnais Illinois
Posted: 13th Mar 2013 16:26
It does not look like there is a difference. Maybe someone who knows more than I do about this can say but to me it looks to be the same command with a different name.
Chris Tate
DBPro Master
11
Years of Service
User Offline
Joined: 29th Aug 2008
Location: London, England
Posted: 13th Mar 2013 19:30
No difference, they are aliases of the same function. In some cases one method is nicer to read than the other; Wait 2000 will 'wait' for 2 seconds, Sleep 2 will 'rest' the CPU for 2 milliseconds; these would work both ways round, but note that these commands are not CPU friendly.

pcRaider
13
Years of Service
User Offline
Joined: 30th May 2007
Location:
Posted: 14th Mar 2013 05:49
Thank you for an answer.
Transcendent
7
Years of Service
User Offline
Joined: 26th Mar 2013
Location:
Posted: 26th Mar 2013 03:20 Edited at: 27th Mar 2013 06:53
@pcRaider

If you haven't noticed, they were trolling your question.

Their methods of clearing the screen were quite complex when all you need is...



Just in case you didn't know
TheComet
12
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 27th Mar 2013 13:33 Edited at: 27th Mar 2013 13:39
I calculated roughly how long it would take to clear the screen. Here's my analysis:

The Superrand() function returns a value between 2-46, but because it's adding two random numbers, uniform distribution shows that the number 25 is twice as common as 48 or 2.

process_womans_intuition_by_using_super_random_technology() is called once for every row of pixels cleared+checked, and tests a random number against the function Superrand(). Therefore, there is a 1/23 chance of repeating the line clear and the line check. The checking function is called twice, increasing the time it takes to clear the line by (t_clear+t_check*2)*2/23.

Additionally, whenever a line is repeated, the stack is increased by 4 bytes (because we're jumping out of a function call with "goto").

Using the current method of clearing the screen, it takes roughly 12 seconds to clear a line.

Using the current method of checking if the screen was cleared, it takes roughly 20 seconds to check a line.

When plugging in the randomness, we get:

(40+12)*(1+2/23) = 56.5 seconds per line, chance of 5 lines being repeated.

There are 480 lines to be cleared+checked. 56.5*480 = 27130 seconds, chance of 2170 lines being repeated.

Results:
The stack increases its size by approximately 8.48 kiB.
It takes approximately 7.5 hours to completely clear the screen, if a stack overflow doesn't already crash the program.

Is that about correct?

TheComet

WLGfx
12
Years of Service
User Offline
Joined: 1st Nov 2007
Location: NW United Kingdom
Posted: 31st Mar 2013 17:12
@TheComet - Every now and then you "could" get a malicious injection attack and you would have to account for the time taken to effectively detect and defer it to another resource, if the system running the app is secure enough for that kind of thing, plus the detection code would have to be implemented during each pixel cycle. All depending on the size of the attack and the length of time per injection, your 7.5 hours could be increased exponentially.

Also the stack size would be reasonably safe running in an environment with ultra amounts of memory. Either that or a page file on a HD that's big enough to handle it.

@Transcendent - Why didn't any of us think of that?

Mental arithmetic? Me? (That's for computers) I can't subtract a fart from a plate of beans!
Warning! May contain Nuts!
Chris Tate
DBPro Master
11
Years of Service
User Offline
Joined: 29th Aug 2008
Location: London, England
Posted: 31st Mar 2013 21:38
This thread is the best; absolute comedy:

Transcendent said

Quote: "@pcRaider

If you haven't noticed, they were trolling your question.

Their methods of clearing the screen were quite complex when all you need is...

code: cls"


But... pcRaider never even asked that question?

Login to post a reply

Server time is: 2020-08-03 16:54:15
Your offset time is: 2020-08-03 16:54:15