
Mac and Windows Compatibility
The ACF Plugin is compatible with both Mac and Windows operating systems. It offers the advantage of running the same compiled code seamlessly on both platforms without the need for any alterations. This cross-compatibility extends to the source code as well, allowing it to be compiled on one platform and executed on the other. However, it's essential to be aware of some platform-specific considerations.
File Paths: Operating systems handle file paths differently. To mitigate this, the plugin automatically converts forward slashes to backslashes on Windows, ensuring that relative paths are handled correctly. For server implementations where a mix of Mac and Windows users is involved, be mindful of differences in file paths, especially if paths are stored for server volumes.
Platform-Specific Code: If your code involves file path manipulation or any other platform-dependent logic, it's advisable to implement code that can handle both Mac and Windows platforms. You can utilize the boolean constants "isMac" or "isWindows" to conditionally execute platform-specific code.
function SaveFile (string filename, string content ) FunctionID 201; int x; x = open (filename, "w"); if ( isWindows ) then content = substitute ( content, "\r", "\r\n"); elseif ( isMac ) then content = substitute ( content, "\r", "\n"); end if write (x, content); close ( x ); return 1; end
Text Encoding: Internally, the plugin uses UTF8 encoded text. Some Windows text editors default to ISO-8859-1 encoding. To ensure seamless code writing on Windows, it's recommended to choose a text editor that supports UTF8 encoding. Notepad.exe may not be the best choice in this regard. Opting for a standard source code editor is a more suitable alternative. When dealing with file I/O, employ text conversion functions to switch between ISO-8859 and UTF8 encoding to handle text requiring this format.
Line Separators: FileMaker uses CR (Carriage Return) internally, whereas text files on Mac and Unix systems use LF (Line Feed), and Windows uses CRLF (Carriage Return Line Feed). Functions that generate text files should account for these differences and provide platform-specific handling. The plugin refrains from automatic processing in this area to grant developers greater control over text generation and parsing according to platform requirements.