StrPtrLen

<< Click to Display Table of Contents >>

Navigation:  ThinBASIC Core Language > BuiltIn Functions > String functions >

StrPtrLen

 

Description

 

Returns the length of a dynamic string giving its pointer.

 

Syntax

 

n = StrPtrLEN(DynamicStringPointer)

 

Returns

 

Number

 

Parameters

 

Name

Type

Optional

Meaning

DynamicStringPointer

Numeric

No

A dynamic string pointer, the one returned by STRPTR or other equivalent.

 

Remarks

 

LEN will always make a copy of the string expression passed as parameter.

 

Use StrPtrLEN to avoid string copy in case of big strings like in the following example:

 

'---Define a 100Mb string

Dim MyString As String = String$(100000000, chr$(0))

MSGBOX 0, "Size: " & StrPtrLEN(STRPTR(MyString))

 

Restrictions

 

See also

 

String Handling, Len,

 

Examples