Basic4GL
« Basic4GL v2.5.0 »

Welcome Guest. Please Login or Register.
May 22, 2013, 10:49am




Basic4GL :: BASIC4GL Boards :: Announcements :: Basic4GL v2.5.0
   [Search This Thread] [Share Topic] [Print]
 AuthorTopic: Basic4GL v2.5.0 (Read 844 times)
Tom Mulgrew
Administrator
*****
member is offline

[avatar]

[msn]
[homepage]

Joined: Jul 2003
Gender: Male
Posts: 507
 Basic4GL v2.5.0
« Thread Started on Jan 13, 2008, 6:10am »

Just so you know, the "official" (whatever that means) v2.5.0 release of Basic4GL is up on the main site. http://www.basic4gl.net

I'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).
Link to Post - Back to Top  IP: Logged
James :) (aka Madcow)
Posts heaps :)
*****
member is offline

[avatar]

Sup



Joined: Mar 2006
Gender: Male
Posts: 1,787
Location: UK
 Re: Basic4GL v2.5.0
« Reply #1 on Jan 13, 2008, 1:00pm »

cool, i'll download it soon and try updating examples.
Link to Post - Back to Top  IP: Logged

- James

There are 10 types of people in the world: Those who understand binary, and those who don't...
Supermonkey
Global Moderator Plus
*****
member is offline

[avatar]



Joined: Jul 2003
Gender: Male
Posts: 1,238
Location: UK
 Re: Basic4GL v2.5.0
« Reply #2 on Jan 13, 2008, 6:15pm »

Any chance you could upload the source code when you have a spare 10 mins? I like to play around with it ;D
Link to Post - Back to Top  IP: Logged

Linkage
Posts a bit
***
member is offline





Joined: Jan 2007
Posts: 147
 Re: Basic4GL v2.5.0
« Reply #3 on Jan 13, 2008, 9:36pm »

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.
Link to Post - Back to Top  IP: Logged
Tom Mulgrew
Administrator
*****
member is offline

[avatar]

[msn]
[homepage]

Joined: Jul 2003
Gender: Male
Posts: 507
 Re: Basic4GL v2.5.0
« Reply #4 on Jan 14, 2008, 1:30am »


Quote:
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
Link to Post - Back to Top  IP: Logged
James :) (aka Madcow)
Posts heaps :)
*****
member is offline

[avatar]

Sup



Joined: Mar 2006
Gender: Male
Posts: 1,787
Location: UK
 Re: Basic4GL v2.5.0
« Reply #5 on Jan 14, 2008, 2:48am »

the last version should be updated from 2.3.0 to 2.4.0 or .1
Link to Post - Back to Top  IP: Logged

- James

There are 10 types of people in the world: Those who understand binary, and those who don't...
andrian
Posts a lot
****
member is offline

[avatar]



Joined: Jun 2007
Gender: Male
Posts: 419
Location: Vulcan
 Re: Basic4GL v2.5.0
« Reply #6 on Jan 14, 2008, 12:14pm »

YAY! Thank you, Tom! :D been waiting a long time!

Could ya PLEASE put it in a ZIP?
« Last Edit: Jan 14, 2008, 12:19pm by andrian »Link to Post - Back to Top  IP: Logged

Vulcan Jedi are rare, yet they exist. It would be illogical to assume otherwise.
James :) (aka Madcow)
Posts heaps :)
*****
member is offline

[avatar]

Sup



Joined: Mar 2006
Gender: Male
Posts: 1,787
Location: UK
 Re: Basic4GL v2.5.0
« Reply #7 on Jan 14, 2008, 1:03pm »

tom what do you need to compile basic4gl from source
Link to Post - Back to Top  IP: Logged

- James

There are 10 types of people in the world: Those who understand binary, and those who don't...
Pizzasgood
Posts a lot
****
member is offline

[avatar]

Keep on truckin'


[homepage]

Joined: Apr 2004
Gender: Male
Posts: 302
Location: Fourth Floor, USA
 Re: Basic4GL v2.5.0
« Reply #8 on Jan 14, 2008, 7:09pm »

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...)
Link to Post - Back to Top  IP: Logged

"I have a tendency to wear my mind on my sleeve / I have a history of losing my shirt"--Barenaked Ladies
Currently running: Puppy 4.2.1
[image]
Tom Mulgrew
Administrator
*****
member is offline

[avatar]

[msn]
[homepage]

Joined: Jul 2003
Gender: Male
Posts: 507
 Re: Basic4GL v2.5.0
« Reply #9 on Jan 15, 2008, 1:17am »


Quote:
Could ya PLEASE put it in a ZIP?


Done. You can grab the zipped version from the download page.

Cheers,
-Tom
Link to Post - Back to Top  IP: Logged
James :) (aka Madcow)
Posts heaps :)
*****
member is offline

[avatar]

Sup



Joined: Mar 2006
Gender: Male
Posts: 1,787
Location: UK
 Re: Basic4GL v2.5.0
« Reply #10 on Jan 15, 2008, 10:57am »

now avalible on wiki
Link to Post - Back to Top  IP: Logged

- James

There are 10 types of people in the world: Those who understand binary, and those who don't...
andrian
Posts a lot
****
member is offline

[avatar]



Joined: Jun 2007
Gender: Male
Posts: 419
Location: Vulcan
 Re: Basic4GL v2.5.0
« Reply #11 on Jan 15, 2008, 12:21pm »

Thanks! ;D
« Last Edit: Jan 15, 2008, 12:23pm by andrian »Link to Post - Back to Top  IP: Logged

Vulcan Jedi are rare, yet they exist. It would be illogical to assume otherwise.
James :) (aka Madcow)
Posts heaps :)
*****
member is offline

[avatar]

Sup



Joined: Mar 2006
Gender: Male
Posts: 1,787
Location: UK
 Re: Basic4GL v2.5.0
« Reply #12 on Jan 15, 2008, 4:49pm »

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.
Link to Post - Back to Top  IP: Logged

- James

There are 10 types of people in the world: Those who understand binary, and those who don't...
davy
Global Moderator
*****
member is online
member is offline

[avatar]

[msn] [aim]
[homepage]

Joined: May 2006
Gender: Male
Posts: 1,049
Location: USA
 Re: Basic4GL v2.5.0
« Reply #13 on Feb 3, 2008, 2:42am »

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?
« Last Edit: Feb 3, 2008, 2:43am by davy »Link to Post - Back to Top  IP: Logged

DJLinux
Global Moderator Plus
*****
member is offline



\_/?


[homepage]

Joined: Apr 2008
Gender: Male
Posts: 1,045
Location: Germany
 Re: Basic4GL v2.5.0
« Reply #14 on Feb 3, 2008, 5:34am »

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
« Last Edit: Feb 3, 2008, 5:42am by DJLinux »Link to Post - Back to Top  IP: Logged

(sorry for my bad English)
I do not answer private messages asking for help because no one else can: benefit from advice I may give or correct me if I'm wrong.
   [Search This Thread] [Share Topic] [Print]

Click Here To Make This Board Ad-Free


This Board Hosted For FREE By ProBoards
Get Your Own Free Message Boards & Free Forums!
Terms of Service | Privacy Policy | Notice | FTC Disclosure | Report Abuse | Mobile