Paradox KB: OPAL: Language Basics Topic



30 Articles Found in the OPAL: Language Basics Topic 

  KB Article  

Mike Prestwood
1. A 10 Minute ObjectPAL Quick Start

If you've never programmed in ObjectPAL, spend 10 minutes and see how easy it is to program Paradox for Windows.

6/19/2008, and updated 11/7/2008

Article
Nothing New Since Your Last Visit
20468
Hits

Corel Paradox / ObjectPAL Coding

Mike Prestwood
2. An ObjectPAL Primer: Part 1

This detailed ObjectPAL primer will get you up and running developing in Paradox/ObjectPAL within a few hours.

3/18/2003, and updated 6/25/2010

Article
Nothing New Since Your Last Visit
20673
Hits

Corel Paradox / ObjectPAL Coding

Mike Prestwood
3. An ObjectPAL Primer: Part 2 Part 2.
3/18/2003, and updated 6/19/2008

Article
Nothing New Since Your Last Visit
17432
Hits

Corel Paradox / ObjectPAL Coding

Mike Prestwood
4. An ObjectPAL Primer: Part 3

Part 3.

3/18/2003, and updated 3/13/2009

Article
Nothing New Since Your Last Visit  
31277
Hits

Corel Paradox / ObjectPAL Coding

Mike Prestwood
5. Before You Code

Before you code in ObjectPAL, ask yourself two questions. Does Paradox already do this? Is there a better and easier way? Remember, simple solutions for simple problems.

6/22/2007, and updated 10/24/2009

Tip
Nothing New Since Your Last Visit
7451
Hits

Corel Paradox / ObjectPAL Coding

Mike Prestwood
6. Camel Casing Camel Casing capitalizes the first character of each word except the first word, so it frequently looks like a one or two hump camel. Used by many languages including Paradox's ObjectPAL. You can contrast Camel Casing with Pascal Casing which capitalizes the first character of each word (including acronyms over two letters in length) and was popularized by Pascal.
6/25/2008, and updated 10/16/2008

Definition
Nothing New Since Your Last Visit
14426
Hits

Corel Paradox / ObjectPAL Coding

Mike Prestwood
7. Consolas Font If you're looking for a replacement for Courier when editing ObjectPAL code, consider Consolas. The Microsoft Consolas Font Family is a set of highly legible fonts designed for ClearType. It is intended for use in programming environments and other circumstances where a monospaced font is specified. This installation package will set the default font for Visual Studio to Consolas, but if you don't have Visual Studio installed, it just skips that process without error.
6/10/2008

Download
Nothing New Since Your Last Visit
12173
Hits

Corel Paradox / ObjectPAL Coding

Mike Prestwood
8. Don't Leave Experiments In Your Code!

If, in experimentation, you use sleep(), doDefault, or DisableDefault to overcome some odd or misunderstood behavior, do not leave the commands in your code. If using the command didnt seem to make a difference, then take it out. Use commands only when they are called for. One great way to really learn the event model and the power of these and other commands is to experiment with adding them. Remember to take them out, however, if they do not do what you wanted.

6/23/2007, and updated 10/24/2009

Tip
Nothing New Since Your Last Visit
7004
Hits

Corel Paradox / ObjectPAL Coding

Mike Prestwood
9. Exploring Where To Put Code

Think levels when you code in the Pardox ObjectPAL development environment.

2/22/2008

Article
Nothing New Since Your Last Visit
14786
Hits

Corel Paradox / ObjectPAL Coding

Mike Prestwood
10. Object.Method() Syntax

The syntax of object.method() is consistent throughout ObjectPAL. If an object with the name box has code on its mouseClick event, you can access that code with box.mouseClick() method from any other object. When this code executes, the UIObject method mouseClick() calls the mouseClick event.

How do you know when you can call the code in a built-in method of an object? Easy, if the run-time library has a method equivalent, then you can use itfor example, mouseClick() and pushButton().

6/24/2007, and updated 10/24/2009

Tip
Nothing New Since Your Last Visit
7908
Hits

Corel Paradox / ObjectPAL Coding

Mike Prestwood
11. ObjectPAL ObjectPAL stands for Object Paradox Application Language.
6/24/2007, and updated 6/13/2008

