repo.or.cz
/
AROS.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
arch/cpu.resource: remove dead code
[AROS.git]
/
workbench
/
classes
/
zune
/
texteditor
/
demo
/
rexx
/
CountWords.TEd
blob
99ea520d0ae1571445ad5f4a88a62ae5d298977c
1
/* Count words in the current document */
2
3
Address 'TEXTEDITOR-DEMO.1'
4
Options Results
5
6
Words = 0
7
GotoLine '-1'
8
GetCursor Line
9
Lines = RESULT
10
GotoLine 0
11
12
Say "Contents:"
13
14
Do While(Lines >= 0)
15
GetLine
16
Contents = RESULT
17
Contents = Left(Contents, Length(contents)-1)
18
Words = Words+Words(Contents)
19
Say Contents
20
Lines = Lines-1
21
Line 1
22
End
23
24
Say "Number of words: " || Words