You're going to need to learn loops, subroutines, and functions. I strongly recommend the
Beginner's Guide to DarkBASIC Programming, or alternatively check out the
Hands-On DarkBASIC book available here on TGC. Either of these will give you a great understanding of how subroutines and functions work, and they'll help you make your games and apps 10x better

.
A subroutine is essentially a block of code that you can run whenever you need it. When you call a subroutine using the
gosub command, your program will go to that subroutine, execute each line in that subroutine, and branch back to where you started. Let's say we wanted to make an overly-complicated rendition of Hello World. This is what your main block of code would look like:
Then you'd need to create the subroutine somewhere below that. Always remember that subroutines should go at the end of your program, and functions (which I'll get to shortly) should go below subroutines. Anyway, the subroutine would look like this:
Notice the command named "hello:" -- it has a colon ( : ) as the end of it... that will define the name of the subroutine. Then, I used the command "return" to tell the program to go back to the line where it last came from. When you use "return," it will take you back to the line directly below the "gosub" command you used earlier. And unlike the testy "goto" command, the "gosub/return" commands will return you to wherever it came from, regardless of the line number, so you'll never need to worry about expanding your code. Some people will tell you subroutines are worthless... they're wrong. Just about any game or piece of software you've ever seen uses subroutines. Even
FPS Creator's engine uses them

.
Next there's functions. Functions are like subroutines, but they're intended to be used for repetetive tasks. For instance, you might put mouse or keyboard control into a single function, and display information into another. Functions are a little more complicated and to some, they can seem downright confusing at first, but once you start using them you won't be able to stop.
Okay, let's make a quick function that prints "hello world." First we'll need some code that calls the function:
We replaced "gosub hello" with "hello()"... this is what we're going to call our function. Now let's create the function:
It's that easy. You should experiment with subroutines and functions and learn how to use them in your program, it's much more effective than using "goto" line after line, even in smaller programs

Why do you say that Goto and any equivalent commands are bad?
Well, saying that using "gosub/return" is bad is rubbish. Subroutines are perfectly adequate and in larger programs they're pretty much mandatory. And in some instances, functions won't be able to do what you need them to do... like, for instance, returning more than one value

.
But using goto is a horrible coding practice, even for short programs. Let's take a look at hello world again:
Simple enough, right? Well, let's say I want my little program to loop. I'll use a goto command:
Okay, no trouble so far. But wait! I want to change the color of my text to red, because white is boring. And I'll want to do that before the CLS command so I'll have to write:
+ Code Snippetink rgb(255,0,0),rgb(0,0,0)
cls
print "Hello World!"
wait key
goto 1
But now, my pointer isn't pointing where I need it to anymore. I'd have to change "goto 1" to "goto 2." And what if my program starts getting bigger? Like, let's say I used "goto" while making Cheney Hunter. The game only has 845 lines of code... but if I had to change something at line 6, then add a bunch of lines before it, I'd have to go and find every "goto" command and replace them, rather than just using subs and functions. I hope that explains it and doesn't just get people more confused lol.