home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Magazyn Exec 3
/
CD_Magazyn_EXEC_nr_3.iso
/
Recent
/
text
/
edit
/
WordCount-CED.lha
/
Word-Count-Fast.ced
next >
Wrap
Text File
|
2000-07-16
|
850b
|
43 lines
/*
** Word-Count-Fast.ced V1.3 by M.Bethke
*/
OPTIONS RESULTS
STATUS BLOCKY
blocky = result
if blocky = -1 then do
status cursorline
cline = result
cline = cline+1
"beg of file"
mark
if result=0 then mark
"end of file"
"copy"
"save clip as T:wordcount.ced.tmp 1"
"jump to line" cline
end
else do
copy
"save clip as T:wordcount.ced.tmp 1"
end
open('TMP','T:wordcount.ced.script','W')
writeln('TMP',"stack 50000")
writeln('TMP',"wc T:wordcount.ced.tmp >T:wordcount.ced.wc")
writeln('TMP',"delete QUIET T:wordcount.ced.tmp")
close('TMP')
address command "execute T:wordcount.ced.script"
open('OUT','T:wordcount.ced.wc','R')
res = readln('OUT')
close('OUT')
parse VALUE res WITH lines words chars rest
address command "delete QUIET T:wordcount.ced.#?"
OKAY1 "Counted" lines "lines, " words "words and " chars "characters"