The Set Variable Action provides a means to set the value of a Project Variable or a User Variable to a new value. The value can include other variables. To append to the existing variable, simply prefix the new value with %VARIABLENAME% where variablename is the name of the variable who's value you are setting.
Note: Although Action List Parameters can be changed, they must be changed from script - not via the Set Variable action.
The name of a FinalBuilder variable to set.
The new value for the variable. Check the Expand Expression box to expand variable and other references in the value. If you want to apply a modifier to the existing value of the variable (eg. maybe you need to make sure the variable has a backslash on the end of it), then select Apply to Existing Value instead.
A modifier is a function that can be applied to the new value (after any variables have been replaced).
The available modifiers are :
|•||None - the default|
|•||Trim - removes white space from the beginning and end of the string|
|•||TrimLeft - removes white space from the left hand side|
|•||TrimRight - removes white space from the right hand side|
|•||IncludeTrailingBackSlash - if a \ doesn't exist on the end of the string, one will be added|
|•||ExcludeTrailingBackSlash - if there's a \ on the end of the string, it will be removed|
|•||ExtractFileName - the drive and path will be removed, eg. "c:\dir\my file.txt" will result in "my file.txt"|
|•||ExtractFilePath - the file name part will be removed, eg. "c:\dir\my file.txt" will result in "c:\dir\"|
|•||ExtractFileDrive - the file name and path will be removed, eg. "c:\dir\my file.txt" will result in "c:"|
|•||ExtractFileExt - the extension of the filename will be returned, eg. "c:\dir\my file.txt" will result in ".txt"|
|•||ShortFileName - the filename and path will be converted to 8.3 DOS style format|
|•||AddQuotes - the string will be enclosed in single quotes if the string is not already quoted|
|•||AddDoubleQuotes - the string will be enclosed in double quotes if the string is not already quoted|
|•||StripQuotes - matching begin and end quotes will be removed from the string|
|•||Increment - the integer value will be incremented by 1|
|•||Deincrement - the integer value will be decremented by 1|
|•||LowerCase - the string will be converted to lowercase characters|
|•||UpperCase - the string will be converted to uppercase characters|
|•||Encrypt - Encrypts using blowfish with a hard wired key|
|•||Decrypt - Decrypts values previously encrypted with the Encrypt modifier|
|•||RemoveFileExt - removes the file extension from the value, eg. "file.txt" will result in "file"|
Apply To Existing Value
If Apply to Existing Value is checked then the New Value field is ignored and the modifier is applied to the existing variable value.
There are some instances, usually when using integer and boolean values in scripting code, that you need to force the variable as a certain type. For example, if you are setting a variable to "100", then you might want this to be forced as an integer type, or maybe as a string type. Use the Default for FinalBuilder to use it's best guess what the type should be.