There is a bug in COUNT-WORDS in the string manipulation tools in the FAQ
at
http://www.neverslow.com/fom/swiftforth/fom-serve/cache/67.html.
It counts a trailing white space as another word. It can be fixed as below.
S" one" COUNT-WORDS . 1 ok
S" one " COUNT-WORDS . 2 ok
: COUNT-WORDS
COUNT-WORDS isn't unique.
0 >R BEGIN ATOKEN WHILE
DROP R> 1+ >R
REPEAT DROP 2DROP R> ; ok
S" one" COUNT-WORDS . 1 ok
S" one " COUNT-WORDS . 1 ok
Matt
Received on Wed Nov 01 2000 - 13:09:37 PST
Subscribe to our e-mail list service. It's free for all SwiftForth and SwiftX users!
This archive was generated 07-Feb-2012. Archive updated nightly.