Thanks to visit codestin.com
Credit goes to www.scribd.com

0% found this document useful (0 votes)
4 views22 pages

Keywords of X++

Uploaded by

ganeshdongre215
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as XLSX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views22 pages

Keywords of X++

Uploaded by

ganeshdongre215
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as XLSX, PDF, TXT or read online on Scribd
You are on page 1/ 22

Reserv Description

ed
word
! Not.
!= Inequality operator (not equal to).
# Prefix on macro names.

& Binary AND.


&& Logical AND.
( Function call operator, which indicates the
beginning of the function call.
) Function call operator, which indicates the end of
the function call.
* Multiply. The asterisk (*) is also used in X++ SQL.
One use is to signify all fields from the tables on
a select statement. Another use is as a wildcard
with the like operator, to signify 0 to many
characters of any kind. The like operator also uses
the ? character.
^ Binary XOR.
| Binary OR.
|| Logical OR.
~ Not.
+ Plus.
++ Increment.
+= Additive assignment.
, Comma operator. Expressions separated by
commas are evaluated left-to-right.
- Minus.
-- Decrement operator.
-= Subtractive assignment.
. Class member access operator, for
example, formRun.run accesses the run method of an
object of the class type FormRun.

/ Divide.
</ Escape in strings. Escapes extra quotation marks,
strong> and certain letters such as \t for tab.
@ Escape of keywords. For
example, str @abstract; would fail to compile
without the @ sign. Also affects literal strings, by
negating the effect of the \ escape character, and
by enabling the string to span more than one line
in the source code. The new line is represented
by one character of hexadecimal 0x0A, which is
commonly called a line feed. No carriage return
character of hexadecimal 0x0D is included, as in
0x0D0A.

: Field declaration or label specifier. The colon (:)


character is also used on the switch statement.
:: Used to call static (class)
methods: ClassName::methodName.
; Terminates statements. Used in for loops or as a
separator of statements.
< Less than.
<< Left shift.
<= Less than or equal.
= Assignment operator. The argument to the left of
"=" is set to the value of the argument to the
right.
== Returns true if both expressions are equal.
> Greater than.
>= Greater than or equal.
>> Right shift.
? Ternary operator. The question mark (?) character
is also used by the like operator to signify exactly
one character of any kind. The like operator also
uses the character.

[ Array declarator, open. Must be used with "]".


] Array declarator, close. Must be used with "[".
{ Indicates the beginning of a number of
statements. The last of these statements must be
followed by a "}".
} Indicates the end of a number of statements. A
"{" must appear before the first of these
statements.
abstract Class and method modifier. An abstract class
cannot be constructed with the new keyword.
An abstract method cannot be called. A table can
also be modified as abstract by setting
its Abstract property to Yes in the AOT, or by
using the DictTable class. The Abstract property
defaults to No, and it cannot be set unless the
table is extended by another table. Each row in
an abstract table must have a dependent row in a
derived table. This means that each row in an
abstract table has a value greater than 0 (zero) in
its InstanceRelationType property field. There are
no other effects from marking a table as abstract.
Informally, programmers often use the
term concrete to describe a class that is non-
abstract.

anytype The method can return any data type.


as Needed when you assign a base class variable to
a derived class variable. For example, given
a Derived class that extends a Base class, the
statement myDerived = myBase as Derived; avoids a
compiler error by using the as keyword. This
keyword also applies when you assign a base
table variable to a derived table variable.

asc An option on the order by or group by clause in


a select statement. The sorting is ascending.
at Specifies the position of a print window.
avg Returns the average of the fields from the rows
specified by the group by clause in
a select statement.
break Immediate exit from code block.
breakpo Represents a breakpoint that is set for debugging
int purposes. To set a breakpoint in your code,
write: breakpoint;

by Part of a reserved term, such as group by and


order by.
byref Specifies that the parameter being passed to the
called method is being passed by reference
(address), instead of by value. Byref is used in X+
+ when calling a .NET method that takes a
parameter by reference (such as with the C#
keywords out or ref).
case Selection within a switch statement.
catch Used in exception handling.
change Changes database settings to another company.
Compan
y

class Declares a class.


client Method modifier.
contain Specifies a variable of type container.
er
continu Forces the next iteration of a loop.
e
count Returns the number of records from the rows
specified by the group by clause in
a select statement.
crossCo Causes a select statement to return data for all
mpany companies that the user is authorized to read
from.
date Specifies a variable of type date.
default Default case within switch statements.
delegat A class member that is able to store multiple
e references to methods in other classes, and to
call all those methods when prompted to do so. A
delegate can store references to various kinds of
methods including the following:

static methods on X++ classes


instance methods on X++ classes
methods on .NET Framework classes
delete_f Allows you to delete multiple records from the
rom database at the same time.
desc An option on the order by or group by clause in
a select statement. The sorting is descending.
display Method modifier.
div Integer division.
do Beginning of a do...while loop.
edit Method modifier.
else Conditional execution (if...else).
eventH Must be used each time you either add or delete
andler a method reference from a delegate by using
the += or -= operator. For example: myDelegate
+= eventHandler(OtherClass::myStaticMethod);

