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.