X = 'a b '; /* Two blanks in each space */
Y = ' '; /* One blank */
N = length(X); /* N = 6 */
I = verifyr(X,Y,N); /* I = 4 */
do while (I > 0);
display ( 'Nonblank at position ' || trim(I) );
N = I - 1;
I = verifyr(X,Y,N);
end;
After the first pass through the do-loop, N=3 and VERIFYR(X,Y,N) returns 1. After the second pass, N=0, VERIFYR(X,Y,N) returns 0, and the loop ends. For another example, see SEARCHR.