IT SOLUTIONS
Your full service technology partner! 
-Collapse +Expand
Paradox
Search Paradox Group:

Advanced
-Collapse +Expand Paradox To/From
To/FromCODEGuides
-Collapse +Expand Paradox Store
PRESTWOODSTORE

Prestwood eMagazine

October Edition
Subscribe now! It's Free!
Enter your email:

   ► KBDesktop Data...Paradox & Ob...ObjectPAL Co...OPAL: Langua...   Print This     
  From the January 2009 Issue of Prestwood eMag
 
Paradox OPAL: Language Basics:
ObjectPAL Constants (const..endConst)
 
Posted 13 years ago on 12/18/2008 and updated 1/24/2009
Paradox Code Snippet:
 A flashcard from our Paradox Flashcards Library
 A code snippet from our Paradox Code Snippets Page

KB101730

General Info: Computer Language Constants

A constant is just like a variable (it holds a value) but, unlike a variable, you cannot change the value of a constant.

ObjectPAL Constants

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.

Syntax Example:
const
kFeetToMeter = Number(3.2808)
kMeterToFeet = Number(.3048)
kName = String("Mike")
  kCA = "California"     ;String inferred.
endConst

Local Constants

Local constants are declared within the method block.

method pushButton(var eventInfo Event)
const
kCA = "California"
endConst
 
  msgInfo("", "CA is short for " + kCA)
endMethod

Var Window Constants

Variables declared in an object's Var window are visible to all methods attached to that object, and objects that it contains.

More Info

Definition:  Computer Language Constants

Comments

1 Comments.
Share a thought or comment...
Comment 1 of 1

A brisk pace and all movement is inducted for the future are. The challenges of the uk dissertation writing service in the ambit of the regulations. It is signed for the exact use of the offers. Pathos did for humans. Skills are vital for the investigation for the bit and bytes of the memory for the field.

Posted 22 months ago
 
Write a Comment...
...
Sign in...

If you are a member, Sign In. Or, you can Create a Free account now.


Anonymous Post (text-only, no HTML):

Enter your name and security key.

Your Name:
Security key = P1182A1
Enter key:
Code Contributed By Mike Prestwood:

Mike Prestwood is a drummer, an author, and creator of the PrestwoodBoards online community. He is the President & CEO of Prestwood IT Solutions. Prestwood IT provides Coding, Website, and Computer Tech services. Mike has authored 6 computer books and over 1,200 articles. As a drummer, he maintains play-drums.com and has authored 3 drum books. If you have a project you wish to discuss with Mike, you can send him a private message through his PrestwoodBoards home page or call him 9AM to 4PM PST at 916-726-5675 x205.

Visit Profile


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.

Beginner

1 Beginner Level Question

Question #1: Multiple Choice

Which of the following is the correct syntax for declaring a constant?

Answer:
1. 
const
  kCA = "California"
end Const
2. 
const
  kCA := "California"
endConst
3. 
constant
  kCA = "California"
endConstant
4. 
const
  kCA = "California"
endConst
5. 
const
  kCA = 'California'
endConst

 KB Article #101730 Counter
8962
Since 12/18/2008
Go ahead!   Use Us! Call: 916-726-5675  Or visit our new sales site: 
www.prestwood.com


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