STRPTR function
Purpose: STRPTR returns a 32 bit pointer to the string space address.
Syntax 1: RetLPSTR = STRPTR(MainStr$) Parameters:
Return Value:
|
Example:
DIM pA AS LPSTR ' allocate a 32 bit string POINTER variable DIM pB AS LPSTR ' allocate a 32 bit string POINTER variable pA = STRPTR("Hello!") 'pA points to "Hello!" pB = pA + 1 'pB points to "ello!" (example of POINTER arithmetic) '~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ' Prepending "$" instructs BCX to treat variable and CONST datatypes as STRINGS '~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PRINT $pA PRINT $pB
Result:
Hello! ello!