Page 1 of 3

PB v4 is a "home run" !

Posted: Fri Feb 24, 2006 7:06 am
by USCode
PureBasic v4 is, IMHO, what we would call a "home run" here in the USA :!:

I have been very impressed with the enhanced feature set, PB command rationalization, improved IDE, optimizations, Unicode support, thread safety, unlimited strings, new datatypes, Gadget library improvements, etc. etc. Sure, we all wish it had this command or that feature but all in all, for what it is and what it tries to be, it's a terrific software development environment.

After reading this comprehensive interview with Fred:
http://www.purearea.net/pb/english/interview.htm

I decided to make a donation (from the secure download page) to support Fred in the continued development of PureBasic.
Not a huge donation but with all the new enhancements and free updates, I feel I've more than gotten my money's worth.

Thanks to Fred and the entire PureBasic team! :)
USCode

Posted: Fri Feb 24, 2006 10:40 am
by srod
Amen to that!

Posted: Fri Feb 24, 2006 3:27 pm
by Jan Vooijs
Yes,

PB4 is the BEST system if have found and i used some!! From good old systems to brand new ones (cheap en expensive).

Wat I like best about PB you can copy paste code from the forum press F5 and presto a working program. No setup no switches no extra code needed just a few lines (even ONE line) and you have a working program!!

Nice very nice. I made a program for my Wife her MP3 stick to fill it with music (beter reading/audio books) she has low vision so need BIG letters and BIG buttons. In 2 days (and that was meanly a learning curve) I wrote a full working program in just 150 lines (and 30% is remarks for the future. Total app size is 'only' 29Kb wauw!! Hello PB!!!

Jan V.

Posted: Fri Feb 24, 2006 3:42 pm
by Dare2
Yes. Moving to the top of the league now! :)

Posted: Fri Feb 24, 2006 5:34 pm
by Thomas
Dare2 wrote:Yes. Moving to the top of the league now! :)
PB grows up but is not yet near the top of the league. Why? The performance is great but what I miss is functionality. Some people claim that there are already too many commands but for my taste there could be some more. If you write a more professional app/game you have to do a lot of API calls and even inline ASM to get around PB's lack of some powerful commands. For me, GFA-Basic 32 is the reference and PB is not even near the complexity and integrity of this Basic.

Posted: Fri Feb 24, 2006 5:40 pm
by Dare2
Whup! Thomas! You rained on our parade! :P

Tell you what, let's head over to the GFA boards and discuss it's greatness there! :twisted: ;)

Posted: Fri Feb 24, 2006 6:22 pm
by Thomas
It was bloated and too expensive that's why nobody bought it anymore. :?

Posted: Fri Feb 24, 2006 6:23 pm
by Fred
What do you mean by 'lack of powerful commands' ?

Posted: Fri Feb 24, 2006 6:47 pm
by Thomas
- More mathematical functions (what do you need doubles for then?).
- Boolean data type.
- Commands like Arrayfill(), Clear, ClearW, FRE(), Run, Step expr., Case expr., ...

Can't find a reference for the 32-bit version now, just worked with the demo for some time. There you didn't need to call API's, I just didn't miss a thing.

The expression handling was much more advanced and it worked the same for every data type.

It's not that easy to achieve without sacrificing speed, I know that. So I'm not unhappy with PB but I won't join the fan club for now. :wink:

Posted: Fri Feb 24, 2006 6:51 pm
by ts-soft
Thomas wrote:- More mathematical functions (what do you need doubles for then?).
- Boolean data type.
- Commands like Arrayfill(), Clear, ClearW, FRE(), Step expr., Case expr., ...
and a runtime for this with 1 MB "GfaWin23.Ocx" :lol:

Posted: Fri Feb 24, 2006 6:54 pm
by Thomas
I did Arrayfill and ClearW myself, it's just a few assembly commands. :roll:

