|
Post by Tom Mulgrew on Jun 3, 2007 4:14:43 GMT -5
Version 2.4.8 is up on the main page.
This one has support for including files (like C++'s #include), so that you can break your program into multiple source files. Look in the "Language guide" for an overview.
Or a quick example here:
Test.inc dim a$ goto End_of_Test
ShowMessage: cls locate (40 - len(a$)) / 2, 12: print a$ Sleep(3000) return
End_of_test:
Main.gb include Test.inc
a$ = "Hello": gosub ShowMessage a$ = "Goodbye": gosub ShowMessage
There are some limitations though, especially around the area of debugging. Basic4GL only displays the main source file, so you cannot place breakpoints inside include files. Also if the program is paused while the instruction pointer is inside the include file, it won't be able to show you the location (the cursor is displayed on the line after the "include").
So yeah, it's not perfect. Perhaps I'll make a version of Basic4GL that supports editing and debugging multiple files at some stage... But anyway, it's there if you want to use it.
-Tom
|
|
|
Post by DJLinux on Jun 3, 2007 5:51:04 GMT -5
|
|
|
Post by DJLinux on Jun 3, 2007 6:03:24 GMT -5
Hello tom i'm again why allow B4GL a struct as number?
i wrote in "test01.bas" (i posted) dim dGeomPair Pair,nPairs
but it must dim dGeomPair Pair ' struct dim nPairs ' integer
and later in the code i used nPair as number not as struct! For i=0 to nPairs-1 ' what is a struct -1? ...
Joshy
|
|
|
Post by Supermonkey on Jun 3, 2007 7:46:05 GMT -5
For debugging why not have the include command just stick all the files into one? So that include just shoves the contents of the included file into the main file, is that not a feasible option?
|
|
|
Post by Nicky Peter Hollyoake on Jun 3, 2007 8:17:49 GMT -5
Won't let me down load it, it says ...
Internet explorer cannot download Basic4gl v2.4.8.exe from www.basic4gl.net
then says the page is unavailable and yeah.
|
|
|
Post by James :) (aka Madcow) on Jun 3, 2007 12:26:28 GMT -5
could you allow the include function to load dlls to the plugin sytem. so you could compile an external .gb file and run it. and the external file would load the dlls it needs to run into basic4gls plugin system using include. then it could do really cool features.
|
|
|
Post by Nicky Peter Hollyoake on Jun 3, 2007 13:30:29 GMT -5
Just like to update the link is now working I just had computer problems I had to delete the cookies for it to work which I don't know work. The command is excellent Tom. Just a question, is it just to make things easier & keep you're code more clear? Or are they a use to this? If not still a useful command.
|
|
|
Post by Tom Mulgrew on Jun 3, 2007 18:00:59 GMT -5
dim dGeomPair Pair,nPairs Needs to be: dim dGeomPair Pair, dGeomPair nPairs Then it should behave as you expect. -Tom
|
|
|
Post by DJLinux on Jun 3, 2007 19:11:00 GMT -5
nPairs is only an integer for the FOR loop and dGeomPair are an struct. Sorry i don't know what you mean.
Joshy
|
|
|
Post by DJLinux on Jun 3, 2007 19:12:44 GMT -5
Hello Madcow what you need is #inclib not #include right?
Joshy
|
|
|
Post by DJLinux on Jun 3, 2007 23:31:30 GMT -5
hello tom the exe reports error in line 133 T#(0,1)=R.m(4):T#(1,1)=R.m(5):T#(2,1)=R.m( 6):T#(3,1)=P.v(1) but there is no error and it works in the IDE so i think stub.bin is the problem.
what do you mean?
Joshy
|
|
|
Post by Tom Mulgrew on Jun 5, 2007 3:09:04 GMT -5
nPairs is only an integer for the FOR loop and dGeomPair are an struct. Sorry i don't know what you mean. dim dGeomPair Pair, nPairs Declares "Pair" as a struct and "nPairs" as an integer.dim dGeomPair Pair, dGeomPair nPairs Declares "Pair" as a struct and "nPairs" as a struct. I'm not sure what the problem is here...?
|
|
|
Post by DJLinux on Jun 5, 2007 6:10:01 GMT -5
hello tom that nPairs are integer is right and mistake from my side. in other lanuguages type a,b,c "a,b,c" will be same type not in B4Gl.
but has you tryed the exe i posted? it reports an error where no error is so i think it has to do with stub.bin?
let me know what's going on if you start the exe i posted.
Joshy
|
|
|
Post by Tom Mulgrew on Jun 6, 2007 16:43:31 GMT -5
I've had a quick look, and I get the same error. I also built an exe on my PC to be sure it wasn't an old stub.bin, and I still get the same error.
The only way I can think of for that line to give that error is if the dMatrix3 in the "R" variable was somehow corrupt. Which could happen if there was a bug in the structure code for plugins. I don't know why it would be different in the standalone than in the application though...
When I get time I'll try and debug through and find out what is going on.
-Tom
|
|
|
Post by Tom Mulgrew on Jun 6, 2007 16:50:29 GMT -5
Just like to update the link is now working I just had computer problems I had to delete the cookies for it to work which I don't know work. The command is excellent Tom. Just a question, is it just to make things easier & keep you're code more clear? Or are they a use to this? If not still a useful command. It's just something that people have been asking for. It's useful if you write code that you would like to re-use for different applications. For example, the I've used "BGM" model rendering code in a couple of projects ("Beams", and the racing demo), which means that the top half of each of those programs is exactly the same code. If I moved that code out into an include file, it would make the game files a bit neater. It would also have the advantage that my bgm code is now in just one file. If I came along later and improved it (like adding textures to models or something), then both of those programs would automatically get the improvements, without having to copy the updates into each file. (Or if someone else was using the bgm rendering code, they could just download the improved version of the include file and use it.) -Tom
|
|