fb:porticula NoPaste
FBSTRING AllocSize Test
Uploader: | Sannaj |
Datum/Zeit: | 17.09.2011 23:21:16 |
' Size test of the string type
type focuseString
val as zstring ptr
len as uinteger
allocSize as uinteger
end type
dim strTest as string
dim strLex as focuseString ptr = cast(any ptr,@strTest)
dim inputD as string
dim as uinteger setlen, exlen
do
input "Spezify len or type ""q"" for exiting: ", inputD
if inputD = "q" then exit do
setlen = valint(inputD)
if inputD = "a" then
strTest = strTest & string(10, 65)
else
strTest = string(setlen, 65)
end if
exlen = ((strLex->len + 31) and (not 31))
print ".len = " & strLex->len
print "expSize = " & exlen
print "expSiz2 = " & (exlen + exlen shr 3)
print ".size = " & strLex->allocSize
print "diff = " & (strLex->allocSize - ((setlen + 31) and (not 31)))
print ""
loop