Footprints, Inc. - 4D Development
Welcome to Footprints' Blog

Articles, thoughts, opinions, etc. To help you get a step closer to where you're going.
How to Replace FootRunner Gold with Native 4D Code

For years, Footprints, Inc. has made the FootRunner Gold plugin available to the 4D development community for free as a means for providing scripting in built 4D applications. With the advent of 4D v16, there is now a native technique within 4D for dynamic scripting. As a result, FootRunner Gold will not be updated to support 4D v16. We simply could not achieve the breadth of 4D code support in a plugin that could be achieved natively by 4D itself.

Fortunately, it is fairly straightforward to switch from FootRunner Gold to native 4D code for your dynamic scripting system.

Bakground

4D v16 increased the capability of the PROCESS 4D TAGS command, in particular the way it can transform code via the 4DCODE tag.

This technique will simply ensure old FootRunner Gold scripts contain 4D code text, and a single method for executing the text that will take care of any additional tagging needs.

For example, PROCESS 4D TAGS will process the following text as if it were a 4D method:

— — — — — — — — — —

<!--#4DCode

ALERT ("Hello World!")

-->

— — — — — — — — — —

Step 1 - Remove Checksums

In FootRunner Gold v15, you may have added a checksum to your scripts via the FRAppendChecksum command. These checksums must be first removed from the script text.

To remove these checksums in 4D v15 prior to converting to 4D v16, write a method that strips the checksum with the FRRemoveChecksum command, one script text block at a time.

If you have already updated to 4D v16, you may manually edit your script text to delete the 8-character checksum at the end of the script.

Step 2 - Replace FRRunText and FRRunTextRaw

Create a new 4D method in your application with the following code:

— — — — — — — — — —

C_TEXT($1;$ttInputText;$ttOutput)

$ttInputText:=$1

$ttFRText:="<!--#4DCODE"+Char(Carriage return)+$ttInputText+Char(Space)+"-->"

PROCESS 4D TAGS ($ttFRText;$ttOutput)

— — — — — — — — — —

Now, every place where FRRunText or FRRunTextRaw was used, call this new method instead.

You no longer need to monitor “levels” of script calls à la FRRunTextÔs recursion parameter.

Step 3 - Remove calls to FRAppendChecksum and FRRemoveChecksum

Finally, all previous code for managing checksums is no longer needed and can be removed. Remove each line of code that calls FRAppendChecksum and FRRemoveChecksum.

Step 4 - FootRunner Gold script parameters

Further revisions may need to be made to your scripts if you used FootRunner Gold script parameters (i.e. when your script refers to $1, $2, etc.). The PROCESS 4D TAGS command supports additional parameters in a manner similar to FootRunner Gold, but the script will need to be revised to pass those parameters into the script text. Refer to 4D's documentation of the PROCESS 4D TAGS command for further information.