I have not seen much written on the subject but I was faced with it: how to use logical variables in operations without using if statements.

 

I was not able to pinpoint such a function and may be I am on an entirely wrong track but to solve my “problem” I have devised a possible conversion and I would like to know if it is acceptable or how could it be improved. Here it is, with its justification

 

num_logic = ASC(STR$(logic))\73    

STR$() will return F or T, their ascii codes (ASC) are 70 and 84. The integer division by any value from 71 to 83 will return 0 or 1.

 

This conversion to numeric finds its place in conditional operations (ex. inclusion in a summation when a condition must be respected sum(numeric(i)*num_logic(i)) ) or condition summaries (ex1: how many true conditions apply to the case sum(num_logic(i)) – ex2. if one condition is false all is false num_logic(1)*num_logic(2)*…

 

I would appreciate any comment on that issue and proposed solution. TIA

 

Jacques Paris

_______________________________________________
MapInfo-L mailing list
MapInfo-L@lists.directionsmag.com
http://www.directionsmag.com/mailman/listinfo/mapinfo-l

Reply via email to