Your full service technology partner! 
-Collapse +Expand
To/From Code
   ► KBTo/From GuidesReferenceCorel ParadoxLanguage Basics  Print This     

Corel Paradox Language Basics


Languages Focus

A variable holds a value that you can use and change throughout your code so long as the variable is within scope. With variable declaration, you not only want to know the syntax of how you declare a variable but you also want to know where. Are you allowed to declare a variable inline? What are the available scopes: local vs. global. Can you assign a value at the same time you declare a variable?

Corel Paradox:   var x SmallInt endVar

Declaring variables is optional unless you click Program | Compiler Warnings while in the ObjectPAL editor for every form, script, and library you create. Using Compiler Warnings is strongly recommended to avoid incorrectly typing an existing variable and to avoid any confusion about variable scope. Also recommended is turning on Compile with Debug for every form, script, and library too for tighter, cleaner code.

Undeclared variables are AnyType variables. Common data types include Currency, Date, Datetime, Logical, LongInt, Number, SmallInt, String, and Time.

Syntax Example:
    FullName String
    Age SmallInt
    Weight Number
FullName = "Mike Prestwood"
Age = 32
Weight =154.4
msgInfo("", FullName + ", age=" + String(Age) 
             + ", weight=" + String(Weight))

Declare local variables within a method. If you want a local static variable (retains it's value because it is not destroyed), declare the variables above the method. Variables declared in an object's Var window are visible to all methods attached to that object, and objects that it contains.

Linked Certification Question(s)

The following are practice certification questions with answers highlighted. These questions were prepared by Mike Prestwood and are intended to stress an important aspect of this KB post. All our practice questions are intended to prepare you generally for passing any certification test as well as prepare you for professional work.


1 Beginner Level Question

Question #1: True or False?

Declaring variables is optional unless you turn on compiler warnings (for example with the menu option Program | Compiler Warnings).

  • True
  • False
  • More Info

    Code:  ObjectPAL Variables (var x SmallInt endVar)

    Sales Website: Or visit our legacy sales site:

    ©1995-2024 Prestwood IT Solutions.   [Security & Privacy]