Troi File Plug-in FMP8 conversion notesWe have two flavors of File Plug-ins: Troi File Plug-in 2.8.2 which uses the Classic function API (Application Programmers Interface) and Troi File Plug-in 3 (or higher) which uses the FileMaker 7 Native function API introduced with FileMaker 7. Below you find a discussion of both. NB Below we will discuss Troi File Plug-in 3.0 (the first version to use the new API), but this also applies to versions with a higher number, for example version 5.5 and 4.0. TIP 1 Troi File Plug-in 3.0 and higher also work with FileMaker 8.x and FileMaker Pro 9, as the share the same plug-in API, so the conversion notes also apply for FileMaker 8.x and 9 databases. TIP 2 You can use both 2.8.2 and 3.0 together when running FileMaker 7. This way you can still use the old function calls, while you are converting your databases and gradually move to use the new features of Troi File Plug-in 3.0. But be aware that the classic and new plug-in don't communicate settings, like for example the default FileSpec. Troi File Plug-in 2.8.2 (Classic API) is compatible with FileMaker 7Troi File Plug-in 2.8.2 in general does work with FileMaker Pro 7, without modification. We have found no other issues with FileMaker 7 than the ones below. ReferenceToClipThis function does not work with FileMaker Pro 7. Solution: use the native FileMaker 7 way to import as a reference. See the RefPict.fp7 example file in the download of File Plug-in 3 GetPathTo -CurrentFileNameThis function does not work with FileMaker Pro 7 when
using the "-CurrentFileName" switch. Solution: use the
built-in Get(FilePath) function. General issue for all classic plug-ins with higher ASCII'sFileMaker Pro 7 has a new internal architecture, which is using Unicode for the text fields. FileMaker Pro 6 only used ASCII encoding. All plug-ins written for the 'classic' FileMaker 6 architecture do not receive characters that are outside this ASCII range, these characters are replaced with spaces. In general our classic plug-ins should be compatible as long as the text used is lower ASCII text. The File Plug-in 2.8.2 is using the classic API, so only characters in the ASCII range will work.
Troi File Plug-in 3.0 (Native FileMaker 7 API)Troi File Plug-in 3.0 and later were created specifically for FileMaker 7. Below are some considerations when converting to Troi File Plug-in 3.0 and later. New function syntaxThe plug-in functions have a different syntax compared to the FileMaker 6 plug-in. For example the GetContents function has this syntax in the classic API: External("TrFile-GetContents", "fileSpec| start | size" ) The syntax in the new API looks like this: TrFile_GetContents( switches ; FileSpec ; { start ; { size }} ) Note that functions look like a real function call, no longer a call to External(). Also a hyphen "-" is no longer allowed in the function names, so the hyphens have changed to underscores "_" instead. Note too that parameters don't have to be concatenated with a pipe. Instead use a semicolon ";" to separate the parameters. The brackets "{}" indicate optional parameters. Below is an example how this function would appear in ScriptMaker: Set Field [textField , TIP Function names are no longer case sensitive, and will change to the correct case after you close the "Specify Calculation" dialog box. Multiple parameters and new switchesAs seen from the syntax, plug-in functions now can have multiple parameters. To make this plug-in more consistent, all functions now have a switches parameter as the first parameter. This makes enhancing the plug-in in the future easier. Finally we renamed a few functions and also removed any spaces in the name. See the specific functions notes below for the specifics. TIP Switches are not case sensitive. Omitting optional parametersWhen you omit an optional parameter be sure to add an extra semicolon after the last one, otherwise FileMaker will show an alert that there are too few parameters in this function. For example, below we omitted the 3rd parameter at the end (initialfolder). This is the correct way to do this: Set Field [theFile, New parameter limitsThe plug-in functions now have a size limit of 1 Gb per parameter (up from the total of 64000 character limit for all parameters in FileMaker 6). The Troi File Plug-in 3.0 can handle those bigger parameters, however, displaying the results in FileMaker 7 can take a long time. For example we read in a 300.000 character text from a file on disk with this script step: Set Field [textField , TrFile_GetContents( "-Unused" ; gFileSpec ; ) ] The step itself took less than a second. However, FileMaker then updated the layout, which took about 20 seconds! Converting the function callWhen converting FileMaker does not change the plug-in call. So after conversion you need to do this manually. Here are the global steps:
Let's for example take this File Plug-in 2.8.2 call: External("TrFile-Get FileSpec Dialog", "Please select a file|" & gInitialFolder) This needs to be changed to this File Plug-in 3.0 call: TrFile_SelectFileDialog( "-Unused" ; "Please select a file" ; gInitialFolder ) TIP Just copy script or steps from the example files, they are all in the File Plug-in 3.0 format! Renamed functionsThe table below will help you figure out the new names for changed function names:
Specific functions notesThe table below lists conversion issues with specific functions:
Obsolete functions
Please report problems and bugsIf you find any other problems or bugs, not mentioned above, please send an email to us. Please do NOT send attachments unless specifically requested. Please include the FileMaker version, your platform and operating system in your comments.
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
© 2017 Troi
Automatisering, all rights
reserved. |