Author Topic: as true and false are 1 and 0. Null should be -1  (Read 1636 times)

Antikore

  • Developing Mortal Theater at day, developing depression at night.
  • Level 22: Trex
  • *
  • Posts: 2020
  • Enjoying Platform Builder from the very start
    • View Profile
    • PBuilder Resources
as true and false are 1 and 0. Null should be -1
« on: February 22, 2020, 01:56:49 PM »
Usign -1 to detect when something returns null I think can be very useful. I suggested something before to use it.

Null should be like -1, as true can be 1 and false 0.
Example of use
Code: [Select]
if key = null //If no key is pressed
{
}
Sorry because my English is not very good because I'm Spanish ;) :P

CGM

  • Christian, 3D artist, former Platform Builder gamdev
  • Master Builder
  • *
  • Posts: 3836
    • View Profile
Re: as true and false are 1 and 0. Null should be -1
« Reply #1 on: February 22, 2020, 02:42:42 PM »
I suggested this. Only I suggested Key = none.