Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
|
|
@ -0,0 +1,14 @@
|
|||
// HistoryVariable.script
|
||||
properties
|
||||
history: [], -- a list of all historical values
|
||||
asTextFormat:"[[the last item of my history]]" -- always display the last value
|
||||
end properties
|
||||
|
||||
to set newValue
|
||||
push newValue nested into my history
|
||||
end set
|
||||
|
||||
to rollback
|
||||
pop my history
|
||||
return it
|
||||
end rollback
|
||||
|
|
@ -0,0 +1,20 @@
|
|||
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
|
||||
Loading…
Add table
Add a link
Reference in a new issue