# FRAppendChecksum

## Version: 15.0.1

### FRAppendChecksum (MethodTextVar) → ErrorCode

Parameter | Type |  | Description
--- | --- | --- | ---
MethodTextVar | Text | ↔ | A text variable to which the Security code will be appended
ErrorCode | Longint | ← | Returns a code which is used to determine if an error occurred 0 = no error 3 = no text passed -108 = out of memory

### Description

FRAppendChecksum is useful for creating and saving methods other than as FootRunner method files on disk. For example, using FRAppendChecksum, you can pass the text of your method through a routine that will validate and save your copied method in your database. Remember, the FRRunText command requires the security code in order to function properly.

### Example

      //OK button script for a dialog with a text field containing 4D method text

    C_LONGINT ($xlError)

    C_TEXT($ttName;ttMethodText)

    If ((OK=1) & (Length (ttMethodText)>0))   //They clicked OK button and have text to save

       $xlError:=FRAppendChecksum(ttMethodText)   //Tack on the checksum security code

       If ($xlError#0)

         BEEP

         ALERT("Try again!")

       Else

         $ttName:=Request("Name your method:")

         If(OK=1)

           CREATE RECORD ([FRs])    //save the method as a data record

           [FRs]FRName:=ttName   //from the user request dialog

           [FRs]MethodText:= ttMethodText    //from the FootRunner text

           SAVE RECORD ([FRs])

         End if

       End if

    End if