[REBOL] Re: Global Words
From: carl:cybercraft at: 22-Jun-2002 9:09
On 22-Jun-02, Gregg Irwin wrote:
> Hi Ammon,
> << Someone here (Sunanda?) had a little script that would tell them
> how many words are in the global context. I am in dire need of such
> a thing. >>
> Well, for overall usage, you can just do:
>>> length? first system/words
> I think someone had a more sophisticated bit that told you how many
> words your script added though, by using QUERY. Couldn't find it at
> a glance here though.
Someone (I forget who:) had posted the following a while back. It
allows you to save all words used, but I'm sure you could modify it
to give you the info you need.
REBOL [
Title "Save All View Words"
]
view layout [
title "Save All View Words"
across
button "Save" [
all-view-words: " "
all-view-words-count: 0
all-words: sort first system/words
write %all-view-words.txt " *** All View Words ***^/^/"
forall all-words [
all-view-words: rejoin [all-view-words " " first
all-words]
all-view-words-count: all-view-words-count + 1
if all-view-words-count = 4 [
write/append %all-view-words.txt join all-view-words
^/
all-view-words: " "
all-view-words-count: 0
]
]
write/append %all-view-words.txt "^/"
]
button "Quit" [unview/all]
]
--
Carl Read