PureBasic 4.50 is out !
-
- Addict
- Posts: 1264
- Joined: Wed Feb 28, 2007 9:13 am
- Location: London
Re: PureBasic 4.50 is out !
I think this is a brilliant update.
4.4 was important with maps and the 2D drawing enhancements, but 4.5 is perhaps an even more important update with the new ability to have maps, lists etc. inside structures. For me this is an extremely useful ability that simplifies a lot of work, and drastically reduces memory consumption (compared to static arrays).
Thank you, thank you, thank you!
Seymour.
4.4 was important with maps and the 2D drawing enhancements, but 4.5 is perhaps an even more important update with the new ability to have maps, lists etc. inside structures. For me this is an extremely useful ability that simplifies a lot of work, and drastically reduces memory consumption (compared to static arrays).
Thank you, thank you, thank you!
Seymour.
JACK WEBB: "Coding in C is like sculpting a statue using only sandpaper. You can do it, but the result wouldn't be any better. So why bother? Just use the right tools and get the job done."
Re: PureBasic 4.50 is out !
I agree, one of the most significant upgrades to Purebasic ever. Awesome.
Thanks team. Much appreciated.
Thanks team. Much appreciated.
I may look like a mule, but I'm not a complete ass.
Re: PureBasic 4.50 is out !
Agreed definately! I'm already using maps and lists inside structures in the latest build of ProGUI im working on.Seymour Clufley wrote:4.4 was important with maps and the 2D drawing enhancements, but 4.5 is perhaps an even more important update with the new ability to have maps, lists etc. inside structures. For me this is an extremely useful ability that simplifies a lot of work, and drastically reduces memory consumption (compared to static arrays).
Thanks PB team!

Chris.
ProGUI - Professional Graphical User Interface Library - http://www.progui.co.uk
Re: PureBasic 4.50 is out !
Congratulation Fred and Freak for this - must have - release.
All the new stuff is terrific and increase the interest of this language.
It's very pleasant to re-code some old programs cleaner thanks to the new features.
All the new stuff is terrific and increase the interest of this language.
It's very pleasant to re-code some old programs cleaner thanks to the new features.
No programming language is perfect. There is not even a single best language.
There are only languages well suited or perhaps poorly suited for particular purposes. Herbert Mayer
There are only languages well suited or perhaps poorly suited for particular purposes. Herbert Mayer
Re: PureBasic 4.50 is out !
Hi! Out of programming habit with VBScript, I discovered this...
PB Sample produces an error.
VBScript does not.
Code: Select all
Procedure LOGICAL(a, b)
ProcedureReturn a = b
EndProcedure
delta = Not LOGICAL(1, 1)
Debug delta
Code: Select all
Function LOGICAL(a, b)
LOGICAL = a = b
End Function
delta = Not LOGICAL(1, 1)
WScript.Echo delta
Re: PureBasic 4.50 is out !
Code: Select all
Procedure LOGICAL(a, b)
ProcedureReturn a = b
EndProcedure
delta = Not LOGICAL(1, 1)
Debug delta


Let's start by turning this line
Code: Select all
ProcedureReturn a = b
Code: Select all
ProcedureReturn b
Code: Select all
Procedure LOGICAL(a, b)
ProcedureReturn b
EndProcedure
delta = 0-LOGICAL(1, 1)
Debug delta

( PB6.00 LTS Win11 x64 Asrock AB350 Pro4 Ryzen 5 3600 32GB GTX1060 6GB)
( The path to enlightenment and the PureBasic Survival Guide right here... )
( The path to enlightenment and the PureBasic Survival Guide right here... )
Re: PureBasic 4.50 is out !
Code: Select all
Procedure LOGICAL(a, b)
ProcedureReturn b
EndProcedure

Code: Select all
Procedure LOGICAL(a, b)
if a = b : ProcedureReturn #True : EndIf
EndProcedure
delta = (Not LOGICAL(1, 1))
Debug delta
Re: PureBasic 4.50 is out !
True, but what I wanted to show is that you should not use a = b as a procedure return value. People should stop asking if the following works:
a = (a = b )
BECAUSE IT DOESN'T.
It's everywhere, in the docs, in the FAQ, even in my pathethic survival guide. I'm tempted to suggest to Fred to put a new feature in: whenever the demo or the normal version of PureBasic is started for the very first time, it should load a demo program that goes something like this:
I don't mind questions, no matter how dumb, but this one is so all over the place that it's frankly a little annoying.
Pfff.
I think I had a bad day
a = (a = b )
BECAUSE IT DOESN'T.
It's everywhere, in the docs, in the FAQ, even in my pathethic survival guide. I'm tempted to suggest to Fred to put a new feature in: whenever the demo or the normal version of PureBasic is started for the very first time, it should load a demo program that goes something like this:
Code: Select all
; please examine this example code carefully
;
; a = (a = b ) ; <== THIS DOES NOT WORK. NO. IT DOESN'T. IT WON'T. IT WILL NOT BE SUPPORTED.
;
; please read the manual or visit the forum
Pfff.
I think I had a bad day

