Jump to content

Debugging Calculation Fields and Custom Functions


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

Recommended Posts

FileMaker Advanced should allow step-throughs of calculation fields and custom functions. Currently this is available only for scripts. My functions can be quite complex, and it's a pain to debug them manually. Here's an example (and I'm not going to explain the symbols because that's not the point);)

Let ( [cp_atTX = Specific_Heat ( TX_K; T0_K; T1_K; T2_K; T3_K; T4_K; cp_atT1; cp_atT2; cp_atT3; cp_atT4; n_max_vibration; T1_endpoint_K; T2_endpoint_K; T3_endpoint_K; T4_endpoint_K; nt; cp_i ) ] ;

Case

(

TX_K ≤ Round(T0_K ; 2) ; .248362 * Erf(.707105 * TX_K - .707105 * T0_K) + .248362 * Erf(.707105 * T0_K) ;

TX_K < Round(midpoint_T0_T1 ; 2) ; Enthalpy ( TX_K; cp_atTX; T0_K; T1_K; T2_K; T3_K; T4_K; enthalpy_0_to_T0; enthalpy_T0_to_T1; enthalpy_T1_to_T2; enthalpy_T2_to_T3; enthalpy_T3_to_T4; n_max_vibration; T1_endpoint_K; T2_endpoint_K; T3_endpoint_K; T4_endpoint_K; cp_atT1; cp_atT2; cp_atT3; cp_atT4; cp_i )+ .248363 * Erf(.707107 * TX_K - .707107 * T0_K) ;

TX_K = Round(midpoint_T0_T1 ; 2) ; aggr_enthalpy_0_to_T0 + aggr_enthalpy_T0_to_midpoint_T0_T1 ;

TX_K < Round(T1_K ; 2) ; aggr_enthalpy_T0_to_midpoint_T0_T1 + Aggr_Enthalpy_Ta_Tb ( midpoint_T0_T1; TX_K; T0_K; T1_K; T2_K; T3_K; T4_K; enthalpy_0_to_T0; enthalpy_T0_to_T1; enthalpy_T1_to_T2; enthalpy_T2_to_T3; enthalpy_T3_to_T4; n_max_vibration; T1_endpoint_K; T2_endpoint_K; T3_endpoint_K; T4_endpoint_K; cp_atT1; cp_atT2; cp_atT3; cp_atT4; cp_i; midpoint_T0_T1; midpoint_T1_T2; midpoint_T2_T3; midpoint_T3_T4; midpoint_TN_Tendpoint; midpoint_Tendpoint_Tmelt; Tendpoint; nt; TN_K; Tmelt_K ) ;

TX_K = Round(T1_K ; 2) ; aggr_enthalpy_0_to_T0 + aggr_enthalpy_T0_T1 ;

TX_K < Round(midpoint_T1_T2 ; 2) and n_max_vibration ≥ 2 ; aggr_enthalpy_0_to_T0 + aggr_enthalpy_T0_T1 + Aggr_Enthalpy_Ta_Tb ( T1_K; TX_K; T0_K; T1_K; T2_K; T3_K; T4_K; enthalpy_0_to_T0; enthalpy_T0_to_T1; enthalpy_T1_to_T2; enthalpy_T2_to_T3; enthalpy_T3_to_T4; n_max_vibration; T1_endpoint_K; T2_endpoint_K; T3_endpoint_K; T4_endpoint_K; cp_atT1; cp_atT2; cp_atT3; cp_atT4; cp_i; midpoint_T0_T1; midpoint_T1_T2; midpoint_T2_T3; midpoint_T3_T4; midpoint_TN_Tendpoint; midpoint_Tendpoint_Tmelt; Tendpoint; nt; TN_K; Tmelt_K ) ;

TX_K = Round(midpoint_T1_T2 ; 2) and n_max_vibration ≥ 2 ; aggr_enthalpy_0_to_T0 + aggr_enthalpy_T0_T1 + aggr_enthalpy_T1_to_midpoint_T1_T2 ;

TX_K < Round(T2_K ; 2) and n_max_vibration ≥ 2 ; aggr_enthalpy_0_to_T0 + aggr_enthalpy_T0_T1 + aggr_enthalpy_T1_to_midpoint_T1_T2 + Aggr_Enthalpy_Ta_Tb ( midpoint_T1_T2; TX_K; T0_K; T1_K; T2_K; T3_K; T4_K; enthalpy_0_to_T0; enthalpy_T0_to_T1; enthalpy_T1_to_T2; enthalpy_T2_to_T3; enthalpy_T3_to_T4; n_max_vibration; T1_endpoint_K; T2_endpoint_K; T3_endpoint_K; T4_endpoint_K; cp_atT1; cp_atT2; cp_atT3; cp_atT4; cp_i; midpoint_T0_T1; midpoint_T1_T2; midpoint_T2_T3; midpoint_T3_T4; midpoint_TN_Tendpoint; midpoint_Tendpoint_Tmelt; Tendpoint; nt; TN_K; Tmelt_K ) ;

TX_K = Round(T2_K ; 2) and n_max_vibration ≥ 2 ; aggr_enthalpy_0_to_T0 + aggr_enthalpy_T0_T1 + aggr_enthalpy_T1_T2 ;

TX_K < Round(midpoint_T2_T3 ; 2) and n_max_vibration ≥ 3 ; aggr_enthalpy_0_to_T0 + aggr_enthalpy_T0_T1 + aggr_enthalpy_T1_T2 + Aggr_Enthalpy_Ta_Tb ( T2_K; TX_K; T0_K; T1_K; T2_K; T3_K; T4_K; enthalpy_0_to_T0; enthalpy_T0_to_T1; enthalpy_T1_to_T2; enthalpy_T2_to_T3; enthalpy_T3_to_T4; n_max_vibration; T1_endpoint_K; T2_endpoint_K; T3_endpoint_K; T4_endpoint_K; cp_atT1; cp_atT2; cp_atT3; cp_atT4; cp_i; midpoint_T0_T1; midpoint_T1_T2; midpoint_T2_T3; midpoint_T3_T4; midpoint_TN_Tendpoint; midpoint_Tendpoint_Tmelt; Tendpoint; nt; TN_K; Tmelt_K ) ;

TX_K = Round(midpoint_T2_T3 ; 2) and n_max_vibration ≥ 3 ; aggr_enthalpy_0_to_T0 + aggr_enthalpy_T0_T1 + aggr_enthalpy_T1_T2 + aggr_enthalpy_T2_to_midpoint_T2_T3 ;

TX_K < Round(T3_K ; 2 ) and n_max_vibration ≥ 3; aggr_enthalpy_0_to_T0 + aggr_enthalpy_T0_T1 + aggr_enthalpy_T1_T2 + aggr_enthalpy_T2_to_midpoint_T2_T3 + Aggr_Enthalpy_Ta_Tb ( midpoint_T2_T3; TX_K; T0_K; T1_K; T2_K; T3_K; T4_K; enthalpy_0_to_T0; enthalpy_T0_to_T1; enthalpy_T1_to_T2; enthalpy_T2_to_T3; enthalpy_T3_to_T4; n_max_vibration; T1_endpoint_K; T2_endpoint_K; T3_endpoint_K; T4_endpoint_K; cp_atT1; cp_atT2; cp_atT3; cp_atT4; cp_i; midpoint_T0_T1; midpoint_T1_T2; midpoint_T2_T3; midpoint_T3_T4; midpoint_TN_Tendpoint; midpoint_Tendpoint_Tmelt; Tendpoint; nt; TN_K; Tmelt_K ) ;

TX_K = Round(T3_K ; 2) and n_max_vibration ≥ 3 ; aggr_enthalpy_0_to_T0 + aggr_enthalpy_T0_T1 + aggr_enthalpy_T1_T2 + aggr_enthalpy_T2_T3 ;

TX_K < Round(midpoint_T3_T4 ; 2) and n_max_vibration = 4 ; aggr_enthalpy_0_to_T0 + aggr_enthalpy_T0_T1 + aggr_enthalpy_T1_T2 + aggr_enthalpy_T2_T3 + Aggr_Enthalpy_Ta_Tb ( T3_K; TX_K; T0_K; T1_K; T2_K; T3_K; T4_K; enthalpy_0_to_T0; enthalpy_T0_to_T1; enthalpy_T1_to_T2; enthalpy_T2_to_T3; enthalpy_T3_to_T4; n_max_vibration; T1_endpoint_K; T2_endpoint_K; T3_endpoint_K; T4_endpoint_K; cp_atT1; cp_atT2; cp_atT3; cp_atT4; cp_i; midpoint_T0_T1; midpoint_T1_T2; midpoint_T2_T3; midpoint_T3_T4; midpoint_TN_Tendpoint; midpoint_Tendpoint_Tmelt; Tendpoint; nt; TN_K; Tmelt_K ) ;

TX_K = Round(midpoint_T3_T4 ; 2) and n_max_vibration = 4 ; aggr_enthalpy_0_to_T0 + aggr_enthalpy_T0_T1 + aggr_enthalpy_T1_T2 + aggr_enthalpy_T2_T3 + aggr_enthalpy_T3_to_midpoint_T3_T4 ;

TX_K < Round(T4_K ; 2) and n_max_vibration = 4 ; aggr_enthalpy_0_to_T0 + aggr_enthalpy_T0_T1 + aggr_enthalpy_T1_T2 + aggr_enthalpy_T2_T3 + aggr_enthalpy_T3_to_midpoint_T3_T4 + Aggr_Enthalpy_Ta_Tb ( midpoint_T3_T4; TX_K; T0_K; T1_K; T2_K; T3_K; T4_K; enthalpy_0_to_T0; enthalpy_T0_to_T1; enthalpy_T1_to_T2; enthalpy_T2_to_T3; enthalpy_T3_to_T4; n_max_vibration; T1_endpoint_K; T2_endpoint_K; T3_endpoint_K; T4_endpoint_K; cp_atT1; cp_atT2; cp_atT3; cp_atT4; cp_i; midpoint_T0_T1; midpoint_T1_T2; midpoint_T2_T3; midpoint_T3_T4; midpoint_TN_Tendpoint; midpoint_Tendpoint_Tmelt; Tendpoint; nt; TN_K; Tmelt_K ) ;

TX_K = Round(T4_K ; 2) and n_max_vibration = 4 ; aggr_enthalpy_0_to_T0 + aggr_enthalpy_T0_T1 + aggr_enthalpy_T1_T2 + aggr_enthalpy_T2_T3 + aggr_enthalpy_T3_T4 ;

TX_K < Round(midpoint_TN_Tendpoint ; 2) ; aggr_enthalpy_at_TN + Aggr_Enthalpy_Ta_Tb ( TN_K; TX_K; T0_K; T1_K; T2_K; T3_K; T4_K; enthalpy_0_to_T0; enthalpy_T0_to_T1; enthalpy_T1_to_T2; enthalpy_T2_to_T3; enthalpy_T3_to_T4; n_max_vibration; T1_endpoint_K; T2_endpoint_K; T3_endpoint_K; T4_endpoint_K; cp_atT1; cp_atT2; cp_atT3; cp_atT4; cp_i; midpoint_T0_T1; midpoint_T1_T2; midpoint_T2_T3; midpoint_T3_T4; midpoint_TN_Tendpoint; midpoint_Tendpoint_Tmelt; Tendpoint; nt; TN_K; Tmelt_K ) ;

TX_K = Round(midpoint_TN_Tendpoint ; 2) ; aggr_enthalpy_at_TN + aggr_enthalpy_TN_to_mdpoint_TN_Tendpoint ;

TX_K < Round(Tendpoint ; 2) ; aggr_enthalpy_at_TN + aggr_enthalpy_TN_to_mdpoint_TN_Tendpoint + Aggr_Enthalpy_Ta_Tb ( midpoint_TN_Tendpoint; TX_K; T0_K; T1_K; T2_K; T3_K; T4_K; enthalpy_0_to_T0; enthalpy_T0_to_T1; enthalpy_T1_to_T2; enthalpy_T2_to_T3; enthalpy_T3_to_T4; n_max_vibration; T1_endpoint_K; T2_endpoint_K; T3_endpoint_K; T4_endpoint_K; cp_atT1; cp_atT2; cp_atT3; cp_atT4; cp_i; midpoint_T0_T1; midpoint_T1_T2; midpoint_T2_T3; midpoint_T3_T4; midpoint_TN_Tendpoint; midpoint_Tendpoint_Tmelt; Tendpoint; nt; TN_K; Tmelt_K ) ;

TX_K = Round(Tendpoint ; 2) ; aggr_enthalpy_at_TN + aggr_enthalpy_TN_Tendpoint ;

TX_K < Round(midpoint_Tendpoint_Tmelt ; 2) ; aggr_enthalpy_at_TN + aggr_enthalpy_TN_Tendpoint + Aggr_Enthalpy_Ta_Tb ( Tendpoint ; TX_K; T0_K; T1_K; T2_K; T3_K; T4_K; enthalpy_0_to_T0; enthalpy_T0_to_T1; enthalpy_T1_to_T2; enthalpy_T2_to_T3; enthalpy_T3_to_T4; n_max_vibration; T1_endpoint_K; T2_endpoint_K; T3_endpoint_K; T4_endpoint_K; cp_atT1; cp_atT2; cp_atT3; cp_atT4; cp_i; midpoint_T0_T1; midpoint_T1_T2; midpoint_T2_T3; midpoint_T3_T4; midpoint_TN_Tendpoint; midpoint_Tendpoint_Tmelt; Tendpoint; nt; TN_K; Tmelt_K ) ;

TX_K = Round(midpoint_Tendpoint_Tmelt ; 2) ; aggr_enthalpy_at_TN + aggr_enthalpy_TN_Tendpoint + aggr_enthalpy_Tendpoint_to_midpoint_Tendpoint_Tmelt ;

TX_K < Round(Tmelt_K ; 2) ; aggr_enthalpy_at_TN + aggr_enthalpy_TN_Tendpoint + aggr_enthalpy_Tendpoint_to_midpoint_Tendpoint_Tmelt + Aggr_Enthalpy_Ta_Tb ( midpoint_Tendpoint_Tmelt; TX_K; T0_K; T1_K; T2_K; T3_K; T4_K; enthalpy_0_to_T0; enthalpy_T0_to_T1; enthalpy_T1_to_T2; enthalpy_T2_to_T3; enthalpy_T3_to_T4; n_max_vibration; T1_endpoint_K; T2_endpoint_K; T3_endpoint_K; T4_endpoint_K; cp_atT1; cp_atT2; cp_atT3; cp_atT4; cp_i; midpoint_T0_T1; midpoint_T1_T2; midpoint_T2_T3; midpoint_T3_T4; midpoint_TN_Tendpoint; midpoint_Tendpoint_Tmelt; Tendpoint; nt; TN_K; Tmelt_K ) ;

TX_K = Round(Tmelt_K ; 2) ; aggr_enthalpy_at_TN + aggr_enthalpy_TN_Tendpoint + aggr_enthalpy_Tendpoint_Tmelt

)

)

========

I'd like to be able to step-through each line and be able to see the values of selected variables.

Edited by Guest
Link to comment
Share on other sites

you can use the DataViewer and comment/uncomment lines with // symbol.

Additionally, you could also buy a keyboard with a carriage return key ;)

LOLz.

Who needs a carriage return?!

http://www.aptworks.com/tools/

I formatted OP just for fun. Somehow seeing it all ordered and legible made it all the more horrifying.

It's a Cthalhulation, not a calculation.

Also, I wish for this feature as well.

Edited by Guest
Link to comment
Share on other sites

This topic is 6085 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.