
Basic Data Operation

This is a basic data operation. It represents a fundamental action on a basic data type.
You may see other such operations in the Basic Data Operations category, or:


Integer Operations
Arithmetic |
Comparison
Boolean Operations
Bitwise |
Logical
String Operations
Concatenation |
Interpolation |
Comparison |
Matching
Memory Operations
Pointers & references |
Addresses


In this task, the goal is to demonstrate common operations on pointers and references. These examples show pointer operations on the stack, which can be dangerous and is rarely done. Pointers and references are commonly used along with Memory allocation on the heap.

      REM Pointer to integer variable:
      pointer_to_varA = ^varA%
      !pointer_to_varA = 123456
      PRINT !pointer_to_varA
 
      REM Pointer to variant variable:
      pointer_to_varB = ^varB
      |pointer_to_varB = PI
      PRINT |pointer_to_varB
 
      REM Pointer to procedure:
      PROCmyproc : REM conventional call to initialise
      pointer_to_myproc = ^PROCmyproc
      PROC(pointer_to_myproc)
 
      REM Pointer to function:
      pointer_to_myfunc = ^FNmyfunc
      PRINT FN(pointer_to_myfunc)
      END
 
      DEF PROCmyproc
      PRINT "Executing myproc"
      ENDPROC
 
      DEF FNmyfunc
      = "Returned from myfunc"