Important Notice
The pages on this site contain documentation for very old MS-DOS software,
purely for historical purposes.
If you're looking for up-to-date documentation, particularly for programming,
you should not rely on the information found here, as it will be woefully
out of date.
StringRelease Routine Details
◄Summary► ◄Details► ◄Example► ◄Contents► ◄Index► ◄Back►
──────────────────────────────────────────────────────────────────────────────
StringRelease(string-descriptor%);
Usage Notes
■ The StringRelease syntax is for the C language.
■ Use the StringRelease routine only to deallocate variable-length strings
that have been transferred to Visual Basic's string space from a non-
Basic routine. Never use it on strings created by Visual Basic.
■ Calls to the StringRelease routine are made from a non-Basic routine
to free up space in Visual Basic's data area.
■ Visual Basic automatically deallocates strings allocated by Basic.
However, strings that have been transferred to Visual Basic from a non-
Basic routine should be deallocated from the non-Basic routine using the
StringRelease routine.
■ Using StringRelease to deallocate strings from a non-Basic routine is
necessary because StringAssign transfers only strings, not string
descriptors. Without the string descriptor, Visual Basic cannot
deallocate the string.
For example, assume that you have passed a string from a MASM routine
to Visual Basic's string space using StringAssign. To deallocate this
string, assuming a descriptor for the variable-length string exists at
offset descriptor, the code is:
.model
extrn stringrelease: far
.code
lea ax, descriptor ; offset of descriptor
push ax
call stringrelease