PB v4 is a "home run" !

Everything else that doesn't fall into one of the other PB categories.
Berikco
Administrator
Administrator
Posts: 1326
Joined: Wed Apr 23, 2003 7:57 pm
Location: Belgium
Contact:

Post by Berikco »

Operatoren
Im allgemeinen werden Berechnungen in der normalen Schreibweise eingegeben, das heißt zwischen den Parametern steht der Operator: also 5 + 7 oder 3 * 4 oder auch 2 + 3 * 4 > 5 * i.
Diese Operatoren sind:


x + y die Addition. Wenn x und y Integer sind (d. h. nicht Double, Single oder Currency, sondern Integer, Word, Byte, Large oder Boolean) wird eine Integeraddition (ohne Überlaufprüfung) durchgeführt, sonst eine Fließkomma- oder Currencyaddition. Eine Fließkommaoperation läßt sich erzwingen durch cDbl oder Kennzeichnung einer Konstanten (durch nnn.0 oder nnn#) als Fließkommakonstante (bzw. cCur oder @).
x - y die Subtraktion. Wenn x und y Integer sind (d. h. nicht Double, Single oder Currency, sondern Integer, Word, Byte, Large oder Boolean) wird eine Integersubtraktion (ohne Überlaufprüfung) durchgeführt, sonst eine Fließkomma- oder Currencysubtraktion.

x * y die Multiplikation. Wenn x und y Integer sind (d. h. nicht Double, Single oder Currency, sondern Integer, Word, Byte, Large oder Boolean) wird eine Integermultiplikation (ohne Überlaufprüfung) durchgeführt, sonst eine Fließkomma- oder Currencymultiplikation.
x / y die Division (immer eine Fließkommadivision)
x ^ y die Potenzierung
-x das negative Vorzeichen, die Negation
+x das positive Vorzeichen
x Mod y der Divisionsrest (als Integeroperation)

x % y der Divisionsrest (als Integeroperation)
x Fmod y der Divisionsrest einer Fließkommadivision
x Div y die IntegerDivision
x \ y die IntegerDivision
x And y die bitweise Und-Verknüpfung (Integer)
x Or y die bitweise Oder-Verknüpfung (Integer)
x Xor y die bitweise Exklusiv-Oder-Verknüpfung (Integer)
x Imp y die bitweise Implikation (Integer)
x Eqv y die bitweise Äquivalenz (Integer)

x And8 y 8-Byte Large Integer bitweise Und
x Or8 y 8-Byte Large Integer bitweise Oder
x Xor8 y 8-Byte Large Integer bitweise Exklusiv-Oder
x Imp8 y 8-Byte Large Integer bitweise Implikation
x Eqv8 y 8-Byte Large Integer bitweise Äquivalenz
x Add8 y 8-Byte Large Integer Addition
x Sub8 y 8-Byte Large Integer Subtraktion
x Mul8 y 8-Byte Large Integer Multiplikation
x Div8 y 8-Byte Large Integer Division

x Mod8 y 8-Byte Large Integer Modulo (Divisionsrest)
x << y Integer x wird um y Bits nach links geschoben (Integer)
x Shl y Integer x wird um y Bits nach links geschoben (Integer)
x Shl% y Integer x wird um y Bits nach links geschoben (32 Bit-Integer)
x Shl& y Wort (2-Byte) Integer x wird um y Bits nach links geschoben (16 Bit-Integer)
x Shlw y Wort (2-Byte) Integer x wird um y Bits nach links geschoben (16 Bit-Integer)

x Shl| y |-Byte Integer x wird um y Bits nach links geschoben (8 Bit-Integer)
x Shl8 y 8-Byte Integer x wird um y Bits nach links geschoben (64 Bit-Large)
x >> y Integer x wird um y Bits nach rechts geschoben (Integer)
x Shr y Integer x wird um y Bits nach rechts geschoben (Integer)
x Shr_ y wie Shr, statt _ %, &, | oder 8, siehe oben: Shl_
x Sar y Integer x wird um y Bits nach rechts geschoben, das oberste Bit wird kopiert, also nicht wie bei Shr mit Null besetzt. Arithmetik Shift nach rechts. (Integer)

x Sar_ y wie Sar, statt _ %, &, | oder 8, siehe oben: Shl_
x Rol y Integer x wird um y Bits links herum rotiert; Bits, die links herausfallen würden, werden von rechts wieder nachgeschoben, also nicht mit Nullen aufgefüllt (Integer)
x Rol_ y wie Rol, statt _ %, &, | oder 8, siehe oben: Shl_
x Ror y Integer x wird um y Bits rechts herum rotiert; Bits, die rechts herausfallen würden, werden von links wieder nachgeschoben, also nicht mit Nullen aufgefüllt (Integer)

x Ror_ y wie Ror, statt _ %, &, | oder 8, siehe oben: Shl_
x = y der Vergleich "gleich"
x != y der Vergleich "ungleich"
x >< y der Vergleich "ungleich"
x <> y der Vergleich "ungleich"
x > y der Vergleich "größer"
x >= y der Vergleich "größer oder gleich"
x => y der Vergleich "gleich oder größer"
x < y der Vergleich "kleiner"
x <= y der Vergleich "kleiner oder gleich"
x =< y der Vergleich "gleich oder kleiner"

x == y der Vergleich "gleich", genau wie = ((altes == ersetzen durch NEAR, oder Vergleich mit Single!))
x NEAR y der Vergleich "fast gleich"
x && y logisches Und, -1 wenn x und y von Null verschieden sind, sonst 0. Wenn x gleich 0 ist, wird y nicht berechnet, da das Ergebnis ohnehin feststeht, logischer Kurzschluß. siehe unten: ?:
x || y logisches Oder, -1 wenn x oder y oder beide von Null verschieden sind, sonst 0. Wenn x ungleich Null ist, so wird y erst gar nicht berechnet, da das Ergebnis ohnehin feststeht, logischer Kurzschluß, siehe unten: ?:

x ^^ y logisches Exklusiv Oder, -1 wenn entweder x und y, aber nicht beide, von Null verschieden sind, sonst 0
x %& y die Bitweise Und-Verknüpfung, höhere Priorität als And
x $ y die Stringaddition, x und y werden, ggf. nach Konvertierung (Str$) als Strings verkettet
x & y die Stringaddition, x und y werden, ggf. nach Konvertierung (Str$) als Strings verkettet
x + y wenn bei der Addition beide Parameter Strings sind, wird eine Stringaddition durchgeführt

x | y die Bitweise Und-Verknüpfung, höhere Priorität als Or
x %| y die Bitweise Und-Verknüpfung, höhere Priorität als Or
Not x das Komplement, mit niedriger Operatorpriorität
~x das Komplement, wie (NOT x), aber mit höherer Priorität
!x die logische Negation, -1 wenn x gleich Null ist, sonst 0
cond ? x : y der bedingte Ausdruck (der einzige dreistellige Operator). wenn cond von 0 verschieden ist, wird der Ausdruck x berechnet, sonst der Ausdruck y. Genau wie bei &&, ||, Iif und Choose wird nur berechnet, was für die Auswertung nötig ist, das heißt, bei ?: oder Iif wird nur der erste oder nur der zweite Ausdurck berechnet - und nicht beide, und dann eines der Rechenergebnisse verworfen. Dadurch ist es z.B. möglich, mit fx = x != 0 ? sin(x) / x : 1 eine Berechnung abzusichern, gegen Division durch Null oder Feldgrenzenüberlauf oder... . Bei komplizierteren Berechnungen gibt es auch einen Geschwindigkeitsgewinn. Gleichbedeutent zu x ? a : b kann auch Iif(x, a, b) verwendet werden.

Variants: Nur die Grundrechenarten + - * / und die Vergleiche ( =, > >=, =>, <, <=, =<, <>, >< und !=) existieren auch in einer Variant Version. Bei Variants mit VT_NULL gibt es sonst (z.B. bei And) eine Fehlermeldung.
Berikco
Administrator
Administrator
Posts: 1326
Joined: Wed Apr 23, 2003 7:57 pm
Location: Belgium
Contact:

Post by Berikco »

mmm takes to long...
here is the help file http://users.telenet.be/berikco/gfawin32.hlp
Berikco
Administrator
Administrator
Posts: 1326
Joined: Wed Apr 23, 2003 7:57 pm
Location: Belgium
Contact:

Post by Berikco »

Thomas wrote:-

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.
You can buy my full version if you like :lol:
User avatar
ts-soft
Always Here
Always Here
Posts: 5756
Joined: Thu Jun 24, 2004 2:44 pm
Location: Berlin - Germany

Post by ts-soft »

Berikco wrote:No big runtime needed.
GFA-BASIC 32 Online Hilfe wrote:Zum GFA-BASIC 32 Version 2.x gehört auch eine neue, umfangreichere Kommandobibliothek mit dem Namen GfaWin2x.Ocx. Diese Datei, mit kompaktem Maschinencode, ist für Exe-Dateien, die mit GFA-BASIC 32 erzeugt werden, notwendig; daher ist es oft erforderlich, zusammen mit dem eigenen, selbstgeschriebenen Programm, diese Datei an Dritte weiterzugeben
PureBasic 5.73 | SpiderBasic 2.30 | Windows 10 Pro (x64) | Linux Mint 20.1 (x64)
Old bugs good, new bugs bad! Updates are evil: might fix old bugs and introduce no new ones.
Image
Berikco
Administrator
Administrator
Posts: 1326
Joined: Wed Apr 23, 2003 7:57 pm
Location: Belgium
Contact:

Post by Berikco »

ts-soft wrote:
Berikco wrote:No big runtime needed.
GFA-BASIC 32 Online Hilfe wrote:Zum GFA-BASIC 32 Version 2.x gehört auch eine neue, umfangreichere Kommandobibliothek mit dem Namen GfaWin2x.Ocx. Diese Datei, mit kompaktem Maschinencode, ist für Exe-Dateien, die mit GFA-BASIC 32 erzeugt werden, notwendig; daher ist es oft erforderlich, zusammen mit dem eigenen, selbstgeschriebenen Programm, diese Datei an Dritte weiterzugeben
If you read my post again, you will see i say PB has no big runtime :)
Thomas
Enthusiast
Enthusiast
Posts: 112
Joined: Sat Apr 26, 2003 8:45 pm

