
Debugging Your Code
Debugging in ACF may not offer a traditional step-through debugging experience, but there are two essential features designed to help you debug your code effectively:
Print Statements: You can insert "print" statements within your code to output information to the console. These print statements don't affect the function's return value but are invaluable for debugging purposes.
Plugin Function ACF_GetConsoleOutput: This function allows you to retrieve the printed output and store it in a text field, variable, or any suitable storage location. The console output can also be monitored using the Data Viewer.
In addition to these features, you can assign values to global FileMaker variables to monitor plugin execution without relying on the console function. It's important to note that each call to ACF_run
will reset the console.
Example:
string a = "this is a string";
int b = 22;
float c = 100.36;
print format ( "Variables a, b, c: %s, %d, %10.2f \n", a, b, c );
// Using the plugin function ACF_GetConsoleOutput lets you retrieve this text:
Variables a, b, c: this is a string, 22, 100.36
In this example, "print" statements are used to display variable values in the console. You can then use ACF_GetConsoleOutput
to retrieve this printed information, aiding you in debugging your ACF code.
This section explains the debugging capabilities within ACF, including how to use print statements and retrieve console output, which can be invaluable for debugging your code effectively.