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.

DarkBASIC Professional Discussion / DB Pro Free Version Problem

Author
Message
lightningfire
15
Years of Service
User Offline
Joined: 28th Sep 2010
Location:
Posted: 28th Sep 2010 16:00
Hi, I'm new to DB and am playing around with the code to learn so here's what I've got so far:



When I run this program, it will not print "Please put in your name:" or the other print comand. It will allow me to type in my name and the password but it just won't print what I've got for the print comands. But if I take out the line of code "cls rgb(90, 40, 50)" then it will work properly. Would anybody happen to know the answer to this problem?

Thanks.
MSon
22
Years of Service
User Offline
Joined: 13th Jul 2004
Location: Earth, (I Think).
Posted: 28th Sep 2010 23:23 Edited at: 28th Sep 2010 23:24
i just took the code right out of here and pressed F5 and it worked instantly.

although the line print "Thank you" wont show as you have a CLS right after it

Grog Grueslayer
Valued Member
21
Years of Service
User Offline
Joined: 30th May 2005
Playing: Green Hell
Posted: 29th Sep 2010 01:32 Edited at: 29th Sep 2010 01:34
It worked for me too. That line shouldn't effect the previous lines. You can use the INPUT command to print text also so there's no need to have it PRINT then get INPUT when one command can do both... all you do is use a semicolon after the last " mark to tell Darkbasic which variable you want.

When you get input it's best to change it's case so it's easier for you to detect the right password. If the case isn't changed and somebody typed in "ENTER" or "Enter" or "enTer" it wouldn't register as being the right password because your specifically looking for "enter" in lower case. To change a strings case to lower you use LOWER$(). If you want it higher case use UPPER$().

I got rid of your GOTO since if they don't get the password right you don't want them using your program anyway. If it doesn't see the right password it ENDs... no need for GOTO.



You should also check out TDKs tutorials for beginners:
http://forum.thegamecreators.com/?m=forum_view&t=99497&b=10

Neco
18
Years of Service
User Offline
Joined: 13th Jul 2008
Location: Waterloo, Wisconsin USA
Posted: 2nd Oct 2010 19:30 Edited at: 2nd Oct 2010 19:32
The problem with "thank you" not showing up, is because you are issuing a clear screen command immediately after it, with no wait time or pause built into the program.

It IS printing it, but the problem is the program moves so fast that you will not see it before it clears the screen.

The solution there, like shown in other peoples examples, is to insert a wait command that stalls the program for a second or two or until a key is pressed.

Inserting a simple "wait 1000" (wait one second) between the Print command and the goto command, will show you that it really is printing.

I'm not sure, however, why it would not print your very first command.

Login to post a reply

Server time is: 2026-07-24 00:18:31
Your offset time is: 2026-07-24 00:18:31