Jump to content
Sign in to follow this  
WF7A

General Custom Function Question

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.

Share this post


Link to post
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.

Share this post


Link to post
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 ).

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

×
×
  • Create New...

Important Information

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