exists Used with join clauses in select statements.


extends A class or interface declaration clause. If your
class does not explicitly extend another class,
your class is considered to extend the Object class
(as if you had written "extends Object").
0 Boolean literal.
final Class and method modifier.
firstFast Used in select statements to speed up the fetch for
the first row.
firstOnl Used in select statements to fetch only the first
y record. The firstOnly keyword does not guarantee
that a maximum of one record is retrieved by an
X++ SQL select statement. If the AOS can use
the EntireTable cache to satisfy the data demands of
the select statement, the firstOnly keyword is
ignored.

firstOnl Same as firstOnly, except returns 10 rows instead


y10 of one.
firstOnl Same as firstOnly, except returns 100 rows
y100 instead of one.
firstOnl Same as firstOnly, except returns 1000 rows
y1000 instead of one.
flush Clears an entire table cache. Here is the syntax
for the flush statement applied to the buffer of
type YourTable:

```xpp

YourTable t;

...

flush t;

```
for For loop iteration.
forceLit Used in select statements to reveal actual values
erals that are used in where clauses to the Microsoft SQL
Server database at the time of optimization.

forceNe Forces the SQL Server database to use a nested-


stedLoo loop algorithm to process a particular SQL
p statement containing a join.

forcePla Used in select statements to instruct the kernel not


ceholde to reveal the actual values used in where clauses to
rs the Microsoft SQL Server database at the time of
optimization.
forceSel Forces the SQL Server database to access the
ectOrde tables in a join in the specified order.
r

forUpda Selects records exclusively for update. The


te operation to be performed on the records that are
fetched is an update. Depending on the
underlying database, the records may be locked
for other users.
from Part of a select statement. The from clause specifies
the table in which the columns exists.
group Part of the clause in a select statement.
group by

if Conditional execution.
implem Implements an interface.
ents
insert_r Copies data from one or more tables into one
ecordse resulting destination table on a single server trip.
t

int Specifies a variable of type integer (32-bit).


int64 Specifies a variable of type integer (64-bit).
interfac Interface declaration.
e
is Asks whether the object referenced by a class
variable either inherits from the given class or is
of the given class. For example, given
a Derived class that extends a Base class, the
expression (myDerived is Base) returns true. This
keyword applies to class inheritance and table
inheritance.

join Tables are joined on columns common to both


tables. You can generate a single result set based
on multiple tables through the use of joins.

like Tests for matches by pattern, with wildcard


