Modules versus forms versus 1 big mess

Everything else that doesn't fall into one of the other PB categories.
Hot Pockets
User
User
Posts: 51
Joined: Mon Jun 01, 2009 3:56 am

Modules versus forms versus 1 big mess

Post 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!!
srod
PureBasic Expert
PureBasic Expert
Posts: 10589
Joined: Wed Oct 29, 2003 4:35 pm
Location: Beyond the pale...

Post 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! :wink:

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! :wink: 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?"
I may look like a mule, but I'm not a complete ass.
PB
PureBasic Expert
PureBasic Expert
Posts: 7581
Joined: Fri Apr 25, 2003 5:24 pm

Post 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. :)
I compile using 5.31 (x86) on Win 7 Ultimate (64-bit).
"PureBasic won't be object oriented, period" - Fred.
Hot Pockets
User
User
Posts: 51
Joined: Mon Jun 01, 2009 3:56 am

1 Big Mess

Post 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 !!
srod
PureBasic Expert
PureBasic Expert
Posts: 10589
Joined: Wed Oct 29, 2003 4:35 pm
Location: Beyond the pale...

Post 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.
I may look like a mule, but I'm not a complete ass.
Post Reply