I.T. Discussion Community!
-Collapse +Expand
To/From Code
-Collapse +Expand Cross Ref Guide
-Collapse +Expand Members-Only
Sign in to see member-only pages.
   ► KBTo/From GuidesCorel Paradox  Print This     

Pointers (Corel Paradox and Delphi Cross Reference Guide)

By Mike Prestwood

Corel Paradox versus Delphi: A side by side comparison between Corel Paradox and Delphi.

Data Structures

Data structures allow you to store and work with data. Common data structures include arrays, associative arrays, etc.


[Other Languages] 

General Info: Pointers / References

A pointer is a variable type that allows you to refer indirectly to another object. Instead of holding data, a pointer holds the address to data -- the address of another variable or object. You can change the address value a pointer points to thus changing the variable or object the pointer is pointing to.

A reference is a type of pointer that cannot change and it must always point to a valid storage (no nulls).

Corel Paradox: 

ObjectPAL doesn't have a developer defined pointer type except for use with DLLs where you use a special CPTR uses keyword to refer to a DLL string pointer data type.

Syntax Example:  
Uses Tapi32
  tapiRequestMakeCall(sNumber CPTR, sAppName CPTR, 
    sLogName CPTR, sComment CPTR) CLONG

Although pointer data types in Delphi coding are less important and not required for most general coding, Delphi fully supports developer defined pointers. Use a carrot (^) to declare a pointer data type. Use the @ operator or Addr function to return the current address of a variable.

Delphi provides typed pointer types such as PChar and PExtended as well as a generic point to anything Pointer type.

Nil is a special pointer value that you can assign to any type of pointer. Nil never points to any valid memory and indicates an unassigned or empty pointer.

Syntax Example:
//Declare a pointer of type integer.
PCounter : ^Integer;
//Assign a value to the location of a pointer.
//Also known as dereferencing.
PCounter^ := 8;
//Assign address of A to B.
PointerB := @PointerA;  //or...PointerB := Addr(PointerA);

Follow PrestwoodBoards on: 

©1995-2020 PrestwoodBoards  [Security & Privacy]
Professional IT Services: Coding | Websites | Computer Tech