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.
StringLength Routine Details
◄Summary► ◄Details► ◄Example► ◄Contents► ◄Index► ◄Back►
──────────────────────────────────────────────────────────────────────────────
length = StringLength(string-descriptor%);
Usage Notes
■ The StringLength syntax is for the C language.
■ If you are not doing mixed-language programming, there is usually no
reason to use StringLength. Instead, use LEN to find the length of a
variable-length string. See: ◄LEN Function►
■ Calls to the StringLength routine are usually made from a non-Basic
routine.
For example, assume that a MASM routine takes a pointer to a string
descriptor as a parameter. MASM can find the length of the string data
by using the following code:
.model
extrn stringlength: far
.code
mov ax, psdparm ; offset of descriptor
push ax
call stringlength
■ The length of the string is returned in AX.