Definition
Nothing New Since Your Last Visit
11234
Hits

Corel Paradox / ObjectPAL Coding

Mike Prestwood
12. ObjectPAL Assignment (=)

ObjectPAL uses = for it's assignment operator.

10/23/2008, and updated 11/10/2008

Code
Nothing New Since Your Last Visit  
8310
Hits

Corel Paradox / ObjectPAL Coding

Mike Prestwood
13. ObjectPAL Case Sensitivity (No)

ObjectPAL is not case sensitive. My preference for ObjectPAL is to follow the camel casing promoted in the examples and help files originally developed by Borland.

11/3/2008, and updated 1/3/2009

Code
Nothing New Since Your Last Visit  
8841
Hits

Corel Paradox / ObjectPAL Coding

Mike Prestwood
14. ObjectPAL Code Blocks (endXxxx)

ObjectPAL code blocks are surrounded by statement ending keywords that all use End with camel caps such as endMethod, endVar, endIf, endSwitch, and endTry.

11/4/2008, and updated 9/24/2009

Code
Nothing New Since Your Last Visit
7467
Hits

Corel Paradox / ObjectPAL Coding

Mike Prestwood
15. ObjectPAL Comments (; and { ... })

Commenting Code
ObjectPAL uses ; for a single line comment and { } for a multiple line comment.

11/4/2008, and updated 1/4/2009

Code
Nothing New Since Your Last Visit  
9203
Hits

Corel Paradox / ObjectPAL Coding

Mike Prestwood
16. ObjectPAL Comparison Operators (=, <>)

Common comparison operators:

= equal
<> not equal
< less than
> greater than
<= less than or equal
>= greater than or equal

2/11/2009

Code

KB Post
Nothing New Since Your Last Visit
17902
Hits

Corel Paradox / ObjectPAL Coding

Mike Prestwood
17. ObjectPAL Constants (const..endConst)

In ObjectPAL, you declare one or more constant values within a const..endConst block. Optionally, you can specify the dataType by casting the value as part of the declaration. If you do not specify the data type, the data type is inferred from the value as either a LongInt, a Number, a SmallInt, or a String. As with variables, the const..endConst block can come within a method or procedure as the first bit of code, or in the Const window. Putting it above the method or procedure is allowed but has no significance so don't.

12/18/2008, and updated 1/24/2009

Code
Nothing New Since Your Last Visit  
8961
Hits

Corel Paradox / ObjectPAL Coding

Mike Prestwood
18. ObjectPAL Development Tools

Corel Paradox for Windows (was Borland Paradox). Also, Borland used to offer a Paradox for DOS tool which support it's Paradox Application Language (PAL) which is not compatible with ObjectPAL. The biggest drawback to Paradox is that Corel does not have anyone at Corel actively developing Paradox for Windows (as opposed to Microsoft Access which does).

11/6/2008, and updated 1/2/2009

Code
Nothing New Since Your Last Visit
8386
Hits

Corel Paradox / ObjectPAL Coding

Mike Prestwood
19. ObjectPAL Edit Record (insertRecord, postRecord, edit)

In ObjectPAL, you use Cursor.InsertRecord to add a new record, Cursor.postRecord to post the record, and Cursor.deleteRecord() to delete it. To edit a record, you must put the cursor into edit mode, Cursor.Edit(). (A cursor applies to both a TCursor and UIObject.)

ObjectPAL gives you tremendous flexibility with editing data and includes many additional commands such as insertAfterRecord and isEdit. For dBASE tables, you can also use unDeleteRecord() to un-delete a record. See the ObjectPAL help for more commands.

2/7/2010

Code
Nothing New Since Your Last Visit
9706
Hits

Corel Paradox / ObjectPAL Coding

Mike Prestwood
20. ObjectPAL Empty String Check (isBlank() or not isAssigned())

In ObjectPAL, an empty variable can be unassigned (essentially null) or blank (equivalent to ""). You have to use both isBlank and isAssigned to check for an empty string.

9/18/2009, and updated 2/12/2010

Code

KB Post
Nothing New Since Your Last Visit
12363
Hits

Corel Paradox / ObjectPAL Coding

Mike Prestwood
21. ObjectPAL End of Statement (whitespace)

Languages Focus: End of Statement

