Populating Boolean variables

Share this topic:



Link to this posting

Postby Ursego » 21 Feb 2013, 22:07

If it's possible, populate Boolean variables with results of Boolean expressions instead of direct assigning of true and false.

*** BAD code: ***

PB:
Code: Select all
if ll_row_count > 1 then
   lb_multi_rows_mode = true
else
   lb_multi_rows_mode = false
end if

C#:
Code: Select all
if (rowCount > 1)
        {
        multiRowsMode = true;
        }
else
        {
        multiRowsMode = false;
        }

*** GOOD code: ***

PB:
Code: Select all
lb_multi_rows_mode = (ll_row_count > 1)

C#:
Code: Select all
multiRowsMode = (rowCount > 1);
User avatar
Ursego
Site Admin
 
Posts: 111
Joined: 19 Feb 2013, 20:33

Return to Intriguing World of Logic

Who is online

Users browsing this forum: No registered users and 1 guest


Populating Boolean variables

Share this topic:


If you think that this site is not too bad, please LIKE it in Facebook. Thanks!





cron
free counters

eXTReMe Tracker