Difference between revisions of "FMWrapper Framework"

From FM Plugin Wikipedia
Jump to: navigation, search
(Size();)
(Size();)
Line 14: Line 14:
 
=Size();=
 
=Size();=
 
Returns the number of parameters passed in the function call by the user.  [numparams-url more]
 
Returns the number of parameters passed in the function call by the user.  [numparams-url more]
 +
[[more numparams-url]]
  
 
=AtAsText(index);=
 
=AtAsText(index);=

Revision as of 23:48, 7 July 2007

These pages are about the FM Wrapper Framework which is supplied by FileMaker and must be included in order to compile plugins for FileMaker


It should be noted, that the FMWrapper.framework itself cannot be published on the internet for others to download or view as you will be in breach of the FMI license agreement.



dataVect

Size();

Returns the number of parameters passed in the function call by the user. [numparams-url more] more numparams-url

AtAsText(index);

Returns the parameter as a fmx::TextPtr for the 'index' parameter. [atastext-url|more]


Number Parameters Passed

The new API allows you to accept multiple parameters which are passed in the Function Call. eg. IDMA_FunctionName( param1 ; param2 ; param3 ; etc )


When registering your function, parameters 5 & 6 refer to the min & max (respectively) number of parameters the user can/must supply. If they are the same, then the user must specify that many parameters. If different, then the user can specify any number between the min & max values.


  • err = fmx::ExprEnv::RegisterExternalFunction(*pluginID, kIDMA_ConvertScript, *name, *prototype, 3, 4, regFunctionFlags, Do_Convert );


Now, in your function, when you want to find out the number of parameters the user actually passed, you can include the following line.

  • fmx::ulong nParams = dataVect.Size();

where

  • fmx::ulong - filemaker type 'unsigned long' (See FMXExtern.h)
  • nParams - variable to store the result, in this case the number of parameters passed by the user
  • dataVect.Size() - returns a ulong number (see FMXCalcEngine.h)



Numparamsexample.png