Till Runner is the user interface of Till executable programs (TEP). Whenever you click on a TEP or run it by any other method, Till Runner (TR) will handle the EP task.
Say we have random accuracy application “ranacc.till”:
! RANDOM ACCURACY PROJECT
minr 1
i 100 ~
r random
r < minr ?
minr r
! show current minimal random number and
! also write it to debug file
@ print minr
pause 0.3
^
^
result 100 * minr
l len result
result string.section result 0 math.min l 6
message newline + 'random accuracy is ' + result + '%'
pause 1.3
! show result message in UI
print message
! write result message to debug file
@ message
! write result message to output stream
out message
And it is converted to a foreground EP “ranacc.exe”:
> till ranacc ux
Here is TR of “ranacc.exe”:
The title of the application is the name of it. It is possible to set the title and author of TR in the code by using system functions “@title” and “@author”:
! RANDOM ACCURACY PROJECT
@title 'Random Accuracy Project'
@author 'Miki Mamera'
....
....
The title was changed and at the bottom the name of the author was added.
In TR there are three buttons: run, pause and stop, that enable controlling program run. If the program is paused, clicking on “run” will resume running, otherwise it will run the program again.
In case we want to let the user interact with the application, we can modify the application to “ranacc.interactive.till”:
! RANDOM ACCURACY PROJECT
@title 'Random Accuracy Project'
@author 'Miki Mamera'
print 'this project tests the accuracy of'
print 'system random function.' + newline
print 'How much random numbers?'
input iternum
print 'running ' + iternum + ' random numbers...'
pause 0.77
clear
minr 1
m ''
i iternum ~
r random
r < minr ? m ++ newline + minr r
^
result 100 * minr
result string.section result 0 math.min (len result) 6
print m string.trim m ++ newline + newline + 'random accuracy is ' + result + '%'
time {}
time now
tick math.floor time 'tick'
io.write ('random-accuracy-' + tick + '.result') m
The system will get the inserted data and continue running. Writing to result file with timestamp was also added.