|
Post by Tom Mulgrew on Jan 13, 2008 6:10:23 GMT -5
Just so you know, the "official" (whatever that means) v2.5.0 release of Basic4GL is up on the main site. www.basic4gl.netI've fixed the memory leak that occurs when strings are passed to/from functions and subroutines. Otherwise it should be functionally exactly the same as the v2.5.0 beta that I put up a week or so ago. In case you missed the discussion, this is finally the release that has proper function and subroutine support, which a lot of people (myself included) have been waiting a long time for. Anyway.. Enjoy.. -Tom PS. If anyone has some time to kill, taking a Basic4GL example program, converting it to use functions/subs instead of GOSUB/RETURN and emailing me the result would be very helpful (currently there are no distributed examples that use functions and subs).
|
|
|
Post by James :) (aka Madcow) on Jan 13, 2008 13:00:46 GMT -5
cool, i'll download it soon and try updating examples.
|
|
|
Post by Supermonkey on Jan 13, 2008 18:15:57 GMT -5
Any chance you could upload the source code when you have a spare 10 mins? I like to play around with it ;D
|
|
|
Post by Linkage on Jan 13, 2008 21:36:43 GMT -5
Cool. Good work Tom. It'll be nice to be able to put my collision detection into functions now rather than writing the right code for every time I need it. I guess now I have to spend some time re-writing some of my code to incorporate that, but oh well.
|
|
|
Post by Tom Mulgrew on Jan 14, 2008 1:30:54 GMT -5
Any chance you could upload the source code when you have a spare 10 mins? I like to play around with it ;D Done.. (It's actually a little bit easier now that I've started using SVN for version control). It's on the download page. -Tom
|
|
|
Post by James :) (aka Madcow) on Jan 14, 2008 2:48:22 GMT -5
the last version should be updated from 2.3.0 to 2.4.0 or .1
|
|
|
Post by andrian on Jan 14, 2008 12:14:53 GMT -5
YAY! Thank you, Tom! been waiting a long time! Could ya PLEASE put it in a ZIP?
|
|
|
Post by James :) (aka Madcow) on Jan 14, 2008 13:03:33 GMT -5
tom what do you need to compile basic4gl from source
|
|
|
Post by Pizzasgood on Jan 14, 2008 19:09:34 GMT -5
Good stuff. Now if only you could upload several weeks worth of free time for me to download, so I could get caught up on everything long enough to give it a try But really, the lack of functions was one of the main things deterring me from messing around with b4gl since learning C++, so I'm several times more likely to come back and play around some more now. I need a good break from Linux hacking anyways. Just need to finish my commitments first, and try not to make new ones (I'm really bad about that...)
|
|
|
Post by Tom Mulgrew on Jan 15, 2008 1:17:06 GMT -5
Could ya PLEASE put it in a ZIP? Done. You can grab the zipped version from the download page. Cheers, -Tom
|
|
|
Post by James :) (aka Madcow) on Jan 15, 2008 10:57:28 GMT -5
now avalible on wiki
|
|
|
Post by andrian on Jan 15, 2008 12:21:37 GMT -5
Thanks! ;D
|
|
|
Post by James :) (aka Madcow) on Jan 15, 2008 16:49:38 GMT -5
In the next version, tom could you make it that after making a .exe it asks you if you'ld like it to copy the sound dlls to the .exe's dir instead of the alert it gives now.
|
|
|
Post by davy on Feb 3, 2008 2:42:34 GMT -5
Looks great Tom! I started playing with them a little while ago and I'm having fun. Exactly what Basic4GL needed. I noticed a couple of small issues, it doesn't seem to be handling allocated data (which was one of the neat things I was looking forward to using function for). Here are a few examples: I was going to make a simple expression tree, but it tells me there's an unset pointer when it reaches the second call to "newNode". When you use "&variable" is it passing by reference? How can you pass a pointer to a pointer? struc Node dim type$ dim value dim Node &left dim Node &right endstruc
sub newNode(Node &n, type$, value) alloc n n.type$ = type$ n.value = value endsub dim Node &root
newNode(root, "ADD", 0) newNode(root.left, "INT", 2) newNode(root.right, "INT", 3)
Unfortunately, this doesn't work either function new(size) dim &a() alloc a, size return a endfunction
dim &a()
a = new(10)
Am I doing something wrong here (it's been a LONG time since I've coded in BASIC), or are these just not possible yet?
|
|
|
Post by DJLinux on Feb 3, 2008 5:34:06 GMT -5
hello davy you can try this Joshy struc Node dim typ$ dim value# dim Node& left dim Node& right endstruc
sub NewNode(Node& root,t$,v#) root.typ$=t$ root.value#=v# alloc root.left alloc root.right end sub
dim Node root NewNode(root ,"a", 1.0) NewNode(root.left ,"b", 2.0) NewNode(root.right,"c", 3.0)
printr root.typ$ + "," + root.value# printr root.left.typ$ + "," + root.left.value# printr root.right.typ$ + "," + root.right.value# and this: function &new(size)() dim &a(),i alloc a, size for i=0 to size-1 a(i)=i next return &a end function
dim i,&a()
&a = new(10)
for i =0 to 9 printr a(i) next
|
|