• <GetStart>
  • CSPro User's Guide
    • The CSPro System
    • Data Dictionary Module
    • The CSPro Language
      • Introduction to CSPro Language
      • Data Requirements
      • CSPro Program Structure
      • Programming Standards
      • Code Folding
      • Debugging CSPro Applications
      • Declaration Section
      • Procedural Sections
      • Logic
      • Language Elements
        • Version
        • Delimiters
        • Comments
        • Preprocessor
        • Variables and Constants
        • Expressions
        • Operators
          • Operators
          • String Comparisons
          • In Operator
          • Has Operator
          • If and Only If Operator
          • Operator Precedence
          • And/Or Truth Table
        • Files
        • Miscellaneous
    • Data Entry Module
    • Batch Editing Applications
    • Tabulation Applications
    • Data Sources
    • CSPro Statements and Functions
    • Templated Reporting System
    • HTML and JavaScript Integration
    • Action Invoker
    • Appendix
  • <CSEntry>
  • <CSBatch>
  • <CSTab>
  • <DataViewer>
  • <TextView>
  • <TblView>
  • <CSFreq>
  • <CSDeploy>
  • <CSPack>
  • <CSDiff>
  • <CSConcat>
  • <Excel2CSPro>
  • <CSExport>
  • <CSIndex>
  • <CSReFmt>
  • <CSSort>
  • <ParadataConcat>
  • <ParadataViewer>
  • <CSCode>
  • <CSDocument>
  • <CSView>
  • <CSWeb>

Operators

CSPro logic has a variety of arithmetic, relational, and logical operators. When more than one operator exists in an expression, the order in which the operators are evaluated is determined by their precedence.
Arithmetic Operators
Operation
Symbol
Addition
+
Subtraction
-
Multiplication
*
Division
/
Modulo (remainder)
%
Exponentiation
^
The arithmetic operators work on numeric expressions, though the addition operator can also be used to perform string concatenation.
Relational Operators
Operation
Symbol
Equal to
=
Not equal to
<>
Less than
<
Less than or equal to
<=
Greater than or equal to
>=
Greater than
>
In range
in
Has range (for repeating items)
has
The relational operators work on numeric and string expressions. String expressions can also be compared using compare or compareNoCase.
Logical Operators
Operation
Symbol
Keyword
Negation
!
not
Conjunction
&
and
Disjunction
|
or
If and only if
<=>
With logical operators, either the symbol or the keyword can be used.
See also: Operator Precedence, And/Or Truth Table