Post by Thomas »

GFA just didn't get the 32-bit version to work properly, too much for a single programmer. Maybe Fred's approach to just implement what people really need and what makes sense is smarter. PB evolves over time and will get even better. But if we praise Fred too much he just starts getting lazy. :wink:

So, PB team, fairly good job!
User avatar
ts-soft
Always Here
Always Here
Posts: 5756
Joined: Thu Jun 24, 2004 2:44 pm
Location: Berlin - Germany

Post by ts-soft »

@Berikco
>> If you read my post again, you will see i say PB has no big runtime

sorry :oops: , my bad english
PureBasic 5.73 | SpiderBasic 2.30 | Windows 10 Pro (x64) | Linux Mint 20.1 (x64)
Old bugs good, new bugs bad! Updates are evil: might fix old bugs and introduce no new ones.
Image
Fred
Administrator
Administrator
Posts: 18247
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Post by Fred »

'Add8' and all '8' ending functions: sounds like a wierd quad support or i miss something ? And what about all the Shl variants ? Seems not that impressive.
Fred
Administrator
Administrator
Posts: 18247
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Post by Fred »

Thomas wrote:But if we praise Fred too much he just starts getting lazy. :wink:
:lol: , so all this fuss was only for that ? :twisted:
Thomas
Enthusiast
Enthusiast
Posts: 112
Joined: Sat Apr 26, 2003 8:45 pm

