GetMemoryInfoStringSpace (statement)

Syntax GetMemoryInfoStringSpace used, free, total[, outFlags]
Description This statement obtains information on the memory usage for string space.
Parameter Description
used Long. The number of used bytes in the string space.
free Long. The number of free bytes in the string space.  
total Long. The number of total bytes in the string space.
outFlags Long. The internal information about the string space. This parameter is unused.
Example
Option Explicit
Sub OnMouseUp(x As Long, y As Long, flags As Long)
    Dim mymsg As String
    Dim used As Long, free As Long, total As Long, outFlags As Long
    Dim charCount
    Dim i
    Dim myarray(100) As String
    mymsg = ""
    mymsg = mymsg & Chr$(13) & "---- BEFORE ----"
    GetMemoryInfoStringSpace used, free, total, outflags
    mymsg = mymsg & Chr$(13) & "SPACE used:" & used & ", free:" & free & ", total:" & total
    mymsg = mymsg & ", outFlags:" & outFlags
    GetMemoryInfoStringSpaceHandles used, free, total 
    mymsg = mymsg & Chr$(13) & "HANDLES used:" & used & ", free:" & free & ", total:" & total
    ' Use up some string space and handles
    charCount = 0
    For i = LBound(myarray) To UBound(myarray) Step 1
        myarray(i) = "ABCDEFGHIJKLMNOPQRSTUVWXYZ " & i & " ABCDEFGHIJKLMNOPQRSTUVWXYZ "
        charCount = charCount + Len(myarray(i))
    Next i
    mymsg = mymsg & Chr$(13)
    mymsg = mymsg & Chr$(13) & "---- AFTER populating, elements:" & (UBound(myarray) - LBound(myarray)) _
        & " char count:" & charCount & " ----"
    GetMemoryInfoStringSpace used, free, total, outFlags
    mymsg = mymsg & Chr$(13) & "SPACE used:" & used & ", free:" & free & ", total:" & total
    mymsg = mymsg & ", outFlags:" & outFlags
    GetMemoryInfoStringSpaceHandles used, free, total 
    mymsg = mymsg & Chr$(13) & "HANDLES used:" & used & ", free:" & free & ", total:" & total
    MsgBox mymsg, ebOKOnly+ebInformation, "Memory Info"
End Sub
See Also GetMemoryInfoSymbolSpace (statement),GetMemoryInfoStringSpaceHandles (statement), GetMemoryInfoPublicSpace (statement)
Note The sum of the used and free parameter values will not be equal to the value of the total parameter. This is because of the overhead that is used to manage the allocated blocks.