( PB6.00 LTS Win11 x64 Asrock AB350 Pro4 Ryzen 5 3600 32GB GTX1060 6GB)
( The path to enlightenment and the PureBasic Survival Guide right here... )
( The path to enlightenment and the PureBasic Survival Guide right here... )
Re: PureBasic 4.50 is out !
Maybe using the equal sign for two different purposes isn't such a good idea.
C and PHP solves the problem by using "=" as the assignment operator and "==" as the comparison operator.
Pascal solves the problem by using := as the assignment operator and = as the comparison operator.
Both remove the ambiguity about what the = is supposed to do.
C and PHP solves the problem by using "=" as the assignment operator and "==" as the comparison operator.
Pascal solves the problem by using := as the assignment operator and = as the comparison operator.
Both remove the ambiguity about what the = is supposed to do.
Re: PureBasic 4.50 is out !
but Purebasic is Basic, so it would be a bad idea to use e.g. Pascal or C syntax..GWarner wrote:Maybe using the equal sign for two different purposes isn't such a good idea.
C and PHP solves the problem by using "=" as the assignment operator and "==" as the comparison operator.
Pascal solves the problem by using := as the assignment operator and = as the comparison operator.
Both remove the ambiguity about what the = is supposed to do.
Re: PureBasic 4.50 is out !
So true! Too many people here forget that, and want PureBasic to be something other than Basic. :roll:nase09 wrote:but Purebasic is Basic, so it would be a bad idea to use e.g. Pascal or C syntax..
Re: PureBasic 4.50 is out !
a small assistance without a warranty for future versions
Show asm output 
P.S. Also computations can be implemented
Code: Select all
Macro BOOL(assert)
((assert) Or #False)
EndMacro
Procedure foo1(a,b)
ProcedureReturn bool(a > b)
EndProcedure
Procedure foo2(a,b)
ProcedureReturn bool(a < b)
EndProcedure
c = foo1(a,b)
Debug c
c = foo2(a,b)
Debug c

P.S. Also computations can be implemented
Code: Select all
Macro BOOL(assert)
((assert) Or #False)
EndMacro
For i = 1 To 10
c = i * 10 * bool(i >= 5)
Debug c
Next
My Projects ThreadToGUI / OOP-BaseClass / EventDesigner V3
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive
Re: PureBasic 4.50 is out !
I know that PureBasic is BASIC, nor am I suggesting that it should use C or Pascal syntax, if you had really read my message you would have seen that.
I'm just suggesting that using the same operator for two completely different purposes isn't such a good idea. The designers of C and Pascal apparently didn't think it was a good idea either.
Since this is dragging this thread way off topic, I'll stop here.
I'm just suggesting that using the same operator for two completely different purposes isn't such a good idea. The designers of C and Pascal apparently didn't think it was a good idea either.
Since this is dragging this thread way off topic, I'll stop here.
Re: PureBasic 4.50 is out !
I entirely agree with blueznl. People migrating from (Visual) BASIC are VERY used to boolean expressions as return values or as part of formulas.
With PureBasic working with boolean expressions is still very confusing. For example, this works:
Yet, this simple one does not work:IMHO people new to PureBasic should be thoroughly informed about this!
With PureBasic working with boolean expressions is still very confusing. For example, this works:
Code: Select all
Procedure.i LeapYear(Year.i)
;returns:
; - True (1) If the given year is a leapyear
; - False (0) if the given year is not a leapyear
ProcedureReturn ((Year % 4) = 0) And ((Year % 100) <> 0) Or ((Year % 400) = 0)
EndProcedure
Debug LeapYear(2008)
Debug LeapYear(2009)
Code: Select all
Procedure Equal(a.i, b.i)
ProcedureReturn (a = b)
EndProcedure
Debug Equal(1, 2) ;should return 0 (#False), but returns 2 instead.
PureBasic 5.41 LTS | Xubuntu 16.04 (x32) | Windows 7 (x64)
Re: PureBasic 4.50 is out !
I read somewhere on the forum that boolean expressions are planed. So we will see how they solve the = issue. ^^
@Frarth: It's not confusing, because they are not supported outsite of if statements. So you should not use them in formulas at all. It's planed and i hope it will come, but it's not just yet supported.
Anyway a compiler error message would be nice.
@Frarth: It's not confusing, because they are not supported outsite of if statements. So you should not use them in formulas at all. It's planed and i hope it will come, but it's not just yet supported.
Anyway a compiler error message would be nice.