BASIC

Author Topic: SYNTAX - alias of <> to !=  (Read 1953 times)

Offline kaotiklabs

  • Dr. Type
  • ****
  • Posts: 313
  • Spain is diferent
    • View Profile
SYNTAX - alias of <> to !=
« on: 2009-Jun-28 »
Maybe would be useful to add the ! sign as NOT, like C language.

You know, liken an alias of <> to !=

Even could be used with boolean functions like:

Code: GLBasic [Select]
while !GameFinished()

...

wend
Vote Cthulhu! Because the stars are right!!!!
Ia Ia Cthulhu F' tang!

Offline Kitty Hello

  • code monkey
  • Administrator
  • Prof. Inline
  • *******
  • Posts: 10714
  • here on my island the sea says 'hello'
    • View Profile
    • http://www.glbasic.com
Re: SYNTAX - alias of <> to !=
« Reply #1 on: 2009-Jun-29 »
WHILE NOT GameFinished() would be nice, right. It's on my TODO list.

Offline Moru

  • Administrator
  • Prof. Inline
  • *******
  • Posts: 1775
    • View Profile
    • Homepage
Re: SYNTAX - alias of <> to !=
« Reply #2 on: 2009-Jun-29 »
In those basics I have used so far you use the NOT function that doesn't exist in GLBasic but can be easily made with a function like this: :-)

Code: GLBasic [Select]
WHILE NOT(GameFinished())
        // do the game
WEND

FUNCTION NOT: val
        IF val = TRUE THEN RETURN FALSE
        IF val = FALSE THEN RETURN TRUE
ENDFUNCTION