/* REXX -- Count number of words in text */ /* no provision for tags, if script use @SCRIPT Q first */ /* author: David McRitchie, "The REXX Macros Toolbox" 1993/11/09 */ Address "ISREDIT" "MACRO (TOKEN)" "seek prefix p'@' all" "(cnt1aw,cnt2aw) = seek_counts" "seek word p'@' all" "(cnt1as,cnt2as) = seek_counts" "seek prefix p'#' all" "(cnt1nw,cnt2nw) = seek_counts" "seek word p'#' all" "(cnt1ns,cnt2ns) = seek_counts" "seek prefix p'$' all" "(cnt1sw,cnt2sw) = seek_counts" "seek word p'$' all" "(cnt1ss,cnt2ss) = seek_counts" "seek p' ^^' all" "(cnt1pw,cnt2pw) = seek_counts" "seek p' ^ ' all" "(cnt1ps,cnt2ps) = seek_counts" "seek p'^' 1 all" "(cnt1p1,cnt2p1) = seek_counts" words = cnt1aw + cnt1nw + cnt1as + cnt1ns breaks = cnt1pw + cnt1ps + cnt1p1 cnt1aw = 0 + cnt1aw; cnt1as= 0 + cnt1as; cnt1nw = 0 + cnt1nw; cnt1ns= 0 + cnt1ns; cnt1sw = 0 + cnt1sw; cnt1ss= 0 + cnt1ss; cnt1pw = 0 + cnt1pw; cnt1ps= 0 + cnt1ps; cnt1p1 = 0 + cnt1p1; moreinf = words "words, begin letter("cnt1aw "+" cnt1as")", "+ numeric("cnt1nw "+" cnt1ns") -- special("cnt1sw "+" cnt1ss")" "LINE_BEFORE .zfirst = NOTELINE (moreinf)" ZEDSMSG = breaks "words" zedlmsg = breaks "words=" cnt1pw"(p' ^^') +" cnt1ps"(p' ^ ') +" cnt1p1"(1 p'^')" "LINE_BEFORE .zfirst = NOTELINE (zedlmsg)" /*ADDRESS*/ "ISPEXEC" "SETMSG MSG(ISRZ000)" "up max" RETURN 1