Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×
The Claris Museum: The Vault of FileMaker Antiquities at Claris Engage 2025! ×

This topic is 8015 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

Hi all,

I had this problem yesterday that almost fried my computer.

2 selfjoin relationships

RelateForward= serial#+1::serial#

RelateBack=serial#-1::serial#

2 Calcs:

c_Calc1: case(not isempty(RelateBack::i_EndTime)and n_scheduled>0, case(not isempty(RelateBack::c_calc2)and n_scheduled>0(relateback::c_Calc2))

c_Calc2: case(not isempty(relateback::c_calc1)and n_scheduled>0, relateback::c_calc1)

One big mess. I know that the calcs are somewhat circular in nature, but they do have defined limits (when t_scheduled=0). I was trying to have all records in an HourLineItem scheduling file store the endtime for a shared open block of time (it is a musician rehearsal scheduling solution that finds times that all players on a certain piece can rehearse).

Thing is, filemaker allowed me to make this beast (usually notifies me when I am going to cause a feedback loop), and then wouldnt allow me to do anything about it. Once I exited definefields, screen froze, hourglass appeared, and could not quit the file or app or anything. Ended up shutting down manually, totally damaging the files and apparently frying part of my hard drive. So, does anyone have a way of safely (or not as dangerous) breaking out of loops like this once they have been started?

BTW-

figured out a different way to do what I needed to, but was just experimenting with calcs.

-Raz

Posted

c_Calc1: case(not isempty(RelateBack::i_EndTime)and n_scheduled>0, case(not isempty(RelateBack::c_calc2)and n_scheduled>0(relateback::c_Calc2))

c_Calc2: case(not isempty(relateback::c_calc1)and n_scheduled>0, relateback::c_calc1)

It looks like your nested case statements (and why nest? Avoiding nesting is one of the case statement's best features!) fail to provide FM with something to do. Let's look at it, simplified:

case(Criterion1, case(Criterion2))

You've given the first case statement something to do if criterion1 is satisfied, that is progress to the nested case. If criterion1 is not satisfied, it will do nothing. Then, in the nested case, you have not given it anything to do if criterion2 is satisfied. There needs to be a comma after criterion2, then instructions for something to happen.

It looks like whatever the results of both criteria, your case statement instructs the script to do nothing. I would wonder why your machine freezes on execution, it should simply give no results. But part of the second, nested, case depends on the results of calc2. This seems to be a good case statement. If its criterion is satisfied, it will fill its field with relateback::c_calc1, and if not satisfied, do nothing. This may somehow set up a feedback loop that FM's syntax detector failed to detect.

I could be way off on all this, though.

Steve Brown

Posted

Thanks Steve,

was not my finest hour in the calc dept, but was just experimenting. I can comprehend why it was circular (calc1 is based on calc2 is based on calc1 is based on...), but was hoping someone knew of a way to break out of this loop without force quitting.

I would not advise testing this on your machine though (try it at work grin.gif).

-Raz

This topic is 8015 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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.