Boolean Arrays

ShonatinaShonatina Member Posts: 114
hi,

I have attached the requirement, how can I code it in such a way that I can select different cominations, the weeks apart and occurances from it and still get the right end date.
Am trying to use arrays with boolean, but i dont know how to pass combinations of values without hard coding the combinations like
if (tuesday and monday and not wed and not thur and not fri and not sat and not sun) = true then
{body condition...}
if (tuesday and monday and not wed and thur and not fri and not sat and not sun) = true then
{body condition...}

i dont want to hard code all the possible combinations. Kindly suggest how to execute with array.

thank you in advance.
smile always
shona
That which you seek inside is that which you find outside

Comments

  • David_SingletonDavid_Singleton Member Posts: 5,479
    Create a new table with a code primary key and boolean fields for the days of the week and store the data there. Create a drill down from your table to this one.
    David Singleton
  • ShonatinaShonatina Member Posts: 114
    hi David, Thanks for replying.

    As of now i thought of doing like this, im using the Date virtual table and finding the day of the week and assigning the values of each day to a array i created with dimension 7.

    so array[1] = monday n so on. with that i create a loop to calculate the end dates.

    How does your method works. how will i know which booleans are selected and what are they?

    Thanks again.
    smile always
    shona
    That which you seek inside is that which you find outside
  • David_SingletonDavid_Singleton Member Posts: 5,479
    Just create the setup manually.

    the table has 8 fields

    Code (code10)
    Mon (boolean)
    Tue (boolean)
    Wed (boolean)
    Thur (boolean)
    Fri (boolean)
    Sat (boolean)
    Sun (boolean)
    David Singleton
  • ufukufuk Member Posts: 514
    You can check the CalcNextRunTime function in Job Queue Dispacher codeunit.
    Ufuk Asci
    Pargesoft
Sign In or Register to comment.