History variables: Difference between revisions
Content added Content deleted
Line 1,277: | Line 1,277: | ||
\\ for strings |
\\ for strings |
||
Module CheckStringHistoryVariables { |
Module CheckStringHistoryVariables { |
||
Class History$ { |
|||
Private: |
|||
myvalue=stack |
|||
Public: |
|||
Group Count { |
|||
Value { |
|||
link parent myvalue to m |
|||
=Len(m) |
|||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
} |
} |
||
} |
|||
Function CopyMe { |
|||
m=This |
|||
.myvalue<=stack(.myvalue) |
|||
=Group(m) |
|||
} |
|||
Group CopyValues { |
|||
⚫ | |||
Else Error "Fault index" |
|||
⚫ | |||
⚫ | |||
⚫ | |||
Stack .myvalue {Drop} |
|||
⚫ | |||
⚫ | |||
Stack .myvalue { |
|||
Push stackitem$()+x$ |
|||
} } |
|||
Value { |
Value { |
||
link parent myvalue to m |
|||
=Stack(m) |
|||
⚫ | |||
Read x$ : Stack .myvalue { Push x$} |
|||
⚫ | |||
⚫ | |||
Module History { |
|||
If Match("S") then Read x$ : Stack .myvalue { Push x$} |
|||
} |
} |
||
} |
} |
||
Function Values$ (x as long) { |
|||
⚫ | |||
⚫ | |||
Else Error "Fault index" |
|||
} |
|||
Module Back { |
|||
if len(.myvalue)<2 then exit |
|||
Stack .myvalue {Drop} |
|||
} |
|||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
} |
} |
||
} |
|||
N$=History$("First") |
|||
⚫ | |||
N$="Second" |
|||
N$="Third" |
|||
Print N.Count=3 |
|||
M=N.CopyValues |
|||
K=Each(M, -1, 1) |
|||
Print N.Values$(2)="Second" |
|||
While K { |
|||
⚫ | |||
} |
|||
N$+=" and this" |
|||
⚫ | |||
Print N.CopyValues |
|||
N.Back |
|||
Print N.Count=3 |
|||
Print N.CopyValues |
|||
⚫ | |||
} |
} |
||
CheckStringHistoryVariables |
CheckStringHistoryVariables |