Version: 2.2.1 +
Object Type: Action Object
With a ChangeValue you can set the value of either a UserVariable or a row of a UserTable. You can also clear the value of either one. The value will then be set back automatically to the value specified in the property DefaultValue of the targeted object.
This property indicates under which condition the ChangeValue is to be executed. If nothing is entered the ChangeValue will always be executed. If a condition has been filled in the ChangeValue will only be executed if the Condition is 'True'. In the property a Formula of type Boolean can be entered as well as a Fixed or a Reference to another object of type Boolean.
DebugLogMode (from version 4.1)
Indicates the level of detail of debug information that is logged when running a Futurama application (website, webservice, console application) to the trace, a logfile, a database etc. The possible values are:
- None: no debug information is logged
- Simple: only basic information is given
- Extended: in addition to the information in the Simple mode the values of all the properties of the object are shown
Possible values are True or False. If the value is False, then the object can only be used within the document where it is created. If the value is True, then also from other Futurama documents can be referred to this object. This means that changes in the object also affect the document in which is referred to this object. If the value is True and you attempt to move or delete the object, a warning will be given. To limit these warnings to a minimum it is recommended to set IsPublic to True only when necessary.
This is the new value that will be given to the UserVariable or row of the UserTable. Only values of the Type of the object that has been selected in the property TargetUserVariable will be possible. If the value is left empty the TargetUserVariable will be cleared i.e. reset to it's DefaultValue.
Note that to secure that NewValue is of the same type as TargetUserVariable, it is recommended first to set the property TargetUserVariable and then to set the value in the property NewValue.
In this property the object needs to be defined whose value has to be set or reset. This has to be a UserVariable or a UserTable. In case of a UserTable also the index of the desired row has to be specified.
The name of the object.
Here a comment can be entered. For example a short description of the object.
The unique identification number of the object. This number is automatically generated by Futurama on the moment of creation. This number can be used when searching for a certain object in the Find Window.
This is an automatic property. If NewValue is empty it will state that the TargetUserVariable will be cleared. If a value is specified in NewValue it will state that the value of the TargetUserVariable will be set to this value.
In this example it is shown how a ChangeValue can be used to change the value of a UserVariable.
Download the Futurama Document changevalue example.
- Open the XML-document which is contained in the zip-file in the Futurama Editor (Version 4.2.1 or later).
- Here an Action object can be seen which contains a ChangeValue object. The property TargetUserVariable of the ChangeValue refers to the UserVariable 'Sum'. As can be seen in the property NewValue of the ChangeValue the value it gives to 'Sum' is the current value of 'Sum' plus 2.
- To see how it works first verify in the Result Window that the current value of 'Sum' is 0.
- Now do a rightclick on the ChangeValue and select Debug | Execute. Verify that the value of 'Sum' has increased to 2.
- Execute the ChangeValue a couple of times and verify that the value of 'Sum' increases by 2 every time, until the value is equal to 10.
- Executing the ChangeValue after that has no effect. This is because a condition has been placed in the property Condition of the ChangeValue checking if 'Sum' is less than 10. If this is true the ChangeValue will be executed and the value of 'Sum' increases. If not the ChangeValue will not be executed.
- Note that executing the Action has the same result as executing the ChangeValue.