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 / Dark Basic Exercise

Author
Message
VGHero11
13
Years of Service
User Offline
Joined: 15th Nov 2011
Location:
Posted: 13th Dec 2011 20:04
Hey fellow Dark Basic Coders

I am doing this exercise from a dark basic guide book but it was made using dark basic not DB pro. My problem is that I'm trying to format this program to DB pro since I rather use it. The problem is that they have you input a number which will cause a for next loop to run for that inputted number. If someone could give me a hand, that would be great.



When we all lend our power together, there is nothing we
can't do!
Please Lend me your STRENGTH!
TheComet
17
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 13th Dec 2011 21:08 Edited at: 13th Dec 2011 21:10
There's no problem with the existing code, it outputs the "Hello World!" in the for...next loop. But it all happens way to quickly for you to see it. I modified your code to this so you can see it work:



Also, that's a very strange way to indent code. I suggest you only add a tab when a command has a counterpart, such as function...endfunction, if...endif, for...next, etc.:



Excuse my warped humor

TheComet

MrValentine
AGK Backer
13
Years of Service
User Offline
Joined: 5th Dec 2010
Playing: FFVII
Posted: 13th Dec 2011 22:11
Rofl Comet...

But yeah it has inpot asking for a message or something but needs to be a number in his original code...

Why not get hands on dark basic... it has a lot of code to put you up to speed... or look for something called TDK`s tutorials... on the forum... I have no idea where it is and also I am on my phone so sorry... hands on dark basic pro is available through the tgc store... I am not sure about the pdf versions however...

VGHero11
13
Years of Service
User Offline
Joined: 15th Nov 2011
Location:
Posted: 14th Dec 2011 19:48
Thank your for the help TheComet. That helped me finish the code.

When we all lend our power together, there is nothing we
can't do!
Please Lend me your STRENGTH!
nonZero
13
Years of Service
User Offline
Joined: 10th Jul 2011
Location: Dark Empire HQ, Otherworld, Silent Hill
Posted: 14th Dec 2011 21:58 Edited at: 14th Dec 2011 22:10
@TheComet:
Insert

at line 8.



Quote: "Also, that's a very strange way to indent code"


      It is rather strange.
      It's like indenting for the sake of indenting.
      It's very confusing when dealing with nests.
      Especially for people debugging the code.
      I must admit though, it does look pretty...
      ...horrible.

      When I see code that's a mess and somebody's asking for halp
            I usually ignore the request.
      Unless I'm feeling generous.
            Then I usually have a look.
                  If it's coherent, I'll help
                  If it's not, I'll tell them to rewrite it
            That's all there is to it.
      I guess that's the long and short of it.

I'm a little bit of a neat-freak (except when it comes to cleaning my room. I'm breeding shadow-things under my bed!)

TheComet
17
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 14th Dec 2011 22:16
Wait, how did you do more than 2 spaces? The forum always deletes my spaces when I do that... Here look:

hi
I'm
Adding
A
New
Space
here
for
every
line.

and this is what it looked like in the edit box:



TheComet

nonZero
13
Years of Service
User Offline
Joined: 10th Jul 2011
Location: Dark Empire HQ, Otherworld, Silent Hill
Posted: 15th Dec 2011 21:10
Quote: "Wait, how did you do more than 2 spaces?"


With my dark magic XD

Ascii number 255 is invisible to just about everything yet is treated as a valid character. It doesn't always respond well to being pasted in web browsers so it's best to just hold down Alt and type 255. Some applications may display it as a box, but they are few. You can create truly hidden folders on your desktop this way (if you name the folder chr$(255), assign it a custom icon of a blank space and hide it behind a gadget so Ctrl+a wont reveal it).

Login to post a reply

Server time is: 2024-11-22 11:49:37
Your offset time is: 2024-11-22 11:49:37