![]() | |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
FMP v8.5 adv Win XP I have built a calender/remember file. A have fields: DateToRemember <Date WarnDaysAhead <Number What I want is to to have a calculation that returns TRUE (1) when the application needs to remind me or FALSE (0) when no reminder is needed. I seem to miss something. I have tried a couple of things but never have gotten it right. The current calc is: cRemember Let ( DIF = DateToRemember - get ( CurrentDate) ; Case ( DIF < 0 ; 0 ; IsEmpty ( WarnDaysAhead ) ; 0 ; DIF > WarnDaysAhead ; 0; 1) ) So my reasoning was: DIF < 0 the DateToRemember is a date in the past. (I don't want to be remembered of those) IsEmpty ( WarnDaysAhead ) I don't want to be remembered at all DIF > WarnDaysAhead the DateToRemember is further ahead the the number of day I have entered in WarnDaysAhead. (I don't want to be remembered yet) In all other cases it is TRUE (1) and I should get warned. Now I have this calender file and I create a separate check file. This will perform just the check. I create a constant here (c_Const <1>) and related this to the cRemember. Now the start-script checks if this relationship is valid. (There are records that returned TRUE). But one way ore the other I don't get the first calculation to return the expected results. What am I missing. Keep Well, Ursus |
#3
| |||
| |||
|
|
Ursus wrote: The current calc is: cRemember Let ( DIF = DateToRemember - get ( CurrentDate) ; Case ( DIF < 0 ; 0 ; IsEmpty ( WarnDaysAhead ) ; 0 ; DIF > WarnDaysAhead ; 0; 1) ) |
#4
| |||
| |||
|
|
Ursus wrote: FMP v8.5 adv Win XP I have built a calender/remember file. Hi Ursus, try this (with some extranea/options) Thanks Chris, |
#5
| |||
| |||
|
|
"Chris Brown" <cbrown (AT) medicine (DOT) adelaide.edu.au> schreef in bericht news:f6s19n$g4v$1 (AT) aioe (DOT) org... Ursus wrote: FMP v8.5 adv Win XP I have built a calender/remember file. Hi Ursus, try this (with some extranea/options) Thanks Chris, Why does this work. What I have done with my own file is split the case that I originally posted into three separate calculations and then created a fourth that simply reads CalcA AND CalcB AND CalcC. This does also has the correct result. Why would my case not work and why does it work when split into three parts. But then again. It now dows work. Thanks for that. Ursus |
#6
| |||
| |||
|
|
I think I have a similar problem in that I would like a text field colored based on how a value in a date field compares to the Current Date. The coloring will work correctly if I modify the calculation but not on following days. My feeling is that a change in the Current Date will not cause the calculations to be re-evaluated. Various attempts at using the Evaluate function where a trigger variable is based on the Current Date have not helped. If there is a way to make the system controlled Current Date trigger a calculation, we will both be happy. Tom On Jul 8, 5:59 pm, Chris Brown <cbr... (AT) medicine (DOT) adelaide.edu.au wrote: Ursus wrote: The current calc is: cRemember Let ( DIF = DateToRemember - get ( CurrentDate) ; Case ( DIF < 0 ; 0 ; IsEmpty ( WarnDaysAhead ) ; 0 ; DIF > WarnDaysAhead ; 0; 1) ) |
#7
| |||
| |||
|
|
Why does this work. What I have done with my own file is split the case that I originally posted into three separate calculations and then created a fourth that simply reads CalcA AND CalcB AND CalcC. This does also has the correct result. Why would my case not work and why does it work when split into three parts. But then again. It now dows work. Thanks for that. Ursus My guess would be that it is the sequence in the case statement, the first line gets result/execution priority, the second row next priority... I often build these up from separate calcs too, its a good way of checking logic elements. regards |
#8
| |||
| |||
|
|
Why does this work. What I have done with my own file is split the case that I originally posted into three separate calculations and then created a fourth that simply reads CalcA AND CalcB AND CalcC. This does also has the correct result. Why would my case not work and why does it work when split into three parts. But then again. It now dows work. Thanks for that. Ursus My guess would be that it is the sequence in the case statement, the first line gets result/execution priority, the second row next priority... I often build these up from separate calcs too, its a good way of checking logic elements. regards I have to come back on this. It does in fact NOT work for dates I create in the future. Yesterday I created a test record for today. I just closed the file and fired the check today. I did not get any warning. Then I opened the calender file switched to the record that holds the test-item. Then refired the test and it DID work. And then afterwards worked on every single test I did. It still looks like the calculation on the date or the relationship does not update. Ursus |
#9
| |||
| |||
|
|
that you created todays date in advance in CAL, then closed the file, then today opened CHECK and it didn't recognize the value 1 records in CAL, really sounds like CAL hasn't re-indexed. And it won't until either it is reopened (and when it is, the Check works), or forced to reindex (which closing doesn't do; opening does; as far as I know) so you need to trigger a re-index, before closing CAL, or open CAL , before opening CHECK, in order to trigger the re-index in CAL |
![]() |
| Thread Tools | |
| Display Modes | |
| |