symbols * and ?. The string on the right side of
the like operator must use four backslash
characters to represent one backslash. Examples
follow:
("&quot; like "<em>" ) //Resolves to false.
("&quot; like "\*") //Resolves to true.
maxof Returns the maximum of the fields from the rows
specified by the group by clause.
minof Returns the minimum of the fields from the rows
specified by the group by clause.
mod Returns the integer remainder of the left
expression1 divided by the right expression2.
Informally this is sometimes called the modulo
operator. ((12 mod 7) == 5) is true.

new Operator. Creates an instance of an anonymous


class that is assignment-compatible with the
named class/interface reference variables, or
allocates memory for an array.

next Fetches the next record in a table.


noFetch Indicates that no records are to be fetched at
notExist present.
Used with join clauses in select statements.
s
null Symbolic constant.
optimist Forces a statement to run with optimistic
icLock concurrency control, even if a different value is
set on the table.
order Part of the order by clause in a select statement.
outer outer join.
pause Halts the execution of a job. The user is asked to
state whether execution should continue.
pessimi Forces a statement to run with pessimistic
sticLock concurrency control, even if a different value is
set on the table.
print Allows you to display output on the screen.
private Method access modifier.
protect Method access modifier.
ed
public Method access modifier.
real Specifies a variable of type real.
repeata Specifies that no other transactions can modify
bleRead data that has been read by logic inside the
current transaction, until after the current
transaction completes. An explicit transaction
completes at either ttsAbort or at the
outermost ttsCommit. For a stand-
alone select statement, the transaction duration
is the duration of the select command. However,
the database sometimes enforces the equivalent
of repeatableRead in individual select statements
even without this keyword appearing in your X++
code (depending on how the database decides to
scan the tables).

retry Used in exception handling.


return Exits from a method.
reverse Records are returned in reverse order.
select The clause designates which columns or
select
views are shown in the result set.
server Method modifier.
setting Used with the update_recordset command.
static Static methods may not refer to instance
variables (only to static variables); may be
invoked by using the class name rather than on
an instance of the class ("MyClass.aStaticProcedure").

str Specifies a variable of type string.

sum Returns the sum of the fields from the rows


specified by the group by clause in
a select statement.
super Calls the method that was overridden by the
current method.
switch Switch selection statement.
tableLo Obsolete; tableLock is no longer available.
ck
this A reference to the current instance of the class.
Used in X++ code inside a method of the class.
Used to reference method members of the class,
but not field members of the class.public str
getFullName() { // Next statement fails to compile
without 'this.'. return this.concatenateFirstAndLastNames(); }

throw Used in exception handling.

1 Boolean literal.
try Used in exception handling.

ttsAbort Discards all changes in the current transaction.

ttsBegin Marks the beginning of a transaction.

ttsCom Marks the end of a transaction.


mit
update_ Allows the manipulation of row sets within one
records operation.
et
validTi Filters rows that are retrieved from a valid time
meStat state table by an X++ SQL select statement. For
e example: select validTimeState(myDateEffective)
* from xMyTable; ...or... select
validTimeState(myDateFrom, myDateTo) * from
xMyTable;
void Identifies a method that does not return a value.
where Part of a select statement. The where clause specifies
the conditions to be satisfied; that is, the rows
that you want to include in the result.

while Iteration statement. Executes a statement or


block repeatedly when a test condition is true.
window Allows you to alter the size of the output window.

Expr
essio
ns
Synt
ax
expressi
on in X+
+ is
used in
either a
mathem
atical or
logical
way.
Expressi
ons are
built on
the data
types of
the
languag
e; that
is, an
expressi
on
returns a
value of
some
type.
This
value
can be
used in
calculati
ons,
assignm
ents,
condition
al
stateme
nts, and

EBNF
Descri
ption
of
Expres
sions
in X+
+

Term
Express =
ion
Relation =
alOpera
tor

Simple- =
expressi
on

Term =

Mult- =
operato
r
CompFa =
ctor
Factor =
Enum =
Variable =

Functio =
nCall
If- =
expressi
on
More information

Relational Operators
Relational Operators
How to: Use #define and #if
to Test a Macro
Arithmetic Operators
Relational Operators

Arithmetic Operators

Arithmetic Operators
Arithmetic Operators
Relational Operators
Arithmetic Operators
Arithmetic Operators
Assignment Operators
Assignment Operators

Arithmetic Operators
Assignment Operators
Assignment Operators

Arithmetic Operators
Relational Operators
Arithmetic Operators
Arithmetic Operators
Assignment Operators

Relational Operators
Relational Operators
Relational Operators
Arithmetic Operators
Ternary Operator (?)
Method Modifiers Table
Inheritance Overview

Anytype
Expression Operators: Is and
As for Inheritance

Select Statement Syntax

Print Statements
Select Statement Syntax

Break Statements

How to: Use the byref


Keyword for CLR Interop.

Switch Statements
Exception Handling with try
and catch Keywords
Change Company Design
Pattern

Classes in X++
Method Modifiers
Containers

Continue Statements

Select Statement Syntax

Cross-Company X++ Code


Basics
Dates
Switch Statements
Event Terminology and
Keywords X++, C#
Comparison: Event

delete_from

Select Statement Syntax

Method Modifiers
Arithmetic Operators
Do...while Loops
Method Modifiers
if and if ... else Statements
Event Terminology and
Keywords X++, C#
Comparison: Event

Select Statement Syntax


Creating a Subclass
Booleans
Method Modifiers
Select Statement Syntax

Select Statement Syntax Set-


based Caching

Set-based Caching

For Loops
Select Statement Syntax

Select Statement Syntax

Select Statement Syntax


Select Statement Syntax

Select Statement Syntax

Select Statement Syntax

Select Statement Syntax


if and if ... else Statements
Interfaces Overview

insert_recordset

Integers
Integers
Interfaces Overview

Expression Operators: Is and


As for Inheritance

Select Statement Syntax

Relational Operators

Select Statement Syntax

Select Statement Syntax


Select Statement Syntax
Select Statement Syntax

Select Statement Syntax

Select Statement Syntax


Select Statement Syntax
Select Statements

Select Statement Syntax

Print Statements
Method Access Control
Method Access Control

Method Access Control


Reals
For more information, see the
documentation for the
underlying relational
database product.

Exception Handling with try


and catch Keywords
Declaration of Methods
Select Statement Syntax
Select Statements

Method Modifiers
update_recordset
Method Modifiers

Strings
Select Statement Syntax

Table Methods

Switch Statements

Loosely similar to the system


variable that is named element.
You use element in form control
methods to reference the
containing form. For more
information, see Using
Variables with Forms.

Exception Handling with try


and catch Keywords
Booleans
Exception Handling with try
and catch Keywords
Transaction Integrity

Transaction Integrity

Transaction Integrity

update_recordset
Effects of Valid Time State
Tables on Read and Write
Operations

Declaration of Methods
Select Statement Syntax

While Loops while select


Statements
Print Statements
Definition
Simple-expression
[RelationalOperator Simple-
expression ]
=

Simple-expression [ +

Compfactor { Mult-operator
CompFactor }
*

[!][-

Literal
EnumName :: Literal
Identifier [ [ Expression ] ] [ .
Expression ]
[ Expression (.

Expression ? Expression :
Expression

You might also like