In coding languages, common End of statement specifiers include a semicolon and return (others exist too). Also of concern when studying a language is can you put two statements on a single code line and can you break a single statement into two or more code lines.

ObjectPAL End of Statement

ObjectPAL is a bit unique in that it doesn't use a semicolon nor a return to mark the end of a line, it uses whitespace which can be a return, space, or tab. This is a bit unusual but does allow for some nice formatting of code.

12/14/2008, and updated 1/19/2009

Code
Nothing New Since Your Last Visit  
9859
Hits

Corel Paradox / ObjectPAL Coding

Mike Prestwood
22. ObjectPAL If Statement (If..Else..EndIf, or switch)

ObjectPAL supports a simple If...Else...EndIf statement.

Notice ObjectPAL does not support an ElseIf feature as part of an if statement. Instead use a switch statement

10/23/2008, and updated 1/17/2009

Code
Nothing New Since Your Last Visit  
12342
Hits

Corel Paradox / ObjectPAL Coding

Mike Prestwood
23. ObjectPAL Level Beginner or Advanced? Whether your ObjectPAL level is set to Beginner or Advanced, you can use all the ObjectPAL methods, procedures, properties, constants, keywords, and so on. The level panel is a help filter used just for learning purposes. However, because you could in effect "hide" code from yourself, I recommend setting this to Advanced (never use beginner).
6/23/2007, and updated 6/10/2008

Tip
Nothing New Since Your Last Visit
6212
Hits

Corel Paradox / ObjectPAL Coding

Mike Prestwood
24. ObjectPAL Literals (quote)

Literals are quoted as in "Prestwood".  If you need to embed a quote use a slash in front of the quote as in \"

In ObjectPAL, string literals are limited to 255 characters but there's nothing preventing you from using multiple string literals together as in:

msgInfo("", "Hi Mike: " + "You can add literals together in ObjectPAL")
11/4/2008, and updated 1/18/2009

Code
Nothing New Since Your Last Visit  
11181
Hits

Corel Paradox / ObjectPAL Coding

Mike Prestwood
25. ObjectPAL Logical Operators

ObjectPAL logical operators:

and and, as in this and that
or or, as in this or that
Not Not, as in Not This

2/12/2009, and updated 9/19/2009

Code

Article
Nothing New Since Your Last Visit  
14409
Hits

Corel Paradox / ObjectPAL Coding

Mike Prestwood
26. ObjectPAL String Concatenation (+)

String literals s are limited to 255 characters but you can simply add two strings together as in:

s = "A long string." + "Another long string."
11/10/2008, and updated 1/1/2009

Code
Nothing New Since Your Last Visit
7751
Hits

Corel Paradox / ObjectPAL Coding

Mike Prestwood
27. ObjectPAL Unary Operators

The ObjectPAL unary operators are:

+
-
Not

2/12/2009

Code
Nothing New Since Your Last Visit
8877
Hits

Corel Paradox / ObjectPAL Coding

Mike Prestwood
28. ObjectPAL Variables (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.

Declare local variables within a method. If you want a local static variable (retains it's value because it is not destroyed), declare the varialbes 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.

11/7/2008, and updated 3/29/2010

Code
Nothing New Since Your Last Visit  
13716
Hits

Corel Paradox / ObjectPAL Coding

Mike Prestwood
29. Study The Experts

Paradox provides experts that generate code at the field level, in the form open, etc. It is a good idea to study the ObjectPAL generated by these experts.

6/23/2007, and updated 10/24/2009

Tip
Nothing New Since Your Last Visit
7012
Hits

Corel Paradox / ObjectPAL Coding

Mike Prestwood
30. Where to Put Code - Short Overview Techniques for thinking about where to put code in Paradox's object-based event model.
12/29/2007, and updated 6/12/2008

Article
Nothing New Since Your Last Visit
9950
Hits

Corel Paradox / ObjectPAL Coding

Icon Legend:
Since your last logged visit:
- New to you or updated since your last visit (sign in now to activate).
- NOT new to you since your last visit (sign in now to activate).
www.prestwood.com For service: 916-726-5675
or support@prestwood.com
Copyright (C) Prestwood IT Solutions.
All Rights Reserved.
Printed 10/18/2021