search for: startsystem

Displaying 1 result from an estimated 1 matches for "startsystem".

Did you mean: starsystems
2013 Sep 15
1
Executing a code until a new user input aborts it (readlines?)
...ut and stop the code when the correct input was entered. Below is an example of a function which would run an endless loop but check in each iteration if there was a new user input which would abort it. It does not do the right thing obviously but maybe someone can point out how this can be done. startSystem <- function(){ cat("Processing code, hit ENTER to stop.") i=a=n=1 while(!is.na(n)){ a=i+a i=i+1 n = readline("") } return(NULL) } Thanks! [[alternative HTML version deleted]]