Difference between revisions of "FMWrapper Framework"

From FM Plugin Wikipedia
Jump to: navigation, search
(Number Parameters Passed)
(Number Parameters Passed)
Line 36: Line 36:
  
 
[[Image:numparamsexample.png]]
 
[[Image:numparamsexample.png]]
 +
 +
----

Revision as of 23:42, 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.



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