RosettaCodeData/Task/History-variables/SenseTalk/history-variables-2.sensetalk
2023-07-01 13:44:08 -04:00

20 lines
464 B
Text

set x to be a new HistoryVariable
tell x to set "Hello"
put "x is now" && x -- display the current value
tell x to set 88
put "x is now" && x
tell x to set "World"
put "x is now" && x
put "History of x:" && x's history -- non-destructively display the history
tell x to set [9,6,3] -- set it to a list
put "x is now" && x
put "History of x:" && the history of x
put "Rolling back:" && x.rollback -- remove the last value
put "After rollback, x is now" && x