Post by Thomas »

yep :D
coma
Enthusiast
Enthusiast
Posts: 164
Joined: Fri Aug 15, 2003 3:46 am
Location: Canada

Post by coma »

Image
Trond
Always Here
Always Here
Posts: 7446
Joined: Mon Sep 22, 2003 6:45 pm
Location: Norway

Post by Trond »

PureBasic lacks a Round() function. That is VERY fundamental. (It has a function named Round() but it does a Trunc(), Ceil() or Floor() depending on parameters.)
Thomas
Enthusiast
Enthusiast
Posts: 112
Joined: Sat Apr 26, 2003 8:45 pm

Post by Thomas »

PB does have a round function! It's just invisible... How about a Round(a,3) for mathematical correct roundings?

Code: Select all

a.f = 1.5
Debug b=a
Last edited by Thomas on Fri Feb 24, 2006 10:04 pm, edited 1 time in total.
Trond
Always Here
Always Here
Posts: 7446
Joined: Mon Sep 22, 2003 6:45 pm
Location: Norway

Post by Trond »

I repeat. Function.
User avatar
blueznl
PureBasic Expert
PureBasic Expert
Posts: 6166
Joined: Sat May 17, 2003 11:31 am
Contact:

Post by blueznl »

second trond's remark :-)

but to be honest, up until v3.8x i think pure wasn't ready to be used properly (shoot me :-)) but at that point it got better

the last 3.94 incarnation was pretty good, but inconsistent and somewhat confusing

then came 4.00, and consistency went up, some very good features were added, and all in all it looks quite good now

what i am missing? well, perhaps some small improvements on the editor and a few personal favourites, but i guess what most people will notice is some basic gui handling that is still missing

such as?

- a command / parameter to make windows modal

- some mouse commands

(gfa16 had clipcursor, defmouse, getcaputre, hidem, setcapture, setmouse, showmouse)

- proper right mouse button support

but again, as of v4 i'm pretty impressed
( 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... )
Post Reply