Cache’ Object Script is an interesting language. Take a look at the following two loops
test s done=0 f ln=1:1:10 d q:done . w !,ln . i ln=5 s done=1 w !,"ln after loop "_ln q test2 s done=0 f ln=1:1:10 q:done d . w !,ln . i ln=5 s done=1 w !,"ln after loop "_ln q
The goal is stop after five iterations and then use the ending index to do something more. Executing the above code results in…
PLAY>d test1
2
3
4
5
ln after loop 5
PLAY>d test21
2
3
4
5
ln after loop 6
PLAY>
Can you spot the difference?
Comments