Adding a variable to the script
To add a variable to a script, call the TfsScript.AddVariable method. It is similar to AddConst method, except that fact that you can change the value of a variable in a script. Note that the actual Delphi variable is not changed after the script execution.
fsScript1.AddVariable('i', 'Integer', i);