What are the use cases of array of Boolean

Because I didn’t know how to use array of bolean and didn’t see the need to use it, I’ve never used array of bolean. and probably most of you guys haven’t either.

But I want to know how and in which situations it will be useful

Hi @sagar.raval

So lets say you have some computations that you need to do on every row of datatable and then the result of true or false needs to be used to either populate the data or no to some field in web application

then doing the computation for each row separately would take so much of memory…SO instead we can do the computations using a compute expression or a linq query for all the rows at once and store the results as true or false in array memory…and just loop through the array and we will know if we need to populate the data or no…

This is one of the scenarios but you will come across many…so basically we mostly use these kind of arrays to use the memory effectively rather than doing the same activity multiple times which consumes more memory


well if possible to give another simple scenario

i didn’t understand

Hi @sagar.raval

Often we see use of them only in complete scenarios …like because for any simple scenario you might not be able to find a notable difference in the time it takes…but yes if you need some other scenarios

I found similar question here…May be can have a look



To give some simple scenario

say you have an array containing numbers in random sequence and you need to know what index of array elements are greater than 100 and less than 100 …ideally you can use a function over this to get to check if they are greater or less…but say you are using this check in multiple places in your project…

then instead of doing the calculation multiple times…do it once store a true or false array…so next time you use …just filter on true or false …no computation ot check that you need to do again


This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.