Page 1 of 1
Modules versus forms versus 1 big mess
Posted: Sun Jun 07, 2009 5:31 am
by Hot Pockets
I have used VB 6 and am trying to learn PB but I can't understand how you put together a complete program. I don't understand how you can make more then 1 module or if you were to use the designer how would you tie that in with the 1 module concept? Please enlighten me!!
Posted: Sun Jun 07, 2009 11:58 am
by srod
I have used VB 6 and am trying to learn PB but I can't understand how you put together a complete program.
You start typing at line 1 and when you've finished typing you have a complete program - or a complete mess in my case!
Purebasic does not offer 'modules' in the sense of distinct object files. Your complete source is compiled down to a single object file and then linked with all required libraries etc. to create the final exe.
In terms of 'modularising' your code you basically have two choices. Either break your projects down into distinct source files and then tie them together with XIncludeFile or create your own user libraries using Tailbite or Moebius etc. The visual designer you mention will, I think, create separate source files for each window that you design (I could be wrong here as I don't use visual designers). These source files are then tied together with XIncludeFile etc.
Personally I use the source code option. Typical projects of mine bring together all kinds of utilities which I store in a central repository and it all works fine; especially when you consider PB's speed of compilation which never ceases to amaze me! Fred, how the hell have you squeezed so much raw speed out of the compiler?
A piece of advice - the quicker you realise that Purebasic is not VB; the better for your own sanity!

I make this point simply to avoid a recurrence of a common theme which runs along the lines "I used to do it this way with VB.... why can I not do it the same way with PB?"
Posted: Sun Jun 07, 2009 1:41 pm
by PB
Hot Pockets: I recommend you bookmark the PureBasic Survival Guide:
http://www.xs4all.nl/~bluez/datatalk/purebasic.htm
It's made for people like you.

1 Big Mess
Posted: Sun Jun 07, 2009 6:57 pm
by Hot Pockets
I wasn't really adverse to using the 1 big mess philosophy, I just wanted to be sure that's what I was dealing with. Thanks for being so helpful !!
Posted: Sun Jun 07, 2009 7:53 pm
by srod
It's not really about creating one big mess (unless you want to). It is easy enough to modularise your code. These days I use basic OOP techniques anyhow which makes it even easier, inmo, to break my projects down even further.