STRPTR function
Purpose: STRPTR returns a 32 bit pointer to the string space address.
Syntax 1: RetLPSTR = STRPTR(MainStr$) Parameters:
|
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 VARIABLES and CONST's as STRINGS '~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PRINT $pA ' Displays "Hello!" PRINT $pB ' Displays "ello!"