rivet Posted October 13, 2002 Posted October 13, 2002 scheduling db: Has anyone found a clever way to calc repeating date that are either sequential or non-sequential? i.e. Repeat event for the the next for days repeat event every second day until Repeat event every wednesday of the next two months Currently I have a full calc list offsetting date + 1 day and then I calc some substitutes. It is a bit clumsy and limited to 365 lines (days)
BobWeaver Posted October 18, 2002 Posted October 18, 2002 I don't quite follow what you are trying to do. Could you give more details or maybe an example of what you want your calculation result to look like for a given input.
Vaughan Posted October 18, 2002 Posted October 18, 2002 The only way I can think of is to have a database full of records (say and calendar where each record is a day of the year) and loop through them with a script checking the criteria. Create a related event record when the criteria is met. Brute force, yes. Ugly, sure. Use lots of "Freeze Window" steps! But that's all I can think of.
rivet Posted October 19, 2002 Author Posted October 19, 2002 please I need more hope then that... this is the million dollar question, I am sure a ton of FM guys have been here many times... oh well I will post if I hit it.
kennedy Posted October 19, 2002 Posted October 19, 2002 Well, some of us still aren't quite sure what you're trying to do. You call it a calc, but it sorta sounds like a script that generates records. As Bob suggested, if you tell us exactly what the input is and exactly what the output you want is, maybe someone here can devise a solution.
rivet Posted October 19, 2002 Author Posted October 19, 2002 sorry... user enters a date which he would like that event to happen multiple time in various ways. So say the user would like the event to repeat every second monday and friday for the following 22 weeks. I need to find those dates somehow. currently I have a list that is 365 lines, each line is date+1, date+2, date+3 etc. then I use a script and calc to find what i need, but this solution is a bit of a mess and limited to one year (not to mention - have you ever waited for FMP to check a 365 line calc after you press ok - pack a lunch!) this is just one example, but if you open any calendar app you might have, check out the repeat options that is what I am trying to create. THX
kennedy Posted October 19, 2002 Posted October 19, 2002 So, the user inputs a Date and a repeat spec? But then there would be infinite dates in the answer. Would you also put in an end date, or when do you stop? So, guessing, the user inputs a start Date, an end Date and a repeat-spec and he gets out... what?... one record for each matching Date?... or a single calc'd field that has each of the matching Dates separated by returns?... or?
rivet Posted October 19, 2002 Author Posted October 19, 2002 Yes, A single calc'd field that has each of the matching Dates separated by returns. Note in some repeat situations you may not have an end date. (i.e. repeat for 20 days).
kennedy Posted October 19, 2002 Posted October 19, 2002 The basic problem calls for a loop. Since there's no loop construct in FMP calculations, the best you could do in a straight calculation is unroll the loop a specified number of times... so, it would be a substandard solution, and hideously ugly and impossible to maintain. Another way that would be far less ugly would be a related file (as has already been mentioned). That has the advantage that you could use separate calcs and relationships to implement lots of different repeat specs in a fairly modular fashion. It would be fairly elegant... though, would have the theoretical disadvantage of being an unrolled loop... you have to pre-generate enough records. But practically, as small as the stored file will be, I think you can easily gen more than enough. To use a proper loop, you have to resort to a script that populates the field. That doesn't suffer the issue of pre-generation, but has other disadvantages... such as what invokes the script and how do you avoid inconsistencies. So, which method is more appropriate for your situation?
Recommended Posts
This topic is 8070 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now