GLBasic forum

Feature request => IDE/Syntax => Topic started by: Markus on 2012-Apr-22

Title: =>
Post by: Markus on 2012-Apr-22
=> ist Syntyx error und man muß >= schreiben.
Das läßt sich doch bestimmt einfach erweitern.

Wenn ich z.B. gucken möchte ob die Mauspos. in einem Rechteck ist schreibe ich immer mx=>x1
weil = der Rand ist und es dann nach innen mit > weiter geht.
Auf der rechten Seite schreibe ich mx<=x2
Die XY Koordinaten gehen ja auch von links nach rechts und oben nach unten.
Title: Re: =>
Post by: hardyx on 2012-Apr-22
In *all* programmig languages the comparation operators used are: <=, = and >=, the equal sign is always in the right. The forms => or =< are not valid. Using a=>b is odd. It's easy to put it in the correct form: b<=a.
Title: Re: =>
Post by: Markus on 2012-Apr-22
i think not all but.
glbasic can translate it also before compiling the c source.

= and > is two in one , a human need no order , its equal or greater , greater or equal.

Visual Basic 2010 and VisualBasic 6 replace the two chars on the fly in the editor.
BlitzBasic3D understand =>
BlitzMax understand =>
DarkBasic Pro understand =>

you can see in 5 of 5 i can write it and its a entrenched habit :-)
Title: Re: =>
Post by: spicypixel on 2012-Apr-22
We say "greater than or equal to" and we also say "less than or equal to". We don't tend to say it the other way around. So for me it makes sense.
Title: Re: =>
Post by: Markus on 2012-Apr-22
the x coord move from left to right so the equal comes first then the greater.
i transfer what i see in a program.
for me is this => inside <=
it looks like two arrows , you can better read and understand this as >= <=

Title: Re: =>
Post by: Ian Price on 2012-Apr-22
I used to use Div Games Studio and that accepted => or >=  and <= or =<

Like you Markus, I always used => and <= too, as they looked like arrows and somehow appeared neater/tidier in the code. Strange but true.

Even after using GLB for a couple of years, I still get the order wrong sometimes for comparisons like this.
Title: Re: =>
Post by: Gary on 2012-Apr-22
While on this subject I keep typing != as I am used to writing in C, If the alternatives get added could this be added as well?
Title: Re: =>
Post by: Markus on 2012-Apr-23
i found a new example why i write this  :S

IF LEN(self.text$)=>1 THEN ...
Title: Re: =>
Post by: Moru on 2012-Apr-23
Since I do more PHP than anything else at the moment, I would be so confused. => is used for totally different things, see snip below:

Code (glbasic) Select
$var = array(
    'first' => 1,
    'second' => 2,
    'third' => 3,
);


When I started programming there was languages that accepted them in any order and that just made me confused. If I would have been forced to the correct order directly mabe it would have been easier now.
Title: Re: =>
Post by: Markus on 2012-Apr-23
@Moru
PHP is gay :-)
can be much easier
the $ must confuse you also ;-)