defining a method or function that accepts parameters

sorry dumb question here… I’m defining a method to display information for a date. It shows up as mDisplayDate() in the method editor when what I need is mDisplayDate(dateParameter). I can manually enter the parameter in the method editor no problems, but how would I then get access to the parameters inside the mDisplayDate method?

I’ve had a look through the documentation but can’t seem to find any information on this. this is pretty fundamental so obviously i must just be looking in the wrong place.

thanks in advance
Ian

You can just put in the parameter(s) you want when calling - then in the method - you can access those parameters using an array notation (i.e. arguments[0]).

For example:

var today = new Date;
var dateFormatted = mDisplayDate(today);

Then in “mDisplayDate” here’s the code:

return utils.dateFormat(arguments[0], ‘MM/dd/yyyy’);

NOTE: You can pass as many parameters as you want - and you access them as argument[0]…argument[n]

Hope this helps,

Bob Cusick

Thanks Bob

that’s exactly what I needed and I’ve got it working fine now. That’s probably something that should be put into the documentation. section 5.3.9 of the Advanced programmers guide discusses passing parameters but not how you access them once you have passed them in to a function.

cheers
Ian

Ian, I agree. We’re in the process of updating that manual as well.

I’ve passed this on to the docs team.

Thanks for your input!

Cheers,

Bob

bcusick:
Ian, I agree. We’re in the process of updating that manual as well.

Hi Bob,

Any time frame available when or wich new manuals will be completed?

Thanks…

Any time frame available when or wich new manuals will be completed?

Hi Bert,

We just completed updating the Servoy Developer Edition User’s Guide, the Servoy Client Edition User’s Guide, and the Servoy Application Server Administrator’s Guide to bring them current with the Servoy 1.2 release.

These books can be purchased online at http://ww2.ondemandmanuals.com/servoy and they are also available for download as pdf files.

The Servoy Advanced Programming Guide for FileMaker Developers is in the process of being updated and should be completed shortly.

Marc Norman
Servoy