This means you shouldn't work with the return variable of a function as a regular variable. The best practice/approach is to have a temporary variable in case you need to build the return value as the function is processed, and only in the end of the procedure do the functionName = returnValue assignment.
Spot on, Rho.
Exactly due to being a breaking change, we’re internally coming to final terms on bringing the version bump to 2.0.I hope you made sure, that this change doesn't bite your own butt within QB64.bas and all the other basic source files involved, would be too bad, if QB64 breaks itself by enforcing the new behaviour.
Btw, are you not on Discord for moral issues or are you just not a chat room guy? Your input in the dev lounge is always very welcome and appreciated.
I hope you made sure, that this change doesn't bite your own butt within QB64.bas and all the other basic source files involved, would be too bad, if QB64 breaks itself by enforcing the new behaviour.
I imagine we’re going to see a slew of reports about libraries erroring out with the next version update, and the librarians will need to check the code in the forum’s library area to test and make certain everything there works as advertised in the future. (The “Samples Gallery & Reference area now.)
will recursion still work?Code: QB64: [Select]
Hello
What's the problem?.
For me it displays as a result of compilation: 5 stars and 1
https://www.dropbox.com/s/79v4le52cn44icc/Test_Qb64.jpg?dl=0
I am leary of the change, but I am an old fogy and hate change that is not my idea anyway ;-))
It is so easy to fix a () less function with a dummy I don't see it worth the risk specially a revision # change to 2.
Fixed with dummy, like thisCode: QB64: [Select]
X = 5 F = 1 Print "*" X = X - 1 F = F(dummy)
And this line makes way more sense to me.Code: QB64: [Select]
F = F(dummy)
Exactly due to being a breaking change, we’re internally coming to final terms on bringing the version bump to 2.0.
Very good point @bplus to take into consideration. Will probably waiting a couple more days before start refactoring my stuff, to see if @FellippeHeitor and the other responsible DEVs rethink the whole thing and come up with a solution, which makes less impact on existing code (maybe another Meta command to switch between the old/new behavior? - If it ever was worth to add a new meta, then for this one, it would avoid the whole effords mentioned by Steve).
bringing the version bump to 2.0.
will recursion still work?
Hello
What's the problem?.
For me it displays as a result of compilation: 5 stars and 1
It seems to work as it should. I also welcome this upgrade, but I am absolutely sure that it is only a matter of time before this thing catches up with me. It's great that it now works. My current programs all working as expected in this version.
How much of a need is there for parameter-less functions?
Boy, do I got a lot of rewriting to do now, just to keep all my libraries up to date once this goes live!
Very good point @bplus to take into consideration. Will probably waiting a couple more days before start refactoring my stuff, to see if @FellippeHeitor and the other responsible DEVs rethink the whole thing and come up with a solution, which makes less impact on existing code (maybe another Meta command to switch between the old/new behavior? - If it ever was worth to add a new meta, then for this one, it would avoid the whole effords mentioned by Steve).
All the resistance to going a full point but, I always knew the debugger stuff would warrant a full bump. Now this just enforces the change.
Sometime near future, when QB64 gets to V4.5, we are going to skip that one right ?
Back when I posted a fix for this three years ago, nobody wanted the functionality and I never added it into the repo.
https://www.qb64.org/forum/index.php?topic=704.msg6085#msg6085
It's kinda a hack, but it works -- unless somebody has a more elegant solution?
@FellippeHeitor
I agree with the changes you did to QB64, I think that the compiler is treating recursive functions properly now and gives meaningful error messages if you attemp to use the function name as a variable :)
Tried out the 32-bit Dev build this morning. I made sure to test it on my games that use a recursive floodfill routine to make sure all works ok. Working very well.
Only thing I noticed is that the font size change wouldn't work at all on first run. It did the next time I started QB64. No big deal of course, but I don't remember that happening before.
Ayway, the recent changes to QB64 work great. Well done!
- Dav
And now with this post I finally became a QB64 Developer and Forum Resident, yeah....
BTW, becoming Forum Resident is due to posting frequency. Becoming a QB64 Developer happened when you contributed to QB64 itself, so setting your status here was long overdue.
@Cobalt has also been "promoted". Thank you gentlemen for your work in QB64.