rem stlen is the string length rem @strdat is the string array from the currently selected entity rem numlines is the number of lines of text in the current selected entity rem i is an incrementing variable :start i = stlen = 0 numlines = 1 set mask, 15,16 getent "Select note entity.",etype on (@key + 3) goto quit,quit,start, call strlen, @strdat, stlen :loop i = i + 1 if (i > stlen - 1) goto count if (@strdat[i] == 10) numlines = numlines + 1 goto loop :count pause "The number of lines is %d",numlines goto start :quit clear i, stlen, numlines exit