Requires FM 1.0 Beta 8.4 (Sep 2007) or newer
%fml Title: "Test copyResToArray" Category: "FM Example Code" Embed: Other="test.txt" // Make a control to display text on the interface ctl[10]: STATICTEXT, Size=(100, 40), Text="This text will be replaced" OnFilterStart: { bool loaded = false; // Load the test.txt file embedded in the plugin into Array #0 loaded = copyResToArray("FMDATA", "test.txt", 0); // If the resource loaded, copy the (max) first 255 characters // into an internal string variable, so it correctly ends // with a zero byte to mark the end of string if (loaded) { strncpy(str1, getArrayAddress(0), 255); } else { strncpy(str1, "Could not find test.txt file", 255); } // Set control #10 to be labelled with the contents of str1 setCtlText(10, str1); return true; }