好文档就是一把金锄头!
欢迎来到金锄头文库![会员中心]
电子文档交易市场
安卓APP | ios版本
电子文档交易市场
安卓APP | ios版本

微软ax2009开发语言:x培训.doc

57页
  • 卖家[上传人]:marr****208
  • 文档编号:117457596
  • 上传时间:2019-12-05
  • 文档格式:DOC
  • 文档大小:1.52MB
  • / 57 举报 版权申诉 马上下载
  • 文本预览
  • 下载提示
  • 常见问题
    • Axapta X++ EssentialsLesson 1: Development Environment 5MorphX 5The Editor 5Editor Tool Bar 6The Right-click Menu 6Syntax 7Jobs 7Lesson 2: Communicating with users 9The Print Command 9Boxes 9Box types 10Communication tools 10Infologs: 11Dialogs: 13Forms: 15Lesson 3: Declaring variables 16Variables 16Declaration of variables 16Data Types 16Simple Declaration 17String Declaration 18Initialization 18Relation between simple and extended data types 19Composite Data Types 20Containers 21Lesson 4: Creating X++Constructs 22Conditional statements 22Operators 22if and else 22switch 23Ternary operator 23Loops 24while 24do-while 24for 25The continue and break commands 25Functions 26Lesson 5: Accessing the database 27Searching for records in the database 27The select command 27The while select command 28Table buffer 28Sorting 29Temporary indexes 29Sorting 29Order by 30Ranging 30Insert, Update, and Delete 30Queries 31Where do you write code? 32Code written in different places 32Lesson 7: Objects and classes 34Objects 34Classes 34Translated to X++ language 34Methods 34Object methods/Dynamic methods 34Class methods/Static methods 35Using the Dialog class 35Using the QueryRun class 36Creating new classes 36The Main method 37Inheritance 38Tables versus classes 38Methods 39Methods returning data 39Lesson 8: Handling exceptions 40What is exception handling? 40Working with tts 40Using the try and catch commands 41Throwing exceptions 42Exercises 43Exercise 2: 43Exercise 3: 43Exercise 4: 44Exercise 5 44Exercise 6 45Exercise 7 45Exercise 8 46Exercise 9 47Exercise 10 47Exercise 11 47Exercise 12 48Exercise 13 48Exercise 14 48Exercise 15 48Exercise 16 49Exercise 17 49Exercise 18 49Exercise 19 50Exercise 20 50Exercise 21 50Exercise 22 51Exercise 22 51Exercise 23 51Solutions 53Lesson 1: Development EnvironmentMorphX The development environment in Damgaard Axapta is called MorphX. MorphX is an Integrated Development Environment, or IDE, because it integrates several functions, such as designing, editing, compiling, and debugging into one common environment. The Damgaard Axapta application is flexible and easily modifiable on many levels. Usually, you only need to modify just a single parameter for the entire system to inherit the change. If, for example, you change the length of a database field, this is automatically reflected on all forms in the application that display this field.X++ is the object oriented programming language which is used in the MorphX environment. Whenever you work with X++, you can get help from the Damgaard Axapta Developer's Guide, available form the Help menu in Damgaard Axapta.To program in X++ you must know the Editor, the available tools, and the syntax. To learn more about these features, go on to the next study pages. The Editor You write programming code in the editor. Whenever you want to create a new job, edit a class declaration or do anything else involving writing of X++ code, you do it in the following editor window: Example:This is an example of a job. No matter what type of object you are working with, the editor looks the same. Write the code between the curly brackets, and use the tools in the editor. Editor Tool BarThe Right-click Menu Anywhere in the editor you have access to the right-click menu displayed below: Besides from repeating some of the functions from the editor toolbar (highlighted with green borders), the menu contains a series of list functions. You can use the list functions to look up for example tables, classes, and enums while you are working in the editor. When you click select any of the list functions, a small window appears inside the editor window, and you can make a type-ahead search in the window.Syntax You must use a number of symbols when you write the X++ code. If you do not use the correct symbols and syntax, the compiler might report an error, and you will not achieve the desired results. The following table lists the symbols and symbol pairs used in X++. Print out the list, and use it as a reference. Jobs A job is a piece of code which is executed sequentially. When you create a new job in the AOT, the following line is stated as default. The code which determines what the job does is written between the curly brackets. You can also insert comments into the code lines. To do that, you must use certain signs that are ignored by the compiler. Comments turn green in the editor.// This is a one-line commentIf your comment is more than one line, they must be block comments. /*This is a block comment because it contains more than one line*/ You use comments to make the program easier to understand for everyone looking at the code. Block comments are often used to document the inner function of the progra。

      点击阅读更多内容
      关于金锄头网 - 版权申诉 - 免责声明 - 诚邀英才 - 联系我们
      手机版 | 川公网安备 51140202000112号 | 经营许可证(蜀ICP备13022795号)
      ©2008-2016 by Sichuan Goldhoe Inc. All Rights Reserved.