SUB SUB_EXAMPLE
(BYVAL passed
AS _OFFSET) 'this points to SUB EXAMPLE below, but uses an OFFSET to point to its parameter. 'NOTE: The sub/function name *MUST* be the same as QB64 translates it as, for us.
'General rule of thumb is to make the subname ALL CAPS, preceeded by SUB_ or FUNCTION_ as dictated.
TYPE DataType
'A datatype to use as an example
TYPE DataType2
'a second datatype
a$
= "Hello World " + MKL$(-1) + MKL$(3)
SUB_EXAMPLE
_OFFSET(a$
) 'Call the sub with the offset to a stringSUB_EXAMPLE2
_OFFSET(a$
) 'Notice, we passed the same string, but are handling it differently here,' according to the paramters set in the second sub
SUB Example
(t
AS DataType
) 'And here, we want to set up the actual sub to work with our example datatype. PRINT t.x
'print the values of that memblock
SUB Example2
(x
AS DataType2
)