Forum Discussion
Komag
11 years agoRoku Guru
Okay, I wrote and tested a function to count the currently used registry space:
FUNCTION getRegSize() ' trig by NONE
sz = 30 ' Header for the whole registry
r = CreateObject("roRegistry")
secList = r.GetSectionList()
FOR EACH name IN secList
sz = sz + 8 ' A small header for each registry section (2 bytes plus section name, assume 6 more bytes)
sec = CreateObject("roRegistrySection", name)
keyList = sec.GetKeyList()
FOR EACH key IN keyList
val = sec.Read(key)
sz = sz + Len(val) + 4 ' Headers - add 2 bytes for the key and 2 bytes for the value
END FOR
END FOR
? "Registry size" sz
END FUNCTION