QB64.com

QB64 is a modern extended BASIC programming language that retains QBasic/QuickBASIC 4.5 compatibility and compiles native binaries for Windows, Linux, and macOS.

The _OFFSET function returns the memory offset of/within a given variable.

Syntax

offset%& = _OFFSET(variable)

Description

Example(s)

Using memcpy with the _OFFSET function values as parameters.


DECLARE CUSTOMTYPE LIBRARY
    SUB memcpy (BYVAL dest AS _OFFSET, BYVAL source AS _OFFSET, BYVAL bytes AS LONG)
END DECLARE

a$ = "1234567890"
b$ = "ABCDEFGHIJ"

memcpy _OFFSET(a$) + 5, _OFFSET(b$) + 5, 5
PRINT a$ 


12345FGHIJ

See Also