Posted: Fri Feb 24, 2006 7:00 pm
by Max.
Thomas wrote:
Dare2 wrote:Yes. Moving to the top of the league now! :)
PB grows up but is not yet near the top of the league. Why? The performance is great but what I miss is functionality. Some people claim that there are already too many commands but for my taste there could be some more. If you write a more professional app/game you have to do a lot of API calls and even inline ASM to get around PB's lack of some powerful commands. For me, GFA-Basic 32 is the reference and PB is not even near the complexity and integrity of this Basic.
Can't really agree to that. While not providing everything you might need itself (Result = CreateApp (Spreadsheet)), it gives you access to nearly everything to an extend that excels any other basic and the biggest success stories of PB wouldn't have been possible in any other Basic than PB that easily.

Posted: Fri Feb 24, 2006 7:05 pm
by Fred
I really have some doubts about the fact your can do everything without calling API... Except the missing maths functions (please draw a list so we can put it on the todo list) all the others things you mentionned can be done in PB without API or assembly (come on, who need asm to do a good program in PB ? The IDE doesn't use on line of assembly code). Would be cool if you can point me the list of the integrated GFA commands so i can take a closer look.

Posted: Fri Feb 24, 2006 7:06 pm
by Thomas
Max. wrote:While not providing everything you might need itself (Result = CreateApp (Spreadsheet)), it gives you access to nearly everything to an extend that excels any other basic and the biggest success stories of PB wouldn't have been possible in any other Basic than PB that easily.
You can hack around everything, that's true. But PB is not consistent in all areas, especially expressions. And from a top of the league language I expect a lot more than just being a wrapper for API, DirectX, OpenGL, Assembler or whatever.
Fred wrote:Would be cool if you can point me the list of the integrated GFA commands so i can take a closer look.
Don't have a list of the 32-bit commands, only for the old Atari ST version: http://home.tu-clausthal.de/~ifmar/gfab ... abasic.txt

Posted: Fri Feb 24, 2006 7:47 pm
by Berikco
Fred wrote: Would be cool if you can point me the list of the integrated GFA commands so i can take a closer look.

As a former official GFA32 betatester, and a not to bad PB coder, i can say you can do at least the same with PB than you could do with GFA 32.
No big runtime needed.
Super small and stable exe's , the GFA32 exe's are unstable as hell.

Here are the mathematical functions....guess Fred maybe needs a translation :lol:

Frank Ostrowski wrote:Log(fexp) Berechnet den natürlichen Logarithmus, mathematisch geschrieben als ln fexp, also den Logarithmus zur Basis e, mit e = 2.71828... .
Log10(fexp) Berechnet den dekadischen (Zehner-) Logarithmus, lg fexp. Logarithmus zur Basis 10.
Log2(fexp) Berechnet den dualen (binären, Zweier-) Logarithmus, lb fexp. Logarithmus zur Basis 2
Der Logarithmus einer Zahl x zu einer Basis y ist die Zahl, mit der y potenziert werden muß, um x zu erhalten. Es gilt x = e ^ Log(x) = Exp(Log(x) und x = 2 ^ Log2(x). Für numerische Berechnungen gilt dies nur angenähert wegen der begrenzten Stellenzahl der Ergebnisse. Dies gilt unabhängig von der verwendeten Stellenzahl (7, 15 oder 12000), da die Ergebnisse von Log (meist) irrationale Zahlen sind, also unendliche nicht periodische Dezimalbrüche.

Allgemein läßt sich der Logarithmus zu einer beliebige Basis berechnen durch:
Log zur Basis y (x) = Log(x) / Log(y). = Log2(x) / Log2(y)
(Anmerkung: Log zur Basis y wird normalerweise durch logy x gekennzeichnet, wobei y tiefgestellt ist. Diese Formatierung läßt WinHelp aber nicht immer zu).
Da bei INTEL-Fließkommaarithmetik die Basis 2 bevorzugt wird, ist Log2(x) minimal schneller als die anderen Log-Funktionen.
Die Log-Funktionen sind nur für Zahlen fexp größer 0 definiert, bei negativen Zahlen und 0 gibt es eine Fehlermeldung.

Exp(fexp) Berechnet e ^ fexp, e = 2.71828...
Exp10(fexp) Berechnet 10 ^ fexp
Exp2(fexp) Berechnet 2 ^ fexp
Die Umkehrfunktionen zu den Log-Funktionen (x = Exp(Log(x)).
Als Parameter fexp sind positive und negative Zahlen sowie 0 erlaubt, das Ergebnis ist stets größer als Null. Bei zu großen positiven Zahlen (etwa Exp(10000)) tritt ein Überlauffehler ein, bei zu kleinen negativen Zahlen (Exp(-10000) ein Unterlauf, der zu einem mathematisch unkorrekten Ergebnis von 0 führt.

Potenzierung: x ^ y = Pow(x, y) = Exp(x * Log(y)) = Exp2(x * Log2(y))
Die Potenzierungsfunktionen mit Log und Exp sind nur für positive Exponenten gültig (y > 0), bei ganzzahlig negativen Exponenten ist der ^ - Operator bzw, die Pow() - Funktion zu verwenden. Bei negativem nicht ganzzahligen Exponenten gibt es auch dann eine Fehlermeldung.
Sqrt(fexp) Quadratwurzel (fexp >= 0)
Sqr(fexp) Quadratwurzel (fexp >= 0)
Square(fexp) Quadrat, (fexp * fexp)

Pow(fexp1, fexp2) Berechnet fexp1 ^ fexp2
_j0(fexp) Bessel Funktion 1. Art, 0. Ordnung.
_j1(fexp) Bessel Funktion 1. Art, 1. Ordnung.
_jn(n, fexp) Bessel Funktion 1. Art, n. Ordnung. (n = iexp)
_y0(fexp) Bessel Funktion 2. Art, 0. Ordnung.
_y1(fexp) Bessel Funktion 2. Art, 1. Ordnung.
_yn (n, fexp) Bessel Funktion 2. Art, n. Ordnung. (n = iexp)
Fact (n) Fakultät, berechnet n! (n = iexp)
Combin(n, k) Kombinationen, berechnet n! / k! / (n-k)! (n, k = iexp)

Variat(n, k) Variationen = Permutationen, n! / k! (n, k = iexp)
Permut(n, k) Variationen = Permutationen, n! / k! (n, k = iexp)
Floor(fexp) Berechnet die nächstkleinere ganze Fließkommazahl
Int(fexp) Berechnet die nächstkleinere ganze Fließkommazahl
Fix(fexp) Berechnet die vom Betrag her nächstkleinere ganze Fließkommazahl, also Abschneiden gegen 0.
Trunc(fexp) Berechnet die vom Betrag her nächstkleinere ganze Fließkommazahl, also Abschneiden gegen 0.

Ceil(fexp) Berechnet die nächstgrößere ganze Fließkommazahl
Frac(fexp) Liefert den gebrochenen Anteil eines arithmetischen Ausdrucks, Frac(x) = x - Trunc(x) = x - Fix(x)
Round(fexp) Runden einer Zahl, 4/5 Rundung
FRound(fexp) Runden einer Zahl, 4/5 Rundung (F = Finanz..)
QRound(fexp) Runden einer Zahl, 4/5 Rundung (Q=Quick). Im Gegensatz zu Round und FRound wird hier die im 80x87 vorgesehene Rundung verwendet, die bei exakt gleichem Abstand zu zwei Zahlen (wie bei 100.5 mit 0.5 Abstand zu 100 und 0.5 Abstand zu 101) stets die gerade Zahl wählt (also QRound (100.5) = 100, Round (100.5) = FRound (100.5) = 101). QRound = QuickRound: Weil diese Rundung vom (Ko-)Prozessor direkt durchgeführt wird, ist sie ein wenig schneller.

Round(fexp, n) FRound(fexp, n) QRound(fexp, n)
Runden einer Zahl, 4/5 Rundung, auf n Stellen, n = 0, wie _Round, bei n>0 wird auf n Stellen hinter dem Komma gerundet, bei n < 0 findet die Rundung vor dem Komma statt. Aufgrund der internen Rundungsproblematik bei Fließkommaarithmetik ist das Ergebnis nicht immer exakt.
Abs(fexp) Betragsfunktion
Abs(iexp) Betragsfunktion, bei _minInt falsch
Abs(liexp) Betragsfunktion, bei _minLarge falsch

Abs(curexp) Betragsfunktion, bei _minCur Fehlermeldung
Sgn(exp) Vorzeichen ermitteln, -1 für exp<0, +1 für exp>0 und 0 für 0. (exp = fexp, iexp, liexp oder curexp) Rückgabewert ist iexp.

Spezialfunktionen:
Diese Funktionen sind für die Benutzung in speziellen Arithmetik-Programmen vorgesehen. Zahlen im intern verwendeten Double-Format bestehen aus einer Mantisse von 52 Bits sowie einem binären Exponenten von 11 Bit und Vorzeichen. Das Vorzeichen läßt sich mit Sgn und Abs behandeln. Zur Trennung der Mantisse und des Exponenten gibt es Funktionen (Mant und GetExp) sowie eine Funktion zur Kombination von Mantisse und Exponent (LdExp).


Mant(fexp) Diese Funktionen ermittelt die Mantisse, also die Zahl zwischen 0.5 und 1.0, die sich durch Multiplikation mit (Division durch) einer Potenz von Zwei ergibt.
GetExp(fexp) Diese Funktion ermittelt den entsprechenden Exponenten der Zweierpotenz.
LdExp(n, fexp) Kombination von Mantisse und Exponent. Wegen der internen Zahlendarstellung im Binärformat ist eine Multiplikation mit einer Zweierpotenz besonders einfach durchführen. LdExp(n, x) entspricht x * 2 ^ n, ist aber etwas schneller.
Winkel Funktionen

Alle Winkelfunktionen sind Fließkommafunktionen, Parameter und Ergebnis sind Fließkomma.


Sin(fexp) Die Sinusfunktion, fexp ist im Bogenmaß
Cos(fexp) Die Cosinusfunktion, fexp ist im Bogenmaß
Tan(fexp) Die Tangensfunktion, fexp ist im Bogenmaß

Asin(fexp) Die Inverse zur Sinusfunktion, -1.0 <= fexp <= 1.0.
Acos(fexp) Die Inverse zur Cosinusfunktion, -1.0 <= fexp <= 1.0.
Atan(fexp) Die Inverse zur Tangensfunktion.
Atn(fexp) Die Inverse zur Tangensfunktion (genau wie Atan).
Atan2(fexp1, fexp2)
Die Inverse zum Tangens, entspricht Atn(fexp1 / fexp2), ohne Division (mit Fehlermöglichkeit bei fexp2 == 0).
SinH(fexp) Hyperbolischer Sinus
CosH(fexp) Hyperbolischer Cosinus

TanH(fexp) Hyperbolischer Tangens
ArSinH(fexp) Hyperbolischer Area Sinus
ArCosH(fexp) Hyperbolischer Area Cosinus
ArTanH(fexp) Hyperbolischer Area Tangens
_Hypot(fexp1, fexp2)
Hypothenusenlängenbestimmung, ergibt Sqr(fexp1 * fexp1 + fexp2 * fexp2), also die Quadratwurzel aus der Summe der Quadrate zweier Zahlen, nach Pythagoras also die Länge der Hypothenuse in einem rechtwinkligen Dreieck.
Anwendungsbeispiel ist die Umrechnung kartesischer (der normalen Rechteck-) Koordinaten in Polarkoordinaten: Winkel = Atan2(x, y) : Radius = _Hypot(x, y)

Deg(fexp) Umwandlung Bogenmaß nach Grad, wie (fexp * 180 / pi)
Rad(fexp) Umwandlung Grad nach Bogenmaß, wie (fexp * PI / 180)