Code: Select all
{#settemp -name counter -content 1}{#loop {#input -head {#gettemp counter -variablename counter}. Enter Data -single}{#cond -if {#input -head {#gettemp counter -variablename counter}. Enter Data -single} == -then {#settemp -name counter -content 99} -else {#settemp -name counter -content {#calc {#gettemp counter -variablename counter}+1 -round 0}}} -count 100}
I am attempting to create a loop which will enter a list of data one after the other. The problem I am having is with the end of the loop. The idea is that if you press enter without entering anything in the data field the loop will end and the data printed to the application. The problem is that it is currently functional but I would like the routine to end once the user enters no data. Instead, it is running the final/last loop and enter has to be pressed a second time so that the condition check can ensure that the counter has reached 100.
I would really like ideas to do this more elegantly. In other words, data can be entered sequentially until the counter reaches 100 or the user enters no data (or maybe another option will work better) and the routine ends immediately?