bool type needed;

Post your requests and ideas on the future development of mikroC.
Post Reply
Author
Message
Serge
Posts: 71
Joined: 12 May 2006 09:41

bool type needed;

#1 Post by Serge » 17 May 2006 16:02

Usefull for flags..

I used enum. or anything else, but the code became garbage...

piort
Posts: 1379
Joined: 28 Dec 2005 16:42
Location: Laval,Québec,Canada,Earth... :-)
Contact:

#2 Post by piort » 18 May 2006 05:01

hi,

i know, bool type are usefull but you can make yours if you want...
the technic i use is to declare a var to byte type and access every bit in it...

let see a exemple ( in pseudo code) :

Code: Select all


var
booli : byte ;
  //some code
booli.0 := 1;
  //some other code
if booli.0 then
  //other code

have fun :)

Serge
Posts: 71
Joined: 12 May 2006 09:41

#3 Post by Serge » 18 May 2006 08:04

make this simple without bool

bool foo(void)
{
// do anything

if (success) return true;
else return false;
}


void foo_caller(void)
{
if (foo()) do_progress;
else do_anything_else
}

bool is usefull here...

Post Reply

Return to “mikroC Wish List”