PDA

View Full Version : FreeBasic SDK: working full source code example



ErosOlmi
24-09-2007, 11:57
Hi all,

please find here attached first full source code example module developed with FreeBasic (continuation from this post: http://community.thinbasic.com/index.php?topic=1208.0 ).

How to work with FreeBasic.
First, here I assume FreeBasic version 0.18.1 Beta is installed into the base directory "C:\FreeBasic\" If not, it should be work in any case providing the IDE is aware of it.
Second I assume FbEdit IDE is installed into "C:\FreeBasic\FbEdit\" directory. If not it should work the same providing that FbEdit is the default application to open .fbp files

Steps:

install FreeBasic downloading from http://www.freebasic.net/
install FbEdit downloading from http://www.radasm.com/fbedit/ Open ZIP file and extract all files (maintaining directory structure under "C:\FreeBasic\". You should have something like "C:\FreeBasic\FbEdit\" with all files inside.
link .fbp files to be opened by "C:\FreeBasic\FbEdit\FbEdit.exe"

If all wend fine, you have now FreeBasic up and running.

How to work with thinBasic modules using FreeBasic.

Download attached zip file and unzip it into a new directory
double click on "thinBasic_FBGFX.fbp" and if all was OK in previous setup you should have the project open into FbEdit. thinBasic_FBGFX.bas and thinCore.bi should be open in the editor
have a look at the code. Structure works more or less the same as in Power Basic
to compile the module just press F5 or menu Make/Compile


List of included files:

libthinCore.dll.a
Static interface library needed by FreeBasic compiler in order to link to thinCore.dll (main thinBasic engine) at runtime
Test_FBGFX_Screen.tBasic
Sample script
Test_FBGFX_ScreenRes.tBasic
Sample script
thinBasic_FBGFX.bas
Module source code
thinBasic_FBGFX.dll
Module compiled code
thinBasic_FBGFX.fbp
FbEdit project file. It contains all the info needed to manage a thinBasic module project under FreeBasic
thinCore.bi
Interface file to be included into every module source code. IT IS UNDER HEAVY CHANGE so expect this file to be quite different in next release. Leave this file as is and look at it just for reference


_________________________________________________
If all went fine you should be able to compile at first try. If not, report problems here.

Also consider we are working on this module interface. Many changes will be introduced if we will see some interest. Some part are still missing like using script variables passed BYREF but it will be quite easy to introduce and we will do it as time will permit.

Tell us what you think and what you need and we will do our best to make it real.

Ciao
Eros

Petr Schreiber
24-09-2007, 15:35
Hi Eros,

I tried to compile with FB and it works good.
So far no problems, just in thinBASIC.BI there is on second line:


' File NAME : thinCore.inc

I am sure you recoginize how serious is this - it affects Earth stability, makes Sun explode and you will be transported to prison for crimes against file extensions ;D


Thanks a lot,
Petr

ErosOlmi
24-09-2007, 15:44
Thanks Petr, attach fixed.

thinCore.bi will change a lot. There is a lot of commented code (Power Basic version) that will be removed and/or substituted by native FreeBasic code.

Ciao
Eros

kryton9
24-09-2007, 18:46
Eros, I didn't test it as freebasic is not installed, but I think support for freeBasic is a great idea. It already looks like a great basic and will just get better as work continues on it. Depending on what happens in powerBasic in the future, I think it is nice to have freeBasic as an option and direction to move to. So thanks for the effort and steps taken!!

sandyrepope
26-09-2007, 16:19
I got curious about FreeBasic so a while ago I downloaded it and fbedit. Later today I'll install it and get to check it out. I also got the thinbasic_fbgfx.zip and will check out this also.

I've got new toys to play with!!!

Thanks
Sandy