Jump to content

General Custom Function Question


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

Recommended Posts

Howdy, all:

I have a copy of FileMaker Pro 9: The Missing Manual in front of me and I just can't "grok" the general set-up up of a Custom Function.

Take for example this calculation I'm working on:

Case(IsEmpty(eurodate);"";

Case (Month (eurodate) < 10; "0" & Month (eurodate); Month (eurodate)) & "." &

(Case (Day (eurodate) < 10; "0" & Day (eurodate); Day (eurodate))) & "." & Year (eurodate))

For report generating purposes--where I use calculation-based Text fields for their set-up instead of discrete fields--I have different date-related fields (car_date, plane_date, house_date, etc.) but they all need to use the above-referenced calc in each of their respective occurrences.

"Ah-hah!," I thought, "I'll just create a custom function so they'll all use the same calc!" Inserting the calc, itself, in the Edit Custom Function set-up windoid was a no-brainer but that's where my knowledge trail ends: I don't understand how to set it, and the Function Parameters field, so regardless of the field name assigned in the separate tables they'll all use the same calculation.

I hope I made sense; if not, then I really should go back to drinking real coffee instead of this decaf stuff.

Link to comment
Share on other sites

Well you name it whatever you want to call it. The parameter in your case would be, eurodate. Its the values that you are going to be passing to the function.

Therefore, if you name the function YourDate () for example, you could create a calc with YourDate (car_date) and it should format it to the way that you want.

Link to comment
Share on other sites

Your function uses a parameter named "eurodate". This parameter needs to be defined. Just type "eurodate" into the box and click the plus sign.

When you call the function, it will be initially inserted as YourFunction ( eurodate ). You then need to replace the parameter with the actual data, e.g. YourFunction ( SomeDateField ).

Link to comment
Share on other sites

Ah! Thank you both!! There is light at the end of the tunnel...though usually that means there's a train coming the other way.

Link to comment
Share on other sites

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