Multiple sources (SOLVED!)

Previous topic - Next topic

ampos

For faster compiliong time, it has been said to split the program in multiple sources files in the same proyect, as the compiler only compiles the sources that has changed.

I think I read somewhere how to do that, but I dont remember.

And I dont remember how to incluse/call SUBs or FUNCTIONs in a different source file.

Any help?
check my web and/or my blog :D
http://diniplay.blogspot.com (devblog)
http://www.ampostata.org
http://ampostata.blogspot.com
I own PC-Win, MacBook 13", iPhone 3G/3GS/4G and iPAC-WinCE

Moebius

See http://www.glbasic.com/xmlhelp.php?lang=en&id=256&action=view for the GLB manual on adding multiple files to your project.
You just need to use the 'Files' tab in the sidebar in the editor.
All functions and subs in included files should be able to be called by your program from what I know, just call them as usual.
Also, I think using types from other source files now works in the later updates.  Don't trust me on this one though.
Endless Loop: n., see Loop, Endless.
Loop, Endless: n., see Endless Loop.
- Random Shack Data Processing Dictionary

Cliff3D

I am using an extended type (and several non-extended types) that are in a secondary source file in my 3D .OBJ project. It seems to work just fine despite issuing a few minor "false warnings" at compile time.

ampos

I tried making a 2nd source window on my proyect, and making a cut&paste from main to this 2nd source, but compiler gives me an error...
check my web and/or my blog :D
http://diniplay.blogspot.com (devblog)
http://www.ampostata.org
http://ampostata.blogspot.com
I own PC-Win, MacBook 13", iPhone 3G/3GS/4G and iPAC-WinCE

ampos

Find:

You can create and save a document/source/window in the proyect, but you have to add the saved document/source in the right window "files" to tell BLG to use it as a "source file to be compiled"
check my web and/or my blog :D
http://diniplay.blogspot.com (devblog)
http://www.ampostata.org
http://ampostata.blogspot.com
I own PC-Win, MacBook 13", iPhone 3G/3GS/4G and iPAC-WinCE

Cliff3D

Yes - although IIRC there's another way to do it, IMHO it's frustrating that GLBasic very much expects you to add an existing file to a project to make it part of a multiple-source project rather than creating multiple sources yourself during the lifetime of the project. It also assumes that new source files created ar eNOT part of the current project automatically, something I consider a flaw and have previously mentioned :(

Kitty Hello

you can right click on any file in the editor (text editor) and select: Add to project (if it's not already in).
You can make a new file in the files tab, or you can also add existing files there.
I'll try to support drag/drop in the next update.

ampos

And why not add it to the current project when you choose "create new file"? What sense has to create in a project a new file that is not part of the project?
check my web and/or my blog :D
http://diniplay.blogspot.com (devblog)
http://www.ampostata.org
http://ampostata.blogspot.com
I own PC-Win, MacBook 13", iPhone 3G/3GS/4G and iPAC-WinCE

Kitty Hello

You mean File/Source/New? That's stupid. Thanks for noticing.