Qbasicnews.com

Full Version: Modular Programming - please explain
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
I'm creating a huge game and came to the subject modular programming.

I've read Nathan's article (Pushing the limits of Qb) and Typosoft Tutorial about Modular programming but still it's not clear to me.

What's so positive about modular programming. And how do I use it?

I'm working on an RPG, imagine I wan't a Pixel*Pixel-scrolling Module and a Enmemy-battle module how do I start?

I hope someone can help me and my post is clear to everyone (my englisch is bad)
modular programming = using functions, subs, or external file
this divides your program into manageable parts. it also allows you to create your own commands

i.e. LoadImage "this.jpg", 1, 1

you won't find commands like that in ordinary QB. by using subs, functions or libraries, greater customization of the language can be acquired.

you can create a new sub/function by using the Edit menu in QB. I think the help file DOES tell you how to use them decently
I'll offer my own definition:

Modular programming is the idea that programs can be divided into manageable and to a certain degree independent parts that can be put together like... a hamburger.
Quote:I'll offer my own definition:

Modular programming is the idea that programs can be divided into manageable and to a certain degree independent parts that can be put together like... a hamburger.

lol. And one of the reasons modular programming is good, is that it's easy to use the same bit of code (subs) multiple times to do common things. Like adding a pickel, for example.
I believe Nathan's article explains it cery well. What exactly do you not understand in the article?

Do you want to split your code into 2 or more modules?
Rel,
Is this the article you mentioned?

http://faq.qbasicnews.com/?blast=ModularizeIt

It is the only one I found in a quick search of the FAQ.
No, its in the articles section, front page of this site ;*)
I managed to solve the problem myself.

I figured out that ther was something wrong with my arrays, After 2 hours changing REDIM's in to DIM's and DIM's in to REDIM's and making DIM's and REDIM's $STATIC or $DYNAMIC, my program did what is was programmed for to do.

Thank you all anyway for your help.
If you're still planning on that HUGE game, I suggest you go with modular progging anyway. It will make things easier for you in the long run, plus you can't be serious about using gosub/gotos. That's all there is without subs -- you might as well use tsr-basic.
Pages: 1 2