Definition
The description of the relationship between classes and objects is that classes is a set of methods for data and operation data, is blueprint, and objects is an instance of classes. this description is quite traditional. According to design patterns explained, classes are individuals responsible for their own behaviors. I personally feel that the former is implemented from the perspective of classes, the latter's statement looks at classes from the design perspective and has a higher abstraction level.
1. class definition.
A. I found the classes node in AOT (Application Object Tree, axapta, which caused me to find it for a long time. I used to find it in my nose, but I couldn't find it.
B. Right-click New Class in the shortcut menu and a new class class1 is displayed. There is a default node classdeclaration in which variables can be declared.
2. Define variables in the class
Double-click classdeclaration and add the definition in.
Variables must be declared before use. x ++ does not allow variable declaration to be mixed with other statements. That is to say, the variable declaration of X ++ must be prior to any other statement. in addition to objects, memory is also allocated for other types during definition.
There are three types of variables:
A. Simple
I. Non-string.
Int intervariable.
Ii. String
Since the string comparison is divided into the left and right sides, there are several declaration methods.
STR dynamic; a string with no limited size, always starting from the left.
STR 10 fixed; a string with a fixed length of 10
STR 10 right rightalignvariable; string with a fixed length of 10 from the right.
B. Initialization
I. Simple Variables
Real A = 3.1415926
Ii. Object
Access accessobject = new acess ();
C. mutiple
Int I, J;
Finally, let's take a look at the Declaration of the array, which is quite distinctive.
It seems that X ++ does not support multi-dimensional arrays and sawtooth arrays.
Int dynamicarry []; Dynamic Array
Real fiexedarray [100]; an array of the real type with a size limit of 100.
Date d [1000]; The size is limited to of the Data Type array, but only 10 data is in the memory.
3. Define methods in the class.
A. In the shortcut menu of the class, select new method
B. Change the method name and define the return type and parameter list.
C. Write in {}Code.