diff --git a/docs/Help_ZH-CN/Maps/table_of_contents.xml b/docs/Help_ZH-CN/Maps/table_of_contents.xml index 7b10e1f864..9f81b8579e 100644 --- a/docs/Help_ZH-CN/Maps/table_of_contents.xml +++ b/docs/Help_ZH-CN/Maps/table_of_contents.xml @@ -337,47 +337,47 @@ X# 团队成员 - - XBase Types - - Array Of Type + + XBase 类型 + + Array Of 类型 - - Array Type + + Array 类型 CodeBlock - - Date Type + + Date 类型 - - Binary Type + + Binary 类型 - - Currency Type + + Currency 类型 - - Float Type + + Float 类型 - - Logic Ttype + + Logic 类型 - - PSZ Type + + PSZ 类型 - - Symbol Type + + Symbol 类型 - - Usual Type + + Usual 类型 - - Workarea Events + + Workarea 事件 - - Dialect (in)compatibilities + + 方言的(不)兼容性 VO @@ -394,60 +394,60 @@ Harbour - - Subsystems of the X# Runtime + + X# 运行时的子系统 - - Combining X# Runtime and Vulcan Runtime + + 结合 X# 运行时和 Vulcan 运行时 - - X# Scripting + + X# 脚本 - - X# Walkthroughs + + X# 演练 - - Using X# in Visual Studio - - Project System - - Solution - - - Build Configurations - - - Projects - - Project Properties - - Application + + 在 Visual Studio 中使用 X# + + 项目系统 + + 解决方案 + + + 生成配置 + + + 项目 + + 项目属性 + + Application(应用程序) - - Language + + Language(语言) - - Dialect + + Dialect(方言) - - Build + + Build(生成) - - Build Events + + Build Events(生成事件) - - Debug + + Debug(调试) - - Resources + + 资源 - - Settings + + 设置 - - References + + 引用 .Net @@ -459,8 +459,8 @@ - - Project Items + + 项目中的项 Source code Items @@ -481,118 +481,118 @@ - - Source Code Editor - - Text Editor Options - - General Options + + 源代码编辑器 + + 文本编辑器选项 + + 常规 - - Scroll Bars + + 滚动条 - - Tabs + + 制表符 - - Formatting + + Formatting(格式化) - - Generator + + Generator(生成器) - - Indentation + + Indentation(缩进) - - Intellisense + + Intellisense(智能感知) - - Options + + Options(选项) - - Settings Completion + + Settings Completion(设置代码完成) - - Keyword Coloring + + Keyword Coloring(关键字颜色) - - Highlighting Errors + + Highlighting Errors(高亮错误) - - Regions + + Regions(区域) - - Blocks + + Blocks(块) - - Parameter Tips + + Parameter Tips(参数提示) - - Quick Info + + Quick Info(快速信息) - - Code Completion + + Code Completion(代码补全) Editor combo boxes - - Goto definition + + Goto definition(转到定义) - - Peek definition + + Peek definition(快速预览) - - Inactive conditional regions + + Inactive conditional regions(非活动条件区域) - - Brace matching + + Brace matching(大括号匹配) - - Highlight Identifiers + + Highlight Identifiers(高亮标识符) - - Highlight Keywords + + Highlight Keywords(高亮关键字) - - Indenting code + + Indenting code(缩进代码) - - Snippets + + Snippets(片段) - - .EditorConfig files + + .EditorConfig 文件 - - Debugger - - Toolbar and Menu + + 调试器 + + 工具栏和菜单 - - Globals Window + + Globals Window(全局窗口) - - Publics and Privates Window + + Publics and Privates Window(公共和私有窗口) - - Workareas window + + Workareas window(工作区窗口) - - Settings Window + + Settings Window(设置窗口) - - Other editors + + 其他编辑器 - - Templates - - Project Templates + + 模板 + + 项目模板 - - Item Templates + + 项目项模板 @@ -608,114 +608,114 @@ UDC Tester - - X# Programming guide - - Quick Start + + X# 程序员指南 + + 快速入门 - - Arrays + + 数组 - - Classes and Structures + + 类和结构 - - Codeblock, Lambda and Anonymous Method Expressions + + 代码块、Lambda 和匿名方法表达式 - - Delegates + + 委托 - - Enumeration Types + + 枚举类型 - - Events + + 事件 - - Exceptions and Exception Handling + + 异常和异常处理 - - File System and the Registry + + 文件系统和注册表 - - Generics + + 泛型 - - Indexers + + 索引器 - - Interfaces + + 接口 - - Interoperability + + Interoperability(本机互操作性) - - LINQ Query Expressions + + LINQ 查询表达式 - - Memory Variables + + 内存变量 - - Modifiers - - Access/Visibility modifiers + + 修饰符 + + 可见性修饰符 - - Class hierarchy modifiers + + 类层次结构修饰符 - - STATIC modifier + + 静态修饰符 ASYNC/AWAIT - - Other modifiers + + 其他修饰符 - - Namespaces + + 命名空间 - - Nullable Types + + 可以为 Null 的类型 - - Statements, Expressions and Operators + + 语句、表达式和运算符 - - Strings + + 字符串 - - Types + + 类型 - - Tuples + + 元组 - - Unsafe Code and Pointers + + 不安全代码和指针 - - XML Documentation Comments + + XML 文档注释 - - Strong Typing + + 强类型 - - Runtime Scripting + + 运行时脚本 调用约定 - - X# Language Reference - - Keywords - - - Types - - Simple (Native) Types + + X# 语言参考 + + 关键字 + + + 类型 + + 简单(固有)类型 BYTE @@ -771,8 +771,8 @@ WORD - - xBase Specific Types + + xBase 特定类型 ARRAY @@ -804,44 +804,44 @@ USUAL - - User defined Types + + 自定义类型 - - Literals - - Char Literals + + 字面量 + + Char 字面量 - - String Literals + + String 字面量 - - Date Literals + + Date 字面量 - - Logic Literals + + Logic 字面量 - - Null Literals + + Null 字面量 - - Numeric Literals - - Integer Literals + + Numeric 字面量 + + Integer 字面量 - - Floating point Literals + + Floating point 字面量 - - Symbol Literals + + Symbol 字面量 - - Escape codes + + 字符转义 - - Binary Literals + + Binary 字面量 @@ -7131,8 +7131,8 @@ XSharpRef.chm::\XSharpRef.hhc - - X# Examples + + X# 示例 匿名方法 diff --git a/docs/Help_ZH-CN/Topics/ARRAY-(FoxPro).xml b/docs/Help_ZH-CN/Topics/ARRAY-(FoxPro).xml index 74e246cbf2..140befc957 100644 --- a/docs/Help_ZH-CN/Topics/ARRAY-(FoxPro).xml +++ b/docs/Help_ZH-CN/Topics/ARRAY-(FoxPro).xml @@ -1,24 +1,28 @@  - + ARRAY (FoxPro)
ARRAY (FoxPro)
- The FoxPro dialect in X# has its own Array type. This type is not declared with an AS keyword, but the array type is derived from the context.
The following lines of code all generate a FoxPro compatible array:
- LOCAL ARRAY aTest(1,2)      // LOCAL ARRAY
PUBLIC ARRAY aPublicArray[10]   // PUBLIC ARRAY
DIMENSION AnotherArray(3,4)   // DIMENSION with parentheses , but angled brackets are supported too
DECLARE ThirdArray[10]      // DIMENSION with angled brackets, but parentheses are supported too
- The elements of a Foxpro compatible array are all USUAL.
FoxPro arrays cannot be dynamically sized with AAdd(). To resize them you need to add a DIMENSION statement with new dimensions.
- Internally FoxPro arrays are single dimensional arrays. But you can also (re)dimension them as two dimensional.
So the 3rd array in this example can also be treated as a single dimensional array of 12 elements.
+ X# 中的 FoxPro 方言有自己的 Array 类型。这种类型不是用 AS 关键字声明的,而是根据上下文推导出数组类型。 - We advise to use angled brackets to access elements of a FoxPro array. This is not ambiguous and the compiler can resolve that at compile time. - If you want to use parentheses to access FoxPro array elements you need to enable the /fox compiler option. This compiler option also enables the behavior that assigning a single value to a FoxPro array will result in assigning that value to all elements in the array. + 以下代码行都生成兼容 FoxPro 的数组: + LOCAL ARRAY aTest(1,2)      // LOCAL ARRAY
PUBLIC ARRAY aPublicArray[10]   // PUBLIC ARRAY
DIMENSION AnotherArray(3,4)   // DIMENSION 也支持方括号
DECLARE ThirdArray[10]      // DECLARE 使用方括号,但也支持使用括号
+ FoxPro 兼容数组的元素都是 USUAL 类型的。
FoxPro 数组不能使用 AAdd() 动态调整大小。要调整它们的大小,需要使用 DIMENSION 语句和新的维度。
+ 在内部,FoxPro 数组是单维数组。但也可以将它们重新定义为二维数组。
因此,这个示例中的第三个数组也可以被视为包含 12 个元素的单维数组。
- Internally FoxPro arrays are implemented as a class that derives from the generic XBase array type. - So all functions in the X# runtime that take an array as parameter will also accept a FoxPro array.
When there is different behavior between the FoxPro implementation of a function or the Xbase implementation then this will be handled at runtime.
- Implementation - The ARRAY type is implemented in the class XSharp.__FoxArray. - The Usualtype of ARRAY has the value 5 + 建议使用尖括号来访问 FoxPro 数组的元素。这样不会产生歧义,编译器可以在编译时解析。 + 如果想要使用括号来访问 FoxPro 数组元素,需要启用 /fox  编译选项。此编译选项还会启用将单个值分配给 FoxPro 数组的所有元素的行为。 + + 在内部,FoxPro 数组是作为从通用 XBase 数组类型派生的类实现的。 + 因此,X# 运行时中接受数组作为参数的所有函数也将接受 FoxPro 数组。
当函数的 FoxPro 实现与 Xbase 实现之间存在不同行为时,这将在运行时处理。
+ + 实现 + ARRAY 类型在类 XSharp.__FoxArray 中实现。 + + ARRAY 的 Usualtype 值为 5
diff --git a/docs/Help_ZH-CN/Topics/ARRAY.xml b/docs/Help_ZH-CN/Topics/ARRAY.xml index fa620dc96c..5d35e64289 100644 --- a/docs/Help_ZH-CN/Topics/ARRAY.xml +++ b/docs/Help_ZH-CN/Topics/ARRAY.xml @@ -1,6 +1,6 @@  - + ARRAY ARRAY @@ -9,9 +9,12 @@
ARRAY
- The ARRAY type is a dynamic array of USUAL values. Each element of the array may contain another array, so arrays can be multidimensional. - Implementation - The ARRAY type is implemented in the class XSharp.__Array. - The Usualtype of ARRAY has the value 5 + + ARRAY 类型是由 USUAL 值组成的动态数组。数组的每个元素都可以包含另一个数组,因此数组可以是多维的。 + + 实现 + ARRAY 类型在 XSharp.__Array 类中实现。 + + ARRAY 的 Usualtype 值为 5。
diff --git a/docs/Help_ZH-CN/Topics/Array-Of-Type.xml b/docs/Help_ZH-CN/Topics/Array-Of-Type.xml index 451fb16097..7f5fb3228a 100644 --- a/docs/Help_ZH-CN/Topics/Array-Of-Type.xml +++ b/docs/Help_ZH-CN/Topics/Array-Of-Type.xml @@ -1,31 +1,39 @@  - - Array Of Type + + Array Of 类型 ARRAY OF XSharp.__ArrayBase
- Array Of Type + Array Of 类型
- This type is used for typed arrays. It has been introduced in the X# Runtime. The internal typename is XSharp.__ArrayBase
The code below shows how you can use it.
- Many of the existing XBase runtime functions that accept arrays now also accept an ARRAY OF. - Runtime functions that expect a codeblock for Arrays expect a Lambda expression for ARRAY OF. - The difference is that the parameters to the Lambda expression will be typed, so there is no late binding necessary. - Parameters to a Codeblock are always of type usual and therefore either require Late Binding support or need to be casted to the right type inside the codeblock. - We have also introduced a special multi dimensional syntax. Given the example below you can also get the first name of the first developer in the array by using the following syntax: + + 该类型用于类型化数组。它已在 X# 运行时中引入。内部类型名是 XSharp.__ArrayBase 。 +
下面的代码展示了如何使用它。
+ + 许多接受数组的现有 XBase 运行时函数现在也接受 ARRAY OF。 + + 期望使用数组代码块的运行时函数期望使用 ARRAY OF 的 Lambda 表达式。 + + 不同之处在于 Lambda 表达式的参数将是类型化的,因此无需后期绑定。 + + 代码块的参数始终是 usual 类型,因此要么需要后期绑定支持,要么需要在代码块内将其转换为正确的类型。 + + 我们还引入了一种特殊的多维语法。在下面的示例中,您还可以使用以下语法获取数组中第一个开发人员的名字:   cFirst := aDevelopers[1, "FirstName"] - This may be useful when you work with existing generated code and the existing code was using a define for the elements in the multi dimensional array. - If you had a (generated) define like + 当你使用现有的生成代码,而现有代码使用定义来定义多维数组中的元素时,这可能会很有用。 + + 如果你有一个(生成的)定义,如 DEFINE DEVELOPER_FirstName := 1 - then you can change the code generator and generate this in stead + 然后,您可以更改代码生成器,生成以下代码 DEFINE DEVELOPER_FirstName := "FirstName" - The code that uses the define can remain unchanged + 使用定义的代码可以保持不变   cFirst := aDevelopers[1, DEVELOPER_FirstName] - Example code - FUNCTION Start AS VOID                          
// declare typed array of developer objects  
LOCAL aDevelopers AS ARRAY OF Developer          
// Initialize the array with the "normal" array syntax
aDevelopers   := {}
// AAdd also supports typed arrays
AAdd(aDevelopers, Developer  { "Chris","Pyrgas"})
AAdd(aDevelopers, Developer  { "Nikos", "Kokkalis"})
AAdd(aDevelopers, Developer  { "Fabrice", "Foray"})
AAdd(aDevelopers, Developer  { "Robert", "van der Hulst"})    
// AEval knows that each element is a developer
AEval(aDevelopers, { d => Console.WriteLine(d)})
// ASort knows the type and passes the correct types to the lambda expression.
// The compiler and runtime "know" that x and y are Developer objects and will produce early bound code
ASort( aDevelopers, 1, ALen(aDevelopers), { x, y => x:LastName < y:LastName})  
// Foreach knows that each element is a Developer object
FOREACH VAR oDeveloper IN aDevelopers                                              
  ? oDeveloper:LastName, oDeveloper:FirstName
NEXT
RETURN

CLASS Developer
  PROPERTY FirstName AS STRING AUTO
  PROPERTY LastName AS STRING AUTO  
     CONSTRUCTOR()
        RETURN
  CONSTRUCTOR (cFirst AS STRING, cLast AS STRING)
       FirstName := cFirst
       LastName  := cLast
  METHOD ToString() AS STRING
       RETURN Firstname+" " + LastName
END CLASS
+ 示例代码 + FUNCTION Start AS VOID                          
// 声明 Developer 对象为 Array Of 数组    
LOCAL aDevelopers AS ARRAY OF Developer          
// 使用 "普通 "数组语法初始化数组
aDevelopers   := {}
// AAdd 也支持 Array 类型
AAdd(aDevelopers, Developer  { "Chris","Pyrgas"})
AAdd(aDevelopers, Developer  { "Nikos", "Kokkalis"})
AAdd(aDevelopers, Developer  { "Fabrice", "Foray"})
AAdd(aDevelopers, Developer  { "Robert", "van der Hulst"})    
// AEval 知道每个元素都是一个 Developer
AEval(aDevelopers, { d => Console.WriteLine(d)})
// ASort 知道类型并将正确的类型传递给 lambda 表达式。
// 编译器和运行时 "知道 "x 和 y 是 Developer 对象,并将生成早期绑定代码
ASort( aDevelopers, 1, ALen(aDevelopers), { x, y => x:LastName < y:LastName})  
// Foreach 知道每个元素都是一个 Developer 对象
FOREACH VAR oDeveloper IN aDevelopers                                              
  ? oDeveloper:LastName, oDeveloper:FirstName
NEXT
RETURN

CLASS Developer
  PROPERTY FirstName AS STRING AUTO
  PROPERTY LastName AS STRING AUTO  
     CONSTRUCTOR()
        RETURN
  CONSTRUCTOR (cFirst AS STRING, cLast AS STRING)
       FirstName := cFirst
       LastName  := cLast
  METHOD ToString() AS STRING
       RETURN Firstname+" " + LastName
END CLASS
diff --git a/docs/Help_ZH-CN/Topics/Array-Type.xml b/docs/Help_ZH-CN/Topics/Array-Type.xml index a16496970e..517be47d1e 100644 --- a/docs/Help_ZH-CN/Topics/Array-Type.xml +++ b/docs/Help_ZH-CN/Topics/Array-Type.xml @@ -1,16 +1,18 @@  - - Array Type + + Array 类型 ARRAY XSharp.__Array
- Array Type + Array 类型
- This implements the so called "ragged" arrays.
The internal typename is XSharp.__Array
+ + 它实现了所谓的 "锯齿状 "数组。 +
内部类型名是 XSharp.__Array
diff --git a/docs/Help_ZH-CN/Topics/Arrays.xml b/docs/Help_ZH-CN/Topics/Arrays.xml index 4414ac841e..8765b9e264 100644 --- a/docs/Help_ZH-CN/Topics/Arrays.xml +++ b/docs/Help_ZH-CN/Topics/Arrays.xml @@ -1,10 +1,10 @@  - - Arrays + + 数组
- Arrays + 数组
diff --git a/docs/Help_ZH-CN/Topics/BINARY.xml b/docs/Help_ZH-CN/Topics/BINARY.xml index 4ac045c312..219b38d882 100644 --- a/docs/Help_ZH-CN/Topics/BINARY.xml +++ b/docs/Help_ZH-CN/Topics/BINARY.xml @@ -1,6 +1,6 @@  - + BINARY BINARY @@ -9,19 +9,22 @@
BINARY
- The BINARY type is represented a series of bytes. - -
  • Binary literals are written as 0h12345678abcdef
  • -
  • The value behind 0h is a sequence of hex numbers. Each pair of hex numbers (nibble) represents 1 byte. There must be an even number of 'nibbles'.
  • -
  • The binary literals are encoded in an array of bytes. In the Core dialect the binary literals are represented as a byte[]. In the other dialects the binary literals are a new type (XSharp.__Binary) which can be specified as the new BINARY keyword.
  • -
  • The UsualType() of BINARY is 29.
  • -
  • The XSharp.__Binary type has operators to add a string to a binary and add a binary to a string.
    Binary + String will return a Binary
    String + Binary will return a String
    Binary + Binary will return a Binary.
    There are also comparison operators on the Binary type (>, <, >=, <=). These will use the string comparison routines that are defined with SetCollation()  with the exception that an = comparison with a single equals operator does not return TRUE when the Right hand side is shorter than the Left hand side and the first bytes match.
  • -
  • Conversions from Binary to String are done with the Encoding.GetBytes() and Encoding.GetString() functions for the current Windows Encoding.
    That means that on single byte code pages each character in the string will result in one byte and each byte will result in one character.
    For multibyte code pages (Chinese, Japanese, Korean etc) some characters will result in more than one byte and some byte pairs will result in a single character.
  • -
  • There are implicit operators that convert a BINARY to a byte[] and back. There are also implicit operators that convert a Binary to a String and back.
  • -
  • When compiling with the Vulcan Runtime then the byte[] array is stored in a USUAL value for the non core dialects.
  • + BINARY 类型表示为一系列字节。 + + +
  • BINARY 字面量写作 0h12345678abcdef
  • +
  • 0h后面的值是一系列十六进制数字。每对十六进制数字(半字节)表示1个字节。必须有偶数个“半字节”。
  • +
  • BINARY 字面量编码为字节数组。在 Core 方言中,BINARY 字面量表示为 byte[]。在其他方言中,二进制字面量是一种新类型(XSharp.__Binary),可以用新的 BINARY 关键字指定。
  • +
  • BINARY 的 UsualType() 为29。
  • +
  • XSharp.__Binary类型具有操作符,可以将字符串添加到二进制中,也可以将二进制添加到字符串中。
    Binary + String 将返回一个二进制
    String + Binary 将返回一个字符串
    Binary + Binary 将返回一个二进制
    BINARY 类型还有比较运算符(>、<、>=、<=)。这些运算符将使用通过 SetCollation() 定义的字符串比较例程,但是当右侧比左侧短且前几个字节匹配时,单个等号的=比较不会返回TRUE。
  • +
  • 从 BINARY 到字符串的转换使用 Encoding.GetBytes() 和 Encoding.GetString() 函数进行,用于当前 Windows 编码。
    这意味着在单字节代码页上,字符串中的每个字符将导致一个字节,每个字节将导致一个字符。
    对于多字节代码页(中文、日文、韩文等),一些字符将导致多个字节,一些字节对将导致一个字符。
  • +
  • 有隐式操作符将 BINARY 转换为 byte[],反之亦然。还有隐式操作符将 Binary 转换为 String,反之亦然。
  • +
  • 当使用 Vulcan Runtime 编译时,对于非 Core 方言,字节数组存储在 USUAL 值中。
  • - Implementation - The BINARY type is implemented in the class XSharp.__Binary
    The Usualtype of BINARY has the value 29
    + + 实现 + Binary 类型在 XSharp.__Binary 类中实现。 +
    Binary 的 Usualtype 值为 29
    diff --git a/docs/Help_ZH-CN/Topics/BYTE.xml b/docs/Help_ZH-CN/Topics/BYTE.xml index 8f3214d6e7..7eae342b1c 100644 --- a/docs/Help_ZH-CN/Topics/BYTE.xml +++ b/docs/Help_ZH-CN/Topics/BYTE.xml @@ -1,6 +1,6 @@  - + BYTE BYTE @@ -9,7 +9,8 @@
    BYTE
    - The BYTE keyword denotes an integral type that stores unsigned 8-bit values with values that range from 0 to 255. + + 保存 8 位(1 字节)无符号整数,值的范围为 0 到 255。
    diff --git a/docs/Help_ZH-CN/Topics/Binary-Literals.xml b/docs/Help_ZH-CN/Topics/Binary-Literals.xml index b58c325123..efffebb56a 100644 --- a/docs/Help_ZH-CN/Topics/Binary-Literals.xml +++ b/docs/Help_ZH-CN/Topics/Binary-Literals.xml @@ -1,17 +1,20 @@  - - Binary Literals + + Binary 字面量 BINARY Binary Literals
    - Binary Literals + Binary 字面量
    - Binary literals are written as 0h12345678abcdef - The value behind 0h is a sequence of hex numbers. Each pair of hex numbers (nibble) represents 1 byte. There must be an even number of 'nibbles'. - The compiler compiles these literals into a byte[] array which is stored into a variable of the type BINARY + + Binary 文字的写法是 0h12345678abcdef + + 0h 后面的值是一串十六进制数。每一对十六进制数(nibble)代表一个字节。必须有偶数个 “nibbles”。 + + 编译器会将这些字面量编译成一个 byte[] 数组,并将其存储到一个 BINARY 类型的变量中。
    diff --git a/docs/Help_ZH-CN/Topics/Binary_Type.xml b/docs/Help_ZH-CN/Topics/Binary_Type.xml index 9d703f7297..24a609253d 100644 --- a/docs/Help_ZH-CN/Topics/Binary_Type.xml +++ b/docs/Help_ZH-CN/Topics/Binary_Type.xml @@ -1,16 +1,19 @@  - - Binary Type + + Binary 类型 BINARY XSharp.__Binary
    - Binary Type + Binary 类型
    - This implements the FoxPro binary type
    The internal typename is XSharp.__Binary
    + + 它实现了 FoxPro Binary 类型。 + + 内部类型名是 XSharp.__Binary diff --git a/docs/Help_ZH-CN/Topics/Build-Configurations.xml b/docs/Help_ZH-CN/Topics/Build-Configurations.xml index 091745436a..706648e96d 100644 --- a/docs/Help_ZH-CN/Topics/Build-Configurations.xml +++ b/docs/Help_ZH-CN/Topics/Build-Configurations.xml @@ -1,30 +1,37 @@  - - Build Configurations + + 生成配置
    - Build Configurations + 生成配置
    - You need build configurations when you need to build your projects with different settings. For example, Debug and Release are configurations and different compiler options are used accordingly when building them. One configuration is active and is indicated in the command bar at the top of the Visual Studio IDE. - + 如果需要用不同的设置来生成项目,就需要生成配置。例如,"调试 "和 "发布 "都是配置,在生成时会相应地使用不同的编译器选项。一个配置处于活动状态,并在 Visual Studio IDE 顶部的命令栏中显示。 - The configuration and the platform control where built output files are stored. Normally, when Visual Studio builds your project, the output is placed in a project subfolder named with the active configuration (for example, bin/Debug), but you can change that. - You can create your own build configurations at the solution and project level. The solution configuration determines which projects are included in the build when that configuration is active. Only the projects that are specified in the active solution configuration will be built. If multiple target platforms are selected in Configuration Manager, all projects that apply to that platform are built. The project configuration determines what build settings and compiler options are used when you build the project. - To create, select, modify, or delete a configuration, you can use the Configuration Manager. To open it, on the menu bar, choose Build > Configuration Manager, or just type Configuration in the search box. You can also use the Solution Configurations list on the Standard toolbar to select a configuration or open the Configuration Manager. + - + 配置和平台控制着生成输出文件的存储位置。通常情况下,当 Visual Studio 生成项目时,输出文件会放在以活动配置命名的项目子文件夹中(例如,bin/Debug),但你可以更改。 - By default, Debug and Release configurations are included in projects that are created by using Visual Studio templates. A Debug configuration supports the debugging of an app, and a Release configuration builds a version of the app that can be deployed. For more information, see How to: Set debug and release configurations. You can also create custom solution configurations and project configurations. For more information, see How to: Create and edit configurations. - Solution Configurations + 您可以在解决方案和项目级别创建自己的生成配置。解决方案配置决定了在该配置处于活动状态时,构建中包含哪些项目。只有在活动的解决方案配置中指定的项目才会被生成。如果在配置管理器中选择了多个目标平台,则会生成适用于该平台的所有项目。项目配置决定了生成项目时使用的生成设置和编译器选项。 + + 要创建、选择、修改或删除配置,可以使用配置管理器。要打开配置管理器,请在菜单栏上选择 "生成">"配置管理器",或在搜索框中键入 "配置"。您也可以使用 "标准 "工具栏上的 "解决方案配置 "列表来选择配置或打开 "配置管理器"。 + + + + 默认情况下,使用 Visual Studio 模板创建的项目中包含调试和发布配置。调试配置支持应用程序的调试,而发布配置则生成可部署的应用程序版本。有关详细信息,请参阅 在 Visual Studio 中设置调试和发布配置 。您还可以创建自定义解决方案配置和项目配置。有关更多信息,请参阅 创建和编辑配置。 + 解决方案配置 + + 解决方案配置指定如何构建和部署解决方案中的项目。要修改解决方案配置或定义新配置,请在 "配置管理器 "的 "活动解决方案配置 "下选择 "编 辑 "或 "新建"。 + + 解决方案配置中项目上下文框中的每个条目都代表解决方案中的一个项目。对于活动解决方案配置和活动解决方案平台的每种组合,您都可以设置每个项目的使用方式。(有关解决方案平台的更多信息,请参阅 将项目配置为面向平台)。 + + 定义新解决方案配置并选择 "创建新的项目配置 "复选框时,Visual Studio 会自动将新配置分配给所有项目。同样,当您定义新的解决方案平台并选择 "创建新项目平台 "复选框时,Visual Studio 会自动将新平台分配给所有项目。此外,如果您添加了一个以新平台为目标的项目,Visual Studio 会将该平台添加到解决方案平台列表中,并将其分配给所有项目。您仍然可以修改每个项目的设置。 + + 活动解决方案配置还为集成开发环境提供了上下文。例如,如果您正在处理一个项目,而配置指定该项目将为移动设备构建,那么工具箱中将仅显示可在移动设备项目中使用的项目。 + 项目配置 + 项目的目标配置和平台共同用于指定构建设置和编译器选项。一个项目可以针对不同的配置和平台组合使用不同的设置。要修改项目的属性,请在 "解决方案资源管理器 "中打开项目的快捷菜单,然后选择 "属性"。在项目设计器的 "Build "(生成)选项卡顶部,选择一个活动配置来编辑其构建设置。 - A solution configuration specifies how projects in the solution are to be built and deployed. To modify a solution configuration or define a new one, in the Configuration Manager, under Active solution configuration, choose Edit or New. - Each entry in the Project contexts box in a solution configuration represents a project in the solution. For every combination of Active solution configuration and Active solution platform, you can set how each project is used. (For more information about solution platforms, see Understand build platforms.) - When you define a new solution configuration and select the Create new project configurations check box, Visual Studio automatically assigns the new configuration to all of the projects. Likewise, when you define a new solution platform and select the Create new project platforms check box, Visual Studio automatically assigns the new platform to all of the projects. Also, if you add a project that targets a new platform, Visual Studio adds that platform to the list of solution platforms and assigns it to all of the projects. You can still modify the settings for each project. - The active solution configuration also provides context to the IDE. For example, if you're working on a project and the configuration specifies that it will be built for a mobile device, the Toolbox displays only items that can be used in a mobile device project. - Project Configurations - The configuration and platform that a project targets are used together to specify the build settings and compiler options to use when it's built. A project can have different settings for each combination of configuration and platform. To modify the properties of a project, open the shortcut menu for the project in Solution Explorer, and then choose Properties. At the top of the Build tab of the project designer, choose an active configuration to edit its build settings. - See the project properties dialogs for more information about which project properties are configuration dependent and which project properties are configuration independent. + 有关哪些项目属性与配置相关,哪些项目属性与配置无关的更多信息,请参见项目属性对话框。
    diff --git a/docs/Help_ZH-CN/Topics/Built-in-Types.xml b/docs/Help_ZH-CN/Topics/Built-in-Types.xml index e5ff5a02e5..402dcf7004 100644 --- a/docs/Help_ZH-CN/Topics/Built-in-Types.xml +++ b/docs/Help_ZH-CN/Topics/Built-in-Types.xml @@ -1,39 +1,40 @@  - - - Types + + + 类型
    - Types + 类型
    - The X# language knows the following data types + + X# 语言可识别以下数据类型 diff --git a/docs/Help_ZH-CN/Topics/CHAR.xml b/docs/Help_ZH-CN/Topics/CHAR.xml index cc4f9ff77e..ff16d39e97 100644 --- a/docs/Help_ZH-CN/Topics/CHAR.xml +++ b/docs/Help_ZH-CN/Topics/CHAR.xml @@ -1,6 +1,6 @@  - + CHAR CHAR @@ -9,7 +9,8 @@
    CHAR
    - The CHAR keyword denotes an type to represent a Unicode character. The Unicode Standard identifies each Unicode character with a unique 21-bit scalar number called a code point, and defines the UTF-16 encoding form that specifies how a code point is encoded into a sequence of one or more 16-bit values. Each 16-bit value ranges from hexadecimal 0x0000 through 0xFFFF and is stored in a Char structure. The value of a Char object is its 16-bit numeric (ordinal) value. + + CHAR 关键字表示一个用于表示 Unicode 字符的类型。Unicode 标准使用称为代码点的唯一 21 位标量数来标识每个 Unicode 字符,并定义了 UTF-16 编码形式,指定代码点如何编码为一个或多个 16 位值的序列。每个 16 位值的范围从十六进制 0x0000 到 0xFFFF,并存储在一个 Char 结构中。Char 对象的值是它的 16 位数值(序数值)。 diff --git a/docs/Help_ZH-CN/Topics/CODEBLOCK.xml b/docs/Help_ZH-CN/Topics/CODEBLOCK.xml index eae604a0f9..c685514846 100644 --- a/docs/Help_ZH-CN/Topics/CODEBLOCK.xml +++ b/docs/Help_ZH-CN/Topics/CODEBLOCK.xml @@ -1,6 +1,6 @@  - + CODEBLOCK CODEBLOCK @@ -9,35 +9,45 @@
    CODEBLOCK
    - The codeblock type was introduced in the XBase language in the Clipper days. - They can be seen like unnamed functions. They can have 0 or more parameters and return a value. - The most simple codeblock that returns a string literal looks like this + + CODEBLOCK(代码块)类型是在 Clipper 时代的 XBase 语言中引入的。 + + 它们可以被看作是无名函数。它们可以有 0 个或多个参数,并返回一个值。 + + 最简单的返回字符串字面值的代码块如下所示: FUNCTION Start() AS VOID
    LOCAL cb AS CODEBLOCK
    cb := {|| "Hello World"}
    ? Eval(cb)
    WAIT

    RETURN
    - To use a codeblock you call the Eval() runtime function - Codeblocks are not restricted to fixed expressions, because they can use parameters.
    The following codeblock adds 2 parameters.
    + 要使用 CODEBLOCK(代码块),您需要调用 Eval() 运行时函数。 + + CODEBLOCK(代码块)不限于固定表达式,因为它们可以使用参数。 +
    以下CODEBLOCK(代码块)添加了 2 个参数:
    FUNCTION Start() AS VOID
    LOCAL cb AS CODEBLOCK
    cb := {|a,b| a + b}
    ? Eval(cb, 1,2)
    ? Eval(cb, "Helllo ", "World")
    WAIT
    RETURN
    - As you can see in the example, we can both use numeric parameters here or string parameters. Both work. That is because the parameters to a codeblock are of the so called USUAL type. They can contain any value. Of course the following will fail because the USUAL type does not support multiplying strings: + 正如您在示例中所看到的,我们既可以在这里使用数字参数,也可以使用字符串参数。两者都可以。这是因为代码块的参数属于所谓的 USUAL 类型。它们可以包含任何值。当然,以下操作将失败,因为 USUAL 类型不支持字符串相乘: FUNCTION Start() AS VOID
    LOCAL cb AS CODEBLOCK
    cb := {|a,b| a * b}
    ? Eval(cb, 1,2)
    ? Eval(cb, "Helllo ", "World")
    WAIT
    RETURN
    - More complicated codeblocks - Codeblocks are not restricted to single expressions.
    They may also contain a (comma seperated) list of expressions. The value of the last expression is the return value of the codeblock:
    - + 更复杂的 codeblock + 代码块不仅限于单个表达式。 +
    它们也可以包含一个(逗号分隔的)表达式列表。最后一个表达式的值是代码块的返回值。
    FUNCTION Start() AS VOID
    LOCAL cb AS CODEBLOCK
    cb := {|a,b,c| QOut("value 1", a) , QOut("value 2", b), QOut("value 3", c), a*b*c}
    ? Eval(cb,10,20,30)
    WAIT
    RETURN
    - XSharp has also introduced codeblocks that contain of (lists of ) statements: + XSharp 还引入了包含语句列表的代码块: FUNCTION Start() AS VOID
    LOCAL cb AS CODEBLOCK
    cb := {| a,b,c|  
      ? "value 1" ,a
      ? "value 2" ,b
      ? "value 3" ,c
      RETURN a*b*c
      }
    ? Eval(cb,10,20,30)
    WAIT
    RETURN
    - Please note - -
  • The first statement should start on a new line after the parameter list
  • -
  • There should be NO semi colon after the parameter list.
  • -
  • The statement list should end with a RETURN statement.
  • + 注意 + +
  • 第一条语句应从参数列表后的新行开始。
  • +
  • 参数列表后不应有分号。
  • +
  • 语句列表应以 RETURN 语句结束。
  • - Implementation - The CODEBLOCK type is implemented in the abstract class XSharp.Codeblock - The Usualtype of CODEBLOCK has the value 9. + 实现 + CODEBLOCK 类型在抽象类 XSharp.Codeblock 中实现。 + + CODEBLOCK 的 Usualtype 值为 9。 + + + 在你的代码中,永远不会有 XSharp.Codeblock 类型的对象。 + + 编译时代码块被转化为 XSharp.Codeblock 的子类。 - In your code you will never have objects of type XSharp.Codeblock. - Compile time codeblocks are translated into a subclass of XSharp.Codeblock - Runtime (macro compiled) codeblocks are translated into a subclass of the class XSharp._Codeblock which inherits from Codeblock.
    Depending on the type of the runtime codeblock this is either an instance of the MacroCodeblock class or of the MacroMemVarCodeblock class (when the macro creates dynamic memory variables)
    + 运行时(宏编译)代码块被转换为 XSharp._Codeblock 类的子类,该类继承于 Codeblock。 +
    根据运行时代码块的类型,它要么是宏代码块(MacroCodeblock)类的实例,要么是宏内存变量代码块(MacroMemVarCodeblock)类的实例(当宏创建动态内存变量时)。
    diff --git a/docs/Help_ZH-CN/Topics/CURRENCY.xml b/docs/Help_ZH-CN/Topics/CURRENCY.xml index 2bcaf2f6d4..f46f925339 100644 --- a/docs/Help_ZH-CN/Topics/CURRENCY.xml +++ b/docs/Help_ZH-CN/Topics/CURRENCY.xml @@ -1,17 +1,17 @@  - + CURRENCY
    CURRENCY
    - -
  • The currency type stored numbers with a precision of 4 decimals. Internally it contains a .Net decimal value, rounded to 4 decimals.
  • -
  • -
    - Implementation - The CURRENCY type is implemented in the structure  XSharp.__Currency - The Usual type of CURRENCY is 28. + + CURRENCY 类型存储的数字精度为 4 位小数。在内部,它包含一个四舍五入为 4 位小数的 .Net 十进制值。 + + 实现 + CURRENCY 类型在 XSharp.__Currency 结构中实现。 + + CURRENCY 的 UsualType 值是 28。
    diff --git a/docs/Help_ZH-CN/Topics/Calling-conventions.xml b/docs/Help_ZH-CN/Topics/Calling-conventions.xml index 0b5537d017..ab4bdb0f13 100644 --- a/docs/Help_ZH-CN/Topics/Calling-conventions.xml +++ b/docs/Help_ZH-CN/Topics/Calling-conventions.xml @@ -1,93 +1,94 @@  - + 调用约定
    调用约定
    - Calling conventions are something from the unmanaged world. They describe how parameters should be passed when you call a function or method and they also describe who is responsible for adjusting the stack when the called function / method returns. - Different compilers have different default strategies for passing parameters to functions. + + 调用约定是非托管世界的东西。它们描述了调用函数或方法时应如何传递参数,还描述了被调用函数/方法返回时由谁负责调整堆栈。 + 不同的编译器有不同的向函数传递参数的默认策略。
    - Type + 类型 - Description + 描述
    - Native Types + 固有类型
    - xBase Specific Types + xBase 特定类型
    - User Defined Types + 自定义类型
    - - - - - -
    - Convention + 约定 - Description + + 描述
    STRICT - This is the most common calling convention in the C/C++ world. With this convention parameters are pushed on the stack. Value types are pushed completely and for reference types the address of the variable is pushed. When a method is called then also the address of the “this” object is pushed on the stack. - After the function / method returns then the calling method adjusts the stack. - This calling convention allows for functions or methods with a variable number of arguments, like printf(). The caller knows the # of parameters that were passed, so the calling is the best candidate for adjusting the stack. - In C/C++ this is also called __cdecl - In VO (and X#) there is also a synonym “ASPEN” for this. + + 这是 C/C++ 世界中最常见的调用约定。在这种约定下,参数被推入堆栈。值类型被完全推送,而对于引用类型,变量的地址被推送。当调用一个方法时,“this ”对象的地址也会被推入堆栈。 + 函数/方法返回后,调用方法将调整堆栈。 + 这种调用约定允许使用参数数量可变的函数或方法,如 printf()。调用者知道传递的参数个数,因此调用是调整堆栈的最佳选择。 + 在 C/C++ 中,这也被称为 __cdecl + 在 VO(和 X#)中,还有一个同义词 “ASPEN”。
    PASCAL - This calling convention is used a lot in the Pascal world. It looks a lot like the STRICT calling convention, but now the function / method that gets called adjusts the stack when it returns. Of course, this also means that there cannot be a variable number of arguments. If and when that is necessary, then usually the last parameter becomes an array of values, so there still is some flexibility. - In C/C++ this is called the __stdcall calling convention. - This calling convention is used by most functions in the windows API. - In VO this is also called WINCALL or CALLBACK. In 16bits windows WINCALL was different from PASCAL but 32 bits windows and later dropped that difference. + + 这种调用约定在 Pascal 的世界里被广泛使用。它看起来很像 STRICT 调用约定,但现在被调用的函数/方法会在返回时调整堆栈。当然,这也意味着不能有可变数量的参数。如果有必要,最后一个参数通常会变成一个数组,因此仍有一定的灵活性。 + 在 C/C++ 中,这被称为 __stdcall 调用约定。 + Windows API 中的大多数函数都使用这种调用约定。 + 在 VO 中,这也被称为 WINCALL 或 CALLBACK。在 16 位的 windows 中,WINCALL 与 PASCAL 不同,但 32 位及以后的 windows 则取消了这一区别。
    THISCALL - This is a special variant of the PASCAL calling convention, where the “this” pointer is not pushed on the stack but passed in a register (usually the ECX register). Passing the “this” in the register can be faster, especially when the register is not used for something else, so repeated calls for the same object to not have to push the “this” pointer. In C/C++ this is called __thisccall + + 这是 PASCAL 调用约定的一个特殊变体,“this ”指针不推入堆栈,而是通过寄存器(通常是 ECX 寄存器)传递。在寄存器中传递 “this ”会更快,特别是当寄存器未被用于其他用途时,因此重复调用同一对象时不必推送 “this ”指针。在 C/C++ 中,这被称为 __thisccall
    FASTCALL - This calling convention tries to pass as many parameters in registers as possible. - In C/C++ this is called __fastcall. + + 这种调用方式试图在寄存器中传递尽可能多的参数。 + 在 C/C++ 中,这被称为 __fastcall 。
    CLIPPER - This is a special calling convention in the Xbase world, where parameters to a function are (technically) all optional and where you can also pass more values than you have declared parameters. Originally in the Xbase languages the calling code would push the values on the stack and would also pass the parameter count, so the function that is called “knows” how many parameters are passed. - In .Net there is no real equivalent for that. To emulate the CLIPPER calling convention we generate a special PARAMS parameter that contains an array of USUAL values. Parameters of type PARAMS must be the last (or only) parameter in the list of parameters. The Roslyn compiler (that we use for x#) will automatically wrap all values that are passed to a function / method with clipper calling convention in an array. - Of course, when you declare a function like this + + 这是 Xbase 世界中的一种特殊调用约定,在 Xbase 世界中,函数的参数(从技术上讲)都是可选的,而且可以传递比声明参数更多的值。最初,在 Xbase 语言中,调用代码会将值推入堆栈,同时也会传递参数数,这样被调用的函数就 “知道 ”传递了多少个参数。 + 在.Net 中,没有真正的等价物。为了模拟 CLIPPER 调用约定,我们生成了一个特殊的 PARAMS 参数,其中包含一个 USUAL 值数组。PARAMS 类型的参数必须是参数列表中的最后一个(或唯一一个)参数。Roslyn 编译器(我们在 x# 中使用的编译器)会自动将传递给使用 clipper 调用约定的函数/方法的所有值封装在一个数组中。 + 当然,当您这样声明一个函数 FUNCTION Foo(a,b,c) - Then you expect that you will have 3 local variables in your code with the names “a”, “b” and “c”. - The compiler however generates a function with a params argument. Something like this: + 然后,你希望在代码中使用 3 个名为 “a”、“b ”和 “c ”的局部变量。 + 然而,编译器会生成一个带有参数的函数。类似这样 FUNCTION Foo(args PARAMS USUAL[]) - Inside the function we then generate local variables with the name of the parameters that you have declared + 然后,我们在函数内部生成局部变量,并将参数的名称标注出来 LOCAL a := args[1] as USUAL
    LOCAL b := args[2] as USUAL
    LOCAL c := args[3] as USUAL
    - In reality, the code is a bit more complex, because you may decide to all the function with less parameters than were declared. We have to take that into account. - It looks like this then: + 实际上,代码会更复杂一些,因为您可能会决定在所有函数中使用比声明参数更少的参数。我们必须考虑到这一点。 + 现在看起来是这样的 LOCAL numParams := args:Length
    LOCAL a := iif(numParams > 0, args[1], NIL) AS USUAL
    - The names for “numParams” and “args” are generated by the complier with a special character in them, to make sure that we do not introduce variable names that conflict with names in your code. - The X# debugger support layer also hides these special variables. + “numParams” 和  ”args" 的名称是由编译器生成的,其中包含一个特殊字符,以确保我们引入的变量名称不会与代码中的名称相冲突。 + X# 调试器支持层也会隐藏这些特殊变量。
    - For “normal” managed code, you really only have to deal with 2 calling conventions: + 对于 “正常的 ”托管代码,你实际上只需要处理两种调用约定: -
  • For untyped methods the compiler uses the CLIPPER calling convention
  • -
  • For typed methods the compiler there is no difference between STRICT and PASCAL. They both produce the same code
  • +
  • 对于未类型方法,编译器使用 CLIPPER 调用约定
  • +
  • 对于类型化方法,编译器在 STRICT 和 PASCAL 之间没有区别。它们都产生相同的代码
  • - Only when you call unmanaged code in other DLLs then you need to use one of the other calling conventions. You have to “know” what the DLL uses. One problem is that quite often the calling convention in C/C++ code is hidden in a compiler macro. - As a rule of thumb you should use STRICT for C/C++ code and PASCAL for windows api funtions. - If it does not work (for example, the .Net runtime complains about stack problems), then switch to the oher calling convention. + 只有在调用其他 DLL 中的非托管代码时,才需要使用其他调用约定。你必须 “知道 ”DLL 使用的是什么。一个问题是,C/C++ 代码中的调用约定往往隐藏在编译器宏中。 + 根据经验,C/C++ 代码应使用 STRICT,Windows api 函数应使用 PASCAL。 + 如果不起作用(例如,.Net 运行时抱怨堆栈问题),则应改用其他调用约定。
    diff --git a/docs/Help_ZH-CN/Topics/Chapter-2.xml b/docs/Help_ZH-CN/Topics/Chapter-2.xml index 2ed039d05f..699076d57f 100644 --- a/docs/Help_ZH-CN/Topics/Chapter-2.xml +++ b/docs/Help_ZH-CN/Topics/Chapter-2.xml @@ -1,64 +1,65 @@  - - X# Language Reference + + X# 语言参考
    - X# Language Reference + X# 语言参考
    - This section is a reference to the X# language - X# Language elements + 本部分是 X# 语言的参考。 - The following table shows reference topics that provide tables of keywords, symbols and literals used as tokens in X#. + X# 语言元素 + + 下表列出了参考主题所提供的 X# 中用作标记的关键字、符号和字面量。
    - Title + 标题 - Description + 描述
    - Keywords + 关键字 - Contains links to information about all X# language keywords. + 包含所有 X# 语言关键字信息的链接。
    - Expression + 表达式 - A list of possible expressions + 可能的表达式清单
    - Symbol and Operators + 符号和运算符 - Contains a table of symbols and operators that are used in the X# language. + 包含 X# 语言中使用的符号和运算符。
    - Literals (X#) + 字面量 (X#) - Describes the syntax for literal values in X# and how to specify type information for X# literals. + 介绍 X# 字面值的语法以及如何为 X# 字面值指定类型信息。
    - Commands and Statements + 命令和语句 - A List of commands and statements + 命令和语句列表
    diff --git a/docs/Help_ZH-CN/Topics/CharLiterals.xml b/docs/Help_ZH-CN/Topics/CharLiterals.xml index 7556029ecb..28d1f49d52 100644 --- a/docs/Help_ZH-CN/Topics/CharLiterals.xml +++ b/docs/Help_ZH-CN/Topics/CharLiterals.xml @@ -1,7 +1,7 @@  - - Char Literals + + Char 字面量 CHAR Char Literals @@ -9,32 +9,36 @@
    - Char Literals + Char 字面量
    - There are different notations for a char literal depending on the dialect selected.
    In the many dialects the single quotes are string delimiters and therefore the 'c' prefix is needed for character literals.
    - Only in the Core and Vulcan dialects single quotes are always reserved for character literals + + 根据所选方言的不同,Char 字面量有不同的符号。 + + 在许多方言中,单引号是字符串分隔符,因此 Char 字面量需要 “c ”前缀。 + + 只有在 Core 和 Vulcan 方言中,字符字面量总是保留单引号 @@ -42,10 +46,10 @@ '<char>'
    - Literal + 字面量 - VO, XPP, FoxPro & Harbour + VO, XPP, FoxPro & Harbour - Vulcan & Core + Vulcan & Core
    - c'<char>' or c"<char>" + c'<char>' 或 c"<char>" - Char literal* + Char 字面量* - Char literal* + Char 字面量*
    - String literal + String 字面量 - Char literal* + Char 字面量*
    diff --git a/docs/Help_ZH-CN/Topics/Classes-and-Structures.xml b/docs/Help_ZH-CN/Topics/Classes-and-Structures.xml index 8cb106024f..675462b28c 100644 --- a/docs/Help_ZH-CN/Topics/Classes-and-Structures.xml +++ b/docs/Help_ZH-CN/Topics/Classes-and-Structures.xml @@ -1,44 +1,45 @@  - - Classes and Structures + + 类和结构
    - Classes and Structures + 类和结构
    - In .Net, there are two kind of types that hold data, reference types (or classes) and value types (or structures). The two of them have different semantics in the way they are used, but both can contain themselves other reference and/or value types. - Classes - A class (or a reference type), is the most common way of storing data. Its name comes from the fact that a variable of a reference type (commonly referred to as an instance of the type) does not contain the data directly, but instead points to (references) a memory location where the actual data is stored. A class in X# is defined through the CLASS...END CLASS statement and can INHERIT from another reference type, implement one or more INTERFACES and may contain fields, properties, constructors, methods, events and other items: - CLASS Customer
      EXPORT name AS INT // exported (public) field
      PROTECT age AS INT // protected field, not visible to code outside the class
    END CLASS
    - Typically classes and all their members are defined in a single file of code. If it's necessary for class members to be defined in multiple files (for example when the amount of class members is very big), then the class must be defined in every file as PARTIAL: - PARTIAL CLASS Customer
    // class members
    END CLASS
    - Since an instance of a class is only storing a pointer to the data, one or more variables can point to the exact same object in memory. Assigning a variable of a reference type to another variable of the same type results to both representing the same data. Updating data using one reference automatically updates the other reference as well: - FUNCTION Start() AS VOID
      LOCAL one, two AS Customer
      one := Customer{}
      two := one // now both vars point to the same object in memory
      two:name := "Robert"
      ? one:name // also "Robert"
    - Nested Classes - A class can even contain other types (classes or structures). In this case the type inside the main type is called a nested type. Nested types can be used by using the name of their container class and their own name, connected by a dot: + + 在 .Net 中,有两种类型可以保存数据,即引用类型(或类)和值类型(或结构)。这两种类型的使用方式语义不同,但都可以包含其他引用和/或值类型。 + + 类(或引用类型)是最常见的数据存储方式。其名称来源于这样一个事实,即引用类型的变量(通常称为该类型的实例)并不直接包含数据,而是指向(引用)存储实际数据的内存位置。X# 中的类是通过 CLASS...END CLASS 语句 定义的,可以从另一个引用类型继承,实现一个或多个 INTERFACES,并可能包含字段、属性、构造函数、方法、事件和其他项目: + CLASS Customer
      EXPORT name AS INT // exported (public) 字段
      PROTECT age AS INT // protected 字段, 类外的代码看不到
    END CLASS
    + 通常情况下,类及其所有成员都定义在一个代码文件中。如果需要在多个文件中定义类成员(例如,当类成员数量非常多时),则必须在每个文件中将类定义为 PARTIAL: + PARTIAL CLASS Customer
    // 类成员
    END CLASS
    + 由于类的实例只存储一个指向数据的指针,因此一个或多个变量可以指向内存中完全相同的对象。将一个引用类型的变量分配给另一个相同类型的变量,会导致两者代表相同的数据。使用一个引用更新数据时,也会自动更新另一个引用: + FUNCTION Start() AS VOID
      LOCAL one, two AS Customer
      one := Customer{}
      two := one // 现在两个变量都指向内存中的同一个对象
      two:name := "Robert"
      ? one:name // 也是 "Robert"
    + 嵌套类 + 一个类甚至可以包含其他类型(类或结构)。在这种情况下,主类型内部的类型称为嵌套类型。使用嵌套类型时,可以使用容器类的名称和自己的名称,中间用点连接: CLASS Customer
      CLASS NestedClass
         EXPORT FieldInNestedClass AS INT
      END CLASS
    END CLASS

    FUNCTION Start() AS VOID
      LOCAL oNested AS Customer.NestedClass
      oNested := Customer.NestedClass{}
      oNested:FieldInNestedClass := 100
      ? oNested:FieldInNestedClass
    - Nested classes are useful in particular for defining helper classes, a class that is only used in the context of the parent class, for holding information only relevant to that class. Creating a nested class for this data, instead of using a regular class results to better structured code. - Structures - A structure (or a value type), in contrast to reference types, stores its data directly. It has some similarities to the Visual Objects STRUCTURE feature (renamed in X# to VOSTRUCT), but it is a lot more powerful than in VO, as it can contain most items that also reference types have, like properties, constructors, methods etc. Unlike reference types though, value types cannot inherit from other types or implement interfaces. They can contain nested classes or structures though. Value types can be defined with the STRUCTURE Statement: + 嵌套类尤其适用于定义辅助类,即只在父类的上下文中使用的类,用于保存只与该类相关的信息。为这些数据创建嵌套类,而不是使用普通类,可以使代码结构更加合理。 + 结构 + 与引用类型相比,结构(或值类型)直接存储数据。它与 Visual Objects 的 STRUCTURE 功能(在 X# 中更名为 VOSTRUCT)有一些相似之处,但它比 VO 功能强大得多,因为它可以包含大多数引用类型也有的项目,如属性、构造函数、方法等。与引用类型不同的是,值类型不能从其他类型继承或实现接口。不过它们可以包含嵌套类或结构。值类型可以用 STRUCTURE 语句 定义: STRUCTURE Vector2D
      EXPORT x AS INT
      EXPORT y AS INT
      METHOD Invert() AS VOID
         SELF:x := - SELF:x
         SELF:y := - SELF:y
    END STRUCTURE
    - Since structures hold their data directly, instantiating them does not involve any additional memory consumption than the memory needed for their data itself (reference types need memory for the data and also for the pointer to the data) or garbage collector activity. They are mostly suitable as light weight data containers, usually hold a small amount of fields, typically 2-4, but can even contain a single element, like the System.Int32 (INT) or System.Boolean (LOGIC) data types which simply define the INT and LOGIC data types, including several methods for manipulating their data. Other very commonly used system defined structures are System.Drawing.Point, System.Drawing.Rectangle etc, all containing a small amount of data fields. - Structure semantics - Structures also have different semantics when using them compared to regular classes. It is not necessary to instantiate such a variable to use it, since declaring a var of a value type results to its data being allocated directly: + 由于结构直接保存数据,因此除了数据本身所需的内存(引用类型的数据和数据指针都需要内存)或垃圾收集器活动外,实例化结构不会涉及任何额外的内存消耗。它们大多适合作为轻量级数据容器,通常只容纳少量字段,一般为 2-4 个,但也可以只容纳一个元素,如 System.Int32 (INT) 或 System.Boolean (LOGIC) 数据类型,它们只是定义了 INT 和 LOGIC 数据类型,包括几种操作其数据的方法。其他非常常用的系统定义结构包括 System.Drawing.Point(点)、System.Drawing.Rectangle(矩形)等,它们都包含少量数据字段。 + 结构语义 + 与普通类相比,结构在使用时也有不同的语义。因为声明一个值类型的 var 会直接分配其数据,所以不需要实例化这样的变量来使用它: FUNCTION Start() AS VOID
      LOCAL vector AS Vector2D
      vector:x := 10
      vector:y := 20
    - Although, for convenience, it's possible to also define constructors in value types and instantiate them as with regular classes: + 不过,为了方便起见,也可以在值类型中定义构造函数,并像普通类一样将它们实例化: STRUCTURE Vector2D
      EXPORT x AS INT
      EXPORT y AS INT
      CONSTRUCTOR(vec_x AS INT, vec_y AS INT)
         SELF:x := vec_x
         SELF:y := vec_y
    END STRUCTURE

    FUNCTION Start() AS VOID
      LOCAL vector AS Vector2D
      vector := Vector2D{10,20}
      ? vector:x // 10
    - The most important difference that must always be taken under consideration, is that assigning a value type to another one results to the data of the source being copied to the destination, so unlike what happens with reference types, the data of the two variables are stored in separate memory locations and any changes to one variable will not affect the other: - FUNCTION Start() AS VOID
      LOCAL vec_1,vec_2 AS Vector2D
      vec_1:x := 10 ; vec_1:y := 20
      vec_2 := vec_1
      ? vec_2:x // 10, value was copied from first vector

      vec_2:x := 40 // put a new value to second vector
      ? vec_1:x // 10 again, first vector value still has its original value
    - For this reason structures are not suitable for very large objects, since assigning one to another or passing one as an argument to a method involves copying all data from the source to the destination. On the other hand, with regular classes, only the pointer to the data is passed as an argument to a method. - Equals operator - Another important difference between reference and value types, is the behavior of the equals operator (==). For reference types, the equals operator between two variables only compares the pointers themselves, not the data of the objects. So it returns TRUE only when both variables point to the same object and in all other cases it returns FALSE, even if the data both objects contain is the same: - CLASS ReferenceType
      EXPORT data AS STRING
    END CLASS

    FUNCTION Start() AS VOID
      LOCAL o1,o2 AS ReferenceType
      o1 := ReferenceType{}
      o1:data := "test"

      o2 := ReferenceType{}
      o2:data := "test"
     
      ? o1 == o2 // FALSE, because o1 and o2 point to different memory locations
     
      o2 := o1
      ? o1 == o2 // TRUE
    - On the other hand, by default the == operator cannot be used on structures and the compiler will report an error if you try to do so. It can be made possible to use it though, by defining an OPERATOR method in the structure that implements how the comparison with == should be done. In the sample below, the == operator is implemented to compare the actual data that the two compared structures hold, so that it returns TRUE, when the data is equal: - STRUCTURE ValueType
      EXPORT data AS STRING
      OPERATOR == (a AS ValueType, b AS ValueType) AS LOGIC
      RETURN a:data == b:data // let the equals == operator return true when the data of the two arguments is the same
    END STRUCTURE
    + 与引用类型不同的是,两个变量的数据存储在不同的内存位置,对其中一个变量的任何更改都不会影响另一个变量: + FUNCTION Start() AS VOID
      LOCAL vec_1,vec_2 AS Vector2D
      vec_1:x := 10 ; vec_1:y := 20
      vec_2 := vec_1
      ? vec_2:x // 10, 值从第一个 Vector 中复制

      vec_2:x := 40 // 将新值加入第二个  Vector
      ? vec_1:x // 10 again, 第一个  Vector 值仍保留其原始值
    + 因此,结构不适合用于非常大的对象,因为将一个对象赋值给另一个对象或将一个对象作为参数传递给方法时,需要将所有数据从源对象复制到目的对象。另一方面,对于普通类,只需将数据指针作为参数传递给方法即可。 + 等号运算符 + 引用类型和值类型的另一个重要区别是等号运算符 (==) 的行为。对于引用类型,两个变量之间的等号运算符只比较指针本身,而不比较对象的数据。因此,只有当两个变量指向同一个对象时,它才会返回 TRUE,而在所有其他情况下,即使两个对象包含的数据相同,它也会返回 FALSE: + CLASS ReferenceType
      EXPORT data AS STRING
    END CLASS

    FUNCTION Start() AS VOID
      LOCAL o1,o2 AS ReferenceType
      o1 := ReferenceType{}
      o1:data := "test"

      o2 := ReferenceType{}
      o2:data := "test"
     
      ? o1 == o2 // FALSE, 因为 o1 和 o2 指向不同的内存位置
     
      o2 := o1
      ? o1 == o2 // TRUE
    + 另一方面,默认情况下 == 操作符不能在结构上使用,如果尝试使用,编译器会报错。不过,通过在结构中定义一个 OPERATOR 方法来实现与 == 运算符的比较,还是可以使用 == 运算符的。在下面的示例中,实现 == 操作符的目的是比较两个被比较结构所持有的实际数据,因此当数据相等时,操作符将返回 TRUE: + STRUCTURE ValueType
      EXPORT data AS STRING
      OPERATOR == (a AS ValueType, b AS ValueType) AS LOGIC
      RETURN a:data == b:data // 当两个参数的数据相同时,让 equals == 运算符返回 true
    END STRUCTURE
    FUNCTION Start() AS VOID
      LOCAL o1,o2 AS ValueType
      o1:data := "test"
      o2:data := "nothing"
      ? o1 == o2 // FALSE
      o2:data := "test"
      ? o1 == o2 // TRUE
    - Note that it is possible to compare values of most common system defined structures like System.Int32, System.Boolean, System.Double, because they also have defined equals operator methods like the one in the code above. - Which one to use - Weather to use a class or a structure for holding data depends on the specific needs related to the particular data. For data holding a lot of information (for example a customer object) you would typically use a reference type, as such objects usually don't get instantiated very often, but usually "live" long for the duration of the program. For smaller objects, that are being a created, manipulated and copied between variables a lot of times and in particular in tight loops (like for example an object representing a Complex number, consisting of a real and an imaginary part, which can be used in a lot of calculations), it is' more suitable to use a structure, as this will typically lead to faster execution, with a lot less memory consumption and garbage collector activity. In any case, it's very important to carefully consider their differences in semantics when using value vs reference types. + 请注意,可以比较 System.Int32、System.Boolean、System.Double 等大多数常见系统定义结构的值,因为它们也有定义的等号操作符方法,如上面代码中的方法。 + 使用哪种 + 使用类还是结构来保存数据取决于与特定数据相关的具体需求。对于保存大量信息的数据(例如客户对象),通常会使用引用类型,因为这类对象通常不会经常被实例化,而是会在程序的持续时间内长期 “存活”。而对于在变量间创建、操作和复制次数较多,特别是在紧密循环中的较小对象(例如表示复数的对象,由实部和虚部组成,可用于大量计算),则更适合使用结构,因为这通常会加快执行速度,减少内存消耗和垃圾回收器活动。无论如何,在使用值类型和引用类型时,仔细考虑它们在语义上的差异是非常重要的。
    diff --git a/docs/Help_ZH-CN/Topics/CodeBlock2.xml b/docs/Help_ZH-CN/Topics/CodeBlock2.xml index fb73f4ad92..d622b363f3 100644 --- a/docs/Help_ZH-CN/Topics/CodeBlock2.xml +++ b/docs/Help_ZH-CN/Topics/CodeBlock2.xml @@ -1,6 +1,6 @@  - + CodeBlock CODEBLOCK @@ -11,9 +11,12 @@
    CodeBlock
    - This is the parent class for compile time codeblocks. - There is also a subclass _CodeBlock which is the parent class for macro compiled (runtime) codeblocks - The internal type names are XSharp.CodeBlock and XSharp._CodeBlock + + 这是编译时代码块的父类。 + + 还有一个子类 _CodeBlock 是宏编译(运行时)代码块的父类。 + + 内部类型名称为 XSharp.CodeBlock 和 XSharp._CodeBlock diff --git a/docs/Help_ZH-CN/Topics/Codeblock_-Lambda-and-Anonymou.xml b/docs/Help_ZH-CN/Topics/Codeblock_-Lambda-and-Anonymou.xml index 99127ed088..8ded4cd55f 100644 --- a/docs/Help_ZH-CN/Topics/Codeblock_-Lambda-and-Anonymou.xml +++ b/docs/Help_ZH-CN/Topics/Codeblock_-Lambda-and-Anonymou.xml @@ -1,49 +1,37 @@  - - Codeblock, Lambda and Anonymous Method Expressions + + 代码块、Lambda 和匿名方法表达式
    - Codeblock, Lambda and Anonymous Method Expressions + 代码块、Lambda 和匿名方法表达式
    - X# contains 3 language constructs that are fairly similar yet different. - Codeblocks - Historically the XBase language has known the CodeBlock Type. A codeblock is specified as + + X# 包含 3 种相当相似但又不同的语言结构。 + 代码块 + XBase 语言历来使用代码块类型。代码块指定为 {| params | expression } - The parameters inside a codeblock are of type USUAL and its return value is also of type USUAL.
    To evaluate a codeblock you call the Eval() runtime function and pass this function the codeblock and parameters when needed
    - - FUNCTION Start() AS VOID
    LOCAL cb as CODEBLOCK
    cb := { |x, y| x * y}
    ? Eval(cb, 2,3)  // shows 6
    WAIT
    RETURN
    - - In stead of a single expression, you can also use an expression list. The value of the last expression in the list is returned as the result of the codeblock. - - FUNCTION Start() AS VOID
    LOCAL cb as CodeBlock
    cb := { |x, y| x += 1, x * y}
    ? Eval(cb, 2,3)  // shows 9
    WAIT
    RETURN
    - - X# has also added the possibility to the language to include a list of statements as "body" of the codeblock. The result of the last statement is returned to the calling code. When the last statement is "Void" then a NIL will be returned:
    Note that the closing Curly must be on a line of its own and the first statement must appear on a new line as well.
    - + 代码块内的参数是 USUAL 类型,其返回值也是 USUAL 类型。
    要对代码块进行评估,需要调用运行时函数 Eval(),并在需要时将代码块和参数传递给该函数。
    + FUNCTION Start() AS VOID
    LOCAL cb as CODEBLOCK
    cb := { |x, y| x * y}
    ? Eval(cb, 2,3)  // 显示 6
    WAIT
    RETURN
    + 您也可以使用表达式列表来代替单个表达式。列表中最后一个表达式的值将作为代码块的结果返回。 + FUNCTION Start() AS VOID
    LOCAL cb as CodeBlock
    cb := { |x, y| x += 1, x * y}
    ? Eval(cb, 2,3)  // 显示 9
    WAIT
    RETURN
    + Vulcan 语言还可以将语句列表作为代码块的 “主体”。最后一条语句的结果将返回给调用代码。当最后一条语句为 “Void ”时,将返回 NIL:
    请注意,结尾的卷边必须独立成行,第一条语句也必须在新的一行中出现。
    FUNCTION Start() AS VOID
    LOCAL cb as CodeBlock
    cb := { |x, y|
            x += 1
               ? x
            RETURN x * y
          }
    ? Eval(cb, 2,3)  // prints 3 and shows the result 9
    WAIT
    RETURN
    - Lambda Expressions - Lamda expressions look a lot like Codeblocks. They are usually used in combination with Delegates. - - + Lambda 表达式 + Lamda 表达式看起来很像 Codeblocks。它们通常与委托结合使用。 DELEGATE MultiPlyInt( x as Int, y as Int) as Int

    FUNCTION Start() AS VOID
    LOCAL lambda as MultiPlyInt
    lambda := { x, y => x * y}
    ? Lambda(2,3) // shows 6
    RETURN
    - - Parameters are optional and the return type can be VOID, so this works as well - + 参数是可选的,返回类型可以是 VOID,因此也可以这样做 DELEGATE DoSomething( ) as VOID

    FUNCTION Start() AS VOID
    LOCAL lambda as DoSomething
    lambda := { => Console.WriteLine("This is a Lambda")}
    Lambda() // prints the text
    RETURN
    - - The parameters of a Lambda expression may be typed. This can be convenient for documentation purposes but can also help the compiler to find the right overload for a method: - + Lambda 表达式的参数可以类型化。这不仅便于文档记录,还能帮助编译器找到方法的正确重载: DELEGATE CalcInt( x AS INT, y AS INT) AS INT

    DELEGATE CalcReal( x AS REAL8, y AS REAL8) AS REAL8

    FUNCTION Start() AS VOID
    TestLambda( { x AS INT, y AS INT => x * y} )
    TestLambda( { x AS REAL8, y AS REAL8 => x + y} )
    TestLambda( { x , y  => x - y } ) // Which one will be called ?
    RETURN

    FUNCTION TestLambda (lambda AS CalcInt) AS VOID
    ? "Int", lambda(2,3)
    RETURN

    FUNCTION TestLambda (lambda AS CalcReal) AS VOID
    ? "Real",lambda(2,3)
    RETURN
    - - The body of the Lambda may also be a single expression, expression list and a statement list. - Anonymous Method Expressions - These work almost the same as Lambda Expressions.
    Take the example below:
    - + Lambda 的主体也可以是单个表达式、表达式列表和语句列表。 + 匿名方法表达式 + 其工作原理与 Lambda 表达式几乎相同。
    请看下面的例子:
    FUNCTION TestAnonymous() AS VOID
      LOCAL oForm AS Form
      oForm := Form{}
      oForm:Click += DELEGATE(o AS System.Object, e AS System.EventArgs ) {  
                     System.Windows.Forms.MessageBox.Show("Click from AME 1!")  
                     System.Windows.Forms.MessageBox.Show("Click from AME 2!")  
                  }  
      oForm:Click += { o,e => System.Windows.Forms.MessageBox.Show("We can also do this with a Lambda!") }  
      oForm:ShowDialog()
      RETURN    
    - The biggest difference between Lambda Expressions and Anonymous Method Expressions is that the parameters to Lambda Expressions do not have to be typed. They will be inferred from the usage. Parameters for Anonymous Method Expressions must always be typed. + Lambda 表达式与匿名方法表达式的最大区别在于,Lambda 表达式的参数无需类型化。它们将从用法中推断出来。匿名方法表达式的参数必须始终键入。
    diff --git a/docs/Help_ZH-CN/Topics/Combining-X-Runtime-and-Vulcan.xml b/docs/Help_ZH-CN/Topics/Combining-X-Runtime-and-Vulcan.xml index ccfd2e3aeb..cee6ead60e 100644 --- a/docs/Help_ZH-CN/Topics/Combining-X-Runtime-and-Vulcan.xml +++ b/docs/Help_ZH-CN/Topics/Combining-X-Runtime-and-Vulcan.xml @@ -1,10 +1,10 @@  - - Combining X# Runtime and Vulcan Runtime + + 结合 X# 运行时和 Vulcan 运行时
    - Combining X# Runtime and Vulcan Runtime + 结合 X# 运行时和 Vulcan 运行时
    Technically it is possible to include both the X# and the Vulcan runtime libraries in your application. When you do so then the compiler will assume that you want to use the X# implementations for the XBase types such as USUAL and DATE. If the compiler does not find the XSharp.Core and XSharp.VO assemblies then it will assume you want to map these types to the Vulcan runtime types. So you can mix things. However if you want to call code in the Vulcan runtime DLLs you may have to use the fully qualified classnames or typenames. diff --git a/docs/Help_ZH-CN/Topics/Currency-Type.xml b/docs/Help_ZH-CN/Topics/Currency-Type.xml index c7e1e1b2e7..ac7a13a65b 100644 --- a/docs/Help_ZH-CN/Topics/Currency-Type.xml +++ b/docs/Help_ZH-CN/Topics/Currency-Type.xml @@ -1,17 +1,18 @@  - - Currency Type + + Currency 类型 CURRENCY XSharp.__Currency
    - Currency Type + Currency 类型
    - This implements the FoxPro Currency type
    The internal typename is XSharp.__Currency
    - + 它实现了 FoxPro 货币类型。 +
    内部类型名是 XSharp.__Currency 。
    +
    diff --git a/docs/Help_ZH-CN/Topics/DATE.xml b/docs/Help_ZH-CN/Topics/DATE.xml index c4f1d51479..7f5e901bf2 100644 --- a/docs/Help_ZH-CN/Topics/DATE.xml +++ b/docs/Help_ZH-CN/Topics/DATE.xml @@ -1,6 +1,6 @@  - + DATE DATE @@ -9,9 +9,13 @@
    DATE
    - The DATE type is an integral type that stores a date value.
    The DATE is internally stored in 3 fields (DAY, MONTH and YEAR) that occupy a total of 32 bits in memory.
    - Implementation - The DATE type is implemented in the structure  XSharp.__Date - The Usual type of DATE  is 2. + + DATE 类型是一种存储日期值的整数类型。 +
    日期在内部存储在 3 个字段中(日、月和年),共占用内存 32 位。
    + + 实现 + DATE 类型在 XSharp.__Date 结构中实现。 + + DATE 的 UsualType 值是 2。
    diff --git a/docs/Help_ZH-CN/Topics/DECIMAL.xml b/docs/Help_ZH-CN/Topics/DECIMAL.xml index cda289d62e..e33d8559d2 100644 --- a/docs/Help_ZH-CN/Topics/DECIMAL.xml +++ b/docs/Help_ZH-CN/Topics/DECIMAL.xml @@ -1,12 +1,14 @@  - + DECIMAL
    DECIMAL
    - The DECIMAL keyword describes the .Net System.Decimal type.
    The Decimal value type represents decimal numbers ranging from positive 79,228,162,514,264,337,593,543,950,335 to negative 79,228,162,514,264,337,593,543,950,335. The Decimal value type is appropriate for financial calculations that require large numbers of significant integral and fractional digits and no round-off errors. The Decimal type does not eliminate the need for rounding. Rather, it minimizes errors due to rounding. For example, the following code produces a result of 0.9999999999999999999999999999 instead of 1.
    + + DECIMAL 关键字描述了 .Net System.Decimal 类型。 +
    Decimal 值类型表示从正 79,228,162,514,264,337,593,543,950,335 到负 79,228,162,514,264,337,593,543,950,335 范围内的十进制数。Decimal 值类型适用于需要大量有效整数和小数位以及不需要舍入误差的金融计算。Decimal 类型并不消除舍入的需要,而是最小化由于舍入而产生的错误。例如,以下代码的结果为 0.9999999999999999999999999999 而不是 1。
    diff --git a/docs/Help_ZH-CN/Topics/DWORD.xml b/docs/Help_ZH-CN/Topics/DWORD.xml index dbbec68d02..3690f9fd62 100644 --- a/docs/Help_ZH-CN/Topics/DWORD.xml +++ b/docs/Help_ZH-CN/Topics/DWORD.xml @@ -1,6 +1,6 @@  - + DWORD DWORD @@ -9,6 +9,7 @@
    DWORD
    - The DWORD keyword denotes an integral type that stores unsigned 32-bit values with values ranging from 0 to 4,294,967,295. + + DWORD 关键字表示一种整数类型,用于存储无符号的 32 位值,取值范围从 0 到 4,294,967,295。
    diff --git a/docs/Help_ZH-CN/Topics/DYNAMIC.xml b/docs/Help_ZH-CN/Topics/DYNAMIC.xml index dbc3bbd103..01bbbafa03 100644 --- a/docs/Help_ZH-CN/Topics/DYNAMIC.xml +++ b/docs/Help_ZH-CN/Topics/DYNAMIC.xml @@ -1,6 +1,6 @@  - + DYNAMIC DYNAMIC @@ -9,10 +9,12 @@
    DYNAMIC
    - The dynamic type enables the operations in which it occurs to bypass compile-time type checking. Instead, these operations are resolved at run time. The dynamic type simplifies access to COM APIs such as the Office Automation APIs, and also to dynamic APIs such as IronPython libraries, and to the HTML Document Object Model (DOM). - Type dynamic behaves like type object in most circumstances. However, operations that contain expressions of type dynamic are not resolved or type checked by the compiler. The compiler packages together information about the operation, and that information is later used to evaluate the operation at run time. As part of the process, variables of type dynamic are compiled into variables of type object. Therefore, type dynamic exists only at compile time, not at run time.
    - Please not that to use the DYNAMIC type in your app you have to include the Microsoft.CSharp DLL at this moment, and the property names and method names are case sensitive at this moment. + DYNAMIC 类型允许其出现的操作绕过编译时类型检查,而是在运行时解析这些操作。DYNAMIC 类型简化了对 COM API(如 Office Automation API)、动态 API(如 IronPython 库)和 HTML 文档对象模型(DOM)的访问。 + + DYNAMIC 类型在大多数情况下的行为类似于对象类型。但是,包含 DYNAMIC 类型表达式的操作不会被编译器解析或类型检查。编译器会打包有关操作的信息,稍后在运行时使用该信息来评估操作。在此过程中,DYNAMIC 类型的变量被编译为对象类型的变量。因此,DYNAMIC 类型仅在编译时存在,而不在运行时存在。 + + 请注意,目前在应用程序中使用 DYNAMIC 类型,您必须在此时包含 Microsoft.CSharp DLL,并且属性名称和方法名称在此时区分大小写。
    diff --git a/docs/Help_ZH-CN/Topics/Date-Type.xml b/docs/Help_ZH-CN/Topics/Date-Type.xml index b3fbc664d1..e7a96cea51 100644 --- a/docs/Help_ZH-CN/Topics/Date-Type.xml +++ b/docs/Help_ZH-CN/Topics/Date-Type.xml @@ -1,16 +1,18 @@  - - Date Type + + Date 类型 DATE XSharp.__Date
    - Date Type + Date 类型
    - This structure holds year, month, day in 32 bits. For date calculations it uses the System.DateTime calculation logic. There are implicit converters between Date and DateTime.
    The internal type name for this type is XSharp.__Date
    + + 该结构以 32 位保存年、月、日。日期计算使用 System.DateTime 计算逻辑。Date 和 DateTime 之间有隐式转换器。 +
    该类型的内部类型名称为 XSharp.__Date 。
    diff --git a/docs/Help_ZH-CN/Topics/DateLiterals.xml b/docs/Help_ZH-CN/Topics/DateLiterals.xml index 7faea0931c..7b76e6d122 100644 --- a/docs/Help_ZH-CN/Topics/DateLiterals.xml +++ b/docs/Help_ZH-CN/Topics/DateLiterals.xml @@ -1,7 +1,7 @@  - - Date Literals + + Date 字面量 DATE Date Literals @@ -11,22 +11,24 @@
    - Date and DateTime Literals + Date 和 DateTime 字面量
    - Date literals are formatted + Date 字面量的格式是 YYYY.MM.DD - - or alternatively + 或者 + {^YYYY-MM-DD} - DateTime Literals can be constructed with the followin syntax + + DateTime 字面量可以用以下语法构建 {^YYYY-MM-DD HH:MM:SS}. - Examples: -   2000.01.01
      2012.02.29
      2015.09.25
      // foxpro date and datetime literals
      {^2019.02.28}
      {^2020.02.29 23:59:59}
    - Date and DateTime literals are supported in all dialects. In the Core dialect both date and datetime literals will be translated to a DateTime value. In the other dialects the Date literals are translated to a Date value. - Of course you can also use runtime functions to construct a literal, such as STOD("20150925") or ConDate(2019,9,25) but a literal is more efficient. + 示例: +   2000.01.01
      2012.02.29
      2015.09.25
      // foxpro date 和 datetime 字面量
      {^2019.02.28}
      {^2020.02.29 23:59:59}
    + 所有方言都支持 Date 和 DateTime 字面量。在 Core 方言中,Date 和 DateTime 字面量都将转换为 DateTime 值。在其他方言中,Date 字面量将被转换为 Date 值。 + + 当然,您也可以使用运行时函数来构造字面量,例如 STOD(“20150925”) 或 ConDate(2019,9,25),但字面量的效率更高。
    diff --git a/docs/Help_ZH-CN/Topics/Delegates.xml b/docs/Help_ZH-CN/Topics/Delegates.xml index 51be66f75c..cd5253f534 100644 --- a/docs/Help_ZH-CN/Topics/Delegates.xml +++ b/docs/Help_ZH-CN/Topics/Delegates.xml @@ -1,10 +1,10 @@  - - Delegates + + 委托
    - Delegates + 委托
    diff --git a/docs/Help_ZH-CN/Topics/Dialect-(in)compatibilities.xml b/docs/Help_ZH-CN/Topics/Dialect-(in)compatibilities.xml index 36b0e4e6be..8b58c264a5 100644 --- a/docs/Help_ZH-CN/Topics/Dialect-(in)compatibilities.xml +++ b/docs/Help_ZH-CN/Topics/Dialect-(in)compatibilities.xml @@ -1,11 +1,12 @@  - - Dialect (in)compatibilities + + 方言的(不)兼容性
    - Dialect (in)compatibilities + 方言的(不)兼容性
    - The following pages list incompatibilties between X# and the various dialects. Please note that this list is not complete yet. + + 以下页面列出了 X# 与各种方言之间的不兼容性。请注意,此列表尚不完整。
    diff --git a/docs/Help_ZH-CN/Topics/Enumeration-Types.xml b/docs/Help_ZH-CN/Topics/Enumeration-Types.xml index a4e6b4192b..a3c8d26d70 100644 --- a/docs/Help_ZH-CN/Topics/Enumeration-Types.xml +++ b/docs/Help_ZH-CN/Topics/Enumeration-Types.xml @@ -1,10 +1,10 @@  - - Enumeration Types + + 枚举类型
    - Enumeration Types + 枚举类型
    diff --git a/docs/Help_ZH-CN/Topics/Escape-codes.xml b/docs/Help_ZH-CN/Topics/Escape-codes.xml index e401ac996d..bb0d841e02 100644 --- a/docs/Help_ZH-CN/Topics/Escape-codes.xml +++ b/docs/Help_ZH-CN/Topics/Escape-codes.xml @@ -1,7 +1,7 @@  - - Escape codes + + 字符转义 \' \" @@ -21,25 +21,26 @@
    - Escape codes + 字符转义
    - The <char> literals in the table that are marked with an asterisk (*) may contain a special escape code + + 表中标有星号 (*) 的 <char> 字面量可能包含特殊转义码 @@ -47,7 +48,7 @@ \\ @@ -55,7 +56,7 @@ \" @@ -63,7 +64,7 @@ \' @@ -71,7 +72,7 @@ \0 @@ -79,7 +80,7 @@ \a @@ -87,7 +88,7 @@ \b @@ -95,7 +96,7 @@ \f @@ -103,7 +104,7 @@ \n @@ -111,7 +112,7 @@ \r @@ -127,7 +128,7 @@ \v @@ -135,7 +136,7 @@ \x HEXDIGIT(1-4) @@ -143,7 +144,7 @@ \u HEXGDIGIT (4 or 8)
    - Character + 字符 - Description + 描述
    - Character that does NOT start with a backslash + 不以反斜杠开头的字符 - Normal character + 正常字符
    - Backslash + 反斜杠
    - Double quote + 双引号
    - Single quote + 单引号
    - 0 character + 0 字符
    - Alert + 警告
    - Backspace + 退格键(Backspace)
    - Form feed + 分页
    - Line feed + 换行
    - New Line + 新行
    - Vertical tab + 纵向 tab
    - Hex number of character. 1-4 hex digits + 字符的十六进制数。1-4 个十六进制数字
    - Unicode number of character. 4 or 8 hex digits + 字符的 Unicode 编码。4 或 8 个十六进制数字
    diff --git a/docs/Help_ZH-CN/Topics/Events.xml b/docs/Help_ZH-CN/Topics/Events.xml index 93f3dc828b..ff483d5a63 100644 --- a/docs/Help_ZH-CN/Topics/Events.xml +++ b/docs/Help_ZH-CN/Topics/Events.xml @@ -1,10 +1,10 @@  - - Events + + 事件
    - Events + 事件
    diff --git a/docs/Help_ZH-CN/Topics/Exceptions-and-Exception-Handl.xml b/docs/Help_ZH-CN/Topics/Exceptions-and-Exception-Handl.xml index 1f7afad4f2..6c31944c3a 100644 --- a/docs/Help_ZH-CN/Topics/Exceptions-and-Exception-Handl.xml +++ b/docs/Help_ZH-CN/Topics/Exceptions-and-Exception-Handl.xml @@ -1,20 +1,21 @@  - - Exceptions and Exception Handling + + 异常和异常处理
    - Exceptions and Exception Handling + 异常和异常处理
    - In X#, errors in the program at run time are propagated through the program by using a mechanism called exceptions. Exceptions are thrown by code that encounters an error and caught by code that can correct the error. Exceptions can be thrown by the .NET Framework common language runtime (CLR) or by code in a program. Once an exception is thrown, it propagates up the call stack until a catch statement for the exception is found. Uncaught exceptions are handled by a generic exception handler provided by the system that displays a dialog box. - Exceptions are represented by classes derived from Exception. This class identifies the type of exception and contains properties that have details about the exception. Throwing an exception involves creating an instance of an exception-derived class, optionally configuring properties of the exception, and then throwing the object by using the throw keyword. For example: + 在 X# 中,程序运行时出现的错误会通过异常机制在程序中传播。异常由遇到错误的代码抛出,并由可以纠正错误的代码捕获。异常可以由 .NET Framework 通用语言运行时(CLR)或程序中的代码抛出。异常一旦被抛出,就会在调用堆栈中向上传播,直到找到异常的捕获语句为止。未捕获的异常由系统提供的通用异常处理程序处理,该程序会显示一个对话框。 + + 异常由 Exception 派生的类表示。该类可识别异常类型,并包含有关异常详细信息的属性。抛出异常包括创建一个异常派生类的实例,可选择配置异常的属性,然后使用 throw 关键字抛出对象。例如
    CLASS CustomException INHERIT Exception

      CONSTRUCTOR(message AS STRING)
      SUPER(message)

    END CLASS

    FUNCTION TestThrow as VOID
    LOCAL ex AS CustomException
    ex := CustomException{"Custom exception in TestThrow()}
    THROW ex
    RETURN
    - After an exception is thrown, the runtime checks the current statement to see whether it is within a try block. If it is, any catch blocks associated with the try block are checked to see whether they can catch the exception. Catch blocks typically specify exception types; if the type of the catch block is the same type as the exception, or a base class of the exception, the catch block can handle the method. For example: + 异常抛出后,运行时会检查当前语句是否在 try 代码块中。如果是,运行时将检查与 try 代码块相关的 catch 代码块,看它们是否能捕获异常。catch 块通常指定异常类型;如果 catch  块的类型与异常类型相同,或者是异常的基类,则捕获块可以处理该方法。例如 FUNCTION TestCatch as VOID

       TRY
           TestThrow()
       CATCH ex AS CustomException
           System.Console.WriteLine(ex.ToString())
       END TRY
    RETURN
    - If the statement that throws an exception is not within a try block or if the try block that encloses it has no matching catch block, the runtime checks the calling method for a try statement and catch blocks. The runtime continues up the calling stack, searching for a compatible catch block. After the catch block is found and executed, control is passed to the next statement after that catch block. + 如果抛出异常的语句不在 try 代码块中,或者包围它的 try 代码块中没有匹配的 catch 代码块,运行时就会检查调用方法中的 try 语句和 catch 代码块。运行时会继续在调用栈中查找兼容的 catch 块。找到并执行捕获块后,控制权将传递给该捕获块后的下一条语句。 - A try statement can contain more than one catch block. The first catch statement that can handle the exception is executed; any following catch statements, even if they are compatible, are ignored. Therefore, catch blocks should always be ordered from most specific (or most-derived) to least specific. + 一个 try 语句可以包含多个 catch 块。第一个能处理异常的 catch 语句会被执行;后面的任何 catch 语句,即使是兼容的,也会被忽略。因此,catch 块的排序应从最特殊(或最派生)到最不特殊。
    diff --git a/docs/Help_ZH-CN/Topics/FLOAT.xml b/docs/Help_ZH-CN/Topics/FLOAT.xml index 6c7c05409b..6781bab273 100644 --- a/docs/Help_ZH-CN/Topics/FLOAT.xml +++ b/docs/Help_ZH-CN/Topics/FLOAT.xml @@ -1,6 +1,6 @@  - + FLOAT FLOAT @@ -9,9 +9,13 @@
    FLOAT
    - The FLOAT type is a type that stores a 64-bit floating point value, along with formatting information. The precision and range of a FLOAT are the same as that from a REAL8, since the value of the float is stored in a REAL8. - Implementation - The FLOAT type is implemented in the structure  XSharp.__Float - The Usual type of FLOAT  is 3. + + FLOAT 类型是一种存储 64 位浮点数值以及格式化信息的类型。FLOAT 的精度和范围与 REAL8 相同,因为浮点数值存储在 REAL8 中。 + + 实现 + + FLOAT 类型在 XSharp.__Float 结构中实现。 + + FLOAT 的 UsualType 是 3。
    diff --git a/docs/Help_ZH-CN/Topics/File-System-and-the-Registry.xml b/docs/Help_ZH-CN/Topics/File-System-and-the-Registry.xml index 6ac123a0fe..2d0b71866a 100644 --- a/docs/Help_ZH-CN/Topics/File-System-and-the-Registry.xml +++ b/docs/Help_ZH-CN/Topics/File-System-and-the-Registry.xml @@ -1,10 +1,10 @@  - - File System and the Registry + + 文件系统和注册表
    - File System and the Registry + 文件系统和注册表
    diff --git a/docs/Help_ZH-CN/Topics/Float-Type.xml b/docs/Help_ZH-CN/Topics/Float-Type.xml index 8e5edc769e..61c1ba148b 100644 --- a/docs/Help_ZH-CN/Topics/Float-Type.xml +++ b/docs/Help_ZH-CN/Topics/Float-Type.xml @@ -1,18 +1,21 @@  - - Float Type + + Float 类型 FLOAT XSharp.__Float
    - Float Type + Float 类型
    - This structure is a combination of a REAL8 (System.Double) and a width and # of decimals. - It is not a reference type like in VO. - The internal type name for this type is XSharp.__Float + + 该结构是一个 REAL8(System.Double)与宽度和小数位数的组合。 + + 它与 VO 中的引用类型不同。 + + 该类型的内部类型名称是 XSharp.__Float diff --git a/docs/Help_ZH-CN/Topics/Generics.xml b/docs/Help_ZH-CN/Topics/Generics.xml index 6f91f38bb7..191a5adfac 100644 --- a/docs/Help_ZH-CN/Topics/Generics.xml +++ b/docs/Help_ZH-CN/Topics/Generics.xml @@ -1,10 +1,10 @@  - - Generics + + 泛型
    - Generics + 泛型
    diff --git a/docs/Help_ZH-CN/Topics/Highlight-words.xml b/docs/Help_ZH-CN/Topics/Highlight-words.xml index e952c6b14e..3f9ae6fe5b 100644 --- a/docs/Help_ZH-CN/Topics/Highlight-words.xml +++ b/docs/Help_ZH-CN/Topics/Highlight-words.xml @@ -1,18 +1,19 @@  - - Highlight Identifiers + + Highlight Identifiers(高亮标识符) Highlight words
    - Highlight Identifiers + Highlight Identifiers(高亮标识符)
    - When you select a specific word, it shows you all the places this word is used, this is case sensitive. + + 当您选择一个特定的单词时,它会显示该单词的所有使用地点,并区分大小写。 - The color for the highlights can be set in the Tools/Options dialog under the Environment/Fonts and Colors node. The X# specific colors all start with the text "X#" + 高亮部分的颜色可以在环境/字体和颜色节点下的工具/选项对话框中设置。X# 专用颜色均以 "X#"开头。
    diff --git a/docs/Help_ZH-CN/Topics/INT.xml b/docs/Help_ZH-CN/Topics/INT.xml index 48c5acad6c..982c7f3238 100644 --- a/docs/Help_ZH-CN/Topics/INT.xml +++ b/docs/Help_ZH-CN/Topics/INT.xml @@ -1,6 +1,6 @@  - + INT INT @@ -11,7 +11,8 @@
    INT / LONG / LONGINT
    - The INT or LONG keyword denotes an integral type that stores signed 32-bit values with values that range from negative 2,147,483,648 (which is represented by the Int32.MinValue constant) through positive 2,147,483,647 (which is represented by the Int32.MaxValue constant) The .NET Framework also includes an unsigned 32-bit integer value type, UInt32 or DWORD, which represents values that range from 0 to 4,294,967,295. + + INT 或 LONG 关键字表示一个整数类型,它存储带符号的 32 位值,取值范围从负 2,147,483,648(由 Int32.MinValue 常量表示)到正 2,147,483,647(由 Int32.MaxValue 常量表示)。.NET Framework 还包括一个无符号的 32 位整数值类型,UInt32 或 DWORD,表示取值范围从 0 到 4,294,967。
    diff --git a/docs/Help_ZH-CN/Topics/INT64.xml b/docs/Help_ZH-CN/Topics/INT64.xml index 464246fc27..2ab579ce42 100644 --- a/docs/Help_ZH-CN/Topics/INT64.xml +++ b/docs/Help_ZH-CN/Topics/INT64.xml @@ -1,6 +1,6 @@  - + INT64 INT64 @@ -9,6 +9,7 @@
    INT64
    - The INT64 keyword denotes an integral type that stores signed 64-bit values with values that range from negative 9,223,372,036,854,775,808 through positive 9,223,372,036,854,775,807 + + INT64 关键字表示一种整数类型,用于存储带符号的 64 位值,取值范围从负 9,223,372,036,854,775,808 到正 9,223,372,036,854,775,807。
    diff --git a/docs/Help_ZH-CN/Topics/Indexers.xml b/docs/Help_ZH-CN/Topics/Indexers.xml index 9364e847f4..323809b198 100644 --- a/docs/Help_ZH-CN/Topics/Indexers.xml +++ b/docs/Help_ZH-CN/Topics/Indexers.xml @@ -1,10 +1,10 @@  - - Indexers + + 索引器
    - Indexers + 索引器
    diff --git a/docs/Help_ZH-CN/Topics/IntegerLiterals.xml b/docs/Help_ZH-CN/Topics/IntegerLiterals.xml index 625f7ea89a..f54b7661fa 100644 --- a/docs/Help_ZH-CN/Topics/IntegerLiterals.xml +++ b/docs/Help_ZH-CN/Topics/IntegerLiterals.xml @@ -1,7 +1,7 @@  - - Integer Literals + + Integer 字面量 Integer Literals Literals @@ -9,36 +9,36 @@
    - Integer Literals + Integer 字面量
    - Literal INT values may be specified in decimal, hexadecimal or binary notation: + INT 的字面量值可以十进制、十六进制或二进制表示: 12345
    0x1234ABCD
    0b010010101
    - - Integer literals may have one of the following suffixes: + 整数字面量可以使用以下后缀之一:
    - Suffix + 后缀 + 描述
    - L or l + L 或 l - Signed 32 bits integer + 有符号 32 位整数
    - U or u + U 或 u - Unsigned integer + 无符号整数
    diff --git a/docs/Help_ZH-CN/Topics/Interfaces.xml b/docs/Help_ZH-CN/Topics/Interfaces.xml index 2a124bb116..e5703af9db 100644 --- a/docs/Help_ZH-CN/Topics/Interfaces.xml +++ b/docs/Help_ZH-CN/Topics/Interfaces.xml @@ -1,10 +1,10 @@  - - Interfaces + + 接口
    - Interfaces + 接口
    diff --git a/docs/Help_ZH-CN/Topics/Interoperability.xml b/docs/Help_ZH-CN/Topics/Interoperability.xml index ec91b443a1..515ed1b640 100644 --- a/docs/Help_ZH-CN/Topics/Interoperability.xml +++ b/docs/Help_ZH-CN/Topics/Interoperability.xml @@ -1,10 +1,10 @@  - - Interoperability + + Interoperability(本机互操作性)
    - Interoperability + Interoperability(本机互操作性)
    diff --git a/docs/Help_ZH-CN/Topics/Item-Templates.xml b/docs/Help_ZH-CN/Topics/Item-Templates.xml index 29c834e7c1..9cd8fc2498 100644 --- a/docs/Help_ZH-CN/Topics/Item-Templates.xml +++ b/docs/Help_ZH-CN/Topics/Item-Templates.xml @@ -1,488 +1,489 @@  - - Item Templates + + 项目项模板 item templates templates
    - Item Templates + 项目项模板
    - The X# Visual Studio integration comes with the following item templates: + + X# Visual Studio 集成包含以下项目项模板: - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/docs/Help_ZH-CN/Topics/Keyword-Matching.xml b/docs/Help_ZH-CN/Topics/Keyword-Matching.xml index 4f1d5f0584..e64d01a5d7 100644 --- a/docs/Help_ZH-CN/Topics/Keyword-Matching.xml +++ b/docs/Help_ZH-CN/Topics/Keyword-Matching.xml @@ -1,20 +1,21 @@  - - Highlight Keywords + + Highlight Keywords(高亮关键字)
    - Highlight Keywords + Highlight Keywords(高亮关键字)
    - The keyword matching feature will highlight keyword pairs in the editor as you can see in the image below. + + 关键词匹配功能会在编辑器中突出显示关键词对,如下图所示。 - The TRY, CATCH and END TRY keywords are highlighted so you can see that they belong to each other + TRY、CATCH 和 END TRY 关键字会高亮显示,以便查看它们是否相互关联。 - If the cursor is located on a RETURN statement then the matching FUNCTION or METHOD will be highlighted, + 如果光标位于 RETURN 语句上,则与之匹配的 FUNCTION 或 METHOD 将突出显示。 - The color for the highlights can be set in the Tools/Options dialog under the Environment/Fonts and Colors node. The X# specific colors all start with the text "X#" + 高亮部分的颜色可以在环境/字体和颜色节点下的工具/选项对话框中设置。X# 专用颜色均以 "X#"开头。
    diff --git a/docs/Help_ZH-CN/Topics/Keywords.xml b/docs/Help_ZH-CN/Topics/Keywords.xml index 79fa8bea81..a928f36051 100644 --- a/docs/Help_ZH-CN/Topics/Keywords.xml +++ b/docs/Help_ZH-CN/Topics/Keywords.xml @@ -1,7 +1,7 @@  - - Keywords + + 关键字 Entities Keywords @@ -9,24 +9,30 @@
    - Keywords + 关键字
    - The table below has the keywords that are available in the X# language. + + 下表列出了 X# 语言中可用的关键字: + -
  • The Keywords in the VO column find their origin in the Visual Objects language. When the compiler dialect is set to VO then these keywords may be abbreviated (4 letter minimum)
  • -
  • The Keywords in the VN column were introduced in Vulcan.NET. These keywords may never be abbreviated, and most of these keywords are positional, so are only recognized in certain positions in the language. That also means that these keywords may be used as Variable Names or Method names
  • -
  • The Keywords in the X# column were introduced in X#. Just like the VN keywords they may never be abbreviated and they are also positional.
  • -
  • The Keywords in the VFP column are FoxPro specific. Please note that many FoxPro commands are implemented as "User Defined Commands" and their tokens are not strictly Keywords inside X#.
  • -
  • The Keywords in the Xb++ column are Xbase++ specific. Please note that many FoxPro commands are implemented as "User Defined Commands" and their tokens are not strictly Keywords inside X#.
  • -
  • Keywords that are listed in the Id column may also be used as an identifier. These are so called "context sensitive" keywords. You may see in the Visual Studio editor that these keywords will change color depending on the position in the source.
    For example if you start typing PROPERTY the word will be shown in the IDENTIFIER color:
  • +
  • VO 列中的关键字源自 Visual Objects 语言。当编译器方言设置为 VO 时,这些关键字可以缩写(最少 4 个字母)
  • +
  • VN 列中的关键字源自 Vulcan.NET。这些关键字永远不能缩写,而且大多数关键字的位置都是固定的,因此只能在语言中的特定位置被识别。这也意味着这些关键字可以用作变量名或方法名。
  • +
  • X# 列中的关键字是在 X# 中引入的。就像 VN 关键字一样,它们永远不能缩写,而且也有固定的位置。
  • +
  • VFP 列中的关键字是 FoxPro 特有的。请注意,许多 FoxPro 命令是作为 “自定义命令(User Defined Commands) ”来实现的,它们在 X# 中并不是严格意义上的关键字。
  • +
  • Xb++栏中的关键字是 Xbase++ 专用的。请注意,许多 Xbase++ 命令是作为 “自定义命令(User Defined Commands) ”实现的,它们在 X# 中并不是严格意义上的关键字。
  • +
  • 在 Id 列中列出的关键字也可用作标识符。这些是所谓的 “上下文敏感 ”关键字。在 Visual Studio 编辑器中,你可能会看到这些关键字会根据在源代码中的位置而改变颜色。
  • + +    例如,如果您开始键入 PROPERTY,该单词将显示为 IDENTIFIER 颜色: - But as soon as you continue to complete the PROPERTY definition it will get the KEYWORD color: + +    但只要您继续完成属性定义,它就会变成关键字颜色: +
    + - Template + + 模板 - Description + + 描述 - Required Framework
    version
    +
    + 需要的 Framework 版本
    + - Category: Code + + 类别:Code + +
    - + + + Class - An empty class definition + + 空的类定义 + 2.0
    - + + + CodeFile - An empty Code File + + 空的代码文件 + 2.0
    - + + + Header - An empty Header File + + 空的头文件 + n/a
    - + + + TextFile - An empty text file + + 空的文本文件 + n/a
    + - Category: Forms + + 类别: Forms + +
    - + + + Windows Forms Form - A Windows form with separate designer.prg + + 带有独立 designer.prg 的 Windows 表单 + 2.0
    - + + + Windows Forms Simple Form - A simple Windows Forms Form without designer.prg + + 不带 designer.prg 的简单 Windows 窗体表单 + 2.0
    - + + + Windows Forms User Control - Windows Forms User Control + + Windows 窗体用户控件 + 2.0
    + - Category: Internal + + 类别:Internal + +
    + + AppConfigInternal + A hidden app.config + 2.0
    + + AppManifestInternal + A hidden app.manifest + 2.0
    + + AssemblyInfoInternal + A hidden assemblyinfo prg + 2.0
    + + Managed Resource Internal + A hidden resource file + 2.0
    + + Settings Internal + A hidden settings file + 2.0
    + - Category: Resources + + 类别:Resources + +
    - + + + Native Resource File (.rc) - A file in which native resources can be defined + + 可以定义本地资源的文件 + n/a
    - + + + Bitmap - A Bitmap file + + Bitmap 文件 + n/a
    - + + + Cursor - A Cursor file + + Cursor 文件 + n/a
    - + + + Icon - An Icon file + + Icon 文件 + n/a
    - + + + Managed resource file (.resx) - A file to store managed resources + + 用于存储管理资源的文件 + 2.0
    + - Category: VO + + 类别:VO + +
    + + VODBServer + An empty DBServer + n/a
    + + VOFieldSpec + An empty FieldSpec container file + n/a
    + + VOMenu + An empty VO Menu + n/a
    + + VOWindow + An empty VO Window + n/a
    + - Category: WCF + + 类别:WCF + +
    - + + + WCF Service - A WCF Service + + WCF 服务 + 3.0
    + - Category: WPF + + 类别:WPF + +
    - + + + WPF Flow Document - Dynamically formatted XAML document + + 动态格式化的 XAML 文档 + 3.0
    - + + + WPF Page - Windows Presentation Foundation page + + Windows Presentation Foundation 页面 + 3.0
    - + + + WPF Page Function - Windows Presentation Foundation page function + + Windows Presentation Foundation 页面功能 + 3.0
    - + + + WPF Resource Dictionary - XAML Resource Dictionary + + XAML 资源字典 + 3.0
    - + + + WPF UserControl - Windows Presentation Foundation user control + + Windows Presentation Foundation 用户控件 + 3.0
    - + + + WPF Window - Windows Presentation Foundation window + + Windows Presentation Foundation 窗口 + 3.0
    - Keyword + 关键字 VO @@ -6190,7 +6196,7 @@
    - 1These type names can only be used as identifiers when the dialect is not Core, VO or Vulcan. + 1这些类型名称只有在方言不是 Core、VO 或 Vulcan 时才能用作标识符。 2This keyword is actually defined by a preprocessor command
    diff --git a/docs/Help_ZH-CN/Topics/LINQ-Query-Expressions.xml b/docs/Help_ZH-CN/Topics/LINQ-Query-Expressions.xml index 48ae0c610c..325db6acc7 100644 --- a/docs/Help_ZH-CN/Topics/LINQ-Query-Expressions.xml +++ b/docs/Help_ZH-CN/Topics/LINQ-Query-Expressions.xml @@ -1,10 +1,10 @@  - - LINQ Query Expressions + + LINQ 查询表达式
    - LINQ Query Expressions + LINQ 查询表达式
    diff --git a/docs/Help_ZH-CN/Topics/LOGIC.xml b/docs/Help_ZH-CN/Topics/LOGIC.xml index 676868a4cc..beb275aa11 100644 --- a/docs/Help_ZH-CN/Topics/LOGIC.xml +++ b/docs/Help_ZH-CN/Topics/LOGIC.xml @@ -1,6 +1,6 @@  - + LOGIC LOGIC @@ -9,8 +9,9 @@
    LOGIC
    - The LOGIC keyword represents the .Net Boolean type. This type can have either of two values: true, or false. - If you have members of type LOGIC in VOSTRUCT or UNION types then these will not be represented with .Net Boolean types because the size of these Boolean is 1 byte but in the Windows API LOGIC values are represented with 4 bytes. Therefore the compiler will replace these with a special type __WinBool which has 4 bytes and has implicit converters between Logic and __WinBool. + 关键字 LOGIC 表示 .Net 的布尔类型。该类型可以有两个值:true 或 false。 + + 如果在 VOSTRUCT 或 UNION 类型中有 LOGIC 类型的成员,则这些成员不会被表示为 .Net 的布尔类型,因为这些布尔类型占用 1 字节,但在 Windows API 中,LOGIC 值用 4 字节表示。因此,编译器将这些替换为特殊类型 __WinBool,它占用 4 字节,并且在 Logic 和 __WinBool 之间有隐式转换器。
    diff --git a/docs/Help_ZH-CN/Topics/Literals.xml b/docs/Help_ZH-CN/Topics/Literals.xml index 2c93e43b96..08336ab3f9 100644 --- a/docs/Help_ZH-CN/Topics/Literals.xml +++ b/docs/Help_ZH-CN/Topics/Literals.xml @@ -1,39 +1,40 @@  - - Literals + + 字面量
    - Literals + 字面量
    - The X# language knows the following literal types + + X# 语言可使用以下字面类型: @@ -47,28 +48,28 @@ diff --git a/docs/Help_ZH-CN/Topics/Logic-Ttype.xml b/docs/Help_ZH-CN/Topics/Logic-Ttype.xml index bee62fd32a..37221958a5 100644 --- a/docs/Help_ZH-CN/Topics/Logic-Ttype.xml +++ b/docs/Help_ZH-CN/Topics/Logic-Ttype.xml @@ -1,17 +1,19 @@  - - Logic Ttype + + Logic 类型 LOGIC XSharp.__WinBool
    - Logic Ttype + Logic 类型
    - For normal use the logic type is mapped to System.Boolean. - Inside VOSTRUCT and UNION the XSharp.__WinBool is used because this is a 4 byte value just like the Win32 api expects. + + 正常使用时,Logic 类型会映射为 System.Boolean。 + + 在 VOSTRUCT 和 UNION 中使用 XSharp.__WinBool,因为这是一个 4 字节的值,就像 Win32 api 所期望的那样。 diff --git a/docs/Help_ZH-CN/Topics/LogicLiterals.xml b/docs/Help_ZH-CN/Topics/LogicLiterals.xml index 5cdf44c093..bb8510f263 100644 --- a/docs/Help_ZH-CN/Topics/LogicLiterals.xml +++ b/docs/Help_ZH-CN/Topics/LogicLiterals.xml @@ -1,7 +1,7 @@  - - Logic Literals + + Logic 字面量 .F. .N. @@ -15,33 +15,34 @@
    - Logic Literals + Logic 字面量
    - X# uses the following Logical literals. + + X# 使用下面的 Logical 字面量。
    - Keyword + 关键字 - Description + 描述
    - Char Literals + Char 字面量
    - Date Literals + Date 字面量
    - Logic Literals + Logic 字面量
    - NULL Literals + NULL 字面量
    - Numeric Literals + Numeric 字面量
    - String Literals + String 字面量
    - Symbol Literals + Symbol 字面量
    - Value + - Description + 描述
    - TRUE or .T. or .Y. + TRUE 或 .T. 或 .Y. - Logical TRUE + 逻辑 TRUE
    - FALSE or .F. or .N. + FALSE 或 .F. 或 .N. - Logical FALSE + 逻辑 FALSE
    diff --git a/docs/Help_ZH-CN/Topics/Managed-Resources.xml b/docs/Help_ZH-CN/Topics/Managed-Resources.xml index 4f5b11b701..cc325268f6 100644 --- a/docs/Help_ZH-CN/Topics/Managed-Resources.xml +++ b/docs/Help_ZH-CN/Topics/Managed-Resources.xml @@ -1,9 +1,11 @@  - + Managed Resources -
    Managed Resources
    - Enter topic text here. +
    + Managed Resources +
    + -
    \ No newline at end of file +
    diff --git a/docs/Help_ZH-CN/Topics/Memory-Variables.xml b/docs/Help_ZH-CN/Topics/Memory-Variables.xml index ce76ca3d11..7ed63db9cb 100644 --- a/docs/Help_ZH-CN/Topics/Memory-Variables.xml +++ b/docs/Help_ZH-CN/Topics/Memory-Variables.xml @@ -1,24 +1,26 @@  - - Memory Variables + + 内存变量
    - Memory Variables + 内存变量
    - X# provides support for dynamically scoped variables that are created and maintained completely at runtime.
    The term dynamically scoped refers to the fact that the scope of these variables is not limited by the entity in which the variable is created.
    -
    Warning! Dynamically scoped variables are NOT supported in the Core and Vulcan dialects. In other dialects they are supported only if the -memvar compiler option is enabled.
    + + X# 提供了对动态作用域变量的支持,这些变量在运行时被完全创建和维护。
    所谓动态作用域,是指这些变量的作用域不受创建变量的实体的限制。
    + + 警告! Core 和 Vulcan 方言不支持动态作用域变量。在其他方言中,只有启用了 -memvar 编译器选项,才支持动态范围变量。 @@ -26,10 +28,10 @@ PRIVATE @@ -37,86 +39,98 @@ PUBLIC
    - Variable Type + 变量类型 - Lifetime + 生存期 - Visibility + 可见性
    - Until creator returns or until released + 直到创建过程的 Return 语句或者至释放前 - Creator and called routines + 所创建的过程和被调用的例程
    - Application or until released + 应用程序或至释放前 - Application + 应用程序
    - The data type of a dynamically scoped variable changes according to the contents of the variable. For this reason they are often described as dynamic or polymorphic. - Dynamically scoped variables are provided mainly for Clipper/Xbase compatibility; however, they are very useful in certain circumstances. For instance, they let you develop rapid prototypes and have certain inheritance properties that you may find hard to resist. - You must be aware, however, that using them comes at a cost. Consider these points: + + 动态作用域变量的数据类型会随着变量内容的变化而变化。因此,它们通常被称为动态或多态变量。 + 提供动态作用域变量主要是为了与 Clipper/Xbase 兼容;不过,它们在某些情况下也非常有用。例如,它们可以让你快速开发原型,并具有某些你可能难以抗拒的继承属性。 + 不过,您必须意识到,使用它们是有代价的。请考虑以下几点: + -
  • Because they are not resolved at compile time, these variables require overhead in the form of runtime code, making your application larger and slower than necessary.
  • -
  • No compile time checking for type compatibility is possible with these variables.
  • -
  • Using the inheritance properties of these variables defies one of the basic tenets of modular programming and may lead to maintenance and debugging problems down the line. Furthermore, this practice will make the transition to lexically scoped and typed variables more difficult.
  • +
  • 由于这些变量不是在编译时解决的,因此需要以运行时代码的形式开销,从而使你的应用程序变得比所需的更大更慢。
  • +
  • 编译时无法检查这些变量的类型兼容性。
  • +
  • 使用这些变量的继承属性违背了模块化编程的基本原则之一,可能会导致维护和调试问题。此外,这种做法还会增加向词法作用域和类型变量过渡的难度。
  • - This section explores dynamically scoped variables fully, but X# has several options for variable declarations that you will want to explore before choosing to use this variable class. The next two sections in this chapter introduce you to Lexically Scoped Variables and Strongly Typed Variables, which you may find useful. - Important! For the sake of illustration, some of the examples in this section use unorthodox programming practices. Using the inheritance properties of public and private variables instead of passing arguments and returning values is not recommended. + + 本节将全面探讨动态作用域变量,但在选择使用该变量类之前,X# 还提供了几种变量声明选项。本章接下来的两节将向你介绍词法作用域变量和强类型变量,你可能会发现它们很有用。 + 重要提示 为了便于说明,本节中的一些示例使用了非正统的编程方法。不建议使用公共变量和私有变量的继承属性,而不是传递参数和返回值。 + Private - Private is one of the two types of dynamically scoped variables, and there are several ways to create a private variable: + Private 是动态作用域变量的两种类型之一,有几种创建私有变量的方法: + -
  • List the variable name as part of a PRIVATE statement. If you do not make an assignment at this time, the variable takes on the NIL value and data type; otherwise, it takes on the data type of its assigned value. You can assign a new value (with a new datatype) to a variable at any time:
    PRIVATE X := 10, y
    This creates x as a numeric variable and y as an untyped variable with the value NIL. You can later change the values and their types by assigning other values to them:
     X := "X# Is great"
      Y := Today()
  • +
  • 在 PRIVATE 语句中列出变量名。如果此时不进行赋值,变量将使用 NIL 值和数据类型;否则,变量将使用其赋值的数据类型。您可以随时为变量分配新值(新数据类型):
    PRIVATE X := 10, y
    这样就将 x 创建为一个数值变量,将 y 创建为一个值为 NIL 的无类型变量。稍后,您可以通过为变量赋值来更改值及其类型:
     X := "X# Is great"
      Y := Today()
  • -
  • List the variable name as part of a PARAMETERS statement within a FUNCTION, PROCEDURE or METHOD definition. The variable takes on the data type of its associated argument when the routine is called, or NIL if the argument is omitted. You can assign a new value (and a new data type) to the variable at any time.
  • +
  • 在函数、过程或方法定义的参数语句中列出变量名。当例程被调用时,变量的数据类型与相关参数相同,如果省略参数,则变量的数据类型为 NIL。您可以随时为变量分配新值(和新数据类型)。
  • +
  • 为一个不存在的变量名赋值(例如,x := 10)。在为变量赋值之前,变量的数据类型与所赋值相同(只有在使用了 -undeclared 和 -memvar 命令行选项后,这个方法才有效)。
  • + + 私有变量具有以下属性: + -
  • Assign a value to a non-existent variable name (for example, x := 10). The variable takes on the data type of its assigned value until you assign a new value to it. (x is numeric, but the assignment x := "Ms. Jones" changes it to a string.) This will only work if you have used the -undeclared  as well as the -memvar commandline options.
  • +
  • 你可以在创建例程和创建者调用的任何例程中访问它们。换句话说,被调用的例程会自动继承私有变量,而无需将它们作为参数传递。
  • +
  • 你可以通过在被调用的例程中明确地创建一个私有变量(使用 PRIVATE 或 PARAMETERS)或声明一个同名的局部变量(使用 LOCAL)来隐藏它们。
  • +
  • 当创建者返回到它的调用例程时,它们会自动从内存中释放,或者你也可以使用 RELEASE、CLEAR ALL 或 CLEAR MEMORY 来显式地释放它们。
  • - Private variables have these properties: - -
  • You can access them within the creating routine and any routines called by the creator. In other words, private variables are automatically inherited by called routines without having to pass them as arguments.
  • -
  • You can hide them from a called routine by explicitly creating a private (using PRIVATE or PARAMETERS) or declaring a local (using LOCAL) variable with the same name in the called routine.
  • -
  • They are automatically released from memory when the creator returns to its calling routine, or you can release them explicitly using RELEASE, CLEAR ALL, or CLEAR MEMORY.
  • -
    - In this example, the function Volume() expects three arguments, or parameters, to be passed. When the function is called, it creates three private variables, nLength, nWidth, and nHeight to accept the arguments. Because they are created with the PARAMETERS statement, any higher-level variables (either public or private) created with these names are temporarily hidden, preventing their values from being overwritten in memory: + + 在本例中,函数 Volume() 需要传递三个参数。调用函数时,它会创建三个私有变量 nLength、nWidth 和 nHeight 来接受参数。由于这些变量是使用 PARAMETERS 语句创建的,因此使用这些名称创建的任何高级变量(无论是公有变量还是私有变量)都会被暂时隐藏,以防止它们的值在内存中被覆盖: FUNCTION Volume()
    PARAMETERS nLength, nWidth, nHeight
    RETURN nLength * nWidth * nHeight
    - In the next example, a modified version of Volume() creates a private variable (assuming no other variable name nVolume is visible) to store its return value. If the variable nVolume exists prior to calling Volume() and is visible to Volume() (for example, nVolume may be public or private to the routine that called Volume()), its value is overwritten in memory and will remain changed when the function returns to its calling routine: + 在下一个示例中,Volume() 的修改版创建了一个私有变量(假设没有其他名为 nVolume 的变量可见)来存储其返回值。如果变量 nVolume 在调用 Volume() 之前就已存在,并且对 Volume() 可见(例如,对于调用 Volume() 的例程来说,nVolume 可能是公共变量或私有变量),那么它的值将在内存中被覆盖,并在函数返回调用例程时保持不变: FUNCTION Volume()
    PARAMETERS nLength, nWidth, nHeight
    nVolume := nLength * nWidth * nHeight
    RETURN nVolume
    - In this version, Volume() specifies the nVolume variable as PRIVATE. Doing this temporarily hides any higher-level variable (either public or private) with the same name, preventing its value from being overwritten in memory: + 在此版本中,Volume( ) 将 nVolume 变量指定为 PRIVATE。这样做可以暂时隐藏任何同名的上层变量(无论是公共变量还是私有变量),防止其值在内存中被覆盖: FUNCTION Volume()
    PARAMETERS nLength, nWidth, nHeight
    PRIVATE nVolume := nLength * nWidth * nHeight
    RETURN nVolume
    Public - The second category of undeclared variable is public. Public variables have application-wide lifetime and visibility, and you can define them in only one way: - -
  • List the variable name as part of a PUBLIC statement. If you do not make an assignment at this time, the variable takes on a value of FALSE (or NIL for array elements); otherwise, it takes on the data type of its assigned value. You can assign a new value (and a new data type) to the variable at any time.
  • + 第二类未声明变量是 Public。公有变量在整个应用程序中都有生命周期和可见性,你只能用一种方式定义它们: + + +
  • 在 PUBLIC 语句中列出变量名。如果此时不赋值,变量的值将是 FALSE(或数组元素的 NIL);否则,变量的数据类型将是其赋值的数据类型。您可以随时为变量赋新值(和新的数据类型)。
  • - Public variables have these properties: - -
  • Once they are created, you can access them anywhere in the application. In other words, public variables are automatically inherited by all routines in the application without having to pass them as arguments or post them as return values.
  • -
  • You can hide them from a routine by explicitly creating a private (using PRIVATE or PARAMETERS) or declaring a local (using LOCAL) variable with the same name.
  • -
  • They are not released from memory until you explicitly release them using RELEASE, CLEAR ALL, or CLEAR MEMORY.
  • + + 公有变量具有以下属性: + + +
  • 一旦创建,你就可以在应用程序的任何地方访问它们。换句话说,公有变量会被应用程序中的所有例程自动继承,而无需将它们作为参数传递或作为返回值发布。
  • +
  • 你可以通过明确地创建一个私有变量(使用 PRIVATE 或 PARAMETERS)或声明一个同名的局部变量(使用 LOCAL)来隐藏公有变量。
  • +
  • 除非使用 RELEASE、CLEAR ALL 或 CLEAR MEMORY 明确地释放它们,否则它们不会从内存中释放。
  • - In this example, the function Volume() is defined without arguments. Instead, the calling routine, Compute(), creates three public variables, nLength, nWidth, and nHeight that are automatically visible to Volume(): + + 在本例中,函数 Volume() 的定义不带参数。相反,调用例程 Compute() 创建了三个公有变量 nLength、nWidth 和 nHeight,它们对 Volume() 自动可见: PROCEDURE Compute()
    PUBLIC nLength := 5, nWidth := 2, nHeight := 4
    ? Volume() // Result: 40

    FUNCTION Volume()
    RETURN nLength * nWidth * nHeight
    - In the next example, a modified version of Volume() creates a public variable to store the computed volume, getting around having to return a value to the calling routine. Since nVolume is public, it is not released from memory when Volume() returns: + 在下一个示例中,Volume() 的修改版创建了一个公有变量来存储计算出的体积,从而避免了向调用例程返回数值的麻烦。由于 nVolume 是公有变量,当 Volume() 返回时,它不会从内存中释放: PROCEDURE Compute()
    PUBLIC nLength := 5, nWidth := 2, nHeight := 4
    Volume()
    ? nVolume // Result: 40 , this will only compile with -undeclared
    RETURN

    PROCEDURE Volume()
    PUBLIC nVolume
    nVolume := nLength * nWidth * nHeight
    RETURN
    - A better solution for the use of the nVolume variable from last example that will not require the -undeclared commandline option is: + 使用上一个示例中的 nVolume 变量,不需要使用 -undeclared 命令行选项,一个更好的解决方案是 PROCEDURE Compute()
    PUBLIC nLength := 5, nWidth := 2, nHeight := 4
    MEMVAR nVolume   // tell the compiler that nVolume is a Public or private
    Volume()
    ? nVolume // Result: 40
    RETURN
    - or + PROCEDURE Compute()
    PUBLIC nLength := 5, nWidth := 2, nHeight := 4
    Volume()
    ? _MEMVAR->nVolume // Result: 40
    RETURN
    - Please note that this kind of programming is NOT recommended. - Variable References - Once a public or private variable is created as demonstrated in the previous two sections, you obtain its value by referring to its name. You might display the value of a variable using a built-in command or function: + 请注意,不建议使用此类程序。 + 变量引用 + 一旦按照前两节的演示创建了公有或私有变量,就可以通过引用变量名来获取其值。您可以使用内置命令或函数显示变量的值: ? nVolume
    QOut(nVolume)
    - or use its value as part of an expression: + 或使用其值作为表达式的一部分: Str(nVolume, 10, 2) + " cubic feet" - For dynamically scoped variables, you can use the _MEMVAR alias to qualify a variable reference. In some cases, you may have to do this in order to help the compiler resolve what might otherwise be an ambiguous reference (for example, if you have a field variable with the same name as a memory variable and want to use the memory variable in an expression). - Note: MEMVAR is an abbreviation for memory variable, a term that is synonymous with dynamically scoped variable.
    Assuming that the database file Measures has fields named nLength, nWidth, and
    - nHeight, this example calls Volume() using the field variable values: + 对于动态作用域变量,可以使用 _MEMVAR 别名来限定变量引用。在某些情况下,你可能必须这样做,以帮助编译器解决可能会产生歧义的引用(例如,如果你有一个与内存变量同名的字段变量,并希望在表达式中使用内存变量)。 + + 注意:MEMVAR 是内存变量的缩写,与动态作用域变量同义。 +
    假设数据库文件 Measures 有名为 nLength、nWidth 和 nHeight 字段,本示例将使用字段变量值调用 Volume():
    FUNCTION Calculate()
    PRIVATE nLength := 5, nWidth := 2, nHeight := 3
    USE measures
    ? Volume(nLength, nWidth, nHeight)
    ...
    - To force the function to use the private variables instead of the field variables, - you could use the _MEMVAR-> (or, more simply, M->) alias to qualify the - variable names: + 要强制函数使用私有变量而不是字段变量,可以使用 _MEMVAR->(或更简单的 M->)别名来限定 变量名: FUNCTION Calculate()
    PRIVATE nLength := 5, nWidth := 2, nHeight := 3
    USE measures
    ? Volume(_MEMVAR->nLength, _MEMVAR->nWidth, _MEMVAR->nHeight)
    ...
    - Of course, it is better to avoid ambiguous situations like the one described above by taking care to have unique field and variable names, but the point is that the compiler has certain default rules for handling ambiguous references. If you do not want to be at the mercy of those defaults, it is best to qualify variable names in all cases. - MEMVAR Declarations - Although you may hear them referred to as such, the statements mentioned so far in the discussion of dynamically scoped variables are not declarations. The term declaration refers to a statement whose purpose is to inform the compiler of something—PRIVATE, PARAMETERS, and PUBLIC are statements that generate memory variables at runtime. - In fact you never have to declare a dynamically scoped variable to the compiler, which is the reason for their inefficiency. Because they are not created using compile-time declaration statements, the compiler has to generate runtime code for handling such issues as type translation, memory management, and resolving ambiguous references to variable names since it is possible for several variables with the same name to be visible at one time. - You can, however, declare dynamically scoped variables with the MEMVAR statement and they will be created as PRIVATE variables: + 当然,最好还是注意使用唯一的字段名和变量名,以避免出现类似上述的含糊不清的情况,但问题是编译器在处理含糊不清的引用时有一定的默认规则。如果不想受这些默认规则的摆布,最好在任何情况下都限定变量名。 + MEMVAR 声明 + 虽然你可能会听到这样的说法,但在讨论动态作用域变量时提到的这些语句并不是声明。声明一词指的是旨在告知编译器某些内容的语句PRIVATE、PARAMETERS 和 PUBLIC 是在运行时生成内存变量的语句。 + + 事实上,你从来不需要向编译器声明动态作用域变量,这就是它们效率低下的原因。因为它们不是通过编译时声明语句创建的,所以编译器必须生成运行时代码来处理类型转换、内存管理和解决变量名的模糊引用等问题,因为同一时间有可能出现多个同名变量。 + + 不过,你可以使用 MEMVAR 语句声明动态作用域变量,它们将被创建为 PRIVATE 变量: FUNCTION Calculate()
    MEMVAR nLength, nWidth, nHeight
    nLength := 5
    nWidth := 2
    nHeight := 3
    USE measures
    ? Volume(nLength, nWidth, nHeight)
    - In this case, the MEMVAR statement causes memory variables to take precedence over field variables with the same names, causing Volume() to be called with the private variables. - Using MEMVAR to declare dynamically scoped variable names to the compiler may make your programs slightly more efficient (especially if you have lots of ambiguous references); however, it will not eliminate the runtime overhead of these variables. + 在这种情况下,MEMVAR 语句会使内存变量优先于同名的字段变量,从而导致 Volume() 被调用为私有变量。 + + 使用 MEMVAR 向编译器声明动态作用域变量名,可能会使程序效率略有提高(尤其是在有大量模糊引用的情况下);但这并不能消除这些变量的运行时开销。
    diff --git a/docs/Help_ZH-CN/Topics/Modifiers.xml b/docs/Help_ZH-CN/Topics/Modifiers.xml index 8b0e87328f..2b59389637 100644 --- a/docs/Help_ZH-CN/Topics/Modifiers.xml +++ b/docs/Help_ZH-CN/Topics/Modifiers.xml @@ -1,7 +1,7 @@  - - Modifiers + + 修饰符 ABSTRACT DEFERRED @@ -27,15 +27,17 @@
    - Modifiers + 修饰符
    - Modifiers are language keywords that are used to modify the visibility of a program element (function, global, class, property etc), or the way they operate within a type hierarchy. - There are several groups of modifiers that will be discussed in these subtopics. + + 修饰符是一种语言关键字,用于修改程序元素(函数、全局、类、属性等)的可见性或在类型层次结构中的运行方式。 + + 这些子课题将讨论几组修饰符。
    - Visibility Modifiers + 可见性修饰符 PUBLIC, EXPORT, PROTECT, PROTECTED, PRIVATE, HIDDEN, INTERNAL @@ -43,7 +45,7 @@
    - Class Hierarchy Modifiers + 类层次结构修饰符 VIRTUAL, OVERRIDE, ABSTRACT, SEALED @@ -51,7 +53,7 @@
    - STATIC modifier + 静态修饰符 STATIC @@ -67,7 +69,7 @@
    - Other Modifiers + 其他修饰符 PARTIAL, EXTERN, UNSAFE diff --git a/docs/Help_ZH-CN/Topics/Modifiers_ClassHierarchy.xml b/docs/Help_ZH-CN/Topics/Modifiers_ClassHierarchy.xml index 9dc64fd17f..d5aaa2904c 100644 --- a/docs/Help_ZH-CN/Topics/Modifiers_ClassHierarchy.xml +++ b/docs/Help_ZH-CN/Topics/Modifiers_ClassHierarchy.xml @@ -1,7 +1,7 @@  - - Class hierarchy modifiers + + 类层次结构修饰符 /cs /vo3 @@ -18,32 +18,33 @@
    - Class hierarchy modifiers + 类层次结构修饰符
    - Hierarchy modifiers control the way elements of a class behave within their class hierarchy. + + 层次结构修饰符控制类元素在其类层次结构中的行为方式。 VIRTUAL/OVERRIDE/NEW - By default, all methods in .Net are non-VIRTUAL, meaning they cannot be overridden by same named methods (and signature - parameter and return types) in descendant classes. In the following example, calling a method from code inside the Parent class, results to calling he version of the method defined in this particular class in the class hierarchy, not the method with the same name and signature defined in the Child class (even though the object we are testing with is an instance of the Child class): - FUNCTION Start() AS VOID
      LOCAL oTest AS Child
      oTest := Child{}
      oTest:DoTest()

    CLASS Parent
      METHOD SomeMethod() AS VOID
         ? "Parent method was called"
      METHOD DoTest() AS VOID
         SELF:SomeMethod() // calls the method of this Parent class, not the same named one defined in the Child class
      RETURN
    END CLASS

    CLASS Child INHERIT Parent
      METHOD SomeMethod() AS VOID
         ? "Child method was called"
    END CLASS
    - This behavior is different to that of Visual Objects, FoxPro and Xbase++, where ALL methods are always considered VIRTUAL. In order to make a method overridable from descendant classes, it needs to be defined as VIRTUAL. In the following code, calling a VIRTUAL method from code in the Parent class, results to calling the version of the method defined in the Child class, since it has overridden the parent method: - CLASS Parent
      METHOD NonVirtualMethod() AS VOID // cannot be overriden in child class
         ? "Parent non virtual method was called"
      VIRTUAL METHOD VirtualMethod() AS VOID // can be overriden
         ? "Parent virtual method was called"
      METHOD DoTest() AS VOID
         SELF:NonVirtualMethod() // calls method in parent
         SELF:VirtualMethod() // calls method in child
      RETURN
    END CLASS

    CLASS Child INHERIT Parent
      METHOD NonVirtualMethod() AS VOID // this is completely different method to the parent one, even though it has the same name
         ? "Child non virtual method was called"
      OVERRIDE METHOD VirtualMethod() AS VOID // overrides the same named method of the parent class
         ? "Child virtual method was called"
    END CLASS
    - Note that VirtualMethod() in the child class is declared with the OVERRIDE modifier, this tells the compiler that we have on purpose overridden a parent method with the same name. The OVERRIDE modifier is not mandatory in X# and can be omitted, but using it makes the code more self-explanatory and allows the compiler to make additional compile time checks. If OVERRIDE is used on a method to override a parent method that is not VIRTUAL, or it does not even exist (or is spelled with a different name or has a different signature in the parent class), then a compiler error will be reported. For this reason, it is recommended  to explicitly declare methods overriding parent methods with the OVERRIDE keyword. It is also possible to enforce the use of the OVERRIDE keyword in the compiler, by enabling the compiler option "Enforce OVERRIDE" (/enforceoverride). + 默认情况下,.Net 中的所有方法都是非虚的,这意味着它们不能被子类中相同名称的方法(以及签名--参数和返回类型)所覆盖。在下面的示例中,从父类内部的代码中调用方法,结果是调用类层次结构中该特定类定义的方法的版本,而不是子类中定义的具有相同名称和签名的方法(即使我们正在测试的对象是子类的实例): + FUNCTION Start() AS VOID
      LOCAL oTest AS Child
      oTest := Child{}
      oTest:DoTest()

    CLASS Parent
      METHOD SomeMethod() AS VOID
         ? "父类方法被调用"
      METHOD DoTest() AS VOID
         SELF:SomeMethod() // 调用父类的方法,而不是子类中定义的同名方法
      RETURN
    END CLASS

    CLASS Child INHERIT Parent
      METHOD SomeMethod() AS VOID
         ? "子类方法被调用"
    END CLASS
    + 这种行为与 Visual Objects、FoxPro 和 Xbase++ 的行为不同,在 Visual Objects、FoxPro 和 Xbase++ 中,所有方法都被认为是虚的。为了使一个方法可以从子类中覆盖,需要将其定义为 VIRTUAL。在下面的代码中,从父类的代码中调用 VIRTUAL 方法,结果是调用子类中定义的方法版本,因为子类已经重载了父类的方法: + CLASS Parent
      METHOD NonVirtualMethod() AS VOID // 不能在子类中被覆盖
         ? "调用了父级非虚方法"
      VIRTUAL METHOD VirtualMethod() AS VOID // 能够覆盖
         ? "父类虚方法被调用"
      METHOD DoTest() AS VOID
         SELF:NonVirtualMethod() // 调用父类中的方法
         SELF:VirtualMethod() // 调用子类中的方法
      RETURN
    END CLASS

    CLASS Child INHERIT Parent
      METHOD NonVirtualMethod() AS VOID // 虽然名称相同,但它与父方法完全不同
         ? "子类非虚方法被调用"
      OVERRIDE METHOD VirtualMethod() AS VOID // 会重载父类中的相同命名方法
         ? "子类虚方法被调用"
    END CLASS
    + 请注意,子类中的 VirtualMethod() 在声明时使用了 OVERRIDE 修饰符,这就告诉编译器,我们有意重载了同名的父类方法。在 X# 中,OVERRIDE 修饰符并不是强制性的,也可以省略,但使用它可以使代码更具自明性,并允许编译器进行额外的编译时检查。如果在一个方法上使用 OVERRIDE 来覆盖一个非 VIRTUAL 的父类方法,或者该方法根本不存在(或在父类中拼写了不同的名称或具有不同的签名),那么编译器将报错。因此,建议使用 OVERRIDE 关键字明确声明覆盖父类方法的方法。还可以通过启用编译器选项 “Enforce OVERRIDE”(强制覆盖)(/enforceoverride),在编译器中强制使用 OVERRIDE 关键字。 - In the above code, the compiler does report a warning on the NonVirtualMethod() defined in the child class: "warning XS0108: 'Child.NonVirtualMethod()' hides inherited member 'Parent.NonVirtualMethod()', use the new keyword if hiding was intended". This warns about the definition of a method in the child class that has the same name with a non-virtual method in the parent class, as this could had been done by accident (either accidentally using the same name, or forgetting to define the base method as virtual). In order to tell the compiler that the use of the same name in a child method was intentional (and prevent the warning), the NEW modifier keyword can be used, which explicitly marks the method as one that does override the base one: - CLASS Child INHERIT Parent
      NEW METHOD NonVirtualMethod() AS VOID // explicitly mark the method as new one, different to the parent method
         ? "Child non virtual method was called"
      OVERRIDE METHOD VirtualMethod() AS VOID // overrides the same named method of the parent class
         ? "Child virtual method was called"
    END CLASS
    - For already existing code ported from older systems like Visual Objects where methods are always VIRTUAL, it can be tiresome to manually add the VIRTUAL modifier keyword in all methods that need it. For this reason, it is possible for convenience to instruct the compiler to automatically treat ALL methods as virtual, with the use of the "All instance methods virtual" (/vo3) compiler option. But is highly recommended to instead review the code and manually add the VIRTUAL modifier only where it is really needed. + 在上述代码中,编译器确实对子类中定义的 NonVirtualMethod() 报告了警告: "警告 XS0108:‘Child.NonVirtualMethod()’ 隐藏了继承成员‘Parent.NonVirtualMethod()’,如果打算隐藏,请使用 new 关键字。这是对子类中与父类中的非虚方法同名的方法定义发出的警告,因为这可能是意外造成的(要么是意外使用了相同的名称,要么是忘记将基本方法定义为虚方法)。为了告诉编译器,在子类方法中使用同名方法是有意为之(并防止出现警告),可以使用 NEW 修饰关键字,明确标记该方法确实覆盖了基类方法: + CLASS Child INHERIT Parent
      NEW METHOD NonVirtualMethod() AS VOID // 明确标记该方法为新方法,与父方法不同
         ? "子类非虚方法被调用"
      OVERRIDE METHOD VirtualMethod() AS VOID // 会重载父类中的相同命名方法
         ? "子类虚方法被调用"
    END CLASS
    + 对于从 Visual Objects 等旧系统移植过来的现有代码(这些系统中的方法总是虚的),在所有需要的方法中手动添加 VIRTUAL 修饰关键字可能会很累。因此,为了方便起见,可以使用 "所有实例方法都是虚方法" (/vo3)编译器选项,指示编译器自动将所有方法都视为虚拟方法。但我们强烈建议您在审查代码时,只在真正需要的地方手动添加 VIRTUAL 修饰符。 - Note that a method in a child class can override a parent class method, only if it has the exact same signature with it, meaning it has the exact same name (even the exact same casing of the name, if the Case sensitive type names (/cs) compiler option is enabled), parameter count and types and return type with the base method. If the two methods are different on any of those aspects, then they are considered as completely different methods and one cannot override the other: - CLASS Parent
      VIRTUAL METHOD VirtualMethod(n AS INT) AS VOID // child class has same named method but with different signature
    END CLASS

    CLASS Child INHERIT Parent
      OVERRIDE METHOD VirtualMethod(c AS STRING) AS INT // compiler error XS0115: 'VirtualMethod': no suitable method found to override
      RETURN 0
    END CLASS


    The VIRTUAL/OVERRIDE/NEW modifiers do not apply to methods only, but also to properties or ACCESS/ASSIGN pairs (and also to events, but it makes little sense in declaring/overriding virtual events):

    FUNCTION Start() AS VOID
      Child{}:DoTest()

    CLASS Parent
      VIRTUAL PROPERTY TestProp AS STRING GET "parent"
      ACCESS TestAccess AS STRING
      RETURN "parent"

      METHOD DoTest() AS VOID
         ? SELF:TestProp // child, because the property is overridden in the child class
         ? SELF:TestAccess // parent, because the access is not virtual
      RETURN
    END CLASS

    CLASS Child INHERIT Parent
      OVERRIDE PROPERTY TestProp AS STRING GET "child"
      NEW ACCESS TestAccess AS STRING
      RETURN "child"
    END CLASS
    - Finally, also class fields can be declared as NEW (but not as VIRTUAL), in order to differentiate them from fields with the same name in a parent class: - FUNCTION Start() AS VOID
      Child{}

    CLASS Parent
      EXPORT cField := "parent" AS STRING
      CONSTRUCTOR()
         ? SELF:cField // parent, refers to the filed defined in the parent class
    END CLASS

    CLASS Child INHERIT Parent
      NEW EXPORT cField := "child" AS STRING
      CONSTRUCTOR()
         SUPER()
         ? SELF:cField // child, refers to the filed defined in the parent class
    END CLASS
    - Please note that the XBase++ dialect also has the modifiers: + 请注意,子类中的方法只有在与父类方法的签名完全相同的情况下才能覆盖父类方法,这意味着子类方法的名称(甚至名称的大小写也完全相同,如果启用大小写敏感(/cs)编译器选项)、参数数量和类型以及返回类型都与基类方法完全相同。如果这两个方法在这些方面有任何不同,那么它们将被视为完全不同的方法,其中一个不能覆盖另一个: + CLASS Parent
      VIRTUAL METHOD VirtualMethod(n AS INT) AS VOID // 子类的方法名称相同,但签名不同
    END CLASS

    CLASS Child INHERIT Parent
      OVERRIDE METHOD VirtualMethod(c AS STRING) AS INT // 编译器错误 XS0115:“VirtualMethod”:未找到可覆盖的合适方法
      RETURN 0
    END CLASS


    VIRTUAL/OVERRIDE/NEW 修饰符不仅适用于方法,也适用于属性或 ACCESS/ASSIGN 对(也适用于事件,但在声明/覆盖虚事件时意义不大):

    FUNCTION Start() AS VOID
      Child{}:DoTest()

    CLASS Parent
      VIRTUAL PROPERTY TestProp AS STRING GET "parent"
      ACCESS TestAccess AS STRING
      RETURN "parent"

      METHOD DoTest() AS VOID
         ? SELF:TestProp // 子类中重载了该属性。
         ? SELF:TestAccess // 父级,因为访问不是虚的
      RETURN
    END CLASS

    CLASS Child INHERIT Parent
      OVERRIDE PROPERTY TestProp AS STRING GET "child"
      NEW ACCESS TestAccess AS STRING
      RETURN "child"
    END CLASS
    + 最后,类字段也可以声明为新字段(但不是虚字段),以便与父类中的同名字段区分开来: + FUNCTION Start() AS VOID
      Child{}

    CLASS Parent
      EXPORT cField := "parent" AS STRING
      CONSTRUCTOR()
         ? SELF:cField // 指的是父类中定义的字段
    END CLASS

    CLASS Child INHERIT Parent
      NEW EXPORT cField := "child" AS STRING
      CONSTRUCTOR()
         SUPER()
         ? SELF:cField // 子类,指的是父类中定义的字段
    END CLASS
    + 请注意,XBase++ 方言也有修饰符: @@ -51,7 +52,7 @@ INTRODUCE @@ -59,21 +60,21 @@ SYNC
    DEFERRED - Synonym for ABSTRACT + ABSTRACT 的同义词
    - Synonym for NEW + NEW 的同义词
    - Code inside the method is protected from running simultaneously in different threads + 方法内的代码受到保护,不会在不同线程中同时运行
    ABSTRACT/SEALED - Using the SEALED modifier on a class, prevents it from being inherited from a child class. - This can be useful in order to prevent users of a class/library to alter its functionality in a subclass and possibly introduce problems in it. - It also allows the compiler to emit more efficient code, because it knows that there will be no subclasses of a type. - SEALED CLASS Parent
    END CLASS

    CLASS Child INHERIT Parent // compiler error XS0509: cannot derive from sealed type 'Parent'
    END CLASS
    - SEALED can be used also on specific (virtual) methods/properties to prevent overriding only them in a subclass: - FUNCTION Start() AS VOID
      Child{}:DoTest()

    CLASS Base
      VIRTUAL METHOD VirtualMethod() AS VOID
         ? "base"
      METHOD DoTest() AS VOID
         SELF:VirtualMethod() // parent, becase method is overriden in the parent class, but cannot be overriden in the subclass of parent
    END CLASS

    CLASS Parent INHERIT Base
      SEALED OVERRIDE METHOD VirtualMethod() AS VOID
         ? "parent"
    END CLASS

    CLASS Child INHERIT Parent // compiler error
    //   OVERRIDE METHOD VirtualMethod() AS VOID // compiler error XS0239: cannot override method because it is sealed
      NEW METHOD VirtualMethod() AS VOID // can only define a NEW method with the same name and signature, which does not override the parent method
         ? "child"
    END CLASS
    - The ABSTRACT modifier can be use on a class in order to prevent it from being accidentally directly instantiated. Only classes inheriting (and implementing additional functionality) from an abstract class can be instantiated. This is useful for classes that implement base functionality, but does not make sense creating an instance of them directly (like the Control class in System.Windows.Forms or the same named class in the VOSDK): - FUNCTION Start() AS VOID
      LOCAL o AS OBJECT
      o := Child{} // OK
      o := Parent{} // Compiler error XS0144: cannot create an instance of the abstract type
     
    ABSTRACT CLASS Parent
    END CLASS

    CLASS Child INHERIT Parent
    END CLASS
    - Abstract classes can also define abstract methods or properties, which dictates that it is mandatory to implement them in classes inheriting from the abstract class. Abstract methods are implicitly virtual so they can be overridden, and it is a compiler error not providing an implementation in a child class: - ABSTRACT CLASS Parent
      METHOD BasicFunctionality() AS VOID // does not need to be overriden in subclass
      ABSTRACT METHOD MustImplementInChild() AS VOID // implementation must be defined in subclasses
    END CLASS

    CLASS Child INHERIT Parent
    //   Omitting this would result to a compiler error that Child class does not implement inherited abstract method
      OVERRIDE METHOD MustImplementInChild() AS VOID
    END CLASS
    - Please note that XBase++ dialect used the modifier FINAL, which is equivalent to SEALED. The FREEZE modifier is not supported by X# + 对一个类使用 SEALED 修饰符,可以防止它被子类继承。 + 这对于防止类/库的用户在子类中改变其功能并可能引入问题非常有用。 + 它还能让编译器生成更高效的代码,因为编译器知道一个类型不会有子类。 + SEALED CLASS Parent
    END CLASS

    CLASS Child INHERIT Parent // 编译器错误 XS0509:不能从 SEALED 类型 “Parent ”派生
    END CLASS
    + SEALED 也可用于特定(虚)方法/属性,以防止在子类中仅重写这些方法/属性: + FUNCTION Start() AS VOID
      Child{}:DoTest()

    CLASS Base
      VIRTUAL METHOD VirtualMethod() AS VOID
         ? "base"
      METHOD DoTest() AS VOID
         SELF:VirtualMethod() // 父类,因为方法在父类中可以被重写,但在父类的子类中不能被重写
    END CLASS

    CLASS Parent INHERIT Base
      SEALED OVERRIDE METHOD VirtualMethod() AS VOID
         ? "parent"
    END CLASS

    CLASS Child INHERIT Parent // compiler error
    //   OVERRIDE METHOD VirtualMethod() AS VOID // 编译器错误 XS0239:无法覆盖方法,因为它是 SEALED 类型
      NEW METHOD VirtualMethod() AS VOID // 只能定义一个具有相同名称和签名的新方法,该方法不能覆盖父方法
         ? "child"
    END CLASS
    + 可以在类上使用 ABSTRACT 修饰符,以防止类被意外地直接实例化。只有从抽象类继承(并实现附加功能)的类才能被实例化。这对于实现基本功能但无法直接创建实例的类(如 System.Windows.Forms 中的 Control 类或 VOSDK 中的同名类)非常有用: + FUNCTION Start() AS VOID
      LOCAL o AS OBJECT
      o := Child{} // OK
      o := Parent{} // 编译器错误 XS0144:无法创建 ABSTRACT 类型的实例
     
    ABSTRACT CLASS Parent
    END CLASS

    CLASS Child INHERIT Parent
    END CLASS
    + 抽象类还可以定义抽象方法或属性,这就要求继承自抽象类的类必须实现这些方法或属性。抽象方法是隐式虚拟的,因此可以被重写,如果不在子类中提供实现,就会造成编译器错误: + ABSTRACT CLASS Parent
      METHOD BasicFunctionality() AS VOID // 子类中无需重载
      ABSTRACT METHOD MustImplementInChild() AS VOID // 必须在子类中定义
    END CLASS

    CLASS Child INHERIT Parent
    //   省略这一点会导致编译器错误,即 Child 类没有实现继承的抽象方法
      OVERRIDE METHOD MustImplementInChild() AS VOID
    END CLASS
    + 请注意,XBase++ 方言使用的修饰符 FINAL 相当于 SEALED。X# 不支持 FREEZE 修饰符。
    diff --git a/docs/Help_ZH-CN/Topics/Modifiers_Others.xml b/docs/Help_ZH-CN/Topics/Modifiers_Others.xml index ba51503cfa..c03420c68e 100644 --- a/docs/Help_ZH-CN/Topics/Modifiers_Others.xml +++ b/docs/Help_ZH-CN/Topics/Modifiers_Others.xml @@ -1,7 +1,7 @@  - - Other modifiers + + 其他修饰符 EXTERN PARTIAL @@ -9,22 +9,22 @@
    - Other modifiers + 其他修饰符
    PARTIAL - Using the PARTIAL modifier on a class declaration, instructs the compiler that the class definition and its members (methods, properties etc) may span in multiple program files in the current application/library. By default (when not using the PARTIAL modifier), all members of a class are expected to be defined in a single file, and if they span in multiple files, then all of the CLASS...END CLASS definitions of that class need to be marked as PARTIAL: - // file code1.prg
    PARTIAL CLASS ClassSpanningInMultipleFiles // omitting PARTIAL would result to compiler error on missing partial modifier on declaration of type
      METHOD MethodInFile1() AS VOID
    END CLASS

    // file code2.prg
    PARTIAL CLASS ClassSpanningInMultipleFiles
      PROPERTY PropertyInFile2() AS LOGIC
         GET
            RETURN TRUE
         END GET
      END PROPERTY
    END CLASS
    - Note that all members of a partial class need to be defined in the same assembly. It is NOT possible to use the PARTIAL modifier to define members of a class in separate assemblies/libraries. + 在类声明中使用 PARTIAL 修饰符可指示编译器,类定义及其成员(方法、属性等)可能会跨当前应用程序/库中的多个程序文件。默认情况下(不使用 PARTIAL 修饰符时),类的所有成员都应在单个文件中定义,如果它们跨多个文件,则该类的所有 CLASS...END CLASS 定义都需要标记为 PARTIAL: + // file code1.prg
    PARTIAL CLASS ClassSpanningInMultipleFiles // 省略 PARTIAL 会导致编译器错误,因为在类型声明中缺少部分修饰符。
      METHOD MethodInFile1() AS VOID
    END CLASS

    // file code2.prg
    PARTIAL CLASS ClassSpanningInMultipleFiles
      PROPERTY PropertyInFile2() AS LOGIC
         GET
            RETURN TRUE
         END GET
      END PROPERTY
    END CLASS
    + 请注意,部分类的所有成员必须在同一个程序集中定义。不能使用 PARTIAL 修饰符在不同的程序集/库中定义类的成员。 EXTERN - The EXTERN modifier tells the compiler that a method is implemented externally, so it has no body in the code itself. Most commonly EXTERN is used together with the DllImport attribute (System.Runtime.InteropServices.DllImportAttribute), which specifies exactly where the method is implemented (usually in a Win32 API dll) and how it needs to be called. When using that, the method needs to be declared also as static: - USING System.Runtime.InteropServices
    FUNCTION Start() AS VOID
      WinAPICalls.MessageBox(IntPtr.Zero, "Calling unmanaged code through an EXTERN method", "EXTERN modifier sample", 0)

    STATIC CLASS WinAPICalls
      [DllImport("user32.dll", CharSet := CharSet.Unicode)];
      STATIC EXTERN METHOD MessageBox(hWnd AS IntPtr, text AS STRING , caption AS STRING , type AS DWORD ) AS INT
    END CLASS
    - Note that it is a compiler error for an EXTERN method to directly return a value, since its complete implementation is provided externally. + EXTERN 修饰符告诉编译器某个方法是在外部实现的,因此它在代码本身中没有主体。EXTERN 通常与 DllImport 属性(System.Runtime.InteropServices.DllImportAttribute)一起使用,后者指定了方法的具体实现位置(通常在 Win32 API dll 中)和调用方式。使用该属性时,还需要将方法声明为静态方法: + USING System.Runtime.InteropServices
    FUNCTION Start() AS VOID
      WinAPICalls.MessageBox(IntPtr.Zero, "通过 EXTERN 方法调用非托管代码", "EXTERN 修饰符示例", 0)

    STATIC CLASS WinAPICalls
      [DllImport("user32.dll", CharSet := CharSet.Unicode)];
      STATIC EXTERN METHOD MessageBox(hWnd AS IntPtr, text AS STRING , caption AS STRING , type AS DWORD ) AS INT
    END CLASS
    + 请注意,EXTERN 方法直接返回值是编译器错误,因为它的完整实现是由外部提供的。 UNSAFE - The UNSAFE modifier on a method specifies that its entire body will run in an unsafe context, meaning it can use pointers to data and manipulate memory directly. The unsafe modifier can be used only when the compiler option Allow unsafe code (/unsafe) is enabled: - FUNCTION Start() AS VOID
      ? UnsafeMethods.GetByte2of4(0x10203040) // 32 (hex 20)

    CLASS UnsafeMethods
      UNSAFE STATIC METHOD GetByte2of4(d AS DWORD) AS BYTE
         LOCAL p AS BYTE PTR
         p := (BYTE PTR) @d // get direct pointer to the data
         RETURN p[3]
    END CLASS
    - When only a small part of the method body involves pointers or other potentially unsafe operations, it is more common to declare a BEGIN UNSAFE block for it, instead of marking the whole method as unsafe: - CLASS UnsafeMethods
      STATIC METHOD GetByte2of4(d AS DWORD) AS BYTE
         LOCAL b AS BYTE
         ? "Begin of unsafe possibly code executing"
         
         BEGIN UNSAFE // code inside this block uses pointer operations
            LOCAL p AS BYTE PTR
            p := (BYTE PTR) @d // get direct pointer to the data
            b := p[3]
         END UNSAFE
         ? "End of unsafe code"

         RETURN b
    END CLASS
    - Note that writing code that uses pointers is strongly discouraged (as the code cannot be verified by the .Net runtime for correct usage and can destabilize the running application) and needs to be used with extreme caution and only when it is absolutely necessary to do so. + 方法上的 UNSAFE 修饰符指定其整个主体将在不安全上下文中运行,这意味着它可以使用指向数据的指针并直接操作内存。只有启用编译器选项允许不安全代码(/unsafe)后,才能使用不安全修改器: + FUNCTION Start() AS VOID
      ? UnsafeMethods.GetByte2of4(0x10203040) // 32 (hex 20)

    CLASS UnsafeMethods
      UNSAFE STATIC METHOD GetByte2of4(d AS DWORD) AS BYTE
         LOCAL p AS BYTE PTR
         p := (BYTE PTR) @d //获取直接指向数据的指针
         RETURN p[3]
    END CLASS
    + 当方法体中只有一小部分涉及指针或其他潜在的不安全操作时,更常见的做法是为其声明一个 BEGIN UNSAFE 块,而不是将整个方法标记为不安全: + CLASS UnsafeMethods
      STATIC METHOD GetByte2of4(d AS DWORD) AS BYTE
         LOCAL b AS BYTE
         ? "Begin of unsafe possibly code executing"
         
         BEGIN UNSAFE // 该代码块内的代码使用指针操作
            LOCAL p AS BYTE PTR
            p := (BYTE PTR) @d // 获取直接指向数据的指针
            b := p[3]
         END UNSAFE
         ? "End of unsafe code"

         RETURN b
    END CLASS
    + 请注意,我们强烈反对编写使用指针的代码(因为.Net 运行时无法验证代码的正确使用,而且会破坏运行应用程序的稳定性),只有在绝对必要的情况下,才需要极其谨慎地使用指针。
    diff --git a/docs/Help_ZH-CN/Topics/Modifiers_Static.xml b/docs/Help_ZH-CN/Topics/Modifiers_Static.xml index be4501c817..28e7870bc2 100644 --- a/docs/Help_ZH-CN/Topics/Modifiers_Static.xml +++ b/docs/Help_ZH-CN/Topics/Modifiers_Static.xml @@ -1,34 +1,35 @@  - - STATIC modifier + + 静态修饰符 STATIC
    - STATIC modifier + 静态修饰符
    - The STATIC modifier has a different meaning when used on a class or its members, on a FUNCTION/GLOBAL or on a LOCAL variable. - Static classes and members - Static members - The STATIC modifier on a member of a class (method, constructor, property, field, event) declares a member which belongs to the class itself, instead of to an instance of the class. Normal (instance) methods and other members can be called by using an instance of the class (for example through SELF, or a local variable holding such an instantiated object) with the colon (":") operator (also with the dot "." operator if the compiler option /allowdot is enabled), while static members can be accessed directly through the class itself, using the dot operator: + + 当 STATIC 修饰符用于类或其成员、FUNCTION/GLOBAL 或 LOCAL 变量时,其含义有所不同。 + 静态类和静态成员 + 静态成员 + 类成员(方法、构造函数、属性、字段、事件)上的 STATIC 修饰符所声明的成员属于类本身,而不是类的实例。普通(实例)方法和其他成员可以通过使用冒号(“:”)运算符(如果编译器选项 /allowdot 启用,也可以使用点“. ”运算符)调用类的实例(例如通过 SELF 或容纳实例对象的局部变量),而静态成员则可以通过使用点运算符直接访问类本身: FUNCTION Start() AS VOID
      LOCAL oInstance AS TestClass
      oInstance := TestClass{}
     
      ? oInstance:instance_field
      ? oInstance:InstanceMethod()
      ? oInstance:InstanceProperty
     
      ? TestClass.static_field
      ? TestClass.StaticMethod()
      ? TestClass.StaticProperty
    CLASS TestClass
      EXPORT instance_field := "instance field" AS STRING
      STATIC EXPORT static_field := "static field" AS STRING
     
      METHOD InstanceMethod() AS STRING
      RETURN "Instance method"
      PROPERTY InstanceProperty() AS STRING GET "Instance property"
         
      STATIC METHOD StaticMethod() AS STRING
      RETURN "Static method"
      STATIC PROPERTY StaticProperty() AS STRING GET "Instance property"
    END CLASS
    - A static method is very similar to a common function and can be used in the same way, but has the advantage that it is encapsulated within a class that may contain other related static or non static members. Like functions, static methods can not use instance members of the class with SELF:, but can access other static members. Methods with related functionality can be grouped together under the same class, offering much better intellisense support in the editor (typing a dot after a class name will show a list of all its static members) and makes the code more structured. For example, the System.Math class offers a lot of mathematical functions, all grouped together under a single class, which makes it easier to find and use, rather that having several standalone functions offering the same functionality. Similarly, a static field can be regarded as a GLOBAL, but again structured under a class. Any method of a class that is not using SELF in its body (so is not accessing any instance members) is a good candidate to be declared as static. - Static constructor - It is also possible to define a single static constructor per class, which is guaranteed to be called automatically just before any static member (method, field, etc) of the class is accessed for the first time. A static constructor must have no parameters and cannot be overloaded. Typical use of a static constructor is to initialize static fields: - FUNCTION Start() AS VOID
      ? TestClass.static_field // adjusted by static constructor

    CLASS TestClass
      STATIC EXPORT static_field := "initial value" AS STRING
     
      STATIC CONSTRUCTOR()
         ? TestClass.static_field // initial value
         TestClass.static_field := "adjusted by static constructor"
    END CLASS
    - Note that it is not allowed to define a static destructor. If you need to cleanup data stored inside a static class, then it is recommended to register a ProcessExit event handler in the AppDomain class.This will be called when the application ends. - FUNCTION Start() AS VOID

    CLASS TestClass
     
      STATIC CONSTRUCTOR()
         AppDomain.CurrentDomain:ProcessExit += EventHandler{CurrentDomain_ProcessExit}

    static method CurrentDomain_ProcessExit(sender as object, e as EventArgs) as void
      // clean up
      return
    END CLASS
    - Static class - When a class is designed to hold only static members, then it can be declared itself as static. Doing so allows the compiler to check every member of the class and make sure none is accidentally declared as non-static: - STATIC CLASS StaticClass
      STATIC EXPORT static_field AS STRING
      EXPORT accidental_instance AS STRING // compiler error XS0708: cannot declare instance members in a static class

      STATIC METHOD Static_method() AS VOID
      METHOD Accidental_Instance_method() AS VOID // compiler error XS0708: cannot declare instance members in a static class
    END CLASS
    - Static functions and globals - Declaring a function or global as static, restricts its visibility to only the code file where it is declared. This way, multiple files can declared functions and globals with the same name, each one being visible only in their respective file: + 静态方法与普通函数非常相似,可以以同样的方式使用,但静态方法的优势在于它被封装在一个类中,而这个类可能包含其他相关的静态或非静态成员。与函数一样,静态方法不能使用类中带有 SELF: 的实例成员,但可以访问其他静态成员。具有相关功能的方法可以集中在同一个类中,从而在编辑器中提供更好的智能感应支持(在类名后键入一个点将显示其所有静态成员的列表),并使代码更有条理。例如,System.Math 类提供了大量的数学函数,这些函数都集中在一个类中,这样就更容易查找和使用,而不是由几个独立的函数来提供相同的功能。同样,静态字段也可以被视为一个 GLOBAL,但同样是在一个类下进行结构化。一个类中的任何方法,如果没有在其主体中使用 SELF(因此没有访问任何实例成员),都可以声明为静态方法。 + 静态构造函数 + 也可以为每个类定义一个静态构造函数,保证在首次访问该类的任何静态成员(方法、字段等)之前自动调用该构造函数。静态构造函数必须没有参数,并且不能重载。静态构造函数的典型用途是初始化静态字段: + FUNCTION Start() AS VOID
      ? TestClass.static_field // 由静态构造函数调整

    CLASS TestClass
      STATIC EXPORT static_field := "初始值" AS STRING
     
      STATIC CONSTRUCTOR()
         ? TestClass.static_field // 初始值
         TestClass.static_field := "由静态构造函数调整"
    END CLASS
    + 请注意,不允许定义静态析构函数。如果需要清理存储在静态类中的数据,建议在 AppDomain 类中注册 ProcessExit 事件处理程序。 + FUNCTION Start() AS VOID

    CLASS TestClass
     
      STATIC CONSTRUCTOR()
         AppDomain.CurrentDomain:ProcessExit += EventHandler{CurrentDomain_ProcessExit}

    static method CurrentDomain_ProcessExit(sender as object, e as EventArgs) as void
      // 清理
      return
    END CLASS
    + 静态类 + 当设计一个类只包含静态成员时,可以将其自身声明为静态。这样,编译器就可以检查类中的每个成员,确保没有一个成员被意外声明为非静态成员: + STATIC CLASS StaticClass
      STATIC EXPORT static_field AS STRING
      EXPORT accidental_instance AS STRING // 编译器错误 XS0708:无法在静态类中声明实例成员

      STATIC METHOD Static_method() AS VOID
      METHOD Accidental_Instance_method() AS VOID // 编译器错误 XS0708:无法在静态类中声明实例成员
    END CLASS
    + 静态函数和全局(GLOBAL) + 将函数或全局项声明为 static 时,其可见性仅限于声明该函数或全局项的代码文件。这样,多个文件可以声明同名的函数和全局,但每个函数和全局只能在各自的文件中可见: STATIC GLOBAL GlobalVisibleOnlyInThisFile AS INT
    STATIC FUNCTION FunctionVisibleOnlyInThisFile() AS VOID
    - Static local - Declaring a LOCAL variable as STATIC, causes it to be initialized with a value only once, at the first time that the method, function or other entity where it is declared is called. The local variable retains its previous value the next time the code is called: - FUNCTION Start() AS VOID
      ? TestStaticLocal() // 2
      ? TestStaticLocal() // 3
      ? TestStaticLocal() // 4

    FUNCTION TestStaticLocal() AS INT
      STATIC LOCAL nStaticLocal := 1 AS INT // gets initialized to 1 only the first time the function is called
      nStaticLocal ++ // the current value will be retained the next time the function is called
    RETURN nStaticLocal
    + 静态局部(变量) + 将局部变量声明为 STATIC(静态)后,只有在首次调用方法、函数或其他实体时,才会对其进行一次初始化。在下一次调用代码时,局部变量将保留其先前的值: + FUNCTION Start() AS VOID
      ? TestStaticLocal() // 2
      ? TestStaticLocal() // 3
      ? TestStaticLocal() // 4

    FUNCTION TestStaticLocal() AS INT
      STATIC LOCAL nStaticLocal := 1 AS INT // 只有在第一次调用函数时才会被初始化为 1
      nStaticLocal ++ // 下次调用函数时将保留当前值
    RETURN nStaticLocal
    diff --git a/docs/Help_ZH-CN/Topics/Modifiers_Visibility.xml b/docs/Help_ZH-CN/Topics/Modifiers_Visibility.xml index 9d306c48ad..acbfd2aba7 100644 --- a/docs/Help_ZH-CN/Topics/Modifiers_Visibility.xml +++ b/docs/Help_ZH-CN/Topics/Modifiers_Visibility.xml @@ -1,7 +1,7 @@  - - Access/Visibility modifiers + + 可见性修饰符 EXPORT HIDDEN @@ -14,25 +14,25 @@
    - Access/Visibility modifiers + 可见性修饰符
    - Access / Visibility modifiers - Access modifiers restrict the visibility of program elements: + 可见性修饰符 + 访问修饰符限制程序元素的可见性: -
  • PUBLIC/EXPORT: A public function, global, type (class, structure, delegate etc) or type member (field, method, property, event etc) is visible to all code within the same assembly (exe or dll) where it is declared and assemblies referenced by the declaring assembly. This is the default in X#.
  • -
  • PROTECT/PROTECTED: The PROTECT(ED) keyword can be applied only to type members and restrict their visibility to code within the same type and classes that inherit from that type
  • -
  • INSTANCE: A unique modifier keyword to X# (and Visual Objects), very similar to PROTECT, but applies only to class fields and has different semantics to PROTECT, on the way it is used by code within the same class (see sample below)
  • -
  • PRIVATE/HIDDEN: Also applies to type members and is more restrictive than PROTECT, as it limits the member visibility to only code within the type where it is declared (not to classes inheriting from that type). If you declare a field or method as PRIVATE then the compiler may produce a compiler warning xs0169 when it detects that that field or method is never called inside the class.
  • -
  • INTERNAL: Restricts the visibility of a type or member only to code from the same assembly (dll or exe). An internal member is not visible to any code outside the defining assembly, not even to classes inheriting from this class declared in other assemblies. Can be combined with PROTECTED, so that an INTERNAL PROTECTED member can be seen only form within the same class and also from inheriting classes that are defined in the same assembly, but not from inheriting classes that are defined in other assemblies.
  • -
  • The XBase++ dialect also has the modifier STATIC which means that the class is only visible in the source file where it is used.
  • +
  • PUBLIC/EXPORT:公共函数、全局、类型(类、结构、委托等)或类型成员(字段、方法、属性、事件等)对声明它的同一程序集(exe 或 dll)中的所有代码以及声明程序集引用的程序集都是可见的。这是 X# 的默认设置。
  • +
  • PROTECT/PROTECTED:PROTECT(ED)关键字只能应用于类型成员,并限制其在同一类型和继承自该类型的类的代码中的可见性。
  • +
  • INSTANCE: X#(和 Visual Objects)独有的修饰符关键字,与 PROTECT 非常相似,但只适用于类字段,其语义与 PROTECT 不同,取决于同一类中的代码使用它的方式(请参阅下面的示例)。
  • +
  • PRIVATE/HIDDEN:也适用于类型成员,但比 PROTECT 更严格,因为它限制了成员的可见性,只对声明该成员的类型内的代码可见(而不是对继承自该类型的类可见)。如果将一个字段或方法声明为 PRIVATE,当编译器检测到该字段或方法从未在类内被调用时,可能会产生编译器警告  xs0169。
  • +
  • INTERNAL:限制类型或成员的可见性,只对同一程序集(dll 或 exe)中的代码可见。内部成员对定义程序集之外的任何代码都不可见,甚至对其他程序集中声明的该类的继承类也不可见。可与 PROTECTED 结合使用,这样,INTERNAL PROTECTED 成员只能在同一类中看到,也可以从定义在同一程序集中的继承类中看到,但不能从定义在其他程序集中的继承类中看到。
  • +
  • XBase++ 方言也有修饰符 STATIC,这意味着类只能在使用它的源文件中可见。
  • - Note: It is still possible to explicitly specify certain assemblies where internal types and members of an assembly are visible, by using the InternalsVisibleTo attribute. See documentation for System.Runtime.CompilerServices.InternalsVisibleToAttribute for more information. - INTERNAL PROCEDURE InternalProc() // procedure accessible only from within the same assembly
    INTERNAL GLOBAL InternalGlobal AS INT // global accessible only from within the same assembly

    PUBLIC CLASS TestClass // accessible from everywhere
      EXPORT Export_field AS INT // accessible from everywhere
      PROTECT Protected_field AS INT // accessible to this class and classes inherited from it
      INTERNAL PROTECT Internal_Protected_field AS INT // accessible to this class and classes inherited from it, defined in this same assembly only
      PRIVATE METHOD Private_Method() AS VOID // accessible only from code inside this particular class
    END CLASS
    + 注:通过使用 InternalsVisibleTo 属性,仍可明确指定某些程序集的内部类型和成员可见。更多信息,请参阅 System.Runtime.CompilerServices.InternalsVisibleToAttribute 文档。 + INTERNAL PROCEDURE InternalProc() // 程序只能在同一程序集内访问
    INTERNAL GLOBAL InternalGlobal AS INT // 只能在同一程序集内访问的全局

    PUBLIC CLASS TestClass // 无处不在
      EXPORT Export_field AS INT // 无处不在
      PROTECT Protected_field AS INT // 本类及其继承的类可以访问
      INTERNAL PROTECT Internal_Protected_field AS INT // 和继承自该类的类的访问权限,仅在同一程序集中定义
      PRIVATE METHOD Private_Method() AS VOID // 只能从该类的代码中访问
    END CLASS
    PROTECTED vs HIDDEN - A compatibility feature for code derived from Visual Objects, INSTANCE applies to fields and is similar to PROTECT, but has different semantics when a property (or ACCESS) is defined with the same name. When using a PROTECT field and an ACCESS/ASSIGN pair (or PROPERTY) is defined with the same name in the type, then any code within that class that tries to access this member, always refers to the field. But when the member is declared with the INSTANCE keyword, then the compiler binds the name to the ACCESS instead: + 作为从 Visual Objects 派生的代码的兼容性功能,INSTANCE 适用于字段,与 PROTECT 类似,但在定义了同名属性(或 ACCESS)时具有不同的语义。当使用 PROTECT 字段并在类型中定义了同名的 ACCESS/ASSIGN 对(或属性)时,该类中任何试图访问该成员的代码都将始终引用该字段。但当使用 INSTANCE 关键字声明该成员时,编译器会将该名称与 ACCESS 绑定: FUNCTION Start() AS VOID
      TestClass{}:DoTest()

    CLASS TestClass
      PROTECT Protected_member := "field" AS STRING
      INSTANCE Instance_member := "field" AS STRING
      ACCESS Protected_member AS STRING
      RETURN "access"
      ACCESS Instance_member AS STRING
      RETURN "access"
      METHOD DoTest() AS VOID
         ? SELF:Protected_member // field
         ? SELF:Instance_member // access, because the field is defined with the INSTANCE keyword
    END CLASS
    - This feature is a left over from old Visual Objects versions that were emitting INSTANCE members for every control in the Window Editor and is depreciated in X#, but still available for compatibility reasons + 该功能是旧 Visual Objects 版本遗留下来的,旧版本会为窗口编辑器中的每个控件生成 INSTANCE 成员,在 X# 中已被淘汰,但出于兼容性原因仍可使用。
    diff --git a/docs/Help_ZH-CN/Topics/Namespaces2.xml b/docs/Help_ZH-CN/Topics/Namespaces2.xml index 29b4240c98..de5ecf04e0 100644 --- a/docs/Help_ZH-CN/Topics/Namespaces2.xml +++ b/docs/Help_ZH-CN/Topics/Namespaces2.xml @@ -1,12 +1,13 @@  - - Namespaces + + 命名空间
    - Namespaces + 命名空间
    - A Namespace is a prefix to item names that provides a logical grouping of types and other .Net elements, making it easier to structure together items that have a common purpose and avoid naming conflicts. Due to the vast amount of libraries and classes available in .Net (in System and 3rd party libraries and in every application written in .Net), using simple small names without a namespace would had led to a lot of naming conflicts, making it impossible to distinguish between each other. For example, there's a type named "Button" (representing a Button control) in the Windows Forms system library, another for WPF, also one in the VOSDK GUI classes and of course the new typed VOSDK GUI classes library has one, too. Furthermore, it's very likely that also dozens of other custom control libraries include a same named type, too! In order to distinguish among all them, an additional prefix name (namespace) has been added to each version of the type: + + 命名空间是项目名称的前缀,它提供了类型和其他 .Net 元素的逻辑分组,使具有共同目的的项目更容易结构化,并避免命名冲突。由于 .Net 中有大量的库和类(在系统库和第三方库中,以及在每个用 .Net 编写的应用程序中),如果不使用命名空间而使用简单的小名,就会导致大量的命名冲突,从而无法区分彼此。例如,在 Windows 窗体系统库中有一个名为 “Button”(代表按钮控件)的类型,在 WPF 中也有一个,在 VOSDK GUI 类中也有一个,当然新的类型化 VOSDK GUI 类库也有一个。此外,其他几十个自定义控件库也很可能包含相同的命名类型!为了将它们区分开来,每个版本的类型都添加了一个额外的前缀名称(命名空间):
  • System.Windows.Forms.Button // Windows forms
  • @@ -15,30 +16,29 @@
  • XSharp.VO.Button // Typed SDK GUI library
  • - For the full class name System.Windows.Forms.Button, everything before the final dot (System.Windows.Forms) is called the namespace of the class, while the rest is called the short class name. Note that a namespace is not something concrete, it does not exist as a separate entity in .Net assembiles, it is only a convention to use a descriptive name prefix for all class names and is not mandatory. Using the dot as name part separator is also a convention in .Net, it could had been equally valid to choose another character like an underscore for the same purpose, resulting to the name System_Windows_Forms_Button for the winforms class name, where "System_Windows_Forms" would had been the namespace part of the name. + 对于完整的类名 System.Windows.Forms.Button,最后一个点(System.Windows.Forms)之前的所有内容都称为类的命名空间,而其余部分则称为简短的类名。请注意,命名空间并不是具体的东西,它在 .Net 汇编中并不作为一个单独的实体存在,它只是对所有类名使用描述性名称前缀的一种约定,并不是强制性的。使用点作为名称分隔符也是.Net 中的一种约定俗成的做法,如果选择其他字符(如下划线)也可以达到同样的目的,这样 winforms 类的名称就变成了 System_Windows_Forms_Button,其中 “System_Windows_Forms ”就是名称中的命名空间部分。 - Also by convention, usually namespace and type names are structured in the following format: - <Company name>.<Library name>.<Optional further group names>.<Short type name> - This has been followed in the name XSharp.VO.Button, where "XSharp" is the company name, "VO" represents the library and "Button" is the actual class (short) name. The optional additional group names provide further better structuring of the type names, often used in large libraries where it is important to logically group together the large amount of available items. - Specifying namespaces to type names - In X#, there are several ways to provide a namespace to types/classes defined in the code. The most common way is to use the BEGIN..END NAMESPACE block statement: + 另外,按照惯例,命名空间和类型名称通常采用以下格式: + <公司名>.<库名>.<可选的其他分组名>.<简短的类型名称> + XSharp.VO.Button(XSharp.VO.Button)就是这样命名的,其中 “XSharp ”是公司名称,“VO ”代表程序库,而 “Button ”则是实际的类(简称)名称。可选的附加组名称可进一步改善类型名称的结构,通常用于大型库中,在这种情况下,将大量可用项目进行逻辑分组非常重要。 + 为类型名称指定命名空间 + 在 X# 中,有几种方法可以为代码中定义的类型/类提供命名空间。最常见的方法是使用 BEGIN...END NAMESPACE 块语句: BEGIN NAMESPACE OurCompany.CommonLibrary
      CLASS GeneralUseType
      // ...
      END CLASS
    END NAMESPACE
    - Every typed defined inside the block will automatically have its name prefixed by the compiler with the namespace provided, so the class in the above sample will become OurCompany.CommonLibrary.GeneralUseType. Also BEGIN NAMESPACE blocks can be nested (to any level) and the above could had been written in an equal way like this: + 在代码块中定义的每一个类型,编译器都会自动在其名称前加上所提供的命名空间,因此上述示例中的类将变成 OurCompany.CommonLibrary.GeneralUseType。此外,BEGIN NAMESPACE 块还可以嵌套(任意级别),上面的代码也可以这样写: BEGIN NAMESPACE OurCompany
      BEGIN NAMESPACE CommonLibrary
         CLASS GeneralUseType
         // ...
         END CLASS
      END NAMESPACE
    END NAMESPACE
    - Another option is to provide the namespace part of the name in the class declaration directly: + 另一种方法是直接在类声明中提供名称的命名空间部分: CLASS OurCompany.CommonLibrary.GeneralUseType
    // ...
    END CLASS
    - Finally, it is possible to define a Default Namespace in the project properties (which maps to the -ns compiler option). When defining this, then all class names in the code that have not been explicitly assigned a namespace, automatically get the one provided in the project option. This is particularly useful for applications and libraries ported from Visual Objects or other systems that did not support the concept of namespaces so all types in them used simple class names. In order to avoid having to explicitly provide namespace names in potentially 100s or 1000s of files of code, the project option can be used instead. - Using types with namespaces - Normally, in order to use a type in code, its full class name (including the namespace part) needs to be used: + 最后,还可以在项目属性中定义默认名称空间(与 -ns 编译器选项相对应)。定义后,代码中所有未明确分配命名空间的类名都会自动获得项目选项中提供的命名空间。这对于从 Visual Objects 或其他不支持命名空间概念的系统移植过来的应用程序和库特别有用,因为这些系统中的所有类型都使用简单的类名。为了避免在可能有 100 或 1000 个代码文件中显式地提供命名空间名称,可以使用项目选项来代替。 + 使用带有命名空间的类型 + 通常,要在代码中使用一个类型,需要使用其完整的类名(包括命名空间部分): FUNCTION Start() AS VOID
      LOCAL oUse AS OurCompany.CommonLibrary.GeneralUseType
      oUse := OurCompany.CommonLibrary.GeneralUseType{}
    - If the namespace part was not included, then the compiler would not had been able to resolve the class name. But because always using such long names can be tedious and may result to all of code bloat, it is common practice to specify the commonly used namespace in each file of code in the beginning of the file, in USING statements: + 如果不包含命名空间部分,编译器就无法解析类名。但由于总是使用这么长的名称可能会很乏味,而且可能会导致代码臃肿,因此通常的做法是在每个代码文件的开头,在 USING 语句中指定常用的命名空间: USING OurCompany.CommonLibrary

    FUNCTION Start() AS VOID
      LOCAL oUse AS GeneralUseType
      oUse := GeneralUseType{}
    - The USING statement instructs the compiler every time it finds a class name that it cannot resolve, to try resolving it by prefixing it with all the namespace names provided in USING statements in the given file. Of course if two or more types used in the code have the same short name with different namespaces, then it is not possible to have a USING statement for each one of them, as that would lead to a name conflict, making it impossible for the compiler to distinguish with exact class is used in each case. - - Also note that any code between a BEGIN...END NAMESPACE statement, additionally automatically resolves short type names defined in it to full type names using the namespace provided in the statement. So it is not necessary to provide a namespace in the class name in this code: - BEGIN NAMESPACE OurCompany.CommonLibrary
      CLASS GeneralUseType
      END CLASS
      CLASS AnotherClass
         METHOD Test() AS VOID
            LOCAL oUse AS GeneralUseType // not necessary to provide the namespace
            oUse := GeneralUseType{}
      END CLASS
    END NAMESPACE
    - Implicit namespace lookup - Especially for libraries with the Default namespace option (see above) provided, it is possible for applications that reference them to use their classes with their short names without needing to provide USING statements. This can be done by enabling the Enable Implicit Namespace lookup project option (which maps to the /ins compiler option). Every such library includes its default namespace as information in an assembly attribute and when that option is used, the compiler automatically resolves type names also by using that default namespace in the library. This is used for example in the VOSDK classes, so all the classes defined in those libraries can be used without the need to provide USING VO statements, in all files of the applications that reference those libraries. + USING 语句指示编译器在每次发现无法解析的类名时,尝试用给定文件中 USING 语句提供的所有命名空间名作为前缀来解析该类名。当然,如果代码中使用的两个或多个类型具有相同的简短名称,但名称空间不同,那么就不可能为每个类型都使用 USING 语句,因为这会导致名称冲突,使编译器无法区分每次使用的是哪一个确切的类。 + 另外请注意,任何介于 BEGIN...END NAMESPACE 语句之间的代码都会自动使用语句中提供的命名空间将其中定义的短类型名解析为完整类型名。因此,在这段代码中没有必要在类名中提供命名空间: + BEGIN NAMESPACE OurCompany.CommonLibrary
      CLASS GeneralUseType
      END CLASS
      CLASS AnotherClass
         METHOD Test() AS VOID
            LOCAL oUse AS GeneralUseType // 无需提供命名空间
            oUse := GeneralUseType{}
      END CLASS
    END NAMESPACE
    + 隐式命名空间查找 + 特别是对于提供了默认命名空间选项(见上文)的库,引用它们的应用程序可以使用其类的简短名称,而无需提供 USING 语句。启用 “Enable Implicit Namespace lookup(启用隐式命名空间查找) ”项目选项(该选项与 /ins 编译器选项相对应)就能实现这一目的。每个此类库都将其默认名称空间作为信息包含在程序集属性中,使用该选项时,编译器也会使用库中的默认名称空间自动解析类型名称。例如,在 VOSDK 类中就使用了这种方法,因此无需在引用这些库的应用程序的所有文件中提供 USING VO 语句,就可以使用这些库中定义的所有类。
    diff --git a/docs/Help_ZH-CN/Topics/Native-Types.xml b/docs/Help_ZH-CN/Topics/Native-Types.xml index b4ed71573e..7fc05ba9b2 100644 --- a/docs/Help_ZH-CN/Topics/Native-Types.xml +++ b/docs/Help_ZH-CN/Topics/Native-Types.xml @@ -1,29 +1,30 @@  - - Simple (Native) Types + + 简单(固有)类型
    - Simple (Native) Types + 简单(固有)类型
    - By simple data types we mean data types that are not primarily used to hold other data, e.g. Objects, Structures, Arrays, etc., that we will see later. - Most data types are identical across all .Net languages. This contributes to the ease with which one can use assemblies written in different .Net languages within one application, one of the main The simple data types come in various categories; some include several types. The following table just groups data types by category: + 我们所说的简单数据类型是指主要不用于保存其他数据的数据类型,如对象、结构、数组等,这些我们稍后会看到。 + + 大多数数据类型在所有 .Net 语言中都是相同的。这有助于在一个应用程序中轻松使用以不同 .Net 语言编写的程序集,这也是简单数据类型的主要特点之一。下表按类别对数据类型进行了分组: @@ -31,7 +32,7 @@ BYTE @@ -101,7 +102,7 @@ INT @@ -171,13 +172,13 @@ PTR @@ -185,7 +186,7 @@ REAL4 @@ -255,7 +256,7 @@ UINT64
    - Type + 类型 - Category + 分类 - .Net Name + .Net 名称 - Size in Bits + 按位计算的大小
    - Unsigned Integer + 无符号整数 Byte @@ -45,7 +46,7 @@ CHAR - Character + (Unicode UTF-16)字符 Char @@ -59,7 +60,7 @@ DWORD - Unsigned Integer + 无符号整数 UInt32 @@ -73,7 +74,7 @@ DECIMAL - Numeric + 数值 Decimal @@ -87,13 +88,13 @@ DYNAMIC - Multi purpose + 多用途 Dynamic - Reference (32 or 64 bits) + 引用 (32 或 64 bits)
    - Signed Integer + 带符号整数 Int32 @@ -115,7 +116,7 @@ INT64 - Signed Integer + 带符号整数 Int64 @@ -129,7 +130,7 @@ LOGIC - Logic + 逻辑型 Boolean @@ -143,7 +144,7 @@ LONGINT - Signed Integer + 带符号整数 Int32 @@ -157,13 +158,13 @@ OBJECT - Multi purpose + 多用途 Object - Reference (32 or 64 bits) + 引用 (32 或 64 bits)
    - Multi purpose + 多用途 Intptr - Reference (32 or 64 bits) + 引用 (32 或 64 bits)
    - Floating Point + 浮点数 Single @@ -199,7 +200,7 @@ REAL8 - Floating Point + 浮点数 Double @@ -213,7 +214,7 @@ SBYTE - Signed Integer + 带符号整数 SByte @@ -227,7 +228,7 @@ SHORT - Signed Integer + 带符号整数 Int16 @@ -241,13 +242,13 @@ STRING - String + 字符串 String - Reference (32 or 64 bits) + 引用 (32 或 64 bits)
    - Unsigned Integer + 无符号整数 Uint64 @@ -269,7 +270,7 @@ VOID - Not a type + 不是一个类型 Void @@ -283,7 +284,7 @@ WORD - Unsigned Integer + 无符号整数 UInt16 diff --git a/docs/Help_ZH-CN/Topics/NullLiterals.xml b/docs/Help_ZH-CN/Topics/NullLiterals.xml index 8d1d182d6c..554641faf4 100644 --- a/docs/Help_ZH-CN/Topics/NullLiterals.xml +++ b/docs/Help_ZH-CN/Topics/NullLiterals.xml @@ -1,7 +1,7 @@  - - Null Literals + + Null 字面量 Literals NULL @@ -17,128 +17,130 @@
    - Null Literals + Null 字面量
    - X# uses the following NULL literals. They indicate the absense of a value. - Some of these literals require the runtime. + + X# 使用以下 NULL 字面量。它们表示没有值。 + + 其中一些字面量需要运行时支持。 - - - - - - - - - - - - - - - - - - - - - -
    - Value + + - Description + + 描述 - Requires Runtime + 需要运行时
    + NULL - "Multi purpose" NULL. Can be used for OBJECT type and Pointer types. + + “多用途” NULL。可用于 OBJECT 类型和指针类型。 N
    + NULL_ARRAY - Null reference to the xBase ARRAY type + + xBase ARRAY 类型的 NULL 引用 Y
    + NULL_CODEBLOCK - Null reference to the xBase CODEBLOCK type + + xBase CODEBLOCK 类型的 NULL 引用 Y
    + NULL_DATE - Empty date (0000-00-00) + + 空数据(0000-00-00) Y
    + NULL_OBJECT - Null reference to an OBJECT value + + 对 OBJECT 值的 NULL 引用 N
    + NULL_PSZ - Null PSZ value + + Null PSZ 值 Y
    + NULL_PTR - Null PTR value + + Null PTR 值 N
    + NULL_STRING - Null reference to a string. When the compiler option /vo2 is used then this will become the equivalent of String.Empty + + 字符串的 NULL 引用。当使用编译器选项 /vo2 时,这将等同于 String.Empty N
    + NULL_SYMBOL - NULL reference to the xBase SYMBOL type + + xBase SYMBOL 类型的 NULL 引用 Y
    + .NULL. - This FoxPro literal null is translated to a NULL reference + + 该 FoxPro 字面量 null 被转换为 NULL 引用 N diff --git a/docs/Help_ZH-CN/Topics/Nullable-Types.xml b/docs/Help_ZH-CN/Topics/Nullable-Types.xml index d191c29475..a2482cb7a4 100644 --- a/docs/Help_ZH-CN/Topics/Nullable-Types.xml +++ b/docs/Help_ZH-CN/Topics/Nullable-Types.xml @@ -1,10 +1,10 @@  - - Nullable Types + + 可以为 Null 的类型
    - Nullable Types + 可以为 Null 的类型
    diff --git a/docs/Help_ZH-CN/Topics/NumericLiterals.xml b/docs/Help_ZH-CN/Topics/NumericLiterals.xml index c47b384d9c..4cebc90162 100644 --- a/docs/Help_ZH-CN/Topics/NumericLiterals.xml +++ b/docs/Help_ZH-CN/Topics/NumericLiterals.xml @@ -1,36 +1,37 @@  - - Numeric Literals + + Numeric 字面量 Literals Numeric Literals
    - Numeric Literals + Numeric 字面量
    - The X# language knows the following numeric literal types + + X# 语言可以使用以下数字字面量类型: diff --git a/docs/Help_ZH-CN/Topics/OBJECT.xml b/docs/Help_ZH-CN/Topics/OBJECT.xml index ff1b0a5b28..2ef150b653 100644 --- a/docs/Help_ZH-CN/Topics/OBJECT.xml +++ b/docs/Help_ZH-CN/Topics/OBJECT.xml @@ -1,6 +1,6 @@  - + OBJECT OBJECT @@ -9,26 +9,27 @@
    OBJECT
    - The OBJECT keyword is a generic type from which all objects in .Net automatically inherit. - X# does not require a class to declare inheritance from Object because the inheritance is implicit. + OBJECT 关键字是 .Net 中所有对象自动继承的通用类型。 - Because all classes in the .NET Framework are derived from Object, every method defined in the Object class is available in all objects in the system. Derived classes can and do override some of these methods, including: + X# 不需要类声明从 Object 继承,因为继承是隐式的。 + + 由于 .NET Framework 中的所有类都派生自 Object,因此 Object 类中定义的每个方法都可在系统中的所有对象中使用。派生类可以重写其中一些方法,包括: -
  • Equals - Supports comparisons between objects.
  • +
  • Equals - 支持对象之间的比较
  • -
  • Finalize - Performs cleanup operations before an object is automatically reclaimed.
  • +
  • Finalize - 在对象自动回收之前执行清理操作
  • -
  • GetHashCode - Generates a number corresponding to the value of the object to support the use of a hash table.
  • +
  • GetHashCode - 生成与对象值对应的数字,以支持哈希表的使用
  • -
  • ToString - Manufactures a human-readable text string that describes an instance of the class.
  • +
  • ToString - 生成描述类实例的可读文本字符串
  • diff --git a/docs/Help_ZH-CN/Topics/Other-editors.xml b/docs/Help_ZH-CN/Topics/Other-editors.xml index 152c8dd76d..db7c63183b 100644 --- a/docs/Help_ZH-CN/Topics/Other-editors.xml +++ b/docs/Help_ZH-CN/Topics/Other-editors.xml @@ -1,12 +1,13 @@  - - Other editors + + 其他编辑器
    - Other editors + 其他编辑器
    - We have added some custom editor to Visual Studio to allow you to edit resources that are migrated from Visual Objects. + + 我们在 Visual Studio 中添加了一些自定义编辑器,允许您编辑从 Visual Objects 迁移过来的资源。
  • Form Editor
  • DbServer Editor
  • @@ -14,15 +15,15 @@
  • Menu Editor
  • - The Tools Options dialog contains some settings that are used by these custom editors: + 具选项对话框包含这些自定义编辑器使用的一些设置: - There is a second page with some settings for the other editor and for some other relevant settings: + 第二页包含其他编辑器的一些设置和其他相关设置: - The values for the settings are stored in the file XSharp\ProjectSystemSettings.json  in your roaming profile folder. + 设置值存储在漫游配置文件文件夹中的 XSharp\ProjectSystemSettings.json 文件中。
    diff --git a/docs/Help_ZH-CN/Topics/PSZ-Type.xml b/docs/Help_ZH-CN/Topics/PSZ-Type.xml index f61e60500b..69cb010529 100644 --- a/docs/Help_ZH-CN/Topics/PSZ-Type.xml +++ b/docs/Help_ZH-CN/Topics/PSZ-Type.xml @@ -1,21 +1,26 @@  - - PSZ Type + + PSZ 类型 PSZ XSharp.__Psz
    - PSZ Type + PSZ 类型
    - This structure contains a pointer to a memory block with an Ansi string. When created with String2Psz() and Cast2Psz() then the compiler will take care of releasing these memory blocks. When created with other runtime functions such as StringAlloc() then you are responsible of releasing the memory yourself. - The internal type name for this type is XSharp.__Psz - Note - Please do not use the PSZ type for new code. It is only included for backward compatibility. - Even new code that calls the windows API can use a better alternative, for example using the [DllImportAttribute] from the framework + 该结构包含一个指向含有 Ansi 字符串的内存块的指针。如果使用 String2Psz() 和 Cast2Psz() 创建,编译器将负责释放这些内存块。如果使用其他运行时函数(如 StringAlloc())创建,则需要自行释放内存。 + + 该类型的内部类型名称是 XSharp.__Psz + + + 注意 + + 请不要在新代码中使用 PSZ 类型。它仅用于向后兼容。 + + 即使是调用 windows API 的新代码,也可以使用更好的替代方法,例如使用框架中的 [DllImportAttribute] 方法。 diff --git a/docs/Help_ZH-CN/Topics/PSZ.xml b/docs/Help_ZH-CN/Topics/PSZ.xml index 40b72a9d94..8642cdf5cc 100644 --- a/docs/Help_ZH-CN/Topics/PSZ.xml +++ b/docs/Help_ZH-CN/Topics/PSZ.xml @@ -1,6 +1,6 @@  - + PSZ PSZ @@ -9,9 +9,14 @@
    PSZ
    - The PSZ type is a pointer type that points to a null terminated sequence of zero or more bytes, typically representing a printable character string. This type is for backward compatibility only. Don't use this type in new code unless you have to. - Implementation - The PSZ type is implemented in the class XSharp.__Psz - The Usual type of PSZ  is 17. + + PSZ 类型是一种指针类型,指向一个由 0 个或多个字节组成的空端序列,通常代表一个可打印字符串。该类型仅用于向后兼容。除非必要,否则不要在新代码中使用这种类型。 + + + 实现 + + PSZ 类型在 XSharp.__Psz 类中实现。 + + PSZ 的 UsualType 值是 17。
    diff --git a/docs/Help_ZH-CN/Topics/PTR2.xml b/docs/Help_ZH-CN/Topics/PTR2.xml index 7d2431fda1..baca0dfd9b 100644 --- a/docs/Help_ZH-CN/Topics/PTR2.xml +++ b/docs/Help_ZH-CN/Topics/PTR2.xml @@ -1,6 +1,6 @@  - + PTR PTR @@ -9,6 +9,10 @@
    PTR
    - The PTR keyword denotes an integral type that stores a pointer to a memory location. It is usually compiled to the System.IntPtr .Net Type.
    Please note that the size of the PTR depends on the underlying operating system and it will also be different when your application runs in x86 or x64 mode.
    In Visual Objects PTR is always 32 bits. Many people have written code that CAST INT values to PTR and back. This works because both values are 32 bit in VO.
    Safe code in .Net cannot do this, since the size of PTR is not fixed.
    + + PTR 关键字表示一个整数类型,用于存储指向内存位置的指针。通常编译为 .Net 类型 System.IntPtr。 +
    请注意,PTR 的大小取决于底层操作系统,并且在应用程序以 x86 或 x64 模式运行时也会有所不同。
    +
    在 Visual Objects 中,PTR 总是 32 位。许多人编写了将 INT 值转换为 PTR 并返回的代码。这是因为 VO 中这两个值都是 32 位的。
    +
    在 .Net 中,安全的代码不能这样做,因为 PTR 的大小不是固定的。
    diff --git a/docs/Help_ZH-CN/Topics/Project-Items.xml b/docs/Help_ZH-CN/Topics/Project-Items.xml index 3bd156b689..ff13fb1e1a 100644 --- a/docs/Help_ZH-CN/Topics/Project-Items.xml +++ b/docs/Help_ZH-CN/Topics/Project-Items.xml @@ -1,9 +1,11 @@  - - Project Items + + 项目中的项 -
    Project Items
    - Enter topic text here. +
    + 项目中的项 +
    + -
    \ No newline at end of file +
    diff --git a/docs/Help_ZH-CN/Topics/Project-Properties.xml b/docs/Help_ZH-CN/Topics/Project-Properties.xml index 8f4dfa4fe6..cb5c766260 100644 --- a/docs/Help_ZH-CN/Topics/Project-Properties.xml +++ b/docs/Help_ZH-CN/Topics/Project-Properties.xml @@ -1,31 +1,33 @@  - - Project Properties + + 项目属性
    - Project Properties + 项目属性
    - There are several ways that you can set project properties in Visual Studio: - -
  • There is a <Myprojectname> Properties menu option in the Project Menu
  • -
  • There is a context menu option "Properties" on the project icons in the Solution Explorer
  • -
  • By choosing the context menu option "Open" on the Properties folder below the Project Icon in the Solution Explorer.
  • + 在 Visual Studio 中,有几种方法可以设置项目属性: + + +
  • 项目菜单中有一个 <Myprojectname> 属性菜单选项
  • +
  • 在 "解决方案资源管理器" 中的项目图标上有一个上下文菜单选项 "属性“
  • +
  • 在 "解决方案资源管理器 "中项目图标下方的 "属性 "文件夹上选择上下文菜单选项 "打开"。
  • - All these options do the same and open the project properties dialog. This dialog has several pages. - -
  • Application
  • -
  • Language
  • -
  • Dialect
  • -
  • Build
  • -
  • Build Events
  • -
  • Debug
  • -
  • Resources
  • -
  • Settings
  • + 所有这些选项的作用相同,都是打开项目属性对话框。该对话框有多个页面。 + + +
  • Application(应用程序)
  • +
  • Language(语言)
  • +
  • Dialect(方言)
  • +
  • Build(生成)
  • +
  • Build Events(生成事件)
  • +
  • Debug(调试)
  • +
  • 资源
  • +
  • 设置
  • - A description of each of these pages will follow in the next chapters. + 接下来的章节将逐一介绍这些页面。
    diff --git a/docs/Help_ZH-CN/Topics/Project-System.xml b/docs/Help_ZH-CN/Topics/Project-System.xml index 4efb01c7a6..d059383091 100644 --- a/docs/Help_ZH-CN/Topics/Project-System.xml +++ b/docs/Help_ZH-CN/Topics/Project-System.xml @@ -1,18 +1,19 @@  - - Project System + + 项目系统 .xsproj MsBuild
    - Project System + 项目系统
    - The X# Visual Studio project system allows you to create X# projects with Visual Studio. It has support for a special kind of project file format for X# (the .xsproj files) and it also recognizes various X# specific file types such as PRG files and several "binary" files for VO compatible Form, Server, Menu and FieldSpec definitions. - Part of this project system is the MsBuild support which uses the .xsproj files and creates command lines for the X# compiler based on properties and values in the .xsproj files. - The following chapters will briefly discuss solutions and projects and will describe the various project property pages for X# inside Visual Studio. + X# Visual Studio 项目系统允许你使用 Visual Studio 创建 X# 项目。它支持一种特殊的 X# 项目文件格式(.xsproj 文件),还能识别各种特定的 X# 文件类型,如 PRG 文件和几种用于 VO 兼容表单、服务器、菜单和 FieldSpec 定义的 "二进制 "文件。 + + 该项目系统的一部分是 MsBuild 支持,它使用 .xsproj 文件,并根据 .xsproj 文件中的属性和值为 X# 编译器创建命令行。 + 以下各章将简要讨论解决方案和项目,并介绍 Visual Studio 内 X# 的各种项目属性页面。
    diff --git a/docs/Help_ZH-CN/Topics/Project-Templates.xml b/docs/Help_ZH-CN/Topics/Project-Templates.xml index 7c73f8b50e..3cd9d66b5f 100644 --- a/docs/Help_ZH-CN/Topics/Project-Templates.xml +++ b/docs/Help_ZH-CN/Topics/Project-Templates.xml @@ -1,7 +1,7 @@  - - Project Templates + + 项目模板 ClassLibrary Console Application @@ -18,409 +18,413 @@
    - Project Templates + 项目模板
    - The X# Visual Studio integration comes with the following project templates: + + X# Visual Studio 集成包含以下项目模板:
    - Keyword + 关键字 - Description + 描述
    - Integer Literals + Integer 字面量
    - Real Liteals + Real 字面量
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    + - Template + + 模板 - Description + + 描述 - Required Framework
    version
    +
    + 需要的 Framework 版本 - Default Dialect + + 默认方言 - References + + References
    + + ClassLibrary - A project for creating a X# class library (.dll) for the Core dialect with no dependencies on the runtime + + 为 Core 方言创建 X# 类库(.dll)的项目,不依赖运行时 + 2.0 + Core - System, and some extensions for frameworks > 3.5 + + System 以及针对 frameworks > 3.5 的一些扩展
    + + Core ClassLibrary - A project for creating a X# class library (.dll) for the Core dialect with a dependency on XSharp.Core + + 一个为 Core 方言创建 X# 类库(.dll)的项目,依赖于 XSharp.Core + 2.0 + Core - System, X# Core and some extensions for frameworks > 3.5 + + System,X# Core 和 frameworks > 3.5 的一些扩展
    + + FoxPro ClassLibrary - A project for creating a X# class library (.dll) for the FoxPro Dialect + + 使用  FoxPro 方言创建 X# 类库(.dll)的项目 + 2.0 + FoxPro - System, X# Core, VFP and some extensions for frameworks > 3.5 + + System,X# Core,VFP 和 frameworks > 3.5 的一些扩展
    + + VO ClassLibrary + A project for creating a X# class library (.dll) for the VO Dialect + 2.0 + Visual Objects + System, X# Core, VO and some extensions for frameworks > 3.5
    + + Vulcan ClassLibrary + A project for creating a X# class library (.dll) for the Vulcan Dialect + 2.0 + Vulcan + System, X# Core, Vulcan and some extensions for frameworks > 3.5
    + + XPP ClassLibrary + A project for creating a X# class library (.dll) for the Xbase++ Dialect + 2.0 + Xbase++ + System, X# Core, XPP and some extensions for frameworks > 3.5
    + + Console Application + A project for creating a X# command-line application in the core dialect. + 2.0 + Core + System, and some extensions for frameworks > 3.5
    + + FoxPro Console Application - A project for creating a X# command-line application in the FoxPro Dialect. + + 使用 FoxPro 方言创建 X# 命令行应用的项目模板。 + 2.0 + FoxPro - System, VFP, and some extensions for frameworks > 3.5 + + System,VFP 和 frameworks > 3.5 的一些扩展
    + + VO Console Application + A project for creating a X# command-line application in the VO Dialect. + 2.0 + Visual Objects + System, VO, and some extensions for frameworks > 3.5
    + + Vulcan Console Application + A project for creating a X# command-line application in the Vulcan dialect with Vulcan Runtime Assemblies (BYOR = Bring Your Own Runtime). + 2.0 + Vulcan + System, Vulcan, and some extensions for frameworks > 3.5
    + + XPP Console Application + A project for creating a X# class library (.dll) for the Xbase++ Dialect + 2.0 + Xbase++ + System, XPP, and some extensions for frameworks > 3.5
    + + Windows Forms Application - A project for creating an application with a Windows Forms user interface. + + 一个用于创建具有 Windows 窗体用户界面的应用程序的项目。 + 2.0 + Core - System, and some extensions for frameworks > 3.5
    System.Drawing
    System.Windows.Forms
    +
    + System 和 frameworks > 3.5 的一些扩展
    System.Drawing
    System.Windows.Forms
    + + WPF Application - Windows Presentation Foundation client application. + + Windows Presentation Foundation 客户端程序。 + 3.0 + Core - System, and some extensions for frameworks > 3.5
    WindowsBase, PresentationCore, PresentationFramework
    +
    + System 和 frameworks > 3.5 的一些扩展
    WindowsBase, PresentationCore, PresentationFramework
    + + VO MDI Application + A project for creating a VO MDI application in the VO Dialect. + 4.6 + Visual Objects + System and some extensions for frameworks > 3.5
    + + VO SDI Application + A project for creating a VO SDI application in the VO Dialect. + 4.6 + Visual Objects + System and some extensions for frameworks > 3.5
    + + Vulcan Console Application + A project for creating a Vulcan command-line application. + 2.0 + Vulcan + System, and some extensions for frameworks > 3.5
    VulcanRT and VulcanRTFuncs
    + + Ms Test Library - A Library with test support using the MsTest Framework + + 使用 MsTest 框架的测试支持库 + 2.0 + Core - System and several MsTest related assemblies + + System 和几个与 MsTest 相关的程序集
    + + NUnit Test Library - A library with test support using the open source NUnit Framework + + 使用开源 NUnit 框架提供测试支持的库 + 2.0 + Core - System and several NUnit  related assemblies.
    The template uses a NuGet package to retrieve the correct assemblies
    +
    + System 和几个与 NUnit 相关的程序集。 + 该模板使用 NuGet 软件包检索正确的程序集
    + + XUnit Test Library - A library with test support using the open source XUnit Framework + + 使用开源 XUnit 框架支持测试的库 + + 2.0 + Core - System and several XUnit  related assemblies.
    The template uses a NuGet package to retrieve the correct assemblies
    +
    + System 和几个与 XUnit 相关的程序集。 + 该模板使用 NuGet 软件包检索正确的程序集
    diff --git a/docs/Help_ZH-CN/Topics/Projects.xml b/docs/Help_ZH-CN/Topics/Projects.xml index 42f508f6b1..4d4dfc5847 100644 --- a/docs/Help_ZH-CN/Topics/Projects.xml +++ b/docs/Help_ZH-CN/Topics/Projects.xml @@ -1,29 +1,39 @@  - - Projects + + 项目 ItemGroup PropertyGroup
    - Projects + 项目
    - Project properties in Visual Studio are stored in the project files. The file names for X# projects end with the .xsproj extension. - Project files are a special kind of XML files. - These XML files contains various groups of information. - Properties at the project level are stored in <PropertyGroup> nodes. - Some of these properties are "Global" and some of these properties have a condition through which they are only active when a certain "configuration" is selected, such as "Debug" or "Release". - Properties as the dialect and the output filename are global. - Properties such as the optimization, PDB generation and output folders are configuration specific. - - The project files also contain the list of references to external assemblies, other projects and COM components and the list of files. - The build system inside Visual Studio uses the contents of the project files and construct a commandline that is passed to the X# compiler to produce the output for the project. - We have developed a set of dialogs that allows you to set the various properties for a project. The following chapters will show you these dialogs and will discuss the various options that you can set on each page. -
    Tip

    Since the project file is a XML file you can also directly edit the project file if you want and for example add <Import> lines to import common properties from "include" files.
    We use that internally for our assemblies, so common properties are declared at one location.
    If you do that then you must be careful when using the project property dialogs inside Visual Studio.
    These dialogs will not understand that some values were read from an imported file and will change the values in the xsproj file, even when they were imported from an external file.
    Also the order of the various property groups is important:
    The PropertyGroups with the Pre and PostBuild events are expected to be at the end of the XML file.
    - - The lists of external references and lists of items inside a project are stored in <ItemGroup> nodes. + + Visual Studio 中的项目属性存储在项目文件中。X# 项目的文件名以 .xsproj 扩展名结尾。 + + 项目文件是一种特殊的 XML 文件。 + + 这些 XML 文件包含各种信息组。 + + 项目级别的属性存储在 <PropertyGroup> 节点中。 + + 其中有些属性是 "全局 "属性,有些属性则有一个条件,只有在选择了特定 "配置"(如 "Debug "或 "Release")时才会激活。 + + 方言和输出文件名等属性是全局属性。 + + 优化、PDB 生成和输出文件夹等属性是特定配置。 + + + 项目文件还包含外部程序集、其他项目和 COM 组件的引用列表以及文件列表。 + + Visual Studio 内部的生成系统会使用项目文件的内容,并构建一条命令行,将其传递给 X# 编译器,以生成项目的输出结果。 + + 我们开发了一组对话框,允许你设置项目的各种属性。以下章节将向您展示这些对话框,并讨论您可以在每个页面上设置的各种选项。 +
    提示

    由于项目文件是一个 XML 文件,因此如果需要,你也可以直接编辑项目文件,例如添加 <Import> 行,从 "include "文件中导入常用属性。
    我们内部对程序集使用这种方法,因此常用属性都在一个位置声明。
    如果这样做,那么在使用 Visual Studio 内部的项目属性对话框时就必须小心。
    这些对话框无法理解某些值是从导入文件中读取的,因此会更改 xsproj 文件中的值,即使这些值是从外部文件中导入的。
    此外,各种属性组的顺序也很重要:
    带有预构建和后构建事件的 PropertyGroups 应位于 XML 文件的末尾。
    + + 外部引用列表和项目内部的项目列表存储在 <ItemGroup> 节点中。 diff --git a/docs/Help_ZH-CN/Topics/PropPage-Application.xml b/docs/Help_ZH-CN/Topics/PropPage-Application.xml index 9e6477b9f5..a0ca1ef915 100644 --- a/docs/Help_ZH-CN/Topics/PropPage-Application.xml +++ b/docs/Help_ZH-CN/Topics/PropPage-Application.xml @@ -1,7 +1,7 @@  - - Application + + Application(应用程序) Application Icon Assembly Name @@ -26,163 +26,177 @@
    - Application + Application(应用程序)
    - The Application page contains the most important settings for your Visual Studio project - + 应用程序页面包含 Visual Studio 项目最重要的设置。 + + - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - Item + + 项目 - Description + + 描述 - Command item + 命令行选项
    + Default Namespace + (默认命名空间) - Specifies the default namespace for added items, such as classes, that are added via the Add New Item Dialog Box. + + 为通过添加新项目对话框添加的项目(如类)指定默认命名空间。 - This is not a commandline option for the compiler but used by Visual Studio. + 这不是编译器的命令行选项,但 Visual Studio 使用它。
    + Dialect + (方言) - Select the compiler dialect to use when compiling this project. Changing the dialect may also change the 'Allow NamedArguments' setting on the Language page." + + 选择编译此项目时要使用的编译器方言。更改方言也可能会更改语言页面上的'Allow Named Arguments'(允许命名参数)设置。 -dialect
    + Output Type + (输出类型) - The type of application to build. + + 要创建的应用程序类型。
    + Startup Object + (启动对象) - The name of the class that contains the Start method that you want called when you launch your application. - The default for X# applications is the Start function inside the compiler generated Functions class. - You can override this setting by specifying another classname here. + + 类的名称,该类包含启动应用程序时需要调用的 Start 方法。 + X# 应用程序默认使用编译器生成的 Functions 类中的 Start 函数。 + 您可以在此处指定另一个类名来覆盖此设置。 -main:
    + Target Framework Moniker + (目标框架) - The version of the Common Language Runtime to use for output assembly. + + 输出程序集所使用的公共语言运行时版本。 - This is not a commandline option for the compiler but controls the location from which reference assemblies are loaded. + 这不是编译器的命令行选项,而是控制加载参考程序集的位置。
    + Assembly Name + (程序集名) - The name of the output file that will hold assembly metadata. + + 输出文件的名称,该文件将保存程序集元数据。 -out
    + Output File + (输出文件) - The name of the protject's primary output file. + + 项目的主要输出文件名。 - This is derived from the assembly name + 该名称源自程序集名称
    + Project File + (项目文件) - The name of the file containing build, configuration, and other information about the project. + + 包含项目的构建、配置和其他信息的文件名。 - This is the name from the current project + 这是当前项目的名称
    + Project Folder + (项目目录) - The absolute location of the project + + 项目的绝对位置 - This is the location from the current project + 这是当前项目的位置
    + Application Icon + (应用程序图标) - Sets the .ico file to use as your application icon. Please note that if your application contains native resources then this value will be ignored. + + 设置用作应用程序图标的 .ico 文件。请注意,如果您的应用程序包含本地资源,该值将被忽略。 -win32icon
    + Prefer native resource over managed resource + (优先选择本地资源而非托管资源) - When your application includes a native resource, use this native resource and do not generate a resource based on the global assembly properties such as AssemblyTitle, AssemblyVersion etc. + + 当您的应用程序包含本地资源时,请使用该本地资源,而不要根据 AssemblyTitle、AssemblyVersion 等全局程序集属性生成资源。 -usenativeversion
    + Suppress default Win32 manifest + (禁止默认的 Win32 清单) - Suppress default Win32 manifest. You will have to supply your own Win32 manifest if you suppress the default one. + + 如果选择,则必须提供自己的 Win32 清单。 -nowin32manifest
    + Vulcan Compatible Managed Resources + (Vulcan 兼容管理资源) - Use Vulcan Compatible Managed Resources (when 'True' then resources files are included in the assembly without namespace prefix. When 'False' then the resource files are prefixed with the namespace of the app, just like in other .Net languages, such as C#) + + 使用 Vulcan 兼容托管资源(当为 "真 "时,资源文件包含在程序集中,不带命名空间前缀。当 "为假 "时,资源文件将以应用程序的命名空间作为前缀,就像其他 .Net 语言一样,如 C# 语言) -resource diff --git a/docs/Help_ZH-CN/Topics/PropPage-Build.xml b/docs/Help_ZH-CN/Topics/PropPage-Build.xml index f9ac98ba75..7029eaeeb4 100644 --- a/docs/Help_ZH-CN/Topics/PropPage-Build.xml +++ b/docs/Help_ZH-CN/Topics/PropPage-Build.xml @@ -1,7 +1,7 @@  - - Build + + Build(生成) Code Signing KeyFile -d @@ -36,219 +36,238 @@
    - Build + Build(生成)
    - The Build properties page contains Configuration Specific properties. So you can have different properties here for a Debug and a Release configuration. Please read the Build Configuration topic for more information about build configurations - + 生成页面包含特定配置的属性。因此,Debug 配置和 Release 配置可以有不同的属性。有关生成配置的更多信息,请阅读生成配置 。 + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/docs/Help_ZH-CN/Topics/PropPage-BuildEvents.xml b/docs/Help_ZH-CN/Topics/PropPage-BuildEvents.xml index 7a468c3091..c48dd3fbfa 100644 --- a/docs/Help_ZH-CN/Topics/PropPage-BuildEvents.xml +++ b/docs/Help_ZH-CN/Topics/PropPage-BuildEvents.xml @@ -1,14 +1,15 @@  - - Build Events + + Build Events(生成事件)()
    - Build Events + Build Events(生成事件)()
    - On the Build Events property page you can specify command lines that need to be run before or after the build process. - You can use this for example to run a tool that generates source code or to copy the output DLLs to another folder. - + 在 "生成事件 "属性页面,你可以指定需要在编译过程之前或之后运行的命令行。 + 例如,您可以用它来运行一个生成源代码的工具,或将输出 DLL 复制到另一个文件夹。 + + s
    diff --git a/docs/Help_ZH-CN/Topics/PropPage-Debug.xml b/docs/Help_ZH-CN/Topics/PropPage-Debug.xml index 93c5734a42..13d6993ea8 100644 --- a/docs/Help_ZH-CN/Topics/PropPage-Debug.xml +++ b/docs/Help_ZH-CN/Topics/PropPage-Debug.xml @@ -1,7 +1,7 @@  - - Debug + + Debug(调试) Command Command Arguments @@ -13,69 +13,74 @@
    - Debug + Debug(调试)
    - +
    - Item + + 项目 - Description + + 描述 - Command item + + 命令行选项
    + Platform Target + (平台目标) - Select the platform target when compiling this project. This should be AnyCPU, X86, x64,Arm or Itanium. + + 编译此项目时选择平台目标。应为 AnyCPU、X86、x64、Arm 或 Itanium。 + -platform
    + Prefer 32 Bit + (首选32位) - Prefer 32 bit when AnyCpu platform is selected. + + 选择 AnyCpu 平台时,首选 32 位。 + -platform
    + Intermediate Output Path + (中间输出路径) - Intermediate Output Path  (macros are allowed). + + 中间输出路径(允许使用宏)。 - used by Visual Studio/MsBuild + + Visual Studio/MsBuild 使用
    + Output Path + (输出路径) - Output Path (macros are allowed). + + 输出路径(允许使用宏)。 - used by Visual Studio/MsBuild + + Visual Studio/MsBuild 使用
    + Code Signing KeyFile + (代码签名密钥文件) - Choose a code signing key file. + + 选择代码签名密钥文件。 + -keyfile
    + Delayed sign only + (只有延迟标识) - Delayed signing. + + 延迟签署。 + -delaysign
    + Sign the output assembly + (对输出程序集进行签名) - Sign the assembly + + 对程序集进行签名。 + -keyfile
    + Extra Command Line Options + (额外命令行选项) - User-Defined Command Line options. + + 用户自定义命令行选项。 - you can specify additional commandline options here + + 您可以在此处指定额外的命令行选项
    + Optimize + (优化) - Should compiler optimize output? + + 编译器应优化输出吗? + -optimize
    + Register for COM interop + (注册 COM 互操作) - Register the output assembly for COM Interop (requires administrator rights + + 注册 COM Interop 的输出程序集(需要管理员权限)。 - This will run a tool after the build process to register the assembly for COM interop. + + 这将在生成后运行一个工具,为 COM 互操作注册程序集。
    + Use Shared Compiler + (使用共享编译器) - Should the shared compiler be used to compile the project? (Faster, but may hide some compiler errors) + + 是否应该使用共享编译器来编译项目?(更快,但可能会隐藏一些编译器错误) + -shared
    + Defines for the preprocessor + (为预处理器定义) - Defines for the preprocessor. + + 为预处理器定义。 + -define
    + Generate preprocessor output + (生成预处理器输出) - Save the output from the preprocessor to .ppo files. + + 将预处理器的输出保存为 .ppo 文件。 + -ppo
    + Suppress Specific Warnings + (禁止特定的警告) - Specify a list of warnings to suppress. + + 指定要禁止的警告列表。 + -nowarn
    + Warning Level + (警告级别) - Set the warning level to a value between 0 and 4. + + 将警告级别设置为 0 至 4 之间的值。 + -warn
    + Warnings As Errors + (将警告视为错误) - Treat warnings as errors. + + 将警告视为错误。 + -warnaserror
    + Generate XML doc comments file + (生成 XML 文档注释文件) - Generate XML doc comments file. + + 生成 XML 文档注释文件。 + -doc
    + XML doc comments file name + (XML 文档注释文件名) - XML doc comments file name. + + XML 文档注释文件名。 + -doc
    - - - - - - - - - - - - - - - - - -
    - Item + + 项目 - Description + + 描述 - Command item + + 命令行选项
    + Command + (命令) - The debug command to execute. + + 要执行的调试命令。 +
    + Command Arguments + (命令行参数) - The command line arguments to pass to the application. + + 要传递给应用程序的命令行参数。 +
    + Generate Debug Information + (生成调试信息) - Generate Debug Information (none, full, pdbonly). + + 生成调试信息(无、完整、pdbonly)。 +
    + Working Directory + (工作目录) - The application's working directory. By default, the directory containing the project file. + + 应用程序的工作目录。默认情况下是包含项目文件的目录。 +
    + Enable unmanaged debugging + (启用非托管调试) - Enable unmanaged debugging. + + 启用非托管调试。 +
    diff --git a/docs/Help_ZH-CN/Topics/PropPage-Dialect.xml b/docs/Help_ZH-CN/Topics/PropPage-Dialect.xml index 49a37cceed..0875d149a3 100644 --- a/docs/Help_ZH-CN/Topics/PropPage-Dialect.xml +++ b/docs/Help_ZH-CN/Topics/PropPage-Dialect.xml @@ -1,7 +1,7 @@  - - Dialect + + Dialect(方言) -fox1 -fox2 @@ -25,243 +25,265 @@
    - Dialect + Dialect(方言)
    - The Dialect page contains some additional language settings. Some of these settings apply to all dialects. Others only apply to the given dialect and will only be enabled when the appropriate dialect is chosen. - + 方言页面包含一些额外的语言设置。其中一些设置适用于所有方言。其他设置只适用于给定的方言,只有在选择了相应方言时才会启用。 + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/docs/Help_ZH-CN/Topics/PropPage-Language.xml b/docs/Help_ZH-CN/Topics/PropPage-Language.xml index 04eb0c65c0..6526028005 100644 --- a/docs/Help_ZH-CN/Topics/PropPage-Language.xml +++ b/docs/Help_ZH-CN/Topics/PropPage-Language.xml @@ -1,7 +1,7 @@  - - Language + + Language(语言) Additional Include paths Allow Late Binding @@ -46,221 +46,240 @@
    - Language + Language(语言)
    - The Language page contains some settings that control X# Language specific options. These settings apply to all dialects. + + 语言页面包含一些控制 X# 语言特定选项的设置。这些设置适用于所有方言。
    - Item + + 项目 - Description + + 描述 - Command item + + 命令行选项
    + All instance methods virtual + (虚拟所有实例化方法) - Add the virtual modifier to all methods by default (which is the normal Visual Objects behavior). + + 默认情况下在所有方法中添加虚拟修饰符(这是 Visual Objects 的正常行为)。 + -vo3
    + Allow Init() and Axit() as aliases for Constructor/Destructor + (允许将 Init() 和 Axit() 作为 Constructor/Destructor 的别名) - Allow Init() and Axit() as aliases for Constructor/Destructor. + + 允许将 Init() 和 Axit() 作为 Constructor/Destructor 的别名。 + -vo1
    + Compatible IIF Behavior + (兼容 IIF 行为) - Compatible IIF Behavior, allow different types of return values in TRUE and FALSE expression. + + 兼容 IIF 行为,允许在 TRUE 和 FALSE 表达式中使用不同类型的返回值。 + -vo10
    + Compatible preprocessor + (兼容预处理器) - Makes the preprocessor case insensitive and also controls how #ifdef inspects #defines. + + 使预处理器对大小写不敏感,并控制 #ifdef 如何检查 #defines。 + -vo8
    + Handle problems with incorrect or missing return statements + (处理不正确或缺少 return 语句的问题) - Allow missing return statements or allow return statements with incorrect return values. + + 允许缺少 Return 语句,或允许 Return 语句带有不正确的返回值。 + -vo9
    + Implicit numeric conversions + (隐式数值转换) - Implicit numeric integer conversions + + 隐式数值整数转换。 + -vo4
    + Initialize strings + (初始化字符串) - Initialize strings to empty string (String.Empty). - Please note that in .NET a NULL_STRING is not the same as a string with length 0. When enabled this will initialize local string variables regardless of the setting of 'initialize locals' setting from the Language page. + + 将字符串初始化为空字符串(String.Empty)。 + 请注意,在 .NET 中,NULL_STRING 与长度为 0 的字符串不同。 启用后,无论 Language 页面中的 "Initialize Local variables"(初始化局部变量 )设置如何,都将初始化本地字符串变量。 + -vo2
    + Clipper Compatible intiger divisions + (Clipper 兼容整数除法) - Compatible integer divisions, integer divisions may return a float. + + 与整数除法兼容,整数除法可返回浮点数。 + -vo12
    + Compatible numeric conversions + (兼容数值转换) - Compatible arithmetic conversions. + + 兼容算术转换。 + -vo11
    + Compatible string comparisons + (兼容字符串比较) - Compatible string comparisons, respects SetExact and collation table. + + 兼容的字符串比较,遵循 Set Exact 和排序规则表。 + -vo13
    + Generate Clipper constructors + (生成 Clipper 构造函数) - Automatically create clipper calling convention constructors for classes without constructor where the parent class has a Clipper Calling convention constructor. + + 为没有构造函数的类自动创建 clipper 调用约定构造函数,其中父类具有 Clipper 调用约定构造函数。 + -vo16
    + Implicit casts and conversions + (隐式强制转换和转换) - Compatible implicit casts and Conversions. + + 兼容隐式强制转换和转换。 + -vo7
    + Implicit Clipper calling convention + (隐式 Clipper 调用约定) - Methods without parameters and calling convention are compiled as Clipper calling convention. - Please note that without this switch all methods without parameters will be seen as STRICT. Methods with untyped parameters are always seen as CLIPPER calling convention. + + 没有参数和调用约定的方法被编译为 Clipper 调用约定。 + 请注意,如果没有此开关,所有没有参数的方法都将被视为 STRICT。具有非类型化参数的方法始终被视为 CLIPPER 调用约定。 + -vo5
    + Implicit pointer conversions + (隐式指针转换) - Implicit conversions between typed function PTR and PTR. + + 类型化函数 PTR 和 PTR 之间的隐式转换。 + -vo6
    + Treat missing types as USUAL + (缺失类型常规处理为 USUAL) - Missing type clauses for locals, instance variables and parameters are treated as USUAL (VO and Vulcan dialect). The default = TRUE for the VO dialect and FALSE for the other dialects. We strongly recommend to set this to FALSE because this will help you to find problems in your code and non optimal code. If you have to use the USUAL type we recommend to explicitly declare variables and parameters as USUAL. + + 局部变量、实例变量和参数的缺失类型子句被视为 USUAL(VO 和 Vulcan 方言)。VO 方言的默认值 = TRUE,其他方言的默认值 = FALSE。强烈建议将其设置为 FALSE,因为这将帮助您查找代码中的问题和非最佳代码。如果必须使用 USUAL 类型,我们建议将变量和参数显式声明为 USUAL。 + -vo15
    + Use FLOAT literals + (使用 FLOAT 字面量) - Store floating point literals as FLOAT and not as System.Double (REAL8). + + 将浮点字面量存储为 FLOAT,而不是 System.Double (REAL8)。 + -vo14
    + Compatible BEGIN SEQUENCE .. END + (兼容 BEGIN SEQUENCE .. END) - Generate code to fully implement the VO compatible BEGIN SEQUENCE .. END SEQUENCE. The compiler generates calls to the runtime functions _SequenceError and _SequenceRecover that you may override in your own code. + + 生成代码以完全实现与 VO 兼容的 BEGIN SEQUENCE ... END SEQUENCE。编译器会生成对运行时函数 _SequenceError 和 _SequenceRecover 的调用,您可以在自己的代码中覆盖这些函数。 + -vo17
    + Inherit from Custom class + (继承自 Custom 类) - All classes are assumed to inherit from the Custom class. This also affects the way in which properties are processed by the compiler. + + 所有类都假定继承自 Custom 类。这也会影响编译器处理属性的方式。 + -fox1
    + Compatible Array Handling + (兼容数组处理) - FoxPro compatible array handling (Allows parenthesized arrays and assigning a single value to an array to fill all elements).
    WARNING Allowing parenthesized arrays may slow down the execution of your program !(/fox2)
    +
    + 兼容 FoxPro 的数组处理(允许使用括号数组和为数组赋值以填充所有元素)。 + 警告 允许使用括号数组可能会减慢程序的执行速度 !(/fox2) + -fox2
    + Inherit from Abstract class + (继承自 Abstract 类) - All classes without parent class inherit from the XPP Abstract class. + + 所有没有父类的类都继承自 XPP Abstract 类。 + -xpp1
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/docs/Help_ZH-CN/Topics/PropPage-Resources.xml b/docs/Help_ZH-CN/Topics/PropPage-Resources.xml index f1ad6d6d1a..bef84ae848 100644 --- a/docs/Help_ZH-CN/Topics/PropPage-Resources.xml +++ b/docs/Help_ZH-CN/Topics/PropPage-Resources.xml @@ -1,28 +1,30 @@  - - Resources + + 资源 Custom tool resource editor
    - Resources + 资源
    - The Resources Property page allows you to open up a resources editor for project wide resources. These resources can be files, strings, images etc. - The Resource editor is the normal Visual Studio resource editor. - + 通过资源页面,您可以为项目范围内的资源打开一个资源编辑器。这些资源可以是文件、字符串、图像等。 + 资源编辑器是普通的 Visual Studio 资源编辑器。 - This resource editor will generate a Resources.Resx file in the Properties folder of the project. - The "Access Modifier" combobox at the top of the screen allows you to control the code generation for these resources: - -
  • With (Custom) then no code will be generated
  • -
  • With "Internal" then X# code will be generated with internal visibility
  • -
  • With "Public" then X# code will be generated with public visibility
  • + + + 该资源编辑器将在项目的 "属性 "文件夹中生成一个 Resources.Resx 文件。 + 通过屏幕顶部的 "访问修改器 "组合框,可以控制这些资源的代码生成: + + +
  • 如果使用(自定义),则不会生成代码
  • +
  • 如果使用 "内部",则将生成具有内部可见性的 X# 代码
  • +
  • 如果使用 "公共",则将生成具有公共可见性的 X# 代码
  • - The value of the Access Modifier also sets the "Custom tool" in the properties dialog for the Resources.Resx file. + 访问修饰符的值还会在 Resources.Resx 文件的属性对话框中设置 "自定义工具"。
    diff --git a/docs/Help_ZH-CN/Topics/PropPage-Settings.xml b/docs/Help_ZH-CN/Topics/PropPage-Settings.xml index 64d9ee33da..f6916c5168 100644 --- a/docs/Help_ZH-CN/Topics/PropPage-Settings.xml +++ b/docs/Help_ZH-CN/Topics/PropPage-Settings.xml @@ -1,7 +1,7 @@  - - Settings + + 设置 app.config Custom Tool @@ -10,47 +10,46 @@
    - Settings + 设置
    - Application settings enable you to store application information dynamically. - -
    Settings allow you to store information on the client computer that should not be included in the application code (for example a connection string), user preferences, and other information you need at run time.
    - Each application setting must have a unique name. The name can be any combination of letters, numbers, or an underscore that does not start with a number, and it cannot have spaces. The name is changed through the Name property. + 应用程序设置可以动态存储应用程序信息。 - Application settings can be stored as any data type that is serialized to XML or has a TypeConverter that implements ToString/FromString. The most common types are String, Integer, and Boolean, but you can also store values as Color, Object, or as a connection string. + +
    设置允许您在客户端计算机上存储不应包含在应用程序代码中的信息(例如连接字符串)、用户偏好以及运行时需要的其他信息。
    + 每个应用程序设置都必须有一个唯一的名称。名称可以是字母、数字或下划线的任意组合,但不能以数字开头,也不能有空格。名称可通过 "名称 "属性更改。 - Application settings also hold a value. The value is set with the Value property and must match the data type of the setting. + 应用程序设置可存储为任何可序列化为 XML 或具有实现 ToString/FromString 的 TypeConverter 的数据类型。最常见的类型是字符串、整数和布尔,但也可以将值存储为颜色、对象或连接字符串。 - In addition, application settings can be bound to a property of a form or control at design time. + 应用程序设置也有一个值。值通过 Value 属性设置,且必须与设置的数据类型相匹配。 - There are two types of application settings, based on scope: - -
  • Application-scoped settings can be used for information such as a URL for a web service or a database connection string. These values are associated with the application. Therefore, users cannot change them at run time.
  • -
  • User-scoped settings can be used for information such as persisting the last position of a form or a font preference. Users can change these values at run time.
  • -
    - - You can change the type of a setting by using the Scope property. + 此外,还可以在设计时将应用程序设置绑定到表单或控件的属性上。 - The project system stores application settings in two XML files: + 根据范围的不同,有两种类型的应用程序设置: - -
  • an app.config file, which is created at design time when you create the first application setting
  • -
  • a user.config file, which is created at run time when the user who runs the application changes the value of any user setting.
  • + +
  • 应用范围设置可用于网络服务的 URL 或数据库连接字符串等信息。这些值与应用程序相关联。因此,用户无法在运行时更改它们。
  • +
  • 用户作用域设置可用于持久化表单最后位置或字体偏好等信息。用户可以在运行时更改这些值。
  • - Notice that changes in user settings are not written to disk unless the application specifically calls a method to do this. + 使用范围属性可以更改设置的类型。 - The Settings Property page allows you to open up a settings editor for project settings. The definition for these settings will be stored in the Properties folder of your project. - The values of these settings will be stored in a app.config file in the root folder of your project. + 项目系统会在两个 XML 文件中存储应用程序设置: - Just like in the resource editor you can also choose the visibility of the generated code (the IDE generates a file called Settings.Designer.prg). This also changes the "Custom Tool" property of the Settings file. + +
  • app.config 文件,在设计时创建第一个应用程序设置时创建
  • +
  • user.config 文件,在运行应用程序的用户更改任何用户设置值时创建。
  • +
    + 请注意,用户设置的更改不会写入磁盘,除非应用程序专门调用一种方法来实现这一点。 + 通过 "设置属性 "页面,您可以打开项目设置的设置编辑器。这些设置的定义将保存在项目的 "属性 "文件夹中。 + 这些设置的值将存储在项目根文件夹下的 app.config 文件中。 - When you compile your project then MsBuild will generate a copy of app.config and will rename it to <yourapp>.exe.config in the output folder of your project. + 与资源编辑器一样,您也可以选择生成代码的可见性(集成开发环境会生成一个名为 Settings.Designer.prg 的文件)。这也会更改设置文件中的 "自定义工具 "属性。 + 编译项目时,MsBuild 会生成一份 app.config 副本,并将其重命名为项目输出文件夹中的 <yourapp>.exe.config。
    diff --git a/docs/Help_ZH-CN/Topics/Quick-Start.xml b/docs/Help_ZH-CN/Topics/Quick-Start.xml index 02f387d0ce..208334fc5f 100644 --- a/docs/Help_ZH-CN/Topics/Quick-Start.xml +++ b/docs/Help_ZH-CN/Topics/Quick-Start.xml @@ -1,10 +1,10 @@  - - Quick Start + + 快速入门
    - Quick Start + 快速入门
    diff --git a/docs/Help_ZH-CN/Topics/REAL4.xml b/docs/Help_ZH-CN/Topics/REAL4.xml index 053bb56b4d..b370a52466 100644 --- a/docs/Help_ZH-CN/Topics/REAL4.xml +++ b/docs/Help_ZH-CN/Topics/REAL4.xml @@ -1,6 +1,6 @@  - + REAL4 REAL4 @@ -9,7 +9,8 @@
    REAL4
    - The REAL4 keyword denotes a single precision 32 bit number with values ranging from negative 3.402823e38 to positive 3.402823e38, as well as positive or negative zero, PositiveInfinity, NegativeInfinity, and not a number ( NaN). It is intended to represent values that are extremely large (such as distances between planets or galaxies) or extremely small (such as the molecular mass of a substance in kilograms) and that often are imprecise (such as the distance from earth to another solar system). The REAL4 type complies with the IEC 60559:1989 (IEEE 754) standard for binary floating-point arithmetic. + + REAL4关键字表示单精度32位数字,取值范围从负3.402823e38到正3.402823e38,以及正零、负零、正无穷大、负无穷大和非数字(NaN)。它旨在表示极大值(例如行星或星系之间的距离)或极小值(例如物质的分子质量以千克为单位),通常是不精确的(例如地球到另一个太阳系的距离)。REAL4类型符合IEC 60559:1989(IEEE 754)标准的二进制浮点运算。
    diff --git a/docs/Help_ZH-CN/Topics/REAL8.xml b/docs/Help_ZH-CN/Topics/REAL8.xml index 9e674021c7..d8d9058215 100644 --- a/docs/Help_ZH-CN/Topics/REAL8.xml +++ b/docs/Help_ZH-CN/Topics/REAL8.xml @@ -1,6 +1,6 @@  - + REAL8 REAL8 @@ -9,7 +9,8 @@
    REAL8
    - The REAL8 keyword denotes an double precision 64-bit number with values ranging from negative 1.79769313486232e308 to positive 1.79769313486232e308, as well as positive or negative zero, PositiveInfinity, NegativeInfinity, and not a number ( NaN). It is intended to represent values that are extremely large (such as distances between planets or galaxies) or extremely small (the molecular mass of a substance in kilograms) and that often are imprecise (such as the distance from earth to another solar system), The Double type complies with the IEC 60559:1989 (IEEE 754) standard for binary floating-point arithmetic. + + REAL8 关键字表示双精度 64 位数字,取值范围从负 1.79769313486232e308 到正 1.79769313486232e308,还包括正零、负零、正无穷大、负无穷大和非数字(NaN)。它旨在表示极大值(如行星或星系之间的距离)或极小值(物质的分子质量以千克为单位),通常是不精确的(如地球到另一个太阳系的距离)。Double 类型符合 IEC 60559:1989(IEEE 754)标准的二进制浮点运算。
    diff --git a/docs/Help_ZH-CN/Topics/RealLiterals.xml b/docs/Help_ZH-CN/Topics/RealLiterals.xml index 603d2b27e2..26fbc31774 100644 --- a/docs/Help_ZH-CN/Topics/RealLiterals.xml +++ b/docs/Help_ZH-CN/Topics/RealLiterals.xml @@ -1,7 +1,7 @@  - - Floating point Literals + + Floating point 字面量 Currency Currency Literal @@ -11,55 +11,57 @@
    - Floating point Literals + Floating point 字面量
    - Single or double precision literals may be used to store numeric values in your code. + 单精度或双精度字面量可用于在代码中存储数值。 123.456
    123.0
    0.123
    .123
    123.456e+7
    123.456e-7
    $123.45
    - Real literals may have one of the following suffixes: + Real 字面量可以有以下后缀之一:
    - Item + + 项目 - Description + + 描述 - Command item + + 命令行选项
    + Allow Late Binding + (允许后期绑定) - Allow property access and method calls on expressions of type OBJECT and USUAL. + + 允许对 OBJECT 和 USUAL 类型的表达式进行属性访问和方法调用。 + /lb
    + Allow Named Arguments + (允许命名参数) - Allow named arguments (Default = TRUE for the Core dialect and FALSE for the other dialects). Changing the dialect may also automatically change this setting. + + 允许命名参数(Core 方言默认为 "FALSE",其他方言默认为 "TRUE")。更改方言也会自动更改此设置。 + /namedargs
    + Allow Unsafe Code + (允许不安全代码) - Allow Unsafe code inside this assembly. + + 允许在该程序集内使用不安全代码。 + /unsafe
    + Case Sensitive + (大小写敏感) - Enable/Disable case sensitivity. + + 启用/禁用大小写敏感。 + /cs
    + Initialize Local variables + (初始化局部变量) - Automatically initialize local variables without initialization expression. Please note that for locals of type string the initial value will depend on the 'Initialize strings' setting from the Dialect page. + + 自动初始化局部变量,无需初始化表达式。请注意,对于字符串类型的局部变量,初始值取决于方言页面中的 "Initialize strings "(初始化字符串)设置。 + /initlocals
    + Overflow Exceptions + (溢出异常) - Check for Overflow and Underflow for numeric expressions, like the CHECKED keyword. + + 检查数字表达式的溢出,如 CHECKED 关键字。 + /ovf
    + Use Zero Based Arrays + (使用基于 0 的数组) - Use Zero Based Arrays. + + 使用基于零的数组 + /az
    + Enforce SELF + (强制 SELF) - When checked then all references to methods and fields/properties inside a class should be prefixed with SELF (or SUPER) + + 选中后,类内对方法和字段/属性的所有引用都应以 SELF(或 SUPER)作为前缀。 + /enforceself
    + Allow DOT for instance members + (允许成员实例使用 DOT<.>) - When checked then you can also use the DOT (.) operator to access instance fields, properties and methods. Otherwise the COLON (:) operator is needed + + 选中后,您还可以使用 DOT (.) 操作符访问实例字段、属性和方法。否则需要使用 COLON (:) 操作符 + /allowdot
    + Enforce VIRTUAL/OVERRIDE + (强制 VIRTUAL/OVERRIDE) - When checked then you MUST prefix methods with VIRTUAL and/or OVERRIDE when overriding methods in a parent class or when defining a new method that can be overridden + + 如果选中,则在覆盖父类中的方法或定义可被覆盖的新方法时,必须在方法前加上 VIRTUAL 和/或 OVERRIDE 字样 + /enforceoverride
    + Allow Old Style assignments + (允许旧式赋值) - When checked then allow the use of the single equals operator (=) for assignments. Otherwise the Colon Equals (:=) operator is mandatory + + 如果选中,则允许在赋值中使用单个等号运算符 (=)。否则,必须使用冒号等号运算符(:=)。 + /allowoldstyleassignments
    + Enable Memvar support + (启用内存变量支持) - Enable support for memory variables (MEMVAR, PUBLIC, PRIVATE & PARAMETERS). - Please note that this is NOT supported for the Core and Vulcan dialects + + 启用对内存变量(MEMVAR、PUBLIC、PRIVATE 和 PARAMETERS)的支持。 + 请注意,Core 和 Vulcan 方言不支持此功能。 + /memvar
    + Enable Undeclared variables support + (启用未声明变量支持) - Enable support for undeclared variables (these are resolved to MEMVARs). - Please note that this requires /memvar to be enabled as well. + + 启用对未声明变量的支持(这些变量被解析为 MEMVAR)。 + 请注意,这需要同时启用 /memvar。 + /undeclared
    + Enable Implicit Namespace lookup + (启用隐式命名空间查询) - Enable the implicit lookup of classes defined in assemblies with an Implicit Namespace attribute. + + 启用对具有隐式命名空间属性的程序集中定义的类的隐式查找。 + /ins
    + Prefix classes with default Namespace + (使用默认命名空间为类加前缀) - Prefix all classes that do not have a namespace prefix and are not in a begin namespace ... end namespace block with the namespace of the assembly. + + 为所有没有命名空间前缀且不在 begin 命名空间中的类添加前缀 ...end namespace 块替换为程序集的命名空间。 + /ns:<Namespace>
    + Additional Include paths + (附加包含路径) - Additional include paths for the preprocessor (it also looks through the folders set with the include environment variable). + + 预处理器的附加包含路径(它也会查看通过 include 环境变量设置的文件夹)。 + /i
    + Alternate standard header file + (替代标准头文件) - Name of an alternative standard header file (alternative for XSharpDefs.xh). + + 替代标准头文件的名称(XSharpDefs.xh 的替代文件)。 + /stddefs
    + Suppress standard header file + (禁止标准头文件) - Suppress inclusion of the standard header file (XSharpDefs.xh) in every file. + + 禁止在每个文件中包含标准头文件(XSharpDefs.xh)。 + /nostddef
    - Suffix + 后缀 + 描述
    - S or s + S 或 s - Single precision (REAL4) + 单精度 (REAL4)
    - D or d + D 或 d - Double precision (REAL8) + 双精度 (REAL8)
    - M or m + M 或 m - Decimal + 十进制
    - Floating point literals without suffix are stored as REAL8, unless you have specified the /vo14 compiler option, in which case they are stored as FLOAT literals. + 不带后缀的浮点(Floating point)字面量以 REAL8 格式存储,除非指定了/vo14 编译器选项,在这种情况下,浮点字面量以 FLOAT 格式存储。. @@ -67,7 +69,7 @@ $
    - Prefix + 前缀 + 描述
    - Currency Literal + Currency 字面量
    diff --git a/docs/Help_ZH-CN/Topics/References.xml b/docs/Help_ZH-CN/Topics/References.xml index 6d535a9606..0de600b5e6 100644 --- a/docs/Help_ZH-CN/Topics/References.xml +++ b/docs/Help_ZH-CN/Topics/References.xml @@ -1,7 +1,7 @@  - - References + + 引用 References to External .Net Assemblies References to External COM components @@ -10,18 +10,20 @@
    - References + 引用
    - XSharp projects inside Visual studio work with source code items and may contain references to code defined in external libraries. - Inside Visual Studio you can set these references through the References dialog. - In short there are 3 kinds of references: - -
  • External .Net assemblies
  • -
  • External COM components
  • -
  • Other projects inside the same Visual Studio solution.
  • + + Visual studio 中的 XSharp 项目使用源代码项,可能包含对外部库中定义的代码的引用。 + 在 Visual Studio 中,您可以通过 "引用 "对话框设置这些引用。 + 简而言之,有三种参考资料: + + +
  • 外部 .Net 程序集
  • +
  • 外部 COM 组件
  • +
  • 同一 Visual Studio 解决方案中的其他项目
  • - References to unmanaged code - You cannot add references to unmanaged code using the Project References. - To call unmanaged code you will have to declare either functions or procedures with the _DLL prefix, or you declare static methods or functions and add a special [DllImport()] attribute to them. + 对非托管代码的引用 + 您不能使用 "项目引用 "为非托管代码添加引用。 + 要调用非托管代码,您必须声明带有 _DLL 前缀的函数或过程,或者声明静态方法或函数,并为其添加特殊的 [DllImport()] 属性。
    diff --git a/docs/Help_ZH-CN/Topics/Runtime-Scripting.xml b/docs/Help_ZH-CN/Topics/Runtime-Scripting.xml index 18f6d77143..1aebb98555 100644 --- a/docs/Help_ZH-CN/Topics/Runtime-Scripting.xml +++ b/docs/Help_ZH-CN/Topics/Runtime-Scripting.xml @@ -1,31 +1,30 @@  - - Runtime Scripting + + 运行时脚本 ExecScript
    - Runtime Scripting + 运行时脚本
    - XSharp 2.8 adds support for Runtime scripting through the ExecScript() function. - Scripting was added for the FoxPro dialect but also works for other dialects. - Inside scripts you will have the full X# language at your disposal. - The first time a script runs it will be compiled. If you run the same script a second time then the script compiler can reuse the already compiled version of the first script. - An example (FoxPro dialect, MessageBox() is a FoxPro functon) + XSharp 2.8 通过 ExecScript() 函数增加了对运行时脚本的支持。 + 脚本是为 FoxPro 方言添加的,但也适用于其他方言。 + 在脚本中,你可以使用完整的 X# 语言。 + 脚本首次运行时将被编译。如果第二次运行同一脚本,脚本编译器可以重复使用第一个脚本的已编译版本。 + 示例(FoxPro 方言,MessageBox() 是一个 FoxPro 函数) VAR cScript := 'MessageBox("Hello ExecScript")'
    ExecScript(cScript)
    - Of course scripts can also be multiple lines and can call any function in the runtime and in your code. - PUBLIC and PRIVATE variables that are visible when your script is started are accessible by the script. - You can also declare new local variables in the script and use any statement and user defined command that you would normally use. - - We did an online session about scripting in Jan 2021 that shows several example scripts. See https://www.youtube.com/watch?v=88crZsEiAOg&t=5s for the recording. - One sample script from that demo is + 当然,脚本也可以是多行的,可以调用运行时和代码中的任何函数。 + 脚本可以访问启动时可见的 PUBLIC 和 PRIVATE 变量。 + 您还可以在脚本中声明新的局部变量,并使用您通常会使用的任何语句和用户定义命令。 + 我们在 2021 年 1 月进行了一次关于脚本的在线讨论,其中展示了几个脚本示例。录音请参见 https://www.youtube.com/watch?v=88crZsEiAOg&t=5s + 其中一个示例脚本是 LPARAMETERS oForm
    USE employees.dbf
    PrintOut(oForm, 'private',MyPrivate, Used(), Alias())
    GO TOP
    DO WHILE ! Eof()  
      PrintOut(oForm, RecNo(), FieldGet(1), FieldGet(2), FieldGet(3))      
      SKIP
    ENDDO  
    USE  
    - That script calls a PrintOut function and passes it the form that was received as parameter. The PrintOut function then adds a line of text to the terminal window that was passed to the script. The USE, GO TOP and SKIP commands are all UDCs that are handled by the script compiler without problems. + 脚本调用 PrintOut 函数,并将收到的表单作为参数传递给它。然后,PrintOut 函数会在传给脚本的终端窗口中添加一行文本。USE、GO TOP 和 SKIP 命令都是 UDC,脚本编译器可以顺利处理。 diff --git a/docs/Help_ZH-CN/Topics/SBYTE.xml b/docs/Help_ZH-CN/Topics/SBYTE.xml index d3b2aa3b84..2ccad5c313 100644 --- a/docs/Help_ZH-CN/Topics/SBYTE.xml +++ b/docs/Help_ZH-CN/Topics/SBYTE.xml @@ -1,12 +1,13 @@  - + SBYTE
    SBYTE
    - The SBYTE keyword denotes an integral type that stores signed 8-bit values with values ranging from negative 128 to positive 127. + + SBYTE 关键字表示一种整数类型,用于存储范围从负128到正127的有符号8位值。
    diff --git a/docs/Help_ZH-CN/Topics/SHORT.xml b/docs/Help_ZH-CN/Topics/SHORT.xml index 2eac702287..ec7694a5aa 100644 --- a/docs/Help_ZH-CN/Topics/SHORT.xml +++ b/docs/Help_ZH-CN/Topics/SHORT.xml @@ -1,6 +1,6 @@  - + SHORT SHORT @@ -10,7 +10,8 @@
    SHORT
    - The SHORT keyword denotes an integral type that stores signed 16-bit values with values ranging from negative 32768 through positive 32767. + + SHORT 关键字表示一个整数类型,用于存储带符号的 16 位值,取值范围从 -32768 到 32767。.
    diff --git a/docs/Help_ZH-CN/Topics/STRING.xml b/docs/Help_ZH-CN/Topics/STRING.xml index 402bb006fd..00fc7d3c5d 100644 --- a/docs/Help_ZH-CN/Topics/STRING.xml +++ b/docs/Help_ZH-CN/Topics/STRING.xml @@ -1,6 +1,6 @@  - + STRING STRING @@ -9,8 +9,10 @@
    STRING
    - A STRING is a sequential collection of Unicode characters that is used to represent text. A String object is a sequential collection of System.Char objects that represent a string. The value of theString object is the content of the sequential collection, and that value is immutable (that is, it is read-only). For more information about the immutability of strings, see the Immutability and the StringBuilder class section later in this topic. The maximum size of a String object in memory is 2 GB, or about 1 billion characters. - Please note that you cannot CAST strings to PSZ like you can in Visual Objects. The PSZ type consists of 8 bits per character where the STRING type has 16 bits per character. + STRING 是一个用于表示文本的 Unicode 字符的顺序集合。一个 String 对象是一组表示字符串的 System.Char 对象的顺序集合。String 对象的值是顺序集合的内容,该值是不可变的(即只读)。有关字符串不可变性的更多信息,请参阅本主题后面的不可变性和 StringBuilder 类部分。String对象在内存中的最大大小为2 GB,或约10亿个字符。 + + 请注意,您不能像在 Visual Objects 中那样将字符串转换为PSZ。PSZ类型由每个字符8位组成,而STRING类型每个字符有16位。 +
    diff --git a/docs/Help_ZH-CN/Topics/SYMBOL.xml b/docs/Help_ZH-CN/Topics/SYMBOL.xml index f9b95e3a9b..b9ad59c23b 100644 --- a/docs/Help_ZH-CN/Topics/SYMBOL.xml +++ b/docs/Help_ZH-CN/Topics/SYMBOL.xml @@ -1,6 +1,6 @@  - + SYMBOL SYMBOL @@ -9,23 +9,29 @@
    SYMBOL
    - The SYMBOL type is a 32-bit integer that represents an index into an array of strings. - Since a SYMBOL represents a string, there is a built-in implicit conversion from SYMBOL to STRING, and from STRING to SYMBOL. + SYMBOL 类型是一个32位整数,表示字符串数组中的索引。 - Since the underlying value of a SYMBOL is an integer, there is a built-in explicit conversion from SYMBOL to DWORD and from DWORD to SYMBOL. A cast is necessary in order to perform explicit conversions. + 由于 SYMBOL 表示一个字符串,因此从 SYMBOL 到 STRING,以及从 STRING 到 SYMBOL 都有内置的隐式转换。 - Unlike with Visual Objects, the number of symbols is not limited by available memory or symbols that are declared in another library.
    - Literal symbols consist of the '#' character followed by one or more alphanumeric character. The first character must be a letter or an underscore. + 由于 SYMBOL 的基础值是整数,因此从 SYMBOL 到 DWORD,以及从 DWORD 到 SYMBOL 都有内置的显式转换。在执行显式转换时需要进行强制转换。 - Some examples of literal symbols are shown below: + 与 Visual Objects 不同,符号的数量不受可用内存或在另一个库中声明的符号的限制。 + + 文字符号由 '#' 字符后跟一个或多个字母数字字符组成。第一个字符必须是字母或下划线。 + + 以下是一些文字符号的示例: #XSharp
    #XSHARP
    - Note that although literal symbols can be specified with lower or upper case letters, the strings they represent are converted to uppercase at compile time, for compatibility with Visual Objects. It is not possible to specify a literal symbol that contains lower case letters, the StringToAtom() function must be used. + 请注意,虽然文字符号可以用小写或大写字母指定,但它们表示的字符串在编译时会转换为大写,以与 Visual Objects 兼容。无法指定包含小写字母的文字符号,必须使用 StringToAtom() 函数。 + + 编译器定义的常量 NULL_SYMBOL 可用于表示空符号,即没有关联字符串值的符号。 + + + 实现 + + SYMBOL 类型在 XSharp.__Symbol 结构中实现。 - The compiler-defined constant NULL_SYMBOL can be used to express a null symbol, i.e. a symbol that has no associated string value. - Implementation - The SYMBOL type is implemented in the structure XSharp.__Symbol - The Usual type of SYMBOL  is 10. + SYMBOL 的 UsualType 值是 10。
    diff --git a/docs/Help_ZH-CN/Topics/Solution.xml b/docs/Help_ZH-CN/Topics/Solution.xml index edcfda4c5e..1967f7465b 100644 --- a/docs/Help_ZH-CN/Topics/Solution.xml +++ b/docs/Help_ZH-CN/Topics/Solution.xml @@ -1,76 +1,78 @@  - - Solution + + 解决方案
    - Solution + 解决方案
    - Visual Studio organizes your source code in Solutions and one or more projects. - A solution is a container for one or more related projects, along with build information, Visual Studio window settings, and any miscellaneous files that aren't associated with a particular project. - A solution is described by a text file (extension .sln) with its own unique format; it's not intended to be edited by hand. - Visual Studio uses two file types (.sln and .suo) to store settings for solutions: + Visual Studio 将源代码组织在解决方案和一个或多个项目中。 + + 解决方案是一个或多个相关项目的容器,其中包括构建信息、Visual Studio 窗口设置以及与特定项目无关的任何其他文件。 + 一个解决方案由一个文本文件(扩展名为 .sln)来描述,它有自己独特的格式,不能手工编辑。 + Visual Studio 使用两种文件类型(.sln 和 .suo)来存储解决方案的设置: - - - - - - - - -
    - Extension + + 扩展名 - Name + + 名称 - Description + + 描述
    + .sln - Visual Studio Solution + + Visual Studio 解决方案 - Organizes projects, project items, and solution items in the solution. + + 在解决方案中组织项目、项目项和解决方案项。
    + .suo - Solution User Options + + 解决方案用户选项 - Stores user-level settings and customizations, such as breakpoints. + + 存储用户级设置和自定义设置,如断点。
    - Different projects in Visual Studio may target different development languages. + Visual Studio 中的不同项目可能针对不同的开发语言。 - It is very well possible to use C# and X# projects next to each other in the same solutions. - And you can set dependency relations between projects for different development languages without problems. - Visual Studio will automatically determine the order in which projects must be build. + 在同一解决方案中,C# 和 X# 项目完全可以同时使用。 + 你还可以在不同开发语言的项目之间设置依赖关系,而不会出现问题。 + Visual Studio 会自动确定项目的构建顺序。 - If you want you can control this order by opening the Solution Properties dialog (right click on the Solution node in the Solution Explorer and choose "Properties"). - The image below shows the Solution Properties dialog for the X# runtime solution. - On this dialog you can also set which project needs to be the "startup project" when you start debugging inside Visual Studio. - As you can see you can also start multiple projects at the same time. - The "Action" combo offers you the choice to Start a program or to start Debugging a program when you start the debugger inside Visual Studio. + 如果需要,可以打开 "解决方案属性 "对话框(右键单击 "解决方案资源管理器 "中的 "解决方案 "节点并选择 "属性")来控制顺序。 + 下图显示了 X# 运行时解决方案的 "解决方案属性 "对话框。 + 在此对话框中,您还可以设置在 Visual Studio 中开始调试时,哪个项目需要作为 "启动项目"。 + 如您所见,您还可以同时启动多个项目。 + 在 Visual Studio 中启动调试器时,"操作"(Action)组合可让您选择启动程序或开始调试程序。 - + - On the "Project Dependencies" tab page you can set the dependencies between projects + 在 "项目依赖项 "(Project Dependencies)选项页面,您可以设置项目之间的依赖关系 - + - On this dialog you can see that 2 projects are already marked with a check box: these are projects that are added in the references list of the XSharp.VO project. - Other projects have a gray checkbox, which means that they depend on XSharp.VO, so you cannot make XSharp.VO dependent on them (that would introduce a circular relation). Other projects ave w hite checkbox. You could add these to the "Depends on:" list for XSharp.VO if you want, which would mean that Visual Studio would always build them before XSharp.VO is built. + 在该对话框中,你可以看到 2 个项目已经标记了复选框:这些项目已添加到 XSharp.VO 项目的引用列表中。 + 其他项目的复选框为灰色,这意味着它们依赖于 XSharp.VO,因此不能让 XSharp.VO 依赖于它们(这将引入循环关系)。其他项目有白色复选框。如果你愿意,可以将这些项目添加到 XSharp.VO 的 "依赖于:"列表中,这意味着 Visual Studio 将始终在 XSharp.VO 被构建之前构建它们。 + - From this dialog you can also open the "Configuration Manager" with which you can maintain the various Configurations (Normally Debug and Release, but you can to that it you want and the various "Platforms". Normally there is only one Platform called "AnyCpu". But if your project contains C++ code you may have a x86 and a x64 platform as well. This configuration manager is also available in the Visual Studio Build menu. - See the next chapter for more information about build configurations. + 您还可以从该对话框打开 "配置管理器"(Configuration Manager),通过它可以维护各种配置(通常是调试和发布配置,但您也可以根据需要更改)和各种 "平台"。通常只有一个名为 "AnyCpu "的平台。但如果你的项目包含 C++ 代码,你也可能有一个 x86 和一个 x64 平台。该配置管理器也可在 Visual Studio "生成"(Build) 菜单中调用。 + 有关生成配置的更多信息,请参阅下一章。 diff --git a/docs/Help_ZH-CN/Topics/Source-Code-Editor.xml b/docs/Help_ZH-CN/Topics/Source-Code-Editor.xml index 0cfa93a22a..e0c8d89650 100644 --- a/docs/Help_ZH-CN/Topics/Source-Code-Editor.xml +++ b/docs/Help_ZH-CN/Topics/Source-Code-Editor.xml @@ -1,10 +1,10 @@  - - Source Code Editor + + 源代码编辑器
    - Source Code Editor + 源代码编辑器
    diff --git a/docs/Help_ZH-CN/Topics/Statements_-Expressions-and-Op.xml b/docs/Help_ZH-CN/Topics/Statements_-Expressions-and-Op.xml index 8dcc3ca69a..ca58999308 100644 --- a/docs/Help_ZH-CN/Topics/Statements_-Expressions-and-Op.xml +++ b/docs/Help_ZH-CN/Topics/Statements_-Expressions-and-Op.xml @@ -1,10 +1,10 @@  - - Statements, Expressions and Operators + + 语句、表达式和运算符
    - Statements, Expressions and Operators + 语句、表达式和运算符
    diff --git a/docs/Help_ZH-CN/Topics/StringLiterals.xml b/docs/Help_ZH-CN/Topics/StringLiterals.xml index bab136f965..bfd9f0e93c 100644 --- a/docs/Help_ZH-CN/Topics/StringLiterals.xml +++ b/docs/Help_ZH-CN/Topics/StringLiterals.xml @@ -1,7 +1,7 @@  - - String Literals + + String 字面量 Literals STRING @@ -9,20 +9,21 @@
    - String Literals + String 字面量
    - There are a couple of different string types inside X#. For normal strings the notation can be different for different dialects: + + X# 中有几种不同的字符串类型。对于普通字符串,不同方言的符号可能不同: @@ -30,10 +31,10 @@ '<char>' @@ -41,7 +42,7 @@ '<char>...<char>' @@ -63,33 +64,33 @@ e"<char>...<char>"
    - Literal + 字面量 - VO, FoxPro & Harbour + VO, FoxPro & Harbour - Vulcan & Core + Vulcan & Core
    - String literal + String 字面量 - Char literal* + Char 字面量*
    - String literal + String 字面量 Not Supported @@ -52,10 +53,10 @@ "<char>...<char>" - String literal + String 字面量 - String literal + String 字面量
    - Extended string literal* + 扩展的 string 字面量* - Extended string literal* + 扩展的 string 字面量*
    - i"<char>.. <char>{expression}" + i"<char>.. <char>{表达式}" - Interpolated string literal + 内插 string 字面量 - Interpolated string literal + 内插 string 字面量
    - ei"<char>.. <char>{expression}" or - ie"<char>.. <char>{expression}" + ei"<char>.. <char>{表达式}" or + ie"<char>.. <char>{表达式}" - Extended interpolated string literal* + 扩展的内插 string 字面量* - Extended interpolated string literal* + 扩展的内插 string 字面量*
    diff --git a/docs/Help_ZH-CN/Topics/Strings.xml b/docs/Help_ZH-CN/Topics/Strings.xml index 64b1ca1528..2bd7635d95 100644 --- a/docs/Help_ZH-CN/Topics/Strings.xml +++ b/docs/Help_ZH-CN/Topics/Strings.xml @@ -1,10 +1,10 @@  - - Strings + + 字符串
    - Strings + 字符串
    diff --git a/docs/Help_ZH-CN/Topics/Strong-Typing.xml b/docs/Help_ZH-CN/Topics/Strong-Typing.xml index f15dab40d2..b73731ce0b 100644 --- a/docs/Help_ZH-CN/Topics/Strong-Typing.xml +++ b/docs/Help_ZH-CN/Topics/Strong-Typing.xml @@ -1,9 +1,11 @@  - - Strong Typing + + 强类型 -
    Strong Typing
    - Enter topic text here. +
    + 强类型 +
    + -
    \ No newline at end of file +
    diff --git a/docs/Help_ZH-CN/Topics/Subsystems-of-the-X-Runtime.xml b/docs/Help_ZH-CN/Topics/Subsystems-of-the-X-Runtime.xml index 3dea90559f..98337c72f2 100644 --- a/docs/Help_ZH-CN/Topics/Subsystems-of-the-X-Runtime.xml +++ b/docs/Help_ZH-CN/Topics/Subsystems-of-the-X-Runtime.xml @@ -1,47 +1,54 @@  - - Subsystems of the X# Runtime + + X# 运行时的子系统
    - Subsystems of the X# Runtime + X# 运行时的子系统
    - Description of Various Subsystems + 各子系统的说明 - - - - - - + - -
    - Subsystem + + 子系统 - Remarks + + 备注
    - Low Level File IO + + 底层文件 IO - These functions are implemented in XSharp.Core.
    There is an important difference between the implementation in XSharp.Core when compared to VO.
    In VO the file handles returned from functions such as FCreate() and FOpen() are OS file handles. That means that you can also pass them directly to Win32 API Functions. In the X# Runtime that is no longer possible.
    We use .Net FileStream objects for the File IO. The File handler returned (which is of the IntPtr type) is a unique key into a table where we are storing these File IO objects. The keys are generated from random numbering. You can't and shouldn't rely on the values of these keys.
    +
    + 这些函数是在 XSharp.Core 中实现的。 + 与 VO 相比,XSharp.Core 的实现有一个重要区别。 + 在 VO 中,从 FCreate() 和 FOpen() 等函数返回的文件句柄是操作系统文件句柄。这意味着你也可以直接将它们传递给 Win32 API 函数。在 X# 运行时中,这已不再可能。 + 我们使用 .Net FileStream 对象进行文件 IO。返回的文件处理程序(IntPtr 类型)是我们存储这些文件 IO 对象的表中的唯一密钥。密钥由随机数生成。您不能也不应该依赖这些键的值。
    - Static Memory IO - - The static memory subsystem allocates memory using the Marshal.AllocHGlobal functionality. Each memory block has 2 guard blocks that contain information about the group number, size and a magic number. We have also implemented memory groups.
    Unlike in VO you cannot release all blocks in a group by simply closing the Memory Group.
    If you want to enumerate allocated blocks you should first call MemTrace(TRUE) to enable block tracing.
    Then create a function with the following prototype
    -
    FUNCTION MyMemWalker(pMem AS IntPtr, nSize AS DWORD) AS LOGIC
    - Then call MemWalk and pass your function as parameter. The runtime will call your function and will pass in all memory blocks that have been allocated and not released yet. +
    + 静态内存 IO + + 静态内存子系统使用 Marshal.AllocHGlobal 功能分配内存。每个内存块都有 2 个保护块,其中包含有关组编号、大小和魔法编号的信息。我们还实现了内存组。 + 与 VO 不同,您不能通过简单地关闭内存组来释放组中的所有块。 + 如果您想枚举已分配的块,应首先调用 MemTrace(TRUE) 启用块跟踪。 + 然后创建一个具有以下原型的函数 + FUNCTION MyMemWalker(pMem AS IntPtr, nSize AS DWORD) AS LOGIC + 然后调用 MemWalk 并将函数作为参数传递。运行时将调用你的函数,并传入所有已分配但尚未释放的内存块。
    - Late Binding Support + + 后期绑定支持 - The Runtime fully supports late binding. The late binding support still needs some optimizations.
    We recommend to only use this when necessary. New code should either use the DYNAMIC type or try to use early bound code as much as possible.
    +
    + 运行时完全支持延迟绑定。后期绑定支持仍需要一些优化。 + 我们建议仅在必要时使用。新代码应使用动态类型或尽量使用早期绑定代码。
    diff --git a/docs/Help_ZH-CN/Topics/Symbol-Type.xml b/docs/Help_ZH-CN/Topics/Symbol-Type.xml index 1c5a6bd3fd..edf7d8cfa1 100644 --- a/docs/Help_ZH-CN/Topics/Symbol-Type.xml +++ b/docs/Help_ZH-CN/Topics/Symbol-Type.xml @@ -1,17 +1,19 @@  - - Symbol Type + + Symbol 类型 SYMBOL XSharp.__Symbol
    - Symbol Type + Symbol 类型
    - This structure holds just a number. This number is a reference to a string table that contains the actual string representation of the symbol. - The internal type name for this type is XSharp.__Symbol + + 该结构只保存一个数字。这个数字是对一个字符串表的引用,该字符串表包含符号的实际字符串表示。 + + 该类型的内部类型名称是 XSharp.__Symbol diff --git a/docs/Help_ZH-CN/Topics/SymbolLiterals.xml b/docs/Help_ZH-CN/Topics/SymbolLiterals.xml index 2cbc4e784d..1ba79a8472 100644 --- a/docs/Help_ZH-CN/Topics/SymbolLiterals.xml +++ b/docs/Help_ZH-CN/Topics/SymbolLiterals.xml @@ -1,7 +1,7 @@  - - Symbol Literals + + Symbol 字面量 Literals SYMBOL @@ -9,12 +9,14 @@
    - Symbol Literals + Symbol 字面量
    - Symbol literals consist of the '#' character followed by one of more alphanumeric characters + Symbol 字面量由 “#”字符和一个或多个字母数字字符组成。 #XSharp
    #AnExample
    - Even though the examples above are written in mixed case, the compiler will treat them as all uppercase. - Symbol literals are compiled only once by the X# compiler for performance reasons.
    Each .Net assembly created by the X# compiler will have a special, compiler generated, class that contains all the literal symbols found in that assembly.
    These literals are initialized at startup and stored in the symbol table in the runtime.
    + 尽管上面的示例是以大小写混合形式编写的,但编译器会将其视为全大写。 + 出于性能考虑,X# 编译器只对符号(Symbol)字面量进行一次编译。 + X# 编译器创建的每个 .Net 程序集都有一个特殊的、由编译器生成的类,其中包含该程序集中的所有文字符号。 + 这些文字符号在启动时初始化,并存储在运行时的符号表中。
    diff --git a/docs/Help_ZH-CN/Topics/Templates.xml b/docs/Help_ZH-CN/Topics/Templates.xml index dea403418e..c9d1edc072 100644 --- a/docs/Help_ZH-CN/Topics/Templates.xml +++ b/docs/Help_ZH-CN/Topics/Templates.xml @@ -1,19 +1,22 @@  - - Templates + + 模板 templates
    - Templates + 模板
    - The Visual Studio integrations comes with a couple of predefined templates. - There are templates for: + + Visual Studio 集成带有几个预定义模板。 + + 这些模板用于: + -
  • Projects
  • -
  • Items
  • +
  • Projects(项目)
  • +
  • Items(项目项)
  • diff --git a/docs/Help_ZH-CN/Topics/Text-Editor-Options.xml b/docs/Help_ZH-CN/Topics/Text-Editor-Options.xml index 1f68787f5a..4778531175 100644 --- a/docs/Help_ZH-CN/Topics/Text-Editor-Options.xml +++ b/docs/Help_ZH-CN/Topics/Text-Editor-Options.xml @@ -1,7 +1,7 @@  - - Text Editor Options + + 文本编辑器选项 EditorSettings.json settings @@ -9,23 +9,38 @@
    - Text Editor Options + 文本编辑器选项
    - The various settings for the Visual Studio editors can be controlled from the Tools/Options menu. - The values for the settings are stored in the file XSharp\EditorSettings.json in your roaming profile folder. - If you have more that one installation of Visual Studio then the settings will be shared between these installations. - When you open that menu point you will see a window like this: + + Visual Studio 编辑器的各种设置可通过 "工具/选项 "菜单进行控制。 + + 设置值存储在漫游配置文件文件夹中的 XSharp\EditorSettings.json 文件中。 + + 如果你安装了多个 Visual Studio,那么这些设置将在这些安装之间共享。 + + 打开该菜单后,你会看到这样一个窗口: - Tools Options dialog - On the left hand side here is a treeview from where you can select the category of the option you are interested in.
    This dialog contains a LOT of option.
    - To ease the navigation you can use the edit control on top to filter. - All X# options can be found by typing X# in this control: - You will then see the categories for X#: + 工具/选项对话框 + + + 左侧有一个树状视图,您可以从中选择感兴趣的选项类别。 +
    该对话框包含大量选项。
    + + 为了方便浏览,可以使用顶部的编辑控件进行筛选。 + + 在该控件中输入 X#,即可找到所有 X# 选项: + + 然后您将看到 X# 的类别: + - Tools Options filtered on X# - The Text Editor category (which was also visible on the first image) contain settings for all languages that are supported by Visual Studio or by an extension installed inside Visual Studio (such as our Visual Studio extension for X#). - There is also an entry under the Debugging category for settings used by the X# expression evaluator inside the debugger - The last category contains some settings for the VO compatible form editor and for some of the other X# specific editors. + 在 X# 上过滤的工具选项 + + + 文本编辑器(Text Editor)类别(在第一张图片上也能看到)包含 Visual Studio 或安装在 Visual Studio 内的扩展(例如我们的 Visual Studio X# 扩展)所支持的所有语言的设置。 + + 调试类别下还有一个条目,用于调试器内 X# 表达式求值器使用的设置。 + + 最后一个类别包含 VO 兼容表单编辑器和其他一些 X# 特定编辑器的一些设置。
    diff --git a/docs/Help_ZH-CN/Topics/Tools-Options-Completion.xml b/docs/Help_ZH-CN/Topics/Tools-Options-Completion.xml index d8fe5605ae..50f3ad25d2 100644 --- a/docs/Help_ZH-CN/Topics/Tools-Options-Completion.xml +++ b/docs/Help_ZH-CN/Topics/Tools-Options-Completion.xml @@ -1,7 +1,7 @@  - - Settings Completion + + Settings Completion(设置代码完成) Options Settings Completion @@ -9,9 +9,10 @@
    - Settings Completion + Settings Completion(设置代码完成)
    - This page contains X# specific settings related to code completion. + + 本页包含与代码自动补全相关的 X# 特定设置。 diff --git a/docs/Help_ZH-CN/Topics/Tools-Options-Formatting.xml b/docs/Help_ZH-CN/Topics/Tools-Options-Formatting.xml index efd8776ae7..d6ff698b57 100644 --- a/docs/Help_ZH-CN/Topics/Tools-Options-Formatting.xml +++ b/docs/Help_ZH-CN/Topics/Tools-Options-Formatting.xml @@ -1,7 +1,7 @@  - - Formatting + + Formatting(格式化) Formatting Options @@ -9,9 +9,10 @@
    - Formatting + Formatting(格式化)
    - This page X# specific settings w.r.t. source code formatting + + 本页 X# 有关源代码格式的特定设置。 diff --git a/docs/Help_ZH-CN/Topics/Tools-Options-General.xml b/docs/Help_ZH-CN/Topics/Tools-Options-General.xml index 5df9be584d..c2fb8cf62c 100644 --- a/docs/Help_ZH-CN/Topics/Tools-Options-General.xml +++ b/docs/Help_ZH-CN/Topics/Tools-Options-General.xml @@ -1,7 +1,7 @@  - - General Options + + 常规 General Options Options @@ -9,10 +9,12 @@
    - General Options + 常规
    - This page contains generic editor settings for the X# language. - The page may change between different versions of Visual Studio + + 本页包含 X# 语言的通用编辑器设置。 + + 在不同版本的 Visual Studio 中,该页面可能会有所变化。 diff --git a/docs/Help_ZH-CN/Topics/Tools-Options-Generator.xml b/docs/Help_ZH-CN/Topics/Tools-Options-Generator.xml index f4dd989926..cb46cffe34 100644 --- a/docs/Help_ZH-CN/Topics/Tools-Options-Generator.xml +++ b/docs/Help_ZH-CN/Topics/Tools-Options-Generator.xml @@ -1,7 +1,7 @@  - - Generator + + Generator(生成器) Generator Options @@ -9,9 +9,11 @@
    - Generator + Generator(生成器)
    - This page X# specific settings w.r.t. source code generating inside VS.
    This applies to the source code generated by the Windows Forms editor but also for the source code generated when you choose "Goto Definition" for a member that is defined in an external assembly.
    + + 本页 X# 有关在 VS 内生成源代码的特定设置。 +
    这不仅适用于 Windows 窗体编辑器生成的源代码,也适用于为外部程序集中定义的成员选择 "转到定义 "时生成的源代码。
    diff --git a/docs/Help_ZH-CN/Topics/Tools-Options-Indentation.xml b/docs/Help_ZH-CN/Topics/Tools-Options-Indentation.xml index 96a2e8031e..85ab492237 100644 --- a/docs/Help_ZH-CN/Topics/Tools-Options-Indentation.xml +++ b/docs/Help_ZH-CN/Topics/Tools-Options-Indentation.xml @@ -1,7 +1,7 @@  - - Indentation + + Indentation(缩进) Indentation Options @@ -9,13 +9,14 @@
    - Indentation + Indentation(缩进)
    - This page contains X# specific settings w.r.t. source indentation. This setting is used by the editor when you choose the option to indent "Smart" on the "Tabs" page. + + 本页包含与源代码缩进有关的 X# 特定设置。在 "制表符 "页面选择 "智能 "缩进选项时,编辑器会使用该设置。 - The listview on top shows the options that you can choose from. The edit control on the bottom shows the result of the setting. + 顶部的列表视图显示可供选择的选项。底部的编辑控件显示设置结果。
    diff --git a/docs/Help_ZH-CN/Topics/Tools-Options-Intellisense.xml b/docs/Help_ZH-CN/Topics/Tools-Options-Intellisense.xml index f0363c9a70..3374fa791d 100644 --- a/docs/Help_ZH-CN/Topics/Tools-Options-Intellisense.xml +++ b/docs/Help_ZH-CN/Topics/Tools-Options-Intellisense.xml @@ -1,7 +1,7 @@  - - Intellisense + + Intellisense(智能感知) Intellisense Options @@ -9,9 +9,10 @@
    - Intellisense + Intellisense(智能感知)
    - This page contains specific X# settings w.r.t. code completion and the dropdowns in the editor. + + 本页包含与代码自动补全和编辑器下拉菜单有关的特定 X# 设置。 diff --git a/docs/Help_ZH-CN/Topics/Tools-Options-Options.xml b/docs/Help_ZH-CN/Topics/Tools-Options-Options.xml index 2251dd7e3f..5e9d3be736 100644 --- a/docs/Help_ZH-CN/Topics/Tools-Options-Options.xml +++ b/docs/Help_ZH-CN/Topics/Tools-Options-Options.xml @@ -1,16 +1,17 @@  - - Options + + Options(选项) Options Tools Options
    - Options + Options(选项)
    - This page contains X# specific switches that allow you to control features inside the X# source code editor. + + 本页包含 X# 专用开关,可让您控制 X# 源代码编辑器内的功能。 diff --git a/docs/Help_ZH-CN/Topics/Tools-Options-ScrollBars.xml b/docs/Help_ZH-CN/Topics/Tools-Options-ScrollBars.xml index 4f5c6540b4..1bfcb5c521 100644 --- a/docs/Help_ZH-CN/Topics/Tools-Options-ScrollBars.xml +++ b/docs/Help_ZH-CN/Topics/Tools-Options-ScrollBars.xml @@ -1,7 +1,7 @@  - - Scroll Bars + + 滚动条 Options Scroll Bars @@ -9,10 +9,12 @@
    - Scroll Bars + 滚动条
    - This page contains generic settings w.r.t. scroll bars. - The page may change between different versions of Visual Studio. + + 本页包含有关滚动条的通用设置。 + + 不同版本的 Visual Studio 可能会更改该页面。 diff --git a/docs/Help_ZH-CN/Topics/Tools-Options-Tabs.xml b/docs/Help_ZH-CN/Topics/Tools-Options-Tabs.xml index 31c1764dd2..565e331dfe 100644 --- a/docs/Help_ZH-CN/Topics/Tools-Options-Tabs.xml +++ b/docs/Help_ZH-CN/Topics/Tools-Options-Tabs.xml @@ -1,7 +1,7 @@  - - Tabs + + 制表符 Options Tabs @@ -9,10 +9,12 @@
    - Tabs + 制表符
    - This page contains generic settings w.r.t. tabs.. - The page may change between different versions of Visual Studio. + + 本页包含与选项卡有关的通用设置。 + + 不同版本的 Visual Studio 可能会更改该页面。 diff --git a/docs/Help_ZH-CN/Topics/Tuples.xml b/docs/Help_ZH-CN/Topics/Tuples.xml index b0a67b042f..a5d003893e 100644 --- a/docs/Help_ZH-CN/Topics/Tuples.xml +++ b/docs/Help_ZH-CN/Topics/Tuples.xml @@ -1,51 +1,51 @@  - + Codeblock, Lambda and Anonymous Method Expressions Tuple
    - Tuples + 元组
    - Tuple generic data type + 元组(Tuple)一般数据类型 - A tuple is a data structure that groups multiple data elements in a lightweight data structure. Tuples can be used as an easy way to represent multiple data elements, pass them as argument(s) or receive them as a return value, without the need to declare a complete new class or structure for holding the data set. + 元组是一种在轻量级数据结构中将多个数据元素分组的数据结构。元组可以作为一种简便的方法来表示多个数据元素,将它们作为参数传递或作为返回值接收,而无需声明一个完整的新类或结构来保存数据集。 - For example, the following code uses the generic System.Collections.Generic.Tuple type to receive multiple values from a function, without the need to declare multiple REF/OUT parameters or to create a new dedicated type for holding them: + 例如,下面的代码使用通用的 System.Collections.Generic.Tuple 类型从函数中接收多个值,而无需声明多个 REF/OUT 参数或创建一个新的专用类型来保存它们: USING System.Collections.Generic

    FUNCTION GetCustomerData() AS Tuple<STRING, INT, LOGIC>
      LOCAL oCustomer AS Tuple<STRING, INT, LOGIC>
      oCustomer := Tuple<STRING, INT, LOGIC>{"Nikos", 47, TRUE}
    RETURN oCustomer

    FUNCTION Start() AS VOID
      LOCAL oCustomer AS Tuple<STRING, INT, LOGIC>
      oCustomer := GetCustomerData()
      ? "Customer name:", oCustomer:Item1
      ? "Age:", oCustomer:Item2
      ? "Is active:", oCustomer:Item3
    - TUPLE keyword + TUPLE 关键字 - X# also supports the dedicated keyword TUPLE, which offers an easier syntax for declaring and working with tuples. The above code can be written in a simpler way with the TUPLE keyword syntax: + X# 还支持专用关键字 TUPLE,它为元组的声明和处理提供了更简便的语法。使用 TUPLE 关键字语法可以更简单地编写上述代码: - FUNCTION GetCustomerData() AS TUPLE(STRING, INT, LOGIC)
      LOCAL oCustomer AS TUPLE(STRING, INT, LOGIC) // defining the tuple
       // tuple item types must match the types in the Tuple definition
      oCustomer := TUPLE{"Nikos", 47, TRUE}
    RETURN oCustomer
    - FUNCTION Start() AS VOID
      LOCAL oCustomer AS (STRING, INT, LOGIC)
      // the TUPLE keyword in the tuple definition can even be omitted!
      oCustomer := GetCustomerData()
      ? "Customer name:", oCustomer:Item1
      ? "Age:", oCustomer:Item2
      ? "Is active:", oCustomer:Item3
    - Note that when using the TUPLE keyword, the compiler internally uses the type System.ValueTuple, instead of the generic type System.Collections.Generic.Tuple. Also when defining the tuple, the TUPLE keyword can be omitted, thus using the more c#-like syntax (type1, type2, ...) - Named tuples - The dedicated TUPLE keyword syntax supports also specifying custom names for the tuple items, instead of using the generic names Item1, Item2 etc. So the code can become much more readable and close to what it would be like if using a separate new class for the data: - FUNCTION Start() AS VOID
      LOCAL oCustomer AS TUPLE(Name AS STRING, Age AS INT, IsActive AS LOGIC)
      // provide names for each item of the tuple
      oCustomer := GetCustomerData()
      ? "Customer name:", oCustomer:Name
      ? "Age:", oCustomer:Age
      ? "Is active:", oCustomer:IsActive
    - to make code even more self-explanatory, a named tuple can also be instantiated by using named arguments: - FUNCTION GetCustomerData() AS Tuple(STRING, INT, LOGIC)
      // defining the named tuple with custom item names
      LOCAL oCustomer AS Tuple(Name AS STRING, Age AS INT, IsActive AS LOGIC)
      // including tuple item names in the tuple instantiation
      oCustomer := TUPLE{Name := "Nikos", Age := 47, IsActive := TRUE}
    RETURN oCustomer
    - Defining tuples with VAR - Tuples can also be defined and instantiated at the same time using the VAR keyword: + FUNCTION GetCustomerData() AS TUPLE(STRING, INT, LOGIC)
      LOCAL oCustomer AS TUPLE(STRING, INT, LOGIC) // 定义元组
       // 元组项目类型必须与元组定义中的类型一致
      oCustomer := TUPLE{"Nikos", 47, TRUE}
    RETURN oCustomer
    + FUNCTION Start() AS VOID
      LOCAL oCustomer AS (STRING, INT, LOGIC)
      // 甚至可以省略元组定义中的 TUPLE 关键字!
      oCustomer := GetCustomerData()
      ? "Customer name:", oCustomer:Item1
      ? "Age:", oCustomer:Item2
      ? "Is active:", oCustomer:Item3
    + 请注意,使用 TUPLE 关键字时,编译器会在内部使用 System.ValueTuple 类型,而不是通用类型 System.Collections.Generic.Tuple。此外,在定义元组时,可以省略 TUPLE 关键字,从而使用更类似于 c# 的语法(type1、type2、...) + 已命名的图元 + 专用的 TUPLE 关键字语法还支持为元组项指定自定义名称,而不是使用 Item1、Item2 等通用名称。这样,代码的可读性就会大大提高,并接近于使用单独的新类来处理数据时的效果: + FUNCTION Start() AS VOID
      LOCAL oCustomer AS TUPLE(Name AS STRING, Age AS INT, IsActive AS LOGIC)
      // 为元组中的每个项目提供名称
      oCustomer := GetCustomerData()
      ? "Customer name:", oCustomer:Name
      ? "Age:", oCustomer:Age
      ? "Is active:", oCustomer:IsActive
    + 为了使代码更加一目了然,命名元组也可以通过使用命名参数来实例化: + FUNCTION GetCustomerData() AS Tuple(STRING, INT, LOGIC)
      // 用自定义项目名称定义命名元组
      LOCAL oCustomer AS Tuple(Name AS STRING, Age AS INT, IsActive AS LOGIC)
      // 在元组实例化中包括元组项目名称
      oCustomer := TUPLE{Name := "Nikos", Age := 47, IsActive := TRUE}
    RETURN oCustomer
    + 用 VAR 定义元组 + 使用 VAR 关键字还可以同时定义元组和实例化元组: FUNCTION Start() AS VOID
      VAR oTuple := TUPLE{"Nikos", 47, FALSE}
      ? oTuple:Item1, oTuple:Item2, oTuple:Item3 // "Nikos", 47, FALSE
    - In this case, the data type of each tuple item is inferred from the item types supplied in the code. In the above sample, the item types are (STRING, INT, LOGIC). + 在这种情况下,每个元组项的数据类型是根据代码中提供的项类型推断出来的。在上述示例中,项目类型为(STRING、INT、LOGIC)。 - Tuples with the same item types can be assigned to each other (thus copying the item values from the source tuple to the destination tuple), and the same can be done for tuples defined with either LOCAL or VAR: + 具有相同项目类型的元组可以互相赋值(从而将项目值从源元组复制到目标元组),对于使用 LOCAL 或 VAR 定义的元组也是如此: FUNCTION Start() AS VOID
      VAR oTuple := TUPLE{"Nikos", 47, FALSE}
      LOCAL oNew AS TUPLE(STRING, INT, LOGIC)

      oNew := oTuple
      ? oNew:Item1, oNew:Item2, oNew:Item3 // "Nikos", 47, FALSE
    - When defining a tuple with the VAR keyword, item names can be provided as well: + 使用 VAR 关键字定义元组时,还可以提供项目名称: FUNCTION Start() AS VOID
      VAR oTuple := TUPLE{Name := "Nikos", Age := 47, IsActive := FALSE}
      ? oTuple:Name, oTuple:Age, oTuple:IsActive // "Nikos", 47, FALSE
    - Finally, when defining a tuple with VAR by using identifiers for the item values, instead of using literal values, then each item automatically gets a name by the identifier name used for it: - CLASS CustomerInfo
      EXPORT Description := "Customer description" AS STRING
    END CLASS

    FUNCTION Start() AS VOID
      LOCAL name := "Unknown Customer" AS STRING
      LOCAL oInfo := CustomerInfo{} AS CustomerInfo

      VAR oTuple := TUPLE{name, oInfo:Description}
      ? oTuple:name // "Unknown Customer"
      ? oTuple:description // "Customer description"
    - Tuple deconstruction - A tuple can be deconstructed to multiple plain variables in one line of code, using the (var1, var2, ...) syntax: + 最后,在使用 VAR 定义元组时,如果使用标识符来定义项值,而不是使用字面值,那么每个项都会自动根据标识符名称获得一个名称: + CLASS CustomerInfo
      EXPORT Description := "Customer description" AS STRING
    END CLASS

    FUNCTION Start() AS VOID
      LOCAL name := "Unknown Customer" AS STRING
      LOCAL oInfo := CustomerInfo{} AS CustomerInfo

      VAR oTuple := TUPLE{name, oInfo:Description}
      ? oTuple:name // "未知客户"
      ? oTuple:description // "客户描述"
    + 元组析构 + 使用 (var1, var2, ...)语法,可以在一行代码中将元组分解为多个普通变量: FUNCTION Start() AS VOID
      LOCAL oCustomer AS TUPLE(Name AS STRING, Age AS INT)
      oCustomer := TUPLE{"Nikos", 47}

      LOCAL name AS STRING
      LOCAL age AS INT
     
      (name, age) := oCustomer
      ? name, age // "Nikos", 47
    - The local variables can also be defined and assigned to the tuple item values in a single line, with a special LOCAL syntax for tuples: - FUNCTION Start() AS VOID
      LOCAL oCustomer AS TUPLE(Name AS STRING, Age AS INT)
      oCustomer := TUPLE{"Nikos", 47}

      LOCAL (name AS STRING, age AS INT) := oCustomer
      ? name, age // "Nikos", 47
      // You can also deconstruct into existing local variables without the LOCAL keyword:
      (name, age) := oCustomer
    - Also the VAR keyword can be used for the tuple deconstruction, in which case the variable types are inferred from the tuple item types: + 也可以使用针对元组的特殊 LOCAL 语法,在一行中定义局部变量并将其赋值给元组项值: + FUNCTION Start() AS VOID
      LOCAL oCustomer AS TUPLE(Name AS STRING, Age AS INT)
      oCustomer := TUPLE{"Nikos", 47}

      LOCAL (name AS STRING, age AS INT) := oCustomer
      ? name, age // "Nikos", 47
      // 您也可以在不使用 LOCAL 关键字的情况下析构到现有的局部变量中:
      (name, age) := oCustomer
    + 此外,VAR 关键字也可用于元组析构,在这种情况下,变量类型是从元组项类型中推断出来的: FUNCTION Start() AS VOID
      LOCAL oCustomer AS TUPLE(Name AS STRING, Age AS INT)
      oCustomer := TUPLE{"Nikos", 47}

      VAR (name, age) := oCustomer
      ? name, age // "Nikos", 47
    diff --git a/docs/Help_ZH-CN/Topics/Types.xml b/docs/Help_ZH-CN/Topics/Types.xml index 5f7285605e..23d4a65d0a 100644 --- a/docs/Help_ZH-CN/Topics/Types.xml +++ b/docs/Help_ZH-CN/Topics/Types.xml @@ -1,10 +1,10 @@  - - Types + + 类型
    - Types + 类型
    diff --git a/docs/Help_ZH-CN/Topics/UDC-Tester.xml b/docs/Help_ZH-CN/Topics/UDC-Tester.xml index c6e9283ba9..6e402e0115 100644 --- a/docs/Help_ZH-CN/Topics/UDC-Tester.xml +++ b/docs/Help_ZH-CN/Topics/UDC-Tester.xml @@ -1,6 +1,6 @@  - + UDC Tester UDC Tester @@ -9,6 +9,6 @@
    UDC Tester
    - Enter topic text here. +
    diff --git a/docs/Help_ZH-CN/Topics/UINT64.xml b/docs/Help_ZH-CN/Topics/UINT64.xml index fc2a798804..81b1537869 100644 --- a/docs/Help_ZH-CN/Topics/UINT64.xml +++ b/docs/Help_ZH-CN/Topics/UINT64.xml @@ -1,6 +1,6 @@  - + UINT64 UNIT64 @@ -9,6 +9,7 @@
    UINT64
    - The UINT64 keyword denotes an integral type that stores unsigned 64-bit values with values ranging from 0 to 18,446,744,073,709,551,615. + + UINT64关键字表示一个整数类型,用于存储无符号64位值,取值范围从0到18,446,744,073,709,551,615。
    diff --git a/docs/Help_ZH-CN/Topics/USUAL.xml b/docs/Help_ZH-CN/Topics/USUAL.xml index ea9a085a65..31e17fdfce 100644 --- a/docs/Help_ZH-CN/Topics/USUAL.xml +++ b/docs/Help_ZH-CN/Topics/USUAL.xml @@ -1,6 +1,6 @@  - + USUAL USUAL @@ -9,25 +9,27 @@
    USUAL
    - The USUAL type is datatype that can contain any data type. It consists internally of a type flag and a value. This type can store any value. - The compiler treats this type in a special way. The compiler will not warn you when you assign a value of type USUAL to another type, but will automatically generate the necessary conversion operation/ - USUAL is provided primarily for compatibility with untyped code. It is not recommended for use in new code because the compiler cannot perform any type checking on expressions where one or more operands are USUAL. Any data type errors will only be discovered at runtime. + USUAL 类型是一种可以包含任何数据类型的数据类型。它内部包含一个类型标志和一个值。这种类型可以存储任何值。 + 编译器对这种类型进行特殊处理。当您将 USUAL 类型的值分配给另一种类型时,编译器不会警告您,但会自动生成必要的转换操作。 - Locals, parameters and fields declared as USUAL also incur considerably more runtime overhead than strongly typed variables. + USUAL 主要用于与无类型代码兼容。不建议在新代码中使用它,因为编译器无法对一个或多个操作数为 USUAL 的表达式执行任何类型检查。任何数据类型错误只能在运行时发现。 - The literal value NIL may be assigned into any storage location typed as USUAL. The value NIL indicates the absence of any other data type or value, and is conceptually equivalent to storing NULL into a reference type. NIL is the default value for a local USUAL variable that has not been initialized. + 作为 USUAL 声明的局部变量、参数和字段也比强类型变量产生更多的运行时开销。 - When the left operand of the ':' operator is a USUAL, the compiler will generate a late bound call to the method, field or property specified as the right operand. This call may fail if the value contained in the USUAL at runtime does not have such a member, the member type is incorrect or inaccessible, or if the name evaluates to a method and the number of parameters or their types is incorrect. The /lb compiler option must be enabled in order to use a USUAL as the left operand of the ':' operator, otherwise a compile-time error will be raised. + 可以将字面值 NIL 分配给任何类型为 USUAL 的存储位置。NIL 值表示没有任何其他数据类型或值,并在概念上等同于将 NULL 存储到引用类型中。NIL 是未初始化的本地 USUAL 变量的默认值。 - Numeric operations and USUAL variables of mixed types. - When you combine 2 USUAL variables in a numeric operation then the type of the result is derived from the types of operands.
    The leading principle has been that we try not to loose decimals.
    + 当“:”运算符的左操作数为 USUAL 时,编译器将生成对指定为右操作数的方法、字段或属性的后期绑定调用。如果运行时 USUAL 中包含的值没有这样的成员,成员类型不正确或不可访问,或者名称评估为方法且参数数量或其类型不正确,则此调用可能失败。必须启用 /lb 编译器选项才能将 USUAL 用作“:”运算符的左操作数,否则将引发编译时错误。 - The generic rule is: - -
  • When the Left Hand Side is fractional then the result is also fractional of the type of the LHS
  • -
  • When the LHS is NOT fractional and the Right Hand Side (RHS) is fractional then the result is the type of the RHS
  • -
  • When both sides are integral then the result has the type of the largest of the two.
  • + 数值运算和混合类型的 USUAL 变量 + 当您在数值操作中组合两个常规变量时,结果的类型取决于操作数的类型。
    主导原则是我们尽量不丢失小数部分。
    + + 通用规则如下: + + +
  • 当左侧为小数时,结果也是左侧类型的小数
  • +
  • 当左侧不是小数且右侧为小数时,结果为右侧类型
  • +
  • 当两侧都是整数时,结果取两者中较大的类型。
  • @@ -167,8 +169,8 @@
    - Implementation - The USUAL type is implemented in the structure  XSharp.__Usual + 实现 + USUAL 类型在 XSharp.__Usual 结构中实现。
    diff --git a/docs/Help_ZH-CN/Topics/Unsafe-Code-and-Pointers.xml b/docs/Help_ZH-CN/Topics/Unsafe-Code-and-Pointers.xml index 455f1b49ba..c04702c73d 100644 --- a/docs/Help_ZH-CN/Topics/Unsafe-Code-and-Pointers.xml +++ b/docs/Help_ZH-CN/Topics/Unsafe-Code-and-Pointers.xml @@ -1,10 +1,10 @@  - - Unsafe Code and Pointers + + 不安全代码和指针
    - Unsafe Code and Pointers + 不安全代码和指针
    diff --git a/docs/Help_ZH-CN/Topics/User-defined-Types.xml b/docs/Help_ZH-CN/Topics/User-defined-Types.xml index ac73716897..d3eb730ca2 100644 --- a/docs/Help_ZH-CN/Topics/User-defined-Types.xml +++ b/docs/Help_ZH-CN/Topics/User-defined-Types.xml @@ -1,7 +1,7 @@  - - User defined Types + + 自定义类型 CLASS CLASS (FoxPro syntax) @@ -15,90 +15,92 @@
    - User defined Types + 自定义类型
    - The X# language allows you to define your own types (in fact the XBase Specific types have all been defined that way). - The language has the following keywords that define User defined Types. + + X# 语言允许你定义自己的类型(事实上,XBase 专用类型都是这样定义的)。 + + 该语言的以下关键字定义了用户定义的类型。 - - - - - - - - - - - - - - - - - - - -
    - Type + + 类型 - Description + + 描述
    + CLASS - Defines a class, using a generic syntax that is available in all dialect. + + 使用通用语法定义一个类,该语法适用于所有方言。
    + CLASS (FoxPro syntax) - Defines a class, using the FoxPro specific syntax. + + 使用 FoxPro 特定语法定义一个类。
    + CLASS (Xbase++ syntax) - Defines a class, using the Xbase++ specific syntax. + + 使用 Xbase++ 特定语法定义一个类。
    + DELEGATE - Defines a delegate, a description of a method or a function. + + 定义委托、方法或函数的描述。
    + ENUM - Defines an enum, a list of possible options. + + 定义一个枚举,即可能的选项列表。
    + INTERFACE - Defines an interface. + + 定义接口。
    + STRUCTURE - Defines a structure, a value type + + 定义一个结构、一个值类型
    + UNION - Defines a Union, a special kind of structure. Only available in the VO and Vulcan dialects. + + 定义 Union,一种特殊的结构。仅适用于 VO 和 Vulcan 方言。
    + VOSTRUCT - Defines a VOStruct, a special kind of structure. Only available in the VO and Vulcan dialects. + + 定义 VOStruct,这是一种特殊的结构。仅适用于 VO 和 Vulcan 方言。
    diff --git a/docs/Help_ZH-CN/Topics/Usual-Type.xml b/docs/Help_ZH-CN/Topics/Usual-Type.xml index 5213b65733..11636bcbe9 100644 --- a/docs/Help_ZH-CN/Topics/Usual-Type.xml +++ b/docs/Help_ZH-CN/Topics/Usual-Type.xml @@ -1,25 +1,28 @@  - - Usual Type + + Usual 类型 USUAL XSharp.__Usual
    - Usual Type + Usual 类型
    - The USUAL type in X# is implemented as a .Net structure. It contains a type flag and a value. The value can be one of the following types: + + X# 中的 USUAL 类型是作为 .Net 结构实现的。它包含一个类型标志和一个值。值可以是以下类型之一: + NIL, Long, Date, Float, Array, Object, String, Logic, Codeblock, Symbol, Ptr, Int64, DateTime, Decimal, DateTime - The internal type name for this type is XSharp.__Usual
    + + 该类型的内部类型名称是 XSharp.__Usual
    @@ -152,15 +155,18 @@
    - Type + 类型 - Usual Type Number + Usual 类型值
    - Note that some Usual Type numbers are not included in this table. There are defines in the compiler for these numbers, but they are never stored inside a USUAL.
    So you can write UsualType(uValue) == REAL8 but that will NEVER be true.
    -
    You can assign values of these other types to a USUAL but the values will be converted to a type listed in the first table. For example if you assign a DWORD to a USUAL then the runtime will look at the value of the DWORD and if it is smaller or equal to MAX_LONG then it will store the value as a LONG. Otherwise it will store it as a FLOAT. Please note that although we support the Int64 type the DWORD conversion does not use this to be compatible with VO. Also if you assign a PSZ to a USUAL then it will be stored as a STRING. So the runtime will automatically call Psz2String() to get the string representation.
    + 请注意,本表中不包括某些常用类型值。编译器中有这些数字的定义,但它们从不存储在 USUAL 中。 + + 因此,您可以写 UsualType(uValue) == REAL8,但这永远不会成真。 + +
    您可以将其他类型的值赋值给 USUAL,但这些值将被转换为第一个表中列出的类型。例如,如果将 DWORD 赋值给 USUAL,运行时将查看 DWORD 的值,如果小于或等于 MAX_LONG,则将其存储为 LONG。否则就会将其存储为 FLOAT。请注意,尽管我们支持 Int64 类型,但为了与 VO 兼容,DWORD 转换并不使用 Int64 类型。此外,如果将 PSZ 赋值给 USUAL,那么它将被存储为 STRING。因此,运行时将自动调用 Psz2String() 来获取字符串表示法。
    diff --git a/docs/Help_ZH-CN/Topics/VFPXporter.xml b/docs/Help_ZH-CN/Topics/VFPXporter.xml index 3b6f5d62a0..a5db1e468d 100644 --- a/docs/Help_ZH-CN/Topics/VFPXporter.xml +++ b/docs/Help_ZH-CN/Topics/VFPXporter.xml @@ -1,6 +1,6 @@  - + VFPXporter export @@ -15,149 +15,159 @@
    VFPXporter
    - The VFPXporter too is created to ease the move of your  Visual FoxPro (VFP) Application in .NET, using a language you already know, with help of XSharp. - 1. Minimum changes to your code during export - 2. Keep the original code as comment if any change is made. - 3. Move VFP Forms to Windows Forms, using an adaptation layer/library called XSharp.VFP.UI.Dll - 4. Move VCX libraries as external projects containing Forms/Controls - 5. Create real Windows Forms solution/project so you can use any existing 3rd party for .NET in your application - Start & Settings - First, open the Settings dialog box: + + VFPXporter 工具旨在通过 XSharp 帮助您将 Visual FoxPro (VFP) 应用程序迁移到 .NET,使用您已经熟悉的语言。 + + 1.在导出过程中对代码的更改最小化 + 2.如果进行了任何更改,将原始代码保留为注释 + 3. 使用名为 XSharp.VFP.UI.Dll 的适配层/库,将 VFP 表单迁移到 Windows Forms + 4. 将 VCX 库作为包含表单/控件的外部项目进行迁移 + 5. 创建真实的 Windows Forms 解决方案/项目,以便您可以在应用程序中使用任何现有的第三方 .NET 库 + + 启动和设置 + 首先,打开设置对话框: - Folders settings + 文件夹设置 -
  • Default VFP item Folder: The folder where VFPXPorter will start to search for elements to export per default.
  • -
  • Default Output Folder: The folder where the VFPXPorter will create the generated export content
  • -
  • Default exporter resources Folder: The folder where the VFPXPorter will look for extra templates/Libraries/Tools.etc
  • +
  • 默认 VFP 项目文件夹(Default VFP item Folder):VFPXPorter 将默认从该文件夹开始搜索要导出的元素。
  • +
  • 默认输出文件夹(Default Output Folder):VFPXPorter 将在该文件夹中创建生成的导出内容。
  • +
  • 默认导出资源文件夹(Default exporter resources Folder):VFPXPorter 将在该文件夹中查找额外的模板/库/工具等。
  • - You can then: + 然后你可以: -
  • Reset Settings to their default values.
  • -
  • Open Settings Folder where the .json settings file is stored (for backup for eg)
  • +
  • 重置设置为默认值(Reset Settings)。
  • +
  • 打开存储 .json 设置文件的设置文件夹(Open Settings Folder), 例如用于备份。
  • - Export settings + + 导出设置 - Check or Uncheck the export settings: Usually the default values are the best choice. + 检查或取消检查导出设置:通常默认值是最佳选择。 -
  • Default Fields modifiers: When exporting a CLASS, set the default Field visibility.
  • +
  • 默认字段修饰符(Default Fields modifiers):导出类时,设置默认字段的可见性。
  • - Project settings + + 项目设置 -
  • Ignore export Errors: Allows to continue the export process in case of errors. All errors are logged in the destination folder.
  • -
  • If needed, you can specify your own name for the Folders where elements are exported.
  • -
  • Each ClassLibrary is in a SubFolder: If your application is using libraries, it is a good practice to export them separately.
  • -
  • Empty the destination folder: Each time you export an element, the destination folder is emptied
  • +
  • 忽略导出错误( Ignore export Errors):允许在出现错误时继续导出过程。所有错误都会记录在目标文件夹中。
  • +
  • 如果需要,您可以为导出元素的文件夹指定自己的名称。
  • +
  • 每个类库在一个子文件夹中(Each ClassLibrary is in a SubFolder):如果您的应用程序使用库,最好将它们单独导出。  
  • +
  • 清空目标文件夹(Empty the destination folder):每次导出元素时,目标文件夹都会被清空。
  • - Exporting - Project + 导出 + 项目 -
  • Input Project: Search for the .PJX file to export.
  • -
  • Output Folder: Indicate where the VFPXPorter will write the generated files.
  • -
  • Analyze: Allow to look at the content that the VFPXPorter has detected in the Project.
  • -
  • Export: Export the project
  • -
  • Open : Open the folder where the files where written
  • +
  • 输入项目(Input Project):搜索要导出的 .PJX 文件。
  • +
  • 输出文件夹(Output Folder):指定 VFPXPorter 将生成文件写入的位置。
  • +
  • 分析(Analyze):允许查看 VFPXPorter 在项目中检测到的内容。
  • +
  • 导出(Export):导出项目。
  • +
  • 打开(Open):打开包含生成文件的文件夹。
  • - The generated folder should contain several folders (One per Library if you have checked the setting, One for detected FreeTables, One for XSharp Tools, …) - - You will find a file with the same name as the exported project with .SLN as extension. This is the MS Visual Studio solution file that will group all exported top-level items (Project, Libraries, ...) - This is the file you should open first. - How does the VFPXPorter work? - The VFPXPorter will read you project and its elements. It will identify their type and generate some X# code. - In order to generate that code, it will look into the Data folder. - There, we will find several .JSON files that are used as conversion Rules: - The documentation for these rules is available in VFPXPorter repository on GitHub. - Then, to generate the files, it will use some templates : One per type of file. You can find these templates on GitHub : Templates - Converting from VFP - Common problems - Please find here a list of the common troubles we will face when converting your VFP GUI code to X# and WinForms. - Events & Methods naming - When converting your Application from VFP to X# & WinForms, you have to keep in mind that these two "worlds" are using a different point-of view to your Form.
    - In VFP, events are routed to the Controls. - So we could consider that, for eg, each button on the Form has its own class that INHERIT from the base-class CommandButton, and is an instance of that particular class: So you can override Events and Methods that that level, and it gives you a lot of control on what's happening there. - In WinFormsevents are routed to the Owner of the Controls: The Form - So, the usage is to prefix the EventHandlers and Methods with the name of the Control. - If button1 is raising a click event, the name of the handler is button1_click. - If a Form is raising a event, as the Form is the class, the name will be nameOfTheForm_Event. - You can change that via an exporter setting: + 生成的文件夹应包含多个文件夹(如果已勾选设置,则每个库一个文件夹,一个用于检测到的 FreeTables,一个用于 XSharp 工具,...)。 + + 您将找到一个与导出项目同名的文件,扩展名为 .SLN。这是 MS Visual Studio 解决方案文件,将组合所有导出的顶级项目(项目、库等)。 + 这是您应首先打开的文件。 + VFPXPorter 工作原理 + VFPXPorter 将读取您的项目及其元素。它会识别它们的类型并生成一些 X# 代码。 + 为了生成代码,它会查看 Data 文件夹。 + 在那里,我们可以找到几个 .JSON 文件,它们被用作转换规则: + 这些规则的文档可在 GitHub 的  VFPXPorter repository 中找到 + 然后,它将使用一些模板来生成文件: 每种文件类型一个。您可以在 GitHub 上找到这些模板 : 模板 + 从 VFP 进行转换 + 常见问题 + 在将您的 VFP 图形用户界面代码转换为 X# 和 WinForms 时,我们会遇到一些常见问题,请参见以下列表。 + 事件和方法命名 + 将应用程序从 VFP 转换到 X# 和 WinForms 时,您必须牢记这两个 “世界 ”对您的窗体使用不同的视角。
    + 在 VFP 中,事件被路由到控件 + 因此,我们可以认为,例如,窗体上的每个按钮都有自己的类,该类继承自基类 CommandButton,并且是该特定类的实例: 因此,您可以重写该级别的事件和方法,这样就可以对发生的事情进行大量控制。 + 在 WinForms 中,事件会传递给控件的所有者: 表单 + 因此,使用方法是在事件处理程序和方法的前缀加上控件的名称。 + 如果 button1 引发了单击事件,那么处理程序的名称就是 button1_click。 + 如果是表单引发事件,由于表单是类,因此处理程序的名称将是 nameOfTheForm_Event。 + 您可以通过导出器设置更改该名称: -
  • Prefix Event methods with FORM name
  • +
  • (以 FORM 名称作为事件方法的前缀Prefix Event methods with FORM name)
  • - Start() Function - The generated code contains a Start() Function, which is the Startup Object of the generated application. If you are also using a Start() Function in your VFP Code, you will have to rename it after export. - Init() Method - With VFP, the Init() method is called when an object is created. - With X#, calling the Constructor() of a class (with the MyClass{} syntax), won't automatically called the Init() Method. - This process is emulated by the InitType.prg template that is used during export. - With Controls, the Init() Method is called when the Handle is created. This code is generated by the InitType.prg template used during export. - Colors - Unfortunately, these cannot be handled automatically as it would break the Windows Forms designer in Visual Studio. - Setting a BackColor or ForeColor with an RGB, like : + + Start() 函数 + 生成的代码包含一个 Start() 函数,它是生成应用程序的启动对象。如果您在 VFP 代码中也使用了 Start() 函数,则必须在导出后对其进行重命名。 + Init() 方法 + 在 VFP 中,创建对象时会调用 Init() 方法。 + 在 X# 中,调用类的 Constructor() (使用 MyClass{} 语法)不会自动调用 Init() 方法。 + 在导出过程中,InitType.prg 模板会模拟这一过程。 + 对于控件,在创建句柄时会调用 Init() 方法。这段代码由导出时使用的 InitType.prg 模板生成。 + 颜色 + 遗憾的是,这些都无法自动处理,因为这会破坏 Visual Studio 中的 Windows 窗体设计器。 + 使用 RGB 设置 BackColor 或 ForeColor,如 :    this.Label1.ForeColor = RGB(255,0,0) - Should be converted to : + 将被转换为:    this.Label1.ForeColor = System.Drawing.Color.FromARGB( 255,0,0) ) - BUT.... If you had a function called RGB() that returns a System.Drawing.Color in a PRG file, in the Tools folder of the Exporter, it will be part of your Exported Solution, and it will supersede the XSharp Runtime definition, and that will do the trick !! - Method Call without parenthesis - In X#, a Property holds a Value that is set/get with the equal sign, while a Method contains code that is executed when called : And you can make the difference because Method call ends with parenthesis. - While this is allowed in VFP, you will have to correct that in X# + BUT.... 如果您在 PRG 文件中使用名为 RGB() 的函数返回 System.Drawing.Color 颜色,那么它将成为您导出解决方案的一部分,并取代 XSharp Runtime 定义,这样就可以解决这个问题了! + + 无参数的方法调用 + 在 X# 中,“属性”包含一个用等号设置/获取的 “值”,而 “方法 ”包含调用时执行的代码。 + 这在 VFP 中是允许的,但在 X# 中您必须纠正这一点    this.Refresh - Should be corrected as + 应更正为:    this.Refresh() - These can be corrected at export time, if you check the "Convert Statement to Call" in settings. - The handled statements are in the Statements.json file - Form Properties casing - In order to modify a Form with the Windows Form Designer in Visual Studio, the Properties must respect the WinForm casing. So, you may have to add some properties to the PropRules.json in order to automatically convert them. - That's why ShowInTaskBar appears in the rules as ShowInTaskbar. (Note the lowercased b) - The following points have been addressed with the VFP2WinForms.json Rules - Access to Parent - The Parent Property is already defined in Windows Forms, and is strongly typed to a System.Windows.Forms.Control object. To avoid troubles, and ease the port of applications, the support library contains a property called _Parent that access the Control's parent, but as a weakly typed Object. - This will forced X# to a late-bound call, and could help in resolving access to ported code. - The call to _Parent is automatically generated by the XPorter. - Calling an Object Event in Your Code - In object with Parent, you may sometimes call directly Event handlers in your VFP code. - This might be problematic, and for example a direct call to the Click event of a button will fail. + 如果在设置中勾选 “将语句转换为调用(Convert Statement to Call)”,就可以在导出时纠正这些问题。 + 处理过的语句在 Statements.json 文件中。 + + 表单属性封装 + 要使用 Visual Studio 中的 Windows 窗体设计器修改窗体,属性必须遵守 WinForm 的格式。因此,您可能需要在 PropRules.json 中添加一些属性,以便自动转换它们。 + 这就是 ShowInTaskBar 在规则中显示为 ShowInTaskbar 的原因(注意小写的 b)。 + + VFP2WinForms.json 规则解决了以下问题 + 父对象访问 + Windows 窗体中已经定义了父属性,并将其强类型化为 System.Windows.Forms.Control 对象。为了避免麻烦并简化应用程序的移植,支持库中包含了一个名为 _Parent 的属性,它可以访问控件的父对象,但却是一个弱类型对象。 + 这将迫使 X# 进行后期绑定调用,并有助于解决移植代码的访问问题。 + 对 _Parent 的调用由 XPorter 自动生成。 + 在您的代码中调用一个对象的事件 + 在父对象中,您有时可能会在 VFP 代码中直接调用事件处理程序。 + 这可能会有问题,例如直接调用按钮的 Click 事件就会失败。 This.Parent.cmd_prec.Click - During export, the This will be turned to ThisObject, the parent. - Array access - In X#, array elements are accessed using brackets []. - In VFP, it is possible to use parenthesis (). - But this can be a problem when accessing a .Net typed-array. - So, in order to ease the port of VFP applications, some array access have been turned to method call in the XSharp.VFP.UI, the Control layer that ease access to .NET Controls with VFP syntax. - x = __screen.FormCount
    __screen.Forms(x-1).Release() // Here, Forms array will be replaced by Forms Method call.
    - Access Fields in the current Area/Cursor - In VFP, it is possible to reference the current WorkArea/Cursor using its name, and to point to specific fields by specifying their name after a Dot selector, like with : + 导出时,“This ”将转为父对象 ThisObject。 + 数组访问 + 在 X# 中,使用括号 [] 访问数组元素。 + 在 VFP 中,您可以使用括号 () 。 + 但在访问.Net 类型数组时,这可能会造成问题。 + 因此,为了简化 VFP 应用程序的移植,在 XSharp.VFP.UI 控制层中,一些数组访问被转为方法调用,从而简化了使用 VFP 语法访问 .NET 控件的过程。 + x = __screen.FormCount
    __screen.Forms(x-1).Release() // 在这里,表单数组将被表单方法调用所取代。
    + 访问当前工作区/Cursor中的字段 + 在 VFP 中,可以使用当前工作区/Cursor 的名称来引用当前工作区/光标,也可以通过在 Dot(.) 后指定字段名称来指向特定字段,例如使用 .VFP: ? movie.title - Unfortunately, in X# the Dot selector is used for Objects, so you will have to use an arrow as selector, like with: + 遗憾的是,在 X# 中,Dot(.) 用于对象,因此您必须使用箭头作为选择器,如 ? movie->title - Undeclared Vars - You can use an undeclared var anywhere in your code. This is something that X# will recognize and support. - In such case, X# will silently create a MemVar: a local, untyped, var. - But there are some cases, where this will not work. For eg: + 未声明变量 + 您可以在代码的任何地方使用未声明的变量。X# 会识别并支持这一点。 + 在这种情况下,X# 会默默地创建一个变量:一个未类型化的局部变量。 + 但在某些情况下,这样做是行不通的。例如 IF SQLExec(nHandle,"SELECT *  FROM employees ORDER BY id ASC  LIMIT 1","CurResult") <=0 THEN &&& validate error first.
      Aerror(laErr)
      Messagebox("Check the following error: " + Chr(13) + laErr[2],'Alert',3000)
      RETURN .F.
    ENDIF
    - In the previous code, the var laErr has never been declared at this level, but it is used as a REF var by the AError() function. - This type of construction is not supported by X#. You will have to create a local variable laErr first. - Unsupported Functions - When building your VFP App, you may call some functions that are not (yet) supported by X#. - The compiler will express a warning (XS0618), but will generate an Exe, that will certainly crash at Runtime. - To avoid that, indicate these warnings as Errors. - To do so, with MS Visual Studio, follow these steps: + 在代码中,变量 laErr 从未在这一级声明,但它被 AError() 函数用作以引用方式传递的参数。 + X# 不支持这种结构。您必须先创建一个局部变量 laErr。 + + 不支持的函数 + 在创建 VFP 应用程序时,您可能会调用一些 X# 尚不支持的函数。 + 编译器会发出警告 (XS0618),但生成的 Exe 肯定会在运行时崩溃。 + 为了避免这种情况,可以将这些警告显示为错误。 + 为此,请按照以下步骤使用 MS Visual Studio: -
  • Open the Properties of the Project
  • -
  • Go To Build
  • -
  • In section Treat Warning as Errors, enter the Specific Warning : XS0618
  • +
  • 打开项目属性
  • +
  • 转到 “生成”(Build)
  • +
  • 在 “将警告视为错误(Treat Warning as Errors)”部分,输入特定警告(Specific warnings:):XS0618
  • - XSharp.VFP.UI.Dll : adaptation layer - VFP GUI Control library is very different from .NET Windows Forms : Properties, Methods and Event Handling are very different. - In order to offer GUI export, VFPXPorter is using an adaptation layer : XSharp.VFP.GUI - That library contains some controls that micmics the way VFP is behaving. It exposes the originals properties of VFP and convert them to their .NET Windows Forms counterparts. + XSharp.VFP.UI.Dll:适配层 + VFP GUI 控件库与 .NET Windows Forms.UI.Dll 有很大不同: 属性、方法和事件处理都非常不同。 + 为了提供图形用户界面导出,VFPXPorter 使用了一个适配层:XSharp.VFP.GUI。 + 该库包含一些与 VFP 行为方式类似的控件。它公开了 VFP 的原始属性,并将其转换为 .NET Windows Forms 对应的属性。 - Some controls might be missing, same for some Properties/Methods/Events : Please report your troubles in the XSharp Forums. + 某些控件可能会丢失,某些属性/方法/事件也是如此: 请在 XSharp 论坛上报告您的问题。
    diff --git a/docs/Help_ZH-CN/Topics/VOID.xml b/docs/Help_ZH-CN/Topics/VOID.xml index 551645b51e..556dc56ac1 100644 --- a/docs/Help_ZH-CN/Topics/VOID.xml +++ b/docs/Help_ZH-CN/Topics/VOID.xml @@ -1,6 +1,6 @@  - + VOID VOID @@ -9,6 +9,8 @@
    VOID
    - VOID specifies a return value type for a function or method that does not return a value.
    Procedures implicitly define a return type of VOID
    + + VOID 用于指定不返回值的函数或方法的返回值类型。 +
    Procedure 隐式定义返回类型为 VOID。
    diff --git a/docs/Help_ZH-CN/Topics/VOXporter.xml b/docs/Help_ZH-CN/Topics/VOXporter.xml index a4ce6fb872..aedb359554 100644 --- a/docs/Help_ZH-CN/Topics/VOXporter.xml +++ b/docs/Help_ZH-CN/Topics/VOXporter.xml @@ -1,6 +1,6 @@  - + VOXporter VOXporter @@ -9,6 +9,6 @@
    VOXporter
    - Enter topic text here. +
    diff --git a/docs/Help_ZH-CN/Topics/VersionHistory.xml b/docs/Help_ZH-CN/Topics/VersionHistory.xml index 6b5bfd4529..2c6460111d 100644 --- a/docs/Help_ZH-CN/Topics/VersionHistory.xml +++ b/docs/Help_ZH-CN/Topics/VersionHistory.xml @@ -1,6 +1,6 @@  - + 版本历史 /shared @@ -18,89 +18,89 @@ 如果您在 X# 中发现问题,我们建议您在 GitHub 上报告。我们会通知您问题的处理进度。 Changes in 2.20 编译器 - Bug 修正 + Bug 修复 -
  • 修正在 FoxPro 方言中 USE 命令的 AGAIN 子句问题 (#235)
  • -
  • 修正在启用 /namedargs 编译器选项的情况下在编译时调用带有命名参数的类型数组(typed array)构造函数的问题 (#1430)
  • -
  • Fixed inconsistency with the INSTANCE keyword and the use inside the class (#1432)
  • -
  • Fixed problem with the REPLACE UDC that could prevent the use of a variable named "replace" (#1443)
  • -
  • Fixed problem with the /vo9 (handle missing RETURN statements) compiler option with ACCESSes in PARTIAL classes (#1450)
  • -
  • Fixed problem with the Lexer recognizing line continuation characters inside a string in the FoxPro dialect (#1453)
  • -
  • Fixed problem with the memvar pragma option (#1454)
  • -
  • Fixed a problem with the /xpp compiler option. (#1243, #1458)
  • -
  • Fixed a problem with accessing Hidden class members in a method from the class where the member was defined, when the object involved was untyped.(#1335, #1457)
  • -
  • Fixed an internal compiler error with a line of code containing a single comma (#1462)
  • -
  • 修正使用 USE 命令时以方括号为包含文件名的字符定界符时产生的entire (#1468)
  • -
    - New Features +
  • 修复了在 FoxPro 方言中 USE 命令的 AGAIN 子句问题 (#235)
  • +
  • 修复了启用 /namedargs 编译器选项的情况下在编译时调用带有命名参数的类型数组(typed array)构造函数的问题 (#1430)
  • +
  • 修复了 INSTANCE 关键字与类内部使用的不一致 (#1432)
  • +
  • 修复了 REPLACE UDC 可能会阻止使用名为 “replace” 的变量的问题 (#1443)
  • +
  • 修复了 /vo9(处理丢失的 RETURN 语句)编译器选项与 PARTIAL 类中的 ACCESSes 的问题 (#1450)
  • +
  • 修复了词法分析器在 FoxPro 方言中识别字符串内的续行符的问题 (#1453)
  • +
  • 修复了 memvar pragma 选项的问题 (#1454)
  • +
  • 修复了 /xpp 编译器选项的问题。(#1243, #1458)
  • +
  • 修复了当涉及的对象未定义类型时,从定义成员的类中访问方法中隐藏类成员的问题(#1335, #1457)
  • +
  • 修复了单行代码行仅包含单逗号时的内部编译器错误 (#1462)
  • +
  • 修复了使用 USE 命令时以方括号为包含文件名的字符定界符时产生的entire (#1468)
  • + + 新特性 -
  • You can now use the NULL() and DEFAULT() expression to initialize any variable with a default value. This is the equivalent of the default keyword in C#.
  • -
  • We have added a new compiler option /modernsyntax (#1394). This disables certain legacy features:
  • +
  • 现在,您可以使用 NULL() 和 DEFAULT() 表达式以默认值初始化任何变量。这相当于 C# 中的默认关键字。
  • +
  • 我们添加了一个新的编译器选项 /modernsyntax (#1394)。这将禁用某些传统功能:
  • -
  • && for line comments
  • -
  • * at the start of a line for a comment line
  • -
  • Bracketed strings
  • -
  • Parenthesized expression lists (thus makes it easier to recognize tuples)
  • +
  • && 作为行注释
  • +
  • * 在行首表示注释
  • +
  • 使用方括号的字符串
  • +
  • 括号表达式列表(因此更容易识别元组)
  • -
  • Added support for IS NULL and IS NOT NULL pattern (#1422)
  • -
  • Added support for file wide FIELD statements in the Harbour dialect (#1436)
  • +
  • 已添加对 IS NULL 和 IS NOT NULL 模式的支持 (#1422)
  • +
  • 在 Harbour 方言中添加了对文件宽 FIELD 语句(file wide FIELD statements)的支持 (#1436) (#1436)
  • - Runtime - Bug fixes + 运行时 + Bug 修复 -
  • Fixed runtime error in Transform() with PTR argument (#1428)
  • -
  • Fixed problem with several String runtime functions throwing a runtime error when passed a PSZ argument (#1429)
  • -
  • Fixed problem with OrdKeyVal() and ADS/ADT files in the ADS RDD (#1434)
  • -
  • Fixed incompatibilities with various xBase dialects with creating and using orders with long names (#1438)
  • -
  • Fixed VO incompatibility in OrderKeyNo() with the ADS RDD when the setting Ax_SetExactKeyPos() is TRUE (#1444)
  • -
  • Fixed a problem in the macro compiler with passing more than 2 arguments by reference (#1445)
  • -
  • Fixed problem with DBSetIndex() seting the record pointer at eof (#1448)
  • -
  • Fixed problem reading fields from OEM dbfs (#1449)
  • -
    - New Features +
  • 修复了在 Transform() 函数中使用 PTR 参数时的运行时错误 (#1428)
  • +
  • 修复了传递 PSZ 参数时,多个 String 运行时函数抛出运行时错误的问题 (#1429)
  • +
  • 修复了在 ADS RDD 中使用 OrdKeyVal() 和 ADS/ADT 文件时的问题 (#1434)
  • +
  • 修复了在创建和使用长名称的索引时,与各种 xBase 方言的不兼容问题 (#1438)
  • +
  • 修复了在 ADS RDD 中使用 OrderKeyNo() 时,如果设置 Ax_SetExactKeyPos() 为 TRUE,则会出现 VO 不兼容的问题 (#1444)
  • +
  • 修复了宏编译器在传递超过两个引用参数时的问题 (#1445)
  • +
  • 修复了 DBSetIndex() 设置记录指针在 eof 时的问题 (#1448)
  • +
  • 修复了从 OEM dbfs 读取字段时的问题 (#1449)
  • + + 新特性 -
  • Implemented the DBFMEMO driver (#604)
  • -
  • Implemented the DBFBLOB driver (#605)
  • -
  • Added missing SetColor() function overload with no parameters (#1440)
  • +
  • 实现了 DBFMEMO 驱动程序(#604)
  • +
  • 实现了 DBFBLOB 驱动程序(#605)
  • +
  • 添加了缺失的无参数 SetColor() 函数重载(#1440)
  • -
  • This version includes the new XSharp.VFP.UI.DLL that is used by forms exported from Visual FoxPro with the VFP Exporter.
  • +
  • 此版本包含了新的 XSharp.VFP.UI.DLL ,该 DLL 由从 Visual FoxPro 导出的表单使用,通过 VFP Exporter 实现。
  • - Visual Studio integration - Bug fixes + Visual Studio 集成 + Bug 修复 -
  • Fixed a problem with "Jump to File" command in VS 2019 (#1146)
  • -
  • Fixed problem with "Go to definition" not working for local function (#1415)
  • -
  • Fixed problem with the Class navigation box showing the wrong current entry in some cases (#1426)
  • -
  • Fixed problem with setting the "enable named arguments" project option (#1431)
  • -
  • Fixed problem with the code generator for types in external assemblies not generating parameters for Indexed properties (#1442)
  • -
  • Fixed problem with the VODBServer editor not saving access/assigns and other entities of the [DBSERVER] section in CAVOFED.TPL (#1452)
  • -
  • Fixed problem with loading supplemental files provided in the cavowed.inf file for the VO Window Editor with absolute or relative paths (#1470)
  • -
  • Fixed a problem in the VS2022 Debugger when different DLLs contained the same namespace with different case.
  • -
  • Fixed a problem where the entity parser inside the editor did not correctly determine the end of an entity that contains a local function or procedure
  • -
  • Fixed a problem where the entity parser inside the editor would choke on a param token at the start of the line when the /memvars compiler option was NOT enabled.
  • -
    - New features - -
  • We have added a menu entry to the Help menu for the Chinese version of the documentation.
  • +
  • 修复了 VS 2019 中“跳转到文件”命令的问题 (#1146)
  • +
  • 修复了本地函数的“转到定义”功能不工作的问题 (#1415)
  • +
  • 修复了在某些情况下类导航框显示错误当前条目的问题 (#1426)
  • +
  • 修复了设置“启用命名参数”项目选项的问题 (#1431)
  • +
  • 修复了外部程序集中的类型的代码生成器未为索引属性生成参数的问题 (#1442)
  • +
  • 修复了 VODBServer 编辑器未保存 [DBSERVER] 部分的 access/assigns 和其他实体的问题 (#1452)
  • +
  • 修复了在 VO 窗口编辑器中加载 cavowed.inf 文件提供的带有绝对或相对路径的补充文件的问题 (#1470)
  • +
  • 修复了 VS2022 调试器中不同 DLL 包含相同命名空间但大小写不同时的问题。
  • +
  • 修复了编辑器内的实体解析器未能正确确定包含本地函数或过程的实体结束的问题
  • +
  • 修复了编辑器内的实体解析器在未启用 /memvars 编译选项时,遇到行首的 param 标记时会出错的问题。
  • +
    + 新特性 + +
  • 我们已经在帮助菜单中为中文版本的文档添加了一个菜单项。
  • VOXporter Bug fixes - +
  • Fixed problem with incorrectly converting attributes to string literals (#1404)
  • New Features - +
  • It is now possible to define special TEXTBLOCK entities in the VO code in any module with name "VXP-TOP" or "{VOXP:TOP}" and VOXporter will automatically insert the contents of the textblock in the beginning of the exported X# .prg file for the module. This is particularly helpful for specifying top level commands like #using statements (#1425)
  • VFPXporter - -
  • This version of X# includes the VFP Exporter. This tool takes a Visual FoxPro project file and converts that into aVisual Studio solution
  • + +
  • 该版本的 X# 包含 VFP Exporter 。该工具可将 Visual FoxPro 项目文件转换为 Visual Studio 解决方案
  • XIDE - +
  • Added option when trying to debug a 32/64bit app in the wrong XIDE version, to automatically open the alternative version
  • Fixed coloring of several positional keywords in the editor
  • Improved editor support for TEXT...END TEXT
  • @@ -111,15 +111,15 @@
  • Fixed a problem with toggling case (CTR+U) of text selected in a column selection
  • Fixed several issues with incorrectly identifying a line with identifiers like PROC or FUNC as entity definitions
  • - Documentation - Bug fixes - -
  • Fixed typo in the /namedargs compiler option topic
  • + 文档 + Bug 修复 + +
  • 修复了 /namedargs 编译器选项主题中的拼写错误。
  • New Features - -
  • We have added several chapters about modifiers
  • -
  • We have added a (partially) translated help file in (Simplified) Chinese
  • + +
  • 我们添加了几个关于修饰符(modifiers) 的章节
  • +
  • 我们添加了(部分)翻译成简体中文的帮助文件。
  • Changes in 2.19.0.2 Compiler @@ -145,21 +145,21 @@ ? oPerson:(FirstName+" "+LastName)   - +
  • The WITH command now also recognizes the AS DataType clause
  • - +
  • XBase++ Class declarations now also allow “END CLASS” as closing token.
  • - +
  • Now the compiler reports an error when attempting to convert from Lambda Expression to usual (#1343)
  • - +
  • We have added support for TUPLE datatypes. This includes declaring local variables, parameters, return value etc.
    We also support decomposition of a tuple return value into multiple locals. See the TUPLE help topic for more information.
  • Runtime Bug fixes - +
  • Fixed problem calling DoEvents() from the macro compiler (#872 )
  • Fixed problem with __Mem2StringRaw() (undocumented) function (#1302)
  • Fixed problem opening DBFCDX index file with incorrect collation information in the header #1360
  • @@ -173,22 +173,22 @@
  • Fixed problem with NoIVarget when using IDynamicProperties (FoxPro dialect) (#1401)
  • Fixed problem with Hex2C() giving different results with lower case letters than with upper case.
    Note that this bug existed also in VO, so now the behavior of Hex2C() with lower case hex letters in X# with is different to VO (#1402)
  • - +
  • Accessing properties on a closed DbServer object that was opened with the Advantage RDD could cause problems in the debugger. The DbServer class now returns empty values when the server is closed.
  • New features - +
  • Implemented CREATE CURSOR command [FoxPro] (#247). Also implemented CREATE TABLE and ALTER TABLE (FoxPro dialect)
  • Implemented INSERT INTO commands (FoxPro dialect for inserting variables from values, arrays, objects and memory variables. INSERT INTO from a SQL query does not work yet.  (FoxPro dialect)
  • - +
  • Implemented new FoxPro-compatible version of Str() function in XSharp.VFP (#386)
  • Now an error is thrown when opening an index file fails (#1358)
  • Added AscA() function and made Asc() dependent on the SetAnsi() setting in the runtime (#1376)
  • Header files Bug fixes - +
  • Implemented several missing commands (#1407)
  • Fixed typo in the SET DECIMALS TO command (#1406)
  • Added missing clauses NAME and MEMVAR for the GATHER command (FoxPro) (#1409)
  • @@ -197,7 +197,7 @@
    Visual Studio Integration Bug fixes - +
  • Fixed problem with looking up public static field in type referenced by static using (#1307)
  • Fixed intellisense problem with locals defined inside block statements (#1345)
  • Fixed problem with intellisense incorrectly resolving type specified in code with full name to another from the usings list (#1363)
  • @@ -206,7 +206,7 @@
  • Fixed problem with Class Navigation bar not showing the method name in certain cases (#1381)
  • New features - +
  • Added support for IEnumerable and DataTable Debugger visualizers (#1373).
    Please note that when browsing X# arrays the results in the visualizer are really ugly because the visualizer ignores attributes to hide properties and fields for our USUAL class.
  • Adjusted the Globals, Workareas etc debugger windows to respect the global theme selected in VS (#1375). Also added status panel to the Workarea window, so you can see the workarea status or field names/values
  • Added intellisense support for locals declared with USING VAR or USING (LOCAL) IMPLIED (#1390)
  • @@ -214,23 +214,23 @@
    VOXporter Fixes - +
  • Fixed problem with VOXporter incorrectly modifying previously commented code with {VOXP:UNC} tags (#1404)
  • Documentation Bug Fixes - +
  • The documentation of functions in the runtime help was describing functions incorrectly.
    For example the topic title for the "Left" function was "Functions.Left Method" This has been changed to "Left Function"
  • The "SingleLineEdit" class in the documentation was called "Real4LineEdit". This has been fixed.
  • New Features - +
  • We have added additional documentation to the X# Programming guide about several subjects.
  • Changes in 2.18.0.4 Compiler Bug fixes - +
  • Fixed some preprocessor issues with XBase++ related commands (#1213, #1288, #1337)
  • Fixed problem with implicit access to static class members (XBase++ dialect) (#1215)
  • Fixed a parser error with the DIMENSION command (VFP dialect) (#1267)
  • @@ -248,7 +248,7 @@
  • Fixed a problem with STATIC DEFINEs in same named .prg files (#1361)
  • New features - +
  • Introduced warning for not specifying the OUT keyword for OUT parameters (#1295)
  • The parser rules for method and constructor calls without parameters have been updated. This may result in a bit faster compilation.
  • SLen() is no longer "inlined" by the compiler. If you reference XSharp.Core in your app, SLen() now gets resolved to the SLen() function inside X# Core.
    If you compile without X# runtime, or compile against the Vulcan Runtime you now need to add a SLen() function to your code.
    This is the code inside X# Core that you can use as a template
    FUNCTION SLen(cString AS STRING) AS DWORD
      LOCAL len := 0 AS DWORD
      IF cString != NULL
         len := (DWORD) cString:Length
      ENDIF
      RETURN len
  • @@ -256,7 +256,7 @@
  • Code generation for some of the Xbase++ specific features has changed.
  • We have added several more UDCs with the IN <cursor> clause
  • - +
  • We have added UDC support for the FoxPro CAST expression
  • Several more SET commands now also support the & operator
  • The compiler now supports "Late bound names" in more locations, such as in the REPLACE command, With command etc. This now compiles without problems:
  • @@ -264,7 +264,7 @@ cVar := "FirstName"
    WITH oCustomer
      .&cVar := "John"
    END WITH
    and this too

    cVar := "FirstName"
    REPLACE &cVar with "John"
    Runtime Bug fixes - +
  • Fixed problem with incorrectly closing dbf file before relations are cleared (#1237)
  • Fixed incorrect index scope visibility immediately after file creation (#1238)
  • Fixed problem in FFirst()/FNext() not finding all files specified by filter (#1315)
  • @@ -278,7 +278,7 @@
  • Fixed a problem in the CurDir() function when the current directory is a UNCPath (\\Server\Share\SomeDir) (#1378)
  • New features - +
  • Added support for accessing indexers in the USUAL type (#1296 )
  • We have added a DbCurrency type that is returned from the RDD when a currency field is read.
  • Implemented the TEXT TO FILE command (#1304)
  • @@ -292,7 +292,7 @@
  • Several DbServer properties no longer call into the RDD when the server is closed, but return blank values instead.
  • Typed SDK classes - +
  • Added a DbServer:Append() overload without parametrs (#1320)
  • Added missing DataServer:LockcurrentRecord() method (#1321)
  • Fixed runtime error when creating a DataWindow with a ShellWindow as owner (#1324)
  • @@ -305,7 +305,7 @@
    Visual Studio Integration Bug fixes - +
  • Fixed problem with the "allow dot" setting in the project file (#1192)
  • Several macros such as $CALLSTACK were not returning values in expected format. This has been fixed (#1236)
  • Fixed build problem when there is a block comment in the first line of form.prg (#1334)
  • @@ -315,7 +315,7 @@
  • The new debugger windows were not following the current windows theme. This is now partially fixed. (#1375)
  • VO Compatible Editors - +
  • Fixed design time display issue with CheckBox and RadioButton captions with specific fonts in the VOWED (#796)
  • Fixed problem with the VOWED editor changing all existing classes in the prg to PARTIAL (#814)
  • Fixed problem with incorrectly adding constructor code to instantiate the DataBrowser in the VOWED, even when there are no (non-deleted) data columns (#1365)
  • @@ -323,7 +323,7 @@
    VOXporter New features - +
  • Introduced options (inline in existing code) to comment, uncomment and delete lines from the original VO code (#1303)
  • - {VOXP:COM} // comment out line @@ -331,13 +331,13 @@ - {VOXP:DEL} and // {VOXP:REM} // remove line Installer New features - +
  • The installer now detects if the required Visual Studio components "Core Editor" and ".Net Desktop Development" are installed.
    When it finds one or more VS installations but none of these installations has both the required components then a warning is shown.
  • Changes in 2.17.0.3 Compiler Bug fixes - +
  • Fixed several incompatibilities with XBase++ regarding using class members (#1215) UNCONFIRMED
  • Fixed /vo3 option not working correctly in XBase++ dialect. Also added support for modifiers final, introduce and override (#1244)
  • Fixed problem with using the NEW modifier on class fields (#1246)
  • @@ -353,14 +353,14 @@
  • Fixed a problem that an property definition with an explicit interface prefix could lead to a compiler crash when the interface was "unknown" at compile time and/or the property name was not "Item" (#1306)
  • New features - +
  • Added support for "classic" INIT PROCEDURE and EXIT PROCEDURE (#1290)
  • Added warnings when statement list inside case blocks, if blocks and other blocks are empty. To suppress the warning you can add a NOP statement in your code.
  • We have made some changes to the lexer and parser in the compiler. This may result in a bit smaller memory footprint and faster compilation speed for code with many nested blocks.
  • Runtime Bug fixes - +
  • Fixed several problems (incompatibilities with VO) in CToD() (#1275)
  • Added support for 3rd parameter in AAdd() for specifying where to insert the new element (#1287)
  • The Default() function now no longer updates usuals that have a value of NULL_OBJECT to be compatible with Visual Objects.(#1119)
  • @@ -368,16 +368,16 @@
    Visual Studio integration New Features - +
  • We have added debugger pane windows for the following items:
  • - +
  • Global variables
  • Dynamic memory variables (Privates and Publics)
  • Workareas
  • Settings
  • - +
  • You can open these windows from the Debug/XSharp menu during debugging. There is also a special "X# Debugger Toolbar" which is also only shown during debugging.
  • These windows will only show information when the app being debugged uses the X# runtime (so they will not work in combination with the Vulcan Runtime).
    If you are debugging an application written in another language that uses the X# runtime then these windows will also show information.
    We have planned to add more features to these windows in future builds, like the properties of the current selected area and the field/values in the current selected workarea
  • We have added support for "FileCodeModel" for X# files. This is used by the WPF designer and XAML editor.
    This now also fixes the Goto definition in the XAML editor (#1026)
  • @@ -385,7 +385,7 @@
  • We have added support for "Goto Definition" for User Defined commands. For example choosing "Goto definition" on the USE keyword from the USE command will bring you to its definition in our standard header file.
  • Bug fixes - +
  • Fixed member completion issue with Type[,] arrays (#980)
  • Fixed missing member completion in class inside namespace when same named class exists without namespace (#1204)
  • Fixed an auto indent problem when an entity has an attribute in the precessing line (#1210)
  • @@ -412,20 +412,20 @@
  • Fixed a VS lock up that could happen when a file was opened during debugging.
  • Parameter tips for classes with a static constructor and a normal constructor were not processed correctly. This has been fixed.
  • - +
  • When a project was opened where the dependency between a dependent item (like a .resx file or a .designer.prg file) and its parent was missing, then an exception could occur, which prevented the project from opening. This has been fixed.
  • When 2 compiler errors occurred on the same line with the same error code they were sometimes shown in the VS output window but not in the Error List. This has been fixed (#1308)
  • VOXporter New Features - +
  • Added support for special tags {VOXP:COM}, {VOXP:UNC} and {VOXP:DEL} / {VOXP:REM} to comment out, uncomment and remove lines from the original VO code (#1303)
  • Changes in 2.16.0.5 Compiler New Features Xbase++ dialect We have made several changes in the way how Xbase++ class definitions are generated. Please check your code extensively with this new build ! - +
  • We now generate a class function for all classes. This returns the same object as the ClassObject() method for Xbase++ classes.
    This class function is generated, regardless of the /xpp1 compiler option.
    The Class function depends on the function __GetXppClassObject and the XSharp.XPP.StaticClassObject class that both can be found in the XSharp.XPP assembly(#1235).
    From the Class function you can access class variables and class methods.
  • In Xbase++ you can have fields (VAR) and properties (ACCESS / ASSIGN METHOD) with the same name, even with same visibility. Previously this was not supported.
    The compiler now automatically makes the field protected (or private for FINAL classes) and marks it with the [IsInstance] attribute.
    Inside the code of the class the compiler will now resolve the name to the field. In code outside of the class the compiler will resolve the name to the property.
  • For derived classes the compiler now automatically generates a property with the name of the parentclass, that is declared as the parent class and returns the equivalent to SUPER.
  • @@ -437,12 +437,12 @@
    New Features other dialects - +
  • Inside Visual Objects you could declare fields with the INSTANCE keyword and add ACCESS/ASSIGN methods with the same name as the INSTANCE field.
    In previous builds of X# this was not supported.
    The compiler now handles this correctly and resolves the name to the field in code inside methods/properties of the class and resolves the name to the property in code outside of the class.
  • The PPO file now contains the original white space from user defined commands and translates.
  • Bug fixes - +
  • Fixed some method overload resolution issues in the VO dialect (#1211).
  • Fixed internal compiler error (insufficient stack) with huge DO CASE statements and huge IF ELSEIF statements (#1214).
  • Fixed a problem with the Interpolated/Extended string syntax (#1218).
  • @@ -467,15 +467,15 @@ If you are using our parser to parse source code, please check your code. We have made some changes to the language definition for the handling of if ... else statements as well as for the case statements (a new condBlock rule that is shared by both rules). This removes some recursion in the language. Also some of the Xbase++ specific rules have been changed. Please check the language definition online Runtime New Features - +
  • Added the DOY() function.
  • Addeding missing ADS_LONG and ADS_LONGLONG defines.
  • - +
  • Improved the speed of CDX skip operations on network drives (#1165).
  • Bug fixes - +
  • Fixed a problem with DbSetRelation() and RLock() (#1226).
  • Adjusted implicit conversion from NULL_PSZ to string to now return NULL instead of an empty string.
  • Some initialization code is now moved from _INIT procedures to the static constructor of the SQLConnection Class, in order to make it easier to use this class from non-X# apps.
  • @@ -487,18 +487,18 @@
  • Fixed an issue with MemRealloc where the second call on the same pointer would return NULL_PTR (#1248).
  • VOSDK - +
  • Global arrays in the SDK classes are now initialized from the class constructor of the SQLConnection class to fix problems when the main app does not include a link to the SQL Classes assembly.
  • Visual Studio integration Debugger - +
  • The debugger expression evaluator now also evaluates late bound properties and fields (if that compiler option is enabled inside your project).
    If this causes negative side effects then you can disable that in the "Tools/Options Debugging/X# Debugger options screen".
  • The debugger expression evaluator now is initialized with the compiler options from your main application (if that application is an X# project).
    The settings on the Debugger Options dialog are now only used when debugging DLLs that are loaded by a non X# startup project.
  • The debugger expression evaluator now always accepts a '.' character for instance fields, properties and methods, regardless of the setting in the project options.
    This is needed because several windows in the VS debugger automatically insert '.' characters when adding expressions to the watch window or when changing values for properties or fields.
  • New Features - +
  • Added support for importing Indexes in the DbServer editor.
  • The X# project system now remembers which Windows were opened in the Windows editor in design mode and reopens them correctly when a solution is reopened.
  • We have added templates for a Harbour console application and Harbour class library.
  • @@ -508,7 +508,7 @@
  • We have updated some of the project templates.
  • Bug fixes - +
  • Fixed a problem with incorrectly showing member list in the editor for the ":=" operator (#1061).
  • Fixed VOMED generation of menu item DEFINE names that were different to the ones generated by VO (#1208).
  • Fixed VOWED incorrect order of generated lines of code in some cases (#1217).
  • @@ -519,12 +519,12 @@ Changes in 2.15.0.3 Compiler New Features - +
  • Implemented the STACKALLOC syntax for allocating a block of memory on the stack (instead of the heap) (#1084)
  • Added ASYNC support to XBase++ methods (#1183)
  • Bug fixes - +
  • Fixed missing compiler error in a few specific cases when using the dot for accessing instance members, when /allowdot is disabled (#1109)
  • Fixed some issues with passing parameters by reference (#1166)
  • Fixed some issues with interpolated strings (#1184)
  • @@ -542,14 +542,14 @@
    Runtime Bug fixes - +
  • Fixed runtime error in DBSort() (#1196)
  • Fixed error in the ConvertFromCodePageToCodePage function
  • A change in the startup code for the XSharp.RuntimeState could lead to incorrect codepages
  • Visual Studio integration New Features - +
  • Added VS option for the WED to manually adjust the x/y positions/sizes in the generated resource with multipliers (#1199)
  • Added new options page to control where the editor looks for identifiers on the Complete Word (Ctrl+Space) command.
  • A lot of improvements to the debugger expression evaluator (#1050). Please note that this debugger expression evaluator is only available in Visual Studio 2019 and later
  • @@ -561,7 +561,7 @@
  • Added a warning to the Application project options page, when switching the target framework.
  • Bug fixes - +
  • Fixed previously broken automatic case synchronization, when using the cursor keys to move to a different line in the editor (#722)
  • Fixed some issues with using Control+Space for code completion (#1044, #1140)
  • Fixed an intellisense problem with typing ":" in some cases (#1061)
  • @@ -583,14 +583,14 @@
    Documentation Changes - +
  • Some methods in the typed SDK were documented as Function. They are now properly documented as Method
  • Property Lists and Method lists for classes now include references to methods that are inherited from parent classes. Methods that are inherited from .Net classes, such as ToString() from System.Object are NOT included.
  • Changes in 2.14.0.2, 3 & 4 Visual Studio Integration Bug fixes - +
  • Fixed an exception in the X# Editor when opening a PRG file in VS 2017
  • Selecting a member from a completion list with the Enter key on a line immediately after an entry that has an XML comment could lead to extra triple slash (///) characters to be inserted in the editor
  • The triple slash command to insert XML comments was not working. This has been fixed.
  • @@ -608,19 +608,19 @@ Changes in 2.14.0.1 Compiler Bug fixes - +
  • Fixed a problem with date literals resulting in a message about an unknown alias "gloal" (#1178)
  • Fixed a problem that leading 0 characters in AssemblyFileVersion and AssemblyInformationalVersion were lost. If the attribute does not have the wildcard '*' then these leading zeros are preserved (#1179)
  • Runtime Bug fixes - +
  • The runtime DLLs for 2.14.0.0 were marked with the TargetFramework Attribute. This caused problems. The attribute is no longer set on the runtime DLLs (#1177)
  • Changes in 2.14.0.0 Compiler Bug fixes - +
  • Fixed a problem resolving methods when a type  and a local have the same name (#922)
  • Improved XML doc messages for methods implicitly generated by the compiler (INITs, implicit constructors) (#1128)
  • Fixed an internal compiler error with DELEGATEs with default parameter values (#1129)
  • @@ -638,11 +638,11 @@
    Runtime New Features - +
  • Added 2 new values to the DbNotificationType enum: BeforeRecordDeleted and BeforeRecordRecalled. Also added AfterRecordDeleted and AfterRecordRecalled which are aliases for the already existent RecordDeleted and RecordRecalled (#1174)
  • Bug fixes - +
  • Added/updated several defines in the Win32API SDK library (#696)
  • Fixed a problem with "SkipUnique" not working correctly (#1117)
  • Fixed an RDD scope problem when the bottom scope is larger than the highest available key value (#1121)
  • @@ -658,7 +658,7 @@
    Visual Studio integration New Features - +
  • Now using the "Reference Manager" instead of the "Add Reference Dialog Box" for adding References (#21, #1005)
  • Added an option to the Solution Explorer context menu to split a Windows Form in a form.prg and form.designer.prg (#33)
  • We have added an options page to the Tools / Options TextEditor/X# settings that allows you to enable/disable certain features in the X# source code editor, such as "Highlight Word", "Brace Matching" etc. The option to backup the source code for the Windows Forms Editor has been moved from the Texteditor options page to the Custom Editor options page. Search for 'Backup" in the Tools/Options dialog to find the setting.
  • @@ -666,7 +666,7 @@
  • We have added "search keywords" to all of our option page. you may be able to find a page by typing the keyword that you are looking for in the search control.
  • Bug fixes - +
  • Fixed  a problem renaming files when a solution is under SCC with Team Foundation Server (#49)
  • The WinForms designer now ignores differences in the namespaces specified in the form.prg and designer.prg files (the one from form.prg is used) (#464)
  • Fixed incorrect mouse tooltip for a class in some cases (#871)
  • @@ -697,29 +697,29 @@ Changes in 2.13.2.2 Compiler Bug fixes - +
  • Class members declared with only the INSTANCE modifier were generated as public. This has been changed to protected, just like in Visual Objects (#1115)
  • Runtime Bug fixes - +
  • IVarGetInfo() returned incorrect values for PROTECTED and INSTANCE members. This has been fixed.(#1116)
  • The Default() function was changing usual variables initialized with NULL_OBJECT to the new value. This was not compatible with Visual Objects (#1119)
  • Visual Studio integration New Features - +
  • The Rebuild Intellisense Database menu option now asks for confirmation before restarting Visual Studio (#1120)
  • The "Include Files" node in the solution explorer can now be hidden (Tools/ Options X# Custom Editors/Other Editors)
  • Bug fixes - +
  • The type information for variables declared in a CATCH clause was not available. This has been fixed (#1118)
  • Fixed several issues with parameter tips (#1098, #1065)
  • Fixed a performance issue when the cursor was on a undeclared identifier in a "global" entity such as a function or procedure in VERY large projects
  • The "Include Files" node could contain duplicate references when the source code for an #include statement contained relative paths, such as
    #include "..\GlobalDefines.vh"
  • - +
  • Suppressed the expansion of the "Include Files" node in the Solution Explorer when a solution is opened.
  • Single character words (like i, j, k) were not highlighted with the 'highlight word' feature
  • The type 'ptr' was not marked in the keyword color in quickinfo tooltips
  • @@ -728,12 +728,12 @@ Changes in 2.13.2.1 Compiler New Features - +
  • The parser now recognizes AS <type> clause for PUBLIC and PRIVATE memory variable declarations but ignores these with a warning
  • We have added support for AS <type> for locals declared with LPARAMETERS. The function/procedure is still clipper calling convention, but the local variable is of the declared type.
  • Bug fixes - +
  • The PUBLIC and PRIVATE keywords are sometimes misinterpreted as memvar declarations when the /memvar compiler option is not even selected. We have added parser rules to prevent this from happening: when /memvar is not selected then PUBLIC and PRIVATE are only used as visibility modifiers
  • Fix to an issue with selecting function and method overloads (#1096, #1101)
  • Build 2.13.2.0 introduced a problem that could cause a big performance problem for VERY large source files. This has been fixed in 2.13.2.1.
  • @@ -741,14 +741,14 @@ Runtime Bug fixes - +
  • When the runtime cannot resolve a late bound call to an overloaded method it produces an error message that includes a list of all relevant overloads (#875, #1096).
  • The .NULL. related behavior that was added for the FoxPro dialect was breaking existing code that involves usuals. In the FoxPro dialect DBNull.Value is now seen as .NULL. but in the other dialects as a NULL_OBJECT / NIL
  • Several internal members of the PropertyContainer class in the VFP library are now public
  • Visual Studio integration Bug fixes - +
  • The lookup code for Peek definition, Goto definition etc. was filtering out instance methods and only returning static methods. This has been fixed (#1111, #1100)
  • Several changes to fix issues with indentation while typing (#1094)
  • Fixed several problems with parameter tips (#1098, #1066, #1110)
  • @@ -759,11 +759,11 @@ Changes in 2.13.1 Compiler New Features - +
  • The PUBLIC and PRIVATE statements in the FoxPro dialect now support inline assignments, such as in
    PUBLIC MyVar := 42
    Without initialization the value of the PUBLIC will be FALSE, with the exception of the variable with the name "FOXPRO" and "FOX". These will be initialized with TRUE in the FoxPro dialect
  • Bug fixes - +
  • Fixed a problem with initialization of File Wide publics in the foxpro dialect
  • Column numbers for error messages were not always correct for complex expressions. This has been fixed (#1088)
  • Corrected an issue in the lexer where line numbers were incorrect when the source contains statements that span multiple lines (by using a semicolon as line continuation character) (#1105)
  • @@ -773,20 +773,20 @@ Runtime New Features - +
  • Added functions to resolve method calls or array access at runtime  (#1108)
  • Added GoTo record number functionality to the WorkareasWindow in the XSharp.RT.Debugger library
  • Visual Studio Integration New Features - +
  • Now the VS Project tree shows (in a special node) include files that are used by a project (#906).
    This includes include files inside the project itself but also include files in the XSharp folder or Vulcan folder (when applicable).
  • We are using the built-in images of Visual Studio in the project tree and on several other locations when possible.
  • Our background parser inside VS is now paused during the built process to interfere less with the build.
  • We have added a setting to the indentation options so you can control the indentation for class fields and properties separately from methods.
    So you can choose to indent the fields and properties and to not indent the methods. This has also been added to the .editorconfig file
  • Bug Fixes - +
  • Fixed problems with Peek Definition and Goto Definition
  • When looking up Functions we were (accidentally) sometimes also including static methods in other classes.
  • When parsing tokens for QuickInfo and Peek Definition then a method name would not be found if there was a space following the name and before the open parenthesis.
  • @@ -798,18 +798,18 @@ Changes in 2.13 Compiler New Features - +
  • We have implemented a new compiler option /allowoldstyleassignments, which allows using the "=" operator instead of ":=" for assignments.
    This option is enabled by default in the VFP dialect and disabled by default in all other dialects.
  • - +
  • We have revised the behavior of the /vo4 and /vo11 command line options that are related to numeric conversions.
    Before /vo4 only was related to conversions between integral numbers. It has now been extended to also include conversions between fractional numbers (such as float, real8, decimal and currency) and integral numbers.
    In the original languages (VO, FoxPro) you can assign a fractional number to a variable with integral value without problems.
    In .Net you can't do that but you will have to add a cast to the assignment:
  • LOCAL integerValue as INT
    LOCAL floatValue := 1.5 as FLOAT
    integerValue := floatValue          // no conversion: this will not compile in .Net without conversion
    integerValue := (INT) floatValue    // explicit conversion: this does compile in .Net
    ? integerValue

    If you enable the compiler option /vo4 then the assignment without the cast will also work.
    The /vo4 compiler option adds an implicit conversion
    In both cases the compiler will produce a warning:
    warning XS9020: Narrowing conversion from 'float' to 'int' may lead to loss of data or overflow errors
    The value of the integer integerValue above is controlled by the /vo11 compiler option:
    By default in .Net conversions from a fractional value to an integer value will round towards zero, so the value will then be 1.
    If you enable the compiler option /vo11 then the fractional number will be rounded to the nearest even integral value, so the value of integerValue in the example will be 2.
    This is not new.
    We have made a change in build 2.13, to make sure that this difference is no longer determined at runtime for the X# numeric types but at compile time.
    In earlier builds this was handled inside conversion operators from the FLOAT and CURRENCY types in the runtime.
    These classes choose the rounding method based on the /vo11 setting from the main program which is stored in the RuntimeState object.
    However that could lead to unwanted side effects when an assembly was compiled with /vo11 but the main program was not.
    This could happen for example with ReportPro or bBrowser.
    If the author of such a library now chooses to compile with /vo11 then he can be certain that all these conversions in his code will follow rounding to zero or rounding to the nearest even integer, depending on his choice.
    - +
  • The DebuggerDisplay attribute for Compile Time Codeblocks has changed. You now see the source code for compile time codeblocks in the debugger.
  • Bug fixes - +
  • Fixed a code generation issue with ASYNC/AWAIT (#1049)
  • Fixed an Internal compiler error with Evaluate() in CODEBLOCK in VFP dialect (#1043)
  • Fixed an Internal compiler error with UDCs incorrectly inserted after an END FUNCTION statement
  • @@ -836,7 +836,7 @@ Runtime Bug fixes - +
  • Fixed some incompatibilities with VO in the Mod() function
  • Fixed an exception with Copy to array in the VFP dialect when dimensions do not match (#993)
  • Fixed a seeking problem with SetDeleted(TRUE) and DESCEND order (#986)
  • @@ -850,7 +850,7 @@
    New Features - +
  • Enhancements for Unicode AnyCpu SQL classes (#1006):
  • Added a property to open a Sqlselect in readonly mode. This should prevent Append(), Delete() and FieldPut()
  • Implemented delay creating InsertCmd, DeleteCmd, UpdateCmd until really needed
  • @@ -860,12 +860,12 @@ FoxPro dialect - +
  • Added ADatabases() function
  • Visual Studio Integration New features - +
  • You can now control how indenting is done through the Tools/Options Text Editor/X# option pages. We have added several options that control indenting of your source code. You can also set these from an .editorconfig file if you want to enforce indenting rules inside your company.
  • We have now added extensive code formatting options to the source code editor. See Tools/Options/Text Editor/X#/Indentation for available options (#430)
  • We have implemented the option "Identifier Case Synchronization". This works as follows: The editor picks up the first occurrence of an Identifier (class name, variable name etc) in a source file and make sure that all other occurrences of that identifier in the same source file use the same case. This does NOT enforce casing across source files (that would be way too slow)
  • @@ -875,7 +875,7 @@
    Bug fixes - +
  • Fixed a problem with Get Latest Version for solution that is under TFS (#1045)
  • Fixed WinForm designer changing formatting in main-prg file (#806)
  • Fixed some problems with code generation in the WinForms designer (#1042, #1052)
  • @@ -896,13 +896,13 @@
  • Right Click on a packages.config file and choosing the option "Migrate to packagereferences" did not work because inside Visual Studio there is a hardcoded list of supported project types. We are now "faking" the projecttype to make VS happy and enable the wizard.
  • Build System - +
  • The XSharp.Build.Dll, which is responsible for creating the command line when compiling X# projects in VS, was not properly passing the /noconfig and /shared compiler options to the compiler. As a result the shared compiler was not used, even when the project property to use the Shared Compiler was enabled. Also the compiler was automatically including references to all the assemblies that are listed inside the file xsc.rsp, which is located inside the XSharp\bin folder.
    You may experience now that assemblies will not compile because of missing types. This will happen if you are using a type that is inside an assembly that is listed inside xsc.rsp. You should add explicit references to these assemblies in your X# project now.
  • Changes in 2.12.2.0 Compiler Bug fixes - +
  • Fixed a bug in the code generation for handling FoxPro array access with parenthesized indices (#988, #991)
  • The compiler was generating incorrect warnings for locals declared with IS. This has been fixed.
  • The compiler was not reporting an error on invalid usage of the OVERRIDE modifier on ACCESS/ASSIGNs, this has been fixed (#981)
  • @@ -915,21 +915,21 @@
  • Fixed a problem with PCount() when passing a single NULL argument to a CLIPPER function/method (#1016)
  • New Features - +
  • We have added support for the TEXT .. ENDTEXT command in all dialects. Please note that there are several variations of this command. One variation work in ALL dialects (TEXT TO varName). Other variations depend on the dialect chosen. We have moved the support for TEXT .. ENDTEXT now also from the compiler to the preprocessor. This means that there are also 2 new preprocessor directives, #text and #endtext (#977, #1029)
  • Implemented new compiler option /vo17, which implements a more compatible to VO behavior for the BEGIN SEQUENCE..RECOVER command (#111, #881, #916):
  • - +
  • For code that contains a RECOVER USING, a check is made for wrapped exceptions. When the exception is not a wrapped exception then a function in the runtime is called (FUNCTION _SequenceError(e AS Exception) AS USUAL) that can process the error. It can for example call the error handler, or throw the error
  • When there is no RECOVER USING clause , then the compiler generates one and from within this generated clause detects if the RECOVER was reached with a wrapped exception or a normal exception. For wrapped exceptions it gets the value and calls a special function in the runtime (FUNCTION _SequenceRecover(uBreakValue AS USUAL) AS VOID). When the generated recover is called with a 'normal' exception then _SequenceError function from the previous bullet is called.
  • - +
  • We have added support for CCALL() and CCALLNATIVE()
  • The #pragma directives are now handled by the preprocessor. As a result you can add #pragma lines anywhere in your code: between entities, inside the body of an entity etc.
  • Runtime Bug fixes - +
  • Changed the prototype for AdsGetFTSIndexInfo (#966)
  • Fixed a problem with TransForm and decimal types (#1001)
  • Added several missing return types in the VFP assembly
  • @@ -945,16 +945,16 @@
  • Foreach was not working correctly on properties containing collections that were returned from a late bound property access such as IVarGet()(#1033)
  • New Features - +
  • You can now register a delegate in the runtime state that allows you to control how the macro compiler caches types from loaded assemblies(#998).
    This delegate has to have the format:

    DELEGATE MacroCompilerIncludeAssemblyInCache(ass as Assembly) AS LOGIC

    Example:

    XSharp.RuntimeState.MacroCompilerIncludeAssemblyInCache := { a  =>  DoNotCacheDevExpress(a)}
    FUNCTION DoNotCacheDevExpress(ass as Assembly) AS LOGIC)
      // do not cache DevExpress assemblies
      RETURN ass:Location:IndexOf("devexpress", StringComparison.OrdinalIgnoreCase) == -1
  • Compatible VO SDK - +
  • Fixed an issue where SetAnsi(FALSE) causes SingleLineEdit controls with pictures to show random characters when entering umlauts (#1038)
  • Typed VO SDK There are 2 new properties for the SQLSelect class. - +
  • ReadOnly - which makes the SQLSelect Readonly
  • BatchUpdates - which controls how updates are handled
  • @@ -962,12 +962,12 @@ Previously the SQLSelect class created DbCommand objects to update, insert and delete changes made to a cursor immediately when the result set was opened.
    That could cause problems when a complex query was used to select data, because the DbCommandBuilder object could not figure out how to create these statements.
    We are now delaying the creation of these commands until the first time they are needed.
    At the same time we have now added a ReadOnly property with a default value of FALSE.
    If you set ReadOnly to true then: - +
  • Calling FieldPut(), Delete() and Append() will generate an error with Gencode EG_READONLY.
  • No Command objects will be created for the SQLSelect, because the cursor cannot be updated.
  • If ReadOnly remains FALSE then the command objects to update, insert and delete will be created the first time they are needed.
    These commands are created in the __CreateDataAdapter() method.
    You can override this method and create the commands in your own subclass when you want.
    The command creation and the updates work as follows:
    - +
  • First a DataAdapter (of type DbDataAdapter) is created using the CreateDataAdapter method from the SQLFactory class
  • Then a CommandBuilder object (of type DbCommandBuilder) is created from the CreateCommandBuilder method of the SQLFactory class
  • Then the Insert, Delete and Update Command objects (all of type DbCommand) are created from the GetInsertCommand() etc methods from the DbCommandBuilder object. The DBCommandBuilder object takes the Select statement and creates commands with parameters based on the SQLSelect command
  • @@ -978,7 +978,7 @@ If you set the BatchUpdates property to TRUE then the SQLSelect will delay sending updates to the server and will not do that for each record movement, but will wait until you call the Update() method with an argument TRUE. This will then write all the buffered changes to the server. This may then also trigger the creation of the DBCommand objects (see before).
    If your table has autoincrement fields then you may want to call Requery() afterwards to see the newly assigned key values.
    Visual Studio Integration Bug fixes - +
  • Fixed the handling for project property pages for flavored projects (#992)
  • When trying to start the debugger with a non existing working directory or program file name, now an appropriate error is displayed (#996)
  • Fixed a problem with the form designer generating sometimes invalid code with #regions (#1020, #935)
  • @@ -988,7 +988,7 @@
  • Fixed problem with windows forms editor failing to open form with command based on UDC (#1037).
  • Sourcecode Editor - +
  • Type lookups on full names were sometimes failing because the fullname was defined as case sensitive (#978)
  • Nested type lookup was sometimes failing. This has been fixed.
  • The indenting options can now also be overridden in the .editorconfig file (#999)
  • @@ -1005,12 +1005,12 @@
  • Pressing CTRL+SPACE in the editor now always invokes a code completion list (#957)
  • New Features - +
  • Added options to insert page and reorder pages in a tabcontrol, in the VOWED (#1024)
  • We have updated the WPF Application template. The Main window is now called  "MainWindow".
  • Added the following new settings to the .editorconfig file to set indentation options (#999).
  • - +
  • indent_entity_content (true or false)
  • indent_block_content (true or false)
  • indent_case_content (true or false)
  • @@ -1019,13 +1019,13 @@
    VOXporter - +
  • The VOXporter now correctly enabled or disables the Allow MEMVAR/Undeclared vars compiler options, if they were enabled in the VO app (#1000)
  • Changes in 2.11.0.1 Compiler Bug fixes - +
  • Fixed an internal compiler error with CLIPPER calling convention delegates (#932)
  • Fixed an AccessViolationException at runtime with the Null-conditional operator ?. on a usual property (#770)
  • [XBase++ dialect] Fixed a problem with parsing method declarations with parentheses (#927)
  • @@ -1042,7 +1042,7 @@
  • Fixed a problem that could lead to the "Could not emit module" error message, caused by NULL values inside IIF() expressions(#989)
  • New features - +
  • Added compiler option /noinit to not generate $Init calls for libraries without INIT procedures for the sake of postponed loading (#854)
  • Added preprocessor support for #stdout and #if. (#912)
  • The full contents of #include files is now written to the ppo file (#920)
  • @@ -1053,12 +1053,12 @@
    Visual Studio Integration New features - +
  • The source code editor now also supports the new #if and #stdout preprocessor commands  (#912)
  • There is new "Lightbulb" option to generate constructors for classes.
  • Bug Fixes - +
  • Fixed a problem with specifying custom preprocessor defines in the project properties (#909)
  • The VO-style editors now retain existing "CLIPPER" clause to methods/constructors when generating code (#913)
  • Fixed incorrect parsing of classes as nested to each other (#939)
  • @@ -1074,7 +1074,7 @@
    Runtime New features - +
  • Added a constructor with IEnumerable to the array class (#943)
  • Implemented missing functions AdsSetTableTransactionFree() and AdsGetFTSIndexInfo() (#966)
  • Moved functions GetRValue(), GetGValue() and GetBValue() from the Win32API library to XSharp.RT, so they can be used by AnyCPU code (#972)
  • @@ -1084,7 +1084,7 @@
  • [VFP dialect] Implemented commands MKDIR, RMDIR and CHDIR (#614)
  • Bug fixes - +
  • Fixed a problem with the ListView TextColor and TextBackgroundColor ACCESSes in the SDK (#896)
  • Fixed a problem with soft Seek not respecting order scope when to strict key is found (#905)
  • Fixed DBUseArea() search logic for files in various folders. Also SetDefault() is no longer initialized with the current directory (for VO compatibility) (#908)
  • @@ -1103,25 +1103,25 @@
  • [VFP dialect] Fixed a problem with SCATTER TO and APPEND FROM ARRAY (#821)
  • Typed SDK - +
  • Fixed a problem with the FileName property of standard open dialogs
  • Fixed a problem with a FOREACH inside the Menu constructor causing handled exceptions
  • RDD Bug fixes - +
  • Fixed a problem in the DBFVFP RDD with the calculation of the keysize of nullable keys (#985)
  • VOXporter Bug fixes - +
  • Fixed incorrectly detecting pointers to functions inside literal strings and comments (#932)
  • Changes in 2.10.0.3 Compiler Bug fixes - +
  • Fixed some problems with COPY TO ARRAY command in the FoxPro dialect (#673)
  • Fixed a problem with using a System.Decimal type on a SWITCH statement (#725)
  • Fixed an internal compiler error with Type() in the FoxPro dialect (#840)
  • @@ -1132,7 +1132,7 @@
  • Fixed a problem resolving parameters passed by reference with the @ operator when the function/ method had a parameter of the pointer type (#899, #902)
  • New features - +
  • Added compiler option (-enforceoverride) to make the OVERRIDE modified mandatory when overriding a parent member (#786, #846)
  • The compiler now reports an error when using String2Psz() and Cast2Psz() in a non local context (since such PSZs are being released on exiting the current entity) (#775)
  • FUNCTIONs and PROCEDUREs now support the ASYNC modifier (#853)
  • @@ -1143,21 +1143,21 @@
    Build System Bug Fixes - +
  • Running MsBuild on a X# WPF project could fail (#879)
  • Visual Studio Integration New features - +
  • We have added Visual Studio integration for VS 2022
  • We have added support for Package References
  • Now XML comments are automatically inserted in the editor when the user types "///". (#867, #887) Conditions:
  • - +
  • Cursor must be on a line before the start of an entity
  • Cursor must NOT be before a comment line
  • - +
  • Now the tooltip on a class includes also information about the parent class and implemented interfaces (if any) (#860)
  • We have added tooltips, parameter completion etc for the pseudo functions that are built into the compiler, such as PCount() and String2Psz().
  • We have added a first version of Lightbulb tips. For now to implement missing interface members and to convert a field to a Property. More implementations and configuration options will follow
  • @@ -1167,7 +1167,7 @@
  • We have added 'Brace Completion' to the editor
  • Bug Fixes - +
  • Fixed some problems with the Format Document command (#552)
  • Fixed several issues with Parameter Tooltips (#728, #843)
  • Fixed problem with code completion list showing even for not defined vars/identifiers (#793)
  • @@ -1193,7 +1193,7 @@
    Runtime Bug fixes - +
  • Fixed DBFCDX corruption that could happen with simultaneous updates (#585)
  • Fixed a problem opening FoxPro tables with indexes on nullable fields (#631)
  • The BlobGet() function was returning a LOGIC instead of the actual field value (#681)
  • @@ -1214,7 +1214,7 @@ Changes in 2.9.1.1 (Cahors) Compiler Bug fixes - +
  • Fixed a problem introduced in 2.9.0.2 with define symbols not respecting the /cs compiler option in combination with the /vo8 compiler option (#816)
  • Fixed an internal compiler error with assignment expressions inside object initializers when the /fox2 compiler option is enabled (#817)
  • Fixed some problems with DATEs in VOSTRUCTs (#773)
  • @@ -1222,14 +1222,14 @@
  • Fixed a problem compiling UDCs such as SET CENTURY &cOn because cOn was not parsed as an identifier but as a keyword.
  • New features - +
  • There is a new result marker (the NotEmpty result marker) in the preprocessor that does the same as the regular result marker, but writes a NIL value to the output when the (optional) match marker is not found in the input.
    This can be used when you want to make the result a part of an IIF() expression in the output, since the sections inside an IIF expression may not be empty.
    The result marker looks like this: <!marker!>
  • Using a Restricted match marker as the first token in an UDC was not allowed before. This has been fixed. You can now write a rule like this, which will output the keyword (SCATTER, GATHER or COPY) followed by the stringified list of options.
  • #command <cmd:SCATTER,GATHER,COPY> <*clauses*> => ?  <"cmd">, <"clauses">
    FUNCTION Start AS VOID
       SCATTER TO TEST   // is preprocessed into ? "SCATTER" , "TO TEST"
       RETURN
    Visual Studio Integration Bug Fixes - +
  • Fixed a problem introduced in 2.9.0.2 with code generation for WPF projects (#820)
  • Fixed a VS freezing problem after building (#819)
  • Fixed some problems with code collapsing and the navigation bar for source files that contains a SELF property (#825)
  • @@ -1252,7 +1252,7 @@
    New features - +
  • We have added a context item to the project context menu in the solution explorer to edit the project file. This will unload the project when needed and then open the file for editing.
  • The Rebuild Intellisense Database menu option in the Tools/XSharp menu now unloads the current solution, deletes the intellisense database and reopens the solution to make sure that the database is recreated correctly.
  • We have made some changes to the process that parses the source code for a solution in the background.
  • @@ -1260,7 +1260,7 @@
    Runtime New features - +
  • Added missing ErrorExec() function (#830)
  • Added support for BlobDirectExport, BlobDirectImport, BlobDirectPut and BlobDirectGet (#832)
  • Fixed a problem with creating DBF files with custom file extension. Also added support for _SET_MEMOEXT (#834)
  • @@ -1269,7 +1269,7 @@ Bug Fixes - +
  • Fixed a problem with _PrivateCount() throwing an InvalidateOperationException (#801)
  • Fixed a problem with member completion in the editor sometimes showing methods of the wrong type (#740)
  • Fixed some problems with the ACopy() function (#815)
  • @@ -1277,40 +1277,40 @@
    Macro compiler New features - +
  • Added support for the & operator (#835)
  • Added support for parameters by reference (both @ and REF are supported) for late bound method calls (#818)
  • VOXporter Bug Fixes - +
  • Fixed problem with incorrectly prefixing PUBLIC declarations with "@@"
  • Changes in 2.9.0.2 (Cahors) Compiler New features - +
  • The parser now supports class variable declarations and global declarations with multiple types(#709)
  • EXPORT var1 AS STRING, var2, var3 as LONG GLOBAL globalvar1 AS STRING, globalvar2, globalvar3 as LONG - +
  • If you are using our parser you should be aware that the ClassVarList rule has disappeared and that the ClassVars, VoGlobal and ClassVar rules have changed.
  • - +
  • We have added a command to fill a foxpro array with a single value
  • STORE <value> TO ARRAY <arrayName> - +
  • When you create a VOSTRUCT or UNION that contains a DATE field, then the compiler will now use the new __WinDate structure that is binary compatible with how DATE values are stored inside a VOSTRUCT or UNION in Visual Objects (#773)
  • It is now possible to use parentheses for (instead of brackets) accessing ARRAY elements in the FoxPro dialect. The compiler option /fox2 must be enabled for that to work (#746)
  • We have added support (for the FoxPro dialect only) for accessing WITH block expressions inside code of a calling function / method. So you can type .SomeProperty and access the property that belongs to a WITH BLOCK expression inside the calling code. To use this Late Binding must be enabled, since the compiler does not know the type of the expression from the calling code (#811).
  • Bug fixes - +
  • When you use the NEW or OVERRIDE modifier for a method where no (virtual) method in a parent class exists an error will now be generated (#586, #777)
  • Fixed a problem with LOGICAL AND and OR for USUAL variables in an array (#597)
  • Error messages and Warnings for some compiler generated code (such as Late bound code) were not always pointing to the right line number, but to the first line in the body of the method or function. This has been fixed. (#603)
  • @@ -1335,7 +1335,7 @@
    Runtime New Features - +
  • We have added several strongly typed overloads for the Empty() function that should result in a bit better performance (#669)
  • We have added an event handler to the RuntimeState class. This event handler is called "StateChanged" and expected a method with the following signature:
    Method MyStateChangedEventHandler(e AS StateChangedEventArgs) AS VOID
    The StateChangeEventArgs type has properties for the Setting Enum, the OldValue and the NewValue.
    You can use this if you have to synchronize the state between the X# runtime and an external app, for example a Vulcan App, VO App or for example (this is where we are using it) with an external database server, such as Advantage.
  • We have added a new (internal) type __WinDate that is used when you store a DATE value into a VoStruct or Union. This field is binary compatible with the Julian date that VO stores inside structures and unions.
  • @@ -1344,7 +1344,7 @@
    Bug Fixes - +
  • Fixed a problem (incompatibility with VO) in the Descend() function (#779) - IMPORTANT NOTE: If you are using Descend() in dbf index expressions, then those indexes need to be reindexed!
  • Late bound code that was returning a PSZ value was not correctly storing that inside a USUAL (#603)
  • Fixed a problem in the Cached IO that could cause problems with low level file IO (#724)
  • @@ -1359,7 +1359,7 @@
  • Fixed a problem with Directory() including files that match by shortname but not by longname (#800)
  • RDDs - +
  • When creating a new DBF with the DBFCDX driver an existing CDX file is not automatically deleted anymore (#603)
  • Fixed a problem with updating memo contents in DBFCDX (#782)
  • Fixed a runtime exception when creating DBFCDX index files with long filenames (#774)
  • @@ -1368,12 +1368,12 @@
  • Fixed a problem with VODBOrdCreate function failing it the cOrder parameter contains an empty string (#809)
  • Macro compiler - +
  • Fixed a problem in the Preprocessor
  • Added support for parameters passed by reference with the @ operator
  • Added support for M->, _MEMVAR-> and MEMVAR-> prefixes in the macro compiler
  • When the Macro compiler finds 2 or more functions with the same name it now uses the same precedence rules that the compiler uses:
  • - +
  • Functions in User Code are used first
  • Functions in the "Specific" runtimes (XSharp.VO, XSharp.XPP, XSharp.VFP, XSharp.Data) take precedence over the ones inside XSharp.RT and XSharp.Core
  • Functions in XSharp.RT take precedence over functions inside XSharp.Core
  • @@ -1383,9 +1383,9 @@ In this build we have started to use the "Community toolkit for Visual Studio extensions" that you can find on GitHub. This toolkit contains "best practices" for code for VS Extension writers, like we are. As a result more code is now running asynchronously which should result in better performance. We have also started to remove 32 bit specific code that would become a problem when migrating to VS 2022 which is a 64 bits version if Visual Studio that is expected to ship in November 2021. New features - +
  • Added several new features to the editor
  • - +
  • The editor can now show divider lines between entities. You can enable/disable this in the options dialog (#280)
  • Keyword inside QuickInfo tooltips are now colored (#748)
  • Goto definition now also works on "external" types. The editor generates a temporary file that contains the type information for the external type. In the options dialog you can also control if the generated code should contains comments (as read from the XML file that comes with an external DLL). (#763)
  • @@ -1393,16 +1393,16 @@
  • You can control which keyword is used for PRIVATE visibility from the Tools/Optons menu entry (PRIVATE or HIDDEN).
  • - +
  • The various code generators inside VS now follow the capitalization rules from the source code editor.
  • The intellisense database now has views that return the unique namespaces in the source code and in the external assemblies
  • The X# specific menu points in the Tools menu have been moved to a separate submenut
  • Added option for the WinForms designer to generate backup (.bak) files of form.prg and form.designer.prg files when saving (#799)
  • Bug Fixes - +
  • Fixed several problems in the editor:
  • - +
  • We have made several improvements to increase the speed inside the editor (#689, #701)
  • Fixed a problem in the type lookup of variables for FOREACH loops (#697)
  • Parameter tips were not shown for methods selected from a completion list (#706)
  • @@ -1422,14 +1422,14 @@
  • Fixed an editor exception in some cases when typing invalid code (#791)
  • - +
  • The code generator for Windows Forms was replacing tab characters with spaces. This has been fixed.(#438)
  • Fixed a problem with the Form Designer corrupting code that contains EXPORT ARRAY OF <type>
  • Fixed a problem with the Form Designer that when removing an event handler in the editor, some code was deleted (#812)
  • Fixed a problem with the Form Designer converting EXPORT, INSTANCE and HIDDEN keywords to PUBLIC and PRIVATE (#802)
  • VO-Compatible Editors - +
  • Now all VO-compatible editors support full Undo/Redo functionality. Also added cut/copy/paste functionality to the Menu editor
  • Fixed several visual problems with VOWED controls in Design and Test mode (#741)
  • Fixed a VS crash when Alt-Tabbing out of the editors, with the Properties window having focus (#764)
  • @@ -1442,13 +1442,13 @@ Changes in 2.8.3.15 (Cahors) Compiler New features - +
  • You can now use the .AND. logical operator and .OR. logical operator between variable names or numbers without leading or trailing whitespace (a.AND.b)
  • The PRIVATE declaration in the FoxPro dialect no longer allows an initializer.
  • Added support for the FoxPro NULL date ( { / / }, { - - } and { . . }) in the FoxPro dialect
  • Bug fixes - +
  • Fixed a problem with a DIM array that uses a DEFINE for its dimension (#638)
  • Fixed a problem with the FoxPro PUBLIC ARRAY command (The ARRAY keyword is no longer mandatory)  (#662).
  • Fixed a problem with DEFAULT(Usual) expressions as parameters for function / method calls (#664)
  • @@ -1462,7 +1462,7 @@
    Runtime Bug Fixes - +
  • The _shutdown flag in the Runtime State is now set when the system shuts down.
  • Fixed a problem with the FoxPro ALen() function (#650)
  • Added default values on several locations (#678)
  • @@ -1473,7 +1473,7 @@
    MacroCompiler New features - +
  • You can now use the .AND. operator between variable names or numbers without leading or trailing whitespace
  • Added support for the FoxPro NULL date ( { / / }, { - - } and { . . }) in the FoxPro dialect
  • Strings containing .AND. and .OR. are no longer reformatted by the macro compiler (#694)
  • @@ -1483,11 +1483,11 @@
    Please test this new functionality and let us know what you think of it.
    Visual Studio Integration New Features - +
  • "Highlight word" now highlights words in the whole file when the cursor is outside of an entity (for example on the USING statements in the start of the file).
  • Bug Fixes - +
  • Fixed a problem with displaying names of custom controls in the toolbox of the VO compatible Windows Editor
  • Fixed a problem with extra spaces when loading settings from cavowed.inf for the VO compatible Windows Editor
  • Fixed a problem with an incorrect completion list after an assignment statement (#658)
  • @@ -1501,13 +1501,13 @@
  • Fixed a problem where the incorrect methods were shown in the completion list (#695)
  • Tools - +
  • Fixed an issue in VOXPorter with resources and the copying to the Resources subfolder
  • Changes in 2.8.2.13 (Cahors) Compiler - +
  • Fixed issues with extension methods that were not marked as STATIC (#660)
  • Fixed problem with IIF() expressions that returned an OBJECT and were assigned to a Decimal
  • The pragma commands were not checking for the current dialect
  • @@ -1518,7 +1518,7 @@
  • Implicit conversions from OBJECT -> NUMERIC are now supported when /vo7 is enabled.
  • Runtime - +
  • Enumerating a USUAL variable in a FOREACH loop will now call a runtime function that returns the ARRAY inside the USUAL or throws an error otherwise (#246)
  • Fixed a problem creating index with an Eval block and 0 records (#619)
  • Fixed an incompatibility with the ALen() function and array handling compared to FoxPro (#642)
  • @@ -1533,16 +1533,16 @@
    Macro compiler - +
  • Fixed a problem calling functions after a new assembly was loaded with Assembly.Load()
  • Added support for passing variables by references (not yet for functions with Clipper calling convention) (#653)
  • VO SDK - +
  • Fixed a problem in GetObjectByHandle() in the GUI Classes(#677)
  • Visual Studio Integration - +
  • Fixed an exception on the Build Options page inside VS (#654)
  • The project system did not write back the right property for the XML documentation generation (#654)
  • Intellisense could crash in header files (#657)
  • @@ -1556,23 +1556,23 @@
  • Improved Build Speed in Visual Studio when no files are changed (#675)
  • Tools - +
  • VO Xporter was generating 2 lines in the .xsproj file for the output folder (#672)
  • Changes in 2.8.1.12 (Cahors) Compiler - +
  • Fixed issues with interpolated strings (#598, #622):
  • - +
  • The script compiler now correctly sets the AllowDot compiler option from the current active dialect in the runtime (Core & FoxPro: AllowDot = true)
  • When compiling with DOT(.) as instance method separator then the ":" character is used inside interpolated strings to prefix the format string.
  • When compiling with COLON (:) as instance method separator then the colon can not be used to separate expressions from the format string inside interpolated strings. In that case we now support a double colon (::) between the expression and the format string. For example
  • LOCAL num as LONG
    num := 42
    ? i"num = {num::F2}" // this diplays num with 2 decimals
    WAIT
    - +
  • You can now use DATE fields inside VOSTRUCT and UNION (#595)
  • Fixed an assertion error 'UnconvertedConditionalOperator' (#616)
  • Fixed an assertion error in the compiler when the namespace "xsharp" is used (#618)
  • @@ -1582,7 +1582,7 @@
  • Fixed a problem where the "IS Pattern" was not always working correctly for variables of type USUAL (#636)
  • Runtime - +
  • Implemented the FoxPro Evl() function (#389)
  • DbCloseArea() was returning TRUE even when no area was open. This was incompatible with VO. We are returning FALSE now.(#611)
  • Macro compiler was not able to find functions in assemblies that were loaded dynamically (#607)
  • @@ -1595,15 +1595,15 @@
  • Fixed a problem with the AELement() function (#639)
  • RDD System - +
  • Fixed a problem with indexes on workareas/cursors created with the SqlExec() function when the index expression contained "nullable" fields (#630)
  • Macrocompiler - +
  • The macro compiler had problems finding functions that were inside an assembly that was loaded later (#607)
  • Visual Studio Integration - +
  • Fix problem with saving dialect from General Page
  • Quick info and Goto definition were not working for members inside the same class when they were not prefixed with SELF:
  • Fix code completion for nullable types with the '?' syntax (#567)
  • @@ -1620,14 +1620,14 @@
  • Local variables were not always recognized with their correct type in the editor (#651)
  • Installer - +
  • The installer was adding an incorrect version of XSharp.CodeAnalysis.dll to the Global Assembly Cache. This has been fixed.
  • Changes in 2.8.0.0 (Cahors) Compiler General - +
  • We have migrated to the latest version of the Roslyn source code.
  • Passing a typed variable by reference to a function/method with clipper calling convention (untyped parameters) was not updating the local variable. This has been fixed.
  • Using the @ operator in a program in the VO Dialect when the /vo7 compiler option is NOT enabled could generate code that produces an error "Cannot be boxed". (#551)
  • @@ -1637,16 +1637,16 @@
  • The _SIZEOF() operator will generate a constant now for VOSTRUCTS and UNIONS. (#545)
  • Using a keyword as field name could cause problems. For example FIELD->NEXT was not handled properly. The compiler now allows that. Of course you can also use the @@ prefix to tell the compiler that in a particular case you do not mean the keyword but an identifier.
  • - +
  • Parenthesized expression that contained an expression list were not compiled correctly. This has been fixed.
    This could happen when you wanted to have more than one expression as part of an IIF() expression.
     
      LOCAL l AS LOGIC
      LOCAL v AS STRING
      l := TRUE                
      v := "abcd"
      ? iif (l, (v := Upper(v), Left(v,3)), (v := Lower(v), Left(v,4)))              
    Since Roslyn (the C# compiler) does not allow an expression list inside a conditional expression, we are converting the parenthesized expression now to a function call to a local function. The expressions inside the Parenthesized expression become the body of the new local function and the compiler calls the generated local function.
  • The compiler now warns if you call a Function in a class that has a member with the same name. For example
  • CLASS Test
    METHOD Left(sValue as STRING, nLen as DWORD) AS STRING
      RETURN "Test"
    METHOD ToString() AS STRING
      RETURN Left("abc",2)   // This will generate a warning that the function Left() is called and not the method Left().
                             // if you want to call the method you will have to prefix the call with SELF:
    END CLASS
    New language features - +
  • We have added support for LOCAL FUNCTION and LOCAL PROCEDURE statements.
    These functions and procedures become part of the statement list of another function, procedure, method etc. They have the following restrictions:
  • - +
  • A LOCAL FUNCTION must be terminated with END FUNCTION, a LOCAL PROCEDURE must be terminated with END PROCEDURE
  • The full "signature" of normal functions is supported, so Parameters, Return type, Type Parameters and Type Parameter constraints.
  • They cannot have Attributes (they are not compiler into methods but in a special kind of Lambda expression)
  • @@ -1657,24 +1657,24 @@
    - +
  • Added support for Expression bodied members. Expression body definitions let you provide a member's implementation in a very concise, readable form. You can use an expression body definition whenever the logic for any supported member, such as a method or property, consists of a single expression. An expression body definition has the following general syntax:
    MEMBER => expression
    An expression-bodied method consists of a single expression that returns a value whose type matches the method's return type, or, for methods that return void, that performs some operation. For example, types that override the ToString method typically include a single expression that returns the string representation of the current object.
    An example of this could be
  • CLASS MyClass
    METHOD ToString() AS STRING => "My Class"
    END CLASS

    The result of this code is exactly the same as

    CLASS MyClass
    METHOD ToString() AS STRING
      RETURN "My Class"
    END CLASS
    So you could say that the => operator replaces the RETURN keyword. - +
  • We have added support for the Null Coalescing Operator (??) like C# has as well as the Null Coalescing assignment operator (??=).
    This operator does a check for != null. The operator will only work on Reference types so not on value types like USUAL, DATE and the built-in types like INT.
  • FUNCTION Start() AS VOID
    LOCAL s := NULL AS STRING
    s := s ?? "abc"            // The ?? is the Null Coalescing Operator
    s ??= "abc"               // This is the same as the line before but compacter
    ? s
    RETURN
    // So this will not compile
    LOCAL i := 0 AS LONG
    i := i ?? 42      // Operator '??' cannot be applied to operands of type 'int' and 'int'
    // But this will compile
    LOCAL i := NULL AS LONG?   // Nullable LONG
    i := i ?? 42      
    - +
  • We have added support for the Properties with INIT accessors. These accessors allow you to assign a value to a property but only in the constructor. The property will be read only outside of he constructor of the class / structure.
  • We have added a new compiler option /enforceself. When this option is used then all calls to instance methods inside a class must be prefixed with SELF (or SUPER). In the FoxPro dialect THIS is supported too. Please note that some generated code, such as inside the Windows Forms editor does not use SELF: and applying this compiler option may force you to change the generated code, or may force you to add an #pragma options("enforceself", disable) to the code to disable the option for that file.
  • We have added a new compiler option /allowdot. With this option you can control if the DOT (".") operator is allowed to be used to access instance members. The default for the Core and FoxPro dialect is /allowdot+. The default for the other dialects is /allowdot-. You can also use this with a #pragma: #pragma options("allowdot", enable)
  • XML comments in the source code no longer require fully qualified cref names (#467)
  • Preprocessor - +
  • The preprocessor now automatically declares a match marker with the name <udc>. This match marker will contain all the tokens that were matched with the UDC by the preprocessor. This can be used for example to add the original source as string to the result:
    #command INSERT INTO <*dbfAndFields*> FROM MEMVAR => __FoxSqlInsertMemVar(<"udc">)
  • Wildcard markers (such as the dbfAndFields marker in the previous bullet) now can also appear in the middle of a UDC. They will continue to match until the first token after the Wildcard marker (in the above example the FROM keyword) is found.
  • The standard header files (from the XSharp\Include folder) are now also included in the compiler as resource. When the file is missing then these files will be loaded from the resource.
  • @@ -1682,19 +1682,19 @@
  • When wildcard tokens are included with a stringify result marker then the white space between these tokens is correctly included in the output of the UDC.
  • FoxPro dialect - +
  • The feature to allow parentheses as array delimiters for the FoxPro dialect that was added in the previous build had too many side effects. We have removed this feature for now. You have to use bracketed array arguments again.
  • - +
  • The /fox2 compiler option is no longer needed (and ignored by the compiler).
    The compiler now checks to see if a runtime function is marked NeedsAccessToLocalsAttribute, which is defined in the XSharp.Internal namespace.
    If the compiler finds a function that is marked with this attribute, such as the Type() function or the SQLExec() function then it will add some code before and after the function call to allow these functions to access the locals on the stack. This will only happen if the /memvar compiler option is enabled and only in the FoxPro dialect.
    The NeedsAccessToLocalsAttribute has a mandatory parameter which indicates if a function is expected to write to the locals or only read the locals.
    When the function is expected to write to locals then the compiler will generate extra code after the call to make sure that the locals are updated when needed.
  • - +
  • We have added a standard header file for the FoxPro embedded SQL statements. This header file should parse embedded SQL but will output warnings that the embedded SQL is not yet supported.
  • We have added the FoxPro array support, with a special subtype of the Array type in the runtime and support for DIMENSION and (Re)DIMENSION and filling arrays by assigning a single value. (#523)
  • Runtime General - +
  • Fixed a problem with the return value of FSeek() and FSeek3()
  • AsHexString() and AsString() were not displaying the same result for PTR values as Visual Objects.
  • Fixed a problem with SetScope() for the DBFCDX RDD when the previous scope was empty. (#578)
  • @@ -1708,7 +1708,7 @@
  • We have added a couple of functions that bring up dialogs to display the current open workareas, settings, globals and private and public memory variables. See DbgShowGlobals(),  DbgShowWorkareas(), DbgShowMemvars() and DbgShowSettings()
  • RDD system - +
  • DbCommit and DbCommitAll were failing when a workarea is opened Read only. This has been fixed. (#554)
  • When FoxPro CDX file has more than one tag and one of the tags has an invalid index expression (for example a missing closing parenthesis, which was accepted by Visual Objects) then the RDD system did not open the CDX at all. We now open the CDX with the exception of the tag with the corrupted index expression. (#542)
  • Added support for Advantage GUID and Int64 columns. GUIDs are returned as string and INT64 as INT64. We have also added some missing DEFINE values from the ACE header file.
  • @@ -1721,27 +1721,27 @@
  • Changed several method prototypes for ADS to have the correct IN / OUT modifiers (#568)
  • Macro Compiler - +
  • Fixed a problem in the FoxPro dialect assigning a value to an expression in the form of VariableName.PropertyName
  • The X# macro compiler was allowing to reference GLOBAL and DEFINE values in macros. This made the compiler incompatible with VO and this would cause problems when indexing on a field with the same name as a GLOBAL or DEFINE. The support to reference GLOBALs or DEFINEs has been removed from the macro compiler. (#554)
  • The Macro compiler had a problem with a variable name was surrounded with parentheses. It was seeing that as a typecast. This has been fixed. (#584)
  • Visual Objects SDK - +
  • Added some missing defines to the Win32APILibrary assembly, such as DUPLICATE_SAME_ACCESS.
  • DbServer:Filter was sometimes returning NIL instead of an empty string (#558)
  • VO Dialect - +
  • We have added support for SysObject (#596)
  • Xbase++ dialect - +
  • Fixed a problem with XPP Collation tables that was introduced in 2.7
  • FoxPro dialect - +
  • Added the NeedsAccessToLocalsAttribute for the /fox2 compiler option
  • Adjusted the code that exposes the values of LOCAL variables to functions such as Type() and SqlExec().
  • Several functions have been marked with the new attributes so they will be able to "see" local variables.
  • @@ -1759,7 +1759,7 @@ Visual Studio Integration The Visual Studio integration in this build no longer supports Visual Studio 2015. Only Visual Studio 2017 and 2019 are supported. General - +
  • New code templates in a subfolder were generated with a namespace name that starts with "global::". This has been fixed.
  • Added support for LOCAL FUNCTION and LOCAL PROCEDURE.
  • Adding an item from the Class template in a folder prefixed the namespace with "global::". This has been fixed.
  • @@ -1774,7 +1774,7 @@
    Source code editor - +
  • Longer QuickInfo tooltips are now shown over multiple lines to make them easier to read.
  • Refactored the "type lookup" code to improve the speed of the source code editor
  • Member completion in the source code editor was not always working for variables declared with the VAR keyword where there were nested curly braces and/or parentheses. (#541, #560)
  • @@ -1788,11 +1788,11 @@
    Code generator - +
  • Character literals are now always prefixed with the 'c' prefix and values > 127 are written in Hex notation to make sure they work in all codepages.
  • Windows Forms Editor - +
  • We have fixed several issues with DevExpress controls.
  • Fixed a problem with a control that has the same name as a X# keyword (#566)
  • Fixed a problem with a control that has a property of type DWORD (#588)
  • @@ -1800,11 +1800,11 @@
  • The .designer.prg no longer has to have the "INHERIT FROM " clause. (#533)
  • Object Browser - +
  • Goto definition was not working when you had performed a search first (#565)
  • VO Compatible Forms editor - +
  • Added support in the WED for correctly visually displaying custom controls that do not have the expected control class inheritance defined
  • Fixed a problem with custom controls in cavowed.inf not recognized that are not data aware
  • Added support for Cloning Windows (#508)
  • @@ -1813,12 +1813,12 @@
  • There is a menu option in Tools/Options to set several settings (#279, #440)
  • Debugger - +
  • The debugger now fully supports 64 bits debugging
  • Added support for the new type names for CURRENCY and BINARY
  • Templates - +
  • We have made adjustments to several VS item templates and project templates (#589)
  • We have added a new X# t4 template (.tt file)
  • @@ -1826,39 +1826,39 @@ Changes in 2.7.0.0 (Cahors) Compiler General - +
  • Fixed a problem with Nullable types that were missing an explicit cast for an assignment
  • - +
  • Fixed a problem with calling a parent constructor in a class hierarchy where a parent level was being skipped and the constructor for the grandparent was called instead.
  • - +
  • The /usenativeversion commandline option was not checking +/- switches. This has been fixed.
  • Fixed a problem with PCall() and PCallNative() in source files with an embedded DOT in the filename (my.file.prg)
  • We have added a new header files to the files in the XSharp\Include files that helps to add custom User Defined Commands or defines that you want to include in every project. This file (CustomDefs.xh) will be automatically include by our XSharpDefs.xh.
    The default contents of this file is just some comments.
    The installer will NOT overwrite the file in this folder and will not delete it when the product is uninstalled.
    You can choose to customize this file in the Include folder under Project Files. However you can also add a file with the same name to your project folder or to a common include folder for your project/solution. That last location allows you to keep the header file under source code control with the rest of your source code.
  • FoxPro dialect - +
  • The compiler now allows a M Dot (M.) prefix in LOCAL, PRIVATE and PUBLIC declarations. (LOCAL m.Name)
  • The compiler now also accepts parentheses as array delimiters in the Foxpro Dialect (aMyArray(1,2))
  • The compiler now allows (and ignores) AS Type OF Classlib clauses for PRIVATE, PUBLIC, PARAMETERS and LPARAMETERS declarations.
  • - +
  • Support for TO keyword in CATCH clause of TRY CATCH
  • Added support for the ASSERT command and SET ASSERT
  • - +
  • Added support for SET CONSOLE and SET ALTERNATE
  • Assignments to macros with a single equals operator were not working ( &myVar = 42). This has been fixed.
  • Added support for zero length binary literals (0h)
  • Build System - +
  • Added a project property to control if RC4005 errors (duplicate defines) should be suppressed for the Native Resource compiler
  • Runtime General - +
  • IsMethod() now returns TRUE for overloaded methods.
  • AbsFloat() was "losing" the settings for # of decimal places. This has been fixed.
  • Binary:ToString() was using single digit numbers for binary values < 15. This has been fixed.
  • @@ -1873,24 +1873,24 @@
  • We have added a DatabasePropertyCollection type. This type is used to add "additional" properties to Fields, such as the DBF fields for FoxPro tables.
  • Terminal API - +
  • We have added support for Alternate files. SET ALTERNATE TO SomeFile.txt. Also SET ALTERNATE ON and SET ALTERNATE OFF
  • The ? statement now respects the sessions for Set Console and Set Alternate .
  • We have added support for the SET COLOR command. Only the fist color in the settings is used and the blink attribute is ignored and interpreted as "highlight". For example SET COLOR TO w+/b
  • We have added a CLEAR SCREEN command
  • FoxPro dialect - +
  • Added an Assert dialog
  • Added support for DBC files. This includes the SET DATABASE to commands, DbGetProp() and reading properties for files that are part of a database without explicitly opening the database first. DbSetProp() does not do anything yet. Also functions like DbAlias() and similar have been implemented.
  • The Runtime now works with DataSession object. The DBC files are opened in their own datasession as well of the files per thread. Each datasession has a list of open tables and a unique list of aliases and cursor/workarea numbers.
  • AutoIncrement columns in cursors returned by SqlExec() now have a numbering scheme that starts with -1 and subtracts 1 for every new row added.
  • - +
  • Several settings needed for the FoxPro dialect have been added to the Set Enum.
  • Macro Compiler - +
  • Until now the macro compiler was producing runtime codeblocks that take an array of objects and return an object return value. There was a class in the runtime that wrapped this and took care of usual -> object conversion for the parameters and for object-> usual conversion of the return value. This caused a problem when macros were returning a NIL value because that was converted to NULL_OBJECT.
    The reason for the OBJECT API is that the macro compiler needs to be used in the Core dialect (in the RDD system) and this dialect does not support the USUAL type.
    We have now added a new IMacroCompilerUsual interface in the XSharp.RT assembly that allows you to compile a string into a codeblock that supports USUAL arguments and a USUAL return value. The macro compiler now supports both this interface as well as the 'old' interface. As a result you may see a (very small) performance improvement when compiling macros.
  • Calling Altd() and _GetInst() inside a macro was not supported. This has been fixed.
  • The macro compiler was reporting an error when you had overridden a built-in function in your own code. We have now implemented a default MacroCompilerResolveAmbiguousMatch delegate in the runtime that now gives preference to functions that are defined in your code over functions in our code.
  • @@ -1899,7 +1899,7 @@
  • Added support for the CURRENCY and BINARY types to the macro compiler.
  • RDD System - +
  • Exclusive DBF access now works in "buffered" mode which should make it a lot faster
  • Internally the RDDs now work with the Stream objects, which makes it a bit faster.
  • Fixed a problem when updating a key in an index where many duplicate key values existed.
  • @@ -1911,7 +1911,7 @@
  • We have added structures and functions for the ADS Management API to the RDD assembly.
  • Visual Studio integration - +
  • When creating a new VO compatible UI form in the VS IDE you can now clone an existing form.
  • Fixed some problems with custom controls in the VO compatible form editor.
  • Fixed several problems in the Windows Forms editor for the code parsing and code generation for DevExpress controls
  • @@ -1923,13 +1923,13 @@ Changes in 2.6.1.0 (Cahors) This is a bug fix release with fixes for some issues found in 2.6.0.0 Compiler - +
  • Fixed problems with passing typed variables by reference to late bound code and to untyped constructors
  • Fixed an internal compiler error in code where a define containing a logic was cast to a byte
      BYTE(_CAST, LOGICDEFINE).
    Of course this is code that should be avoided at all times, but unfortunately even the VO SDK is full of code like this..
    The example above should be written as IIF(LOGICDEFINE, 1,0) for example. The compiler will see that the define is constant and will replace that code with either 1 or 0.
  • The compiler was not recognizing $.50 as a valid Currency literal (because the 0 is missing). This is now accepted.
  • Runtime - +
  • Updated the code in the runtime that handles late bound calls to improve the handling of parameters by reference
  • Fixed a problem in late bound code when accessing properties such as fInit, dwFuncs and dwVars in the OleAutoObject class
  • Added operator TRUE and operator FALSE to the Usual type
  • @@ -1938,7 +1938,7 @@
  • Added a DbTableSave() function to save changes in a DbDataTable to the current workarea.
  • Visual Studio integration - +
  • Opening and upgrading project files that are under Scc could sometimes cause problems. This has been fixed
  • Fixed a regression introduced in 2.6.0.0. causing the task list to no longer be updated.
  • Opening a solution that referenced X# projects that do not exist on disk could cause an exception. This has been fixed.
  • @@ -1950,7 +1950,7 @@ Changes in 2.6.0.0 (Cahors) Please note that there are some breaking changes in this build.
    Therefore the Assembly version number of the Runtime Components has been changed and you will need to recompile all your code and you need new versions of 3rd party components!
    Compiler - +
  • The compiler was ignoring a (USUAL) cast. This has been fixed.
  • When the compiler detects a TRY .. ENDTRY without CATCH and FINALLY then it automatically adds a CATCH class that catches all exceptions silently. This was already the case, but we now generate a warning XS9101 when this happens.
  • Passing parameters by reference with an @ sign was not working correctly for late bound method calls. This has been fixed.
  • @@ -1970,32 +1970,32 @@
  • Added support for pattern matching (WHEN clauses) in TRY .. CATCH statements, such as in the example below. The WHEN keyword is positional, so it can also be used as a variable name like in the example.
  • FUNCTION Test AS VOID
      local when := 42 as long
      TRY
         THROW Exception{"FooBar"}
      CATCH e as Exception WHEN e:Message == "Foo"
         ? "Foo", when, e:Message
      CATCH e as Exception WHEN e:Message == "Bar"
         ? "Bar", when, e:Message
      CATCH WHEN when == 42
         ? "No Foo and No Bar", when
         
      END TRY                
      RETURN
    - +
  • Added support for pattern matching and filters for SWITCH statements. We support both the "Identifier AS Type" clause as well as the "WHEN expression" filter clause, like in the examples below
  •   VAR foo := 42
      VAR iValues := <LONG>{1,2,3,4,5}
      FOREACH VAR i IN iValues
         SWITCH i
         CASE 1                        // This is now called the 'constant pattern'
            ? "One"
         CASE 2 WHEN foo == 42         // Filter with a constant pattern
            ? "Two and Foo == 42"
         CASE 2
            ? "Two"
         CASE 3
            ? "Three"
         CASE 4
            ? "Four"
         OTHERWISE
            ? "Other", i
         END SWITCH
      VAR oValues := <OBJECT>{1,2.1,"abc", "def", TRUE, FALSE, 1.1m}
      FOREACH VAR o in oValues
         SWITCH o
         CASE i AS LONG         // Pattern matching
            ? "Long", i
         CASE r8 AS REAL8   // Pattern matching
            ? "Real8", r8
         CASE s AS STRING  WHEN s == "abc" // Pattern matching with filter
            ? "String abc", s
         CASE s AS STRING     // Pattern matching
            ? "String other", s
         CASE l AS LOGIC   WHEN l == TRUE   // Pattern matching with filter
            ? "Logic", l
         OTHERWISE
            ? o:GetType():FullName, o
         END SWITCH
      NEXT
    - +
  • Please note that the performance of these patterns and filters is just like normal IF statements or DO CASE statements.
    The difference is that the compiler checks for duplicate CASE expressions so you are less likely to make mistakes.
  • We have added support for the IN parameter modifier. This declares a parameter that is a REF READONLY parameter. You could consider to use this when passing large structures to methods or functions. Instead of passing the whole structure then the compiler will only pass the address of the structure which is 4 bytes or 8 bytes depending on if you are running in 32 bits or 64 bits.
    We are planning to use this in the X# runtime for functions that accept USUAL parameters which should give you a small performance benefit (Usual variables are 16 bytes in 32 bits mode and 20 bytes when running in 64 bit mode).
  • Runtime - +
  • Error messages in Late Bound code were not always showing the error causing the exception. We now retrieve the "inner most" exception so the message shows the first exception that was thrown.
  • We have added runtime state settings for Set.Safety and Set.Compatible and the functions for SetCompatible and SetSafety
  • - +
  • A UDC used to save and restore workareas for various Db..() functions was incorrect, causing the wrong area to be selected after the function call. This has been fixed.
  • - +
  • The VFP MkDir() function has been added.
  • Fixed a problem in late bound IVarGet() / IVarPut() when a subclass of a type implements only the Getter or the Setter and the parent class implements both.
  • - +
  • We have added a IDynamicProperties interface and added an implementation of this on the XPP DataObject, VFP Empty and VO OleAutoObject classes. This interface is used to optimize late bound access to properties in these classes.
  • An Exception in OleAutoObject.NoMethod was not forwarded "as is" but as an argument exception.
  • - +
  • The Select() function now behaves differently in the FoxPro dialect to be compatible with FoxPro (no exception is thrown when the alias that is passed does not exist)
  • When an Error object is created from an exception then the innermost exception is used for the error information.
  • The casing of the Default() function has changed.
  • @@ -2003,7 +2003,7 @@
  • We have added the CLOSE ALL UDC to dbcmd.xh as synonym for CLOSE DATABASES.
  • RDD System - +
  • Fixed a problem in the Advantage RDD for the ADSADT driver when field names were > 10 characters.
  • In the Advantage RDD the EOF, BOF and FOUND flags for tables that are a child in a relation were not properly set. This has been fixed.
  • In the FoxPro dialect the 'AutoOrder' behavior has changed. In this dialect no longer the first order in the first index is selected. The index file is opened but the file stays in natural order and when opening the file the cursor is positioned on the record number 1.
  • @@ -2013,7 +2013,7 @@
  • Fixed a problem with the OrdDescend() function/
  • Visual Studio integration - +
  • Fixed a problem in the VS parser for default expressions in parameter lists
  • Parameters for external methods/functions were not always showing the right "As"/"Is" modifiers
  • The location on the QuickInfo tooltip is now shown on its own line inside the tooltip.
  • @@ -2024,12 +2024,12 @@
  • When looking for a method such as Foo.SomeMethod() the codemodel sometimes returned a method Bar.SomeMethod().
    This was leading to problems when opening forms in the Windows Forms editor. This has been fixed.
  • VO Compatible editors - +
  • Code generated from the VO Compatible editors now preserves the INTERNAL or other modifiers as well as IMPLEMENTS clauses for classes.
  • We have fixed the display of "LoadResString" captions in PushButton controls
  • Foxpro commands - +
  • We have added support for several new Foxpro compatible commands:
  • CLOSE ALL
  • SCATTER
  • @@ -2040,32 +2040,32 @@
  • APPEND FROM SDF|CSV|DELIMITED|FOXPLUS|FOX2X
  • All variations support a fields list, FIELDS LIKE or FIELDS EXCEPT clause and the relevant commands also support the MEMO and BLANK clauses.
  • - +
  • Not all variations from COPY TO and APPEND FROM are supports, such as copying to excel and sylk
  • The Database and name clause in the COPY TO command are ignored for now as well as the CodePage clause
  • Build System - +
  • We have prepared the X# Build System to work with SDK type projects that are used by .Net 5 and .Net Core. See the topic below for what this means for the project files.
  • Please note that the source code for the Build System has been moved to the Compiler repository on GitHub, since the build system is also needed for automated builds that run outside of Visual Studio.
  • Changes to project files - +
  • We are now no longer deploying our MSBuild support to a folder inside each VS version separately but we are only deploying it once in a folder inside the XSharp installation folder.
    The installer sets an environment variable XSharpMsBuildDir which points to that folder. As a result all project files will be updated when opened with this version of X#.
  • - +
  • The change that we make is that the macro "$(MSBuildExtensionsPath)\XSharp" is replaced with "$(XSharpMsBuildDir)" which is an environment variable that points to the location of the X# MsBuild support files on your machine. If you are running X# on a build server you can set this environment variable in your build scripts when needed.
  • The installer automatically adds this environment variable and points it to the <XSharpDir>\MsBuild folder.
  • Changes in 2.5.2.0 (Cahors) Compiler - +
  • When a define contains an expression that contains the _Chr() function with a value > 127 then a warning is generated about possible code page differences between the development machine and the end users machine
  • Fixed an issue where a define was defined as PTR(_CAST,0)  and this define was also used as a default value for a function/method.
  • Runtime - +
  • Calling IsAccess, IsAssign and similar methods on a NULL_OBJECT was causing an exception. This has been fixed.
  • EmptyUsual now also works for the type OBJECT
  • When a float division was returning an Infinite value then no divide by zero exception was generated. This has been fixed.
  • @@ -2074,15 +2074,15 @@
  • The variable name passed to NoIVarGet() and NoVarPut() is now converted to Uppercase.
  • RDD System - +
  • Fixed a problem with skipping forward when a Scoped Descending Cdx was at Eof()
  • VOSDK - +
  • Several DbServer methods were calling a method to write changes before the correct workarea was selected. This was an old bug originating in VO and has been fixed.
  • Visual Studio integration - +
  • Looking up XML documentation was sometimes not working in VS 2019. This has been fixed.
  • ClassView and Objectview are working "somewhat" now. This needs to be improved.
  • Improved the loading of so called "Primary Interop Assemblies"
  • @@ -2092,22 +2092,22 @@
  • The position and size of the property window and toolbox of the VO Window editor (and the other VO Editors) is now saved between sessions of Visual Studio.
  • Build System - +
  • The generated XML files were generated in the project folder and not in the intermediate folder. This has been fixed.
  • Documentation - +
  • The [Source] links were missing for most topics. This has been fixed.
  • Corrected some docs
  • Changes in 2.5.1.0 (Cahors) Compiler - +
  • no changes to the compiler in this build (it is still called 2.5.0.0)
  • Runtime - +
  • (VO Compatibility) Fixed a VO compatibility issue for arrays . Accessing an single dimensional array with an index with 2 dimensions now returns NIL and does not generate an exception. This is stupid but compatible.
  • (VO Compatibility) Comparing a usual with a numeric value with a symbol no longer generates an exception. The numeric value is now casted to a symbol and that symbol is used for the comparison.
  • (XPP compatibility) Accessing a USUAL variable with the index operator (u[1]) is not allowed for usuals containing a LONG. This will return TRUE or FALSE and is a simple way to check if a bit is set.
  • @@ -2115,7 +2115,7 @@
  • Added some optimizations to the support code for late binding
  • Visual Studio integration - +
  • Reading type information for external assemblies would fail when the external assembly contained 2 types for which the names were only different in case.
  • The entity parser did not recognize GET and SET accessors that were prefixed with a visibility modifier (PROTECTED SET)
  • The entity parser did not recognize ENUM members that did not start with the MEMBER keyword
  • @@ -2124,20 +2124,20 @@
  • Fixed a problem in the VS debugger where we were subtracting one from index operators for arrays and collections. This was not correct (obviously).
  • Build System - +
  • The file name of the generated XML file was derived from the project file name instead of the output assembly name. This has been fixed.
  • Changes in 2.5.0.0 (Cahors) Compiler - +
  • #pragma lines that were followed by incorrect syntax would "eat" the incorrect syntax causing entire methods to be excluded from compilation. This has been fixed.
  • Multiline compile time codeblocks in a method /function with a VOID return type were not being compiled correctly. This has been fixed.
  • The compiler now allows to type the parameters in a codeblock. Since the codeblock definition requires parameters of type USUAL this gets transformed by the compiler. The parameters will still be of type USUAL, but inside the codeblock a local variable of the proper type will be allocated. So this compiles now
  •   { | s as string, i as int| s:SubString(i,1) } - +
  • The code to fill in missing parameters was causing problems when passing parameters to COM calls (Word Example from Peter Monadjemi)
  • Fixed a problem passing an IntPtr, Typed pointer of the address of a VOSTRUCT to a function that accepts an object.
  • We have added code to add an integer value to a PSZ, which results in a new PSZ that starts at a relative location in the original PSZ. No new buffer is allocated.
  • @@ -2150,14 +2150,14 @@
  • The compiler now allows to embed quotes inside a string by writing double quotes. So this works:
  • ? "Some String that has an embedded "" character" - +
  • When you declare a MEMVAR with the same name as a function, the compiler will now have no problem anymore resolving the function call. Please note that you HAVE to declare the memvar for this resolution to work.
    For example

  • FUNCTION Start() AS VOID
    MEMVAR Test
    Test := 123      // assign to the memory variable
    Test(Test)      // call the function 'Test' with the value of 'Test'
    RETURN
    FUNCTION Test(a)
    ? a
    RETURN a
    Common Runtime - +
  • The Workareas class no longer has an array of 4096 elements, but uses a dictionary to hold the open RDDs. This reduces the memory used by the runtime state.
  • Fixed a problem in the WrapperRDD class
  • OrdSetFocus() now returns the previous active tag as STRING
  • @@ -2181,11 +2181,11 @@
  • The OS() function now returns a more appropriate version description when running on Windows. It reads the version name from the registry and also includes a x86 and x64 flag in the version.
  • RDD System - +
  • The DBF RDD Now forces a disk flush when writing a record in shared mode.
  • Fixed a problem in the DBFCDX rdd that could corrupt indexes.
  • We have built in a validation routine inside the DBFCDX RDD that validates the integrity of the current tag. To call this routine call DbOrderInfo with the DBOI_VALIDATE constant.
    This will validate:
  • - +
  • If all records are included exactly once in the index
  • If the values for each record in the index are correct
  • If the order of the index keys in a page is correct
  • @@ -2193,33 +2193,33 @@
    When a problem is found then this call returns FALSE and a file will be written with the name <BagName>_<TagName>.ERR containing a description of the errors found. - +
  • Most exported variables inside the Workarea class (inside XSharp.Core) and other RDD classes have been changed to PROTECTED.
    We have also added some properties for variables that need to be accessed from outside of the RDD
  • Fixed a problem that occurred when skipping back repeatedly from the BOF position in a scoped CDX index.
  • The Zap() operation for DBFCDX was not clearing one of the internal caches. This has been fixed.
  • The DBFCDX driver now closes and deletes a CDX file when the last tag in that CDX has been deleted.
  • Macro compiler - +
  • The macro compiler was not recognizing 0000.00.00 as an empty date. This has been fixed.
  • The macro compiler now also exotic characters in identifiers like the normal compiler. We have added the same identifier name rules that the C# compiler uses.
  • XBase++ Functions - +
  • Fixed a problem in the XPP function SetCollationTable()
  • DbCargo() can now also set the cargo value for a workarea to NULL or NIL
  • We have added several functions, such as PosUpper(), PosLower(), PosIns() and PosDel().
  • VFP Functions - +
  • Added AllTrim() , RTrim(), LTrim() and Trim() variations for FoxPro (thanks Antonio)
  • Added StrToFile() and FileToStr() (thanks Antonio and Karl Heinz)
  • VOSDK - +
  • We have created a Destroy() method on the CSession and CSocket class, so you can 'clean up' objects (in VO you could call Axit(), but that is no longer allowed). The derstructor on these classes will also call Destroy().
  • Fixed a problem in TreeView:GetItemAttributes. It can now also be called with a hItem (which happens inside TreeViewSelectionEvent:NewTreeViewItem)
  • The OpenDialog class is now resizable.
  • @@ -2230,7 +2230,7 @@
    Visual Studio Integration Code Model - +
  • We have totally rewritten the background parser and code model that is used to parse "entities" in the VS editor and that is used to build a memory model of the types, methods, functions etc in your VS solution. This parser now uses the same lexer that the compiler uses, but the entities are collected with a hand written parser (since the code in the editor buffer may contains incomplete code we can't reliably use the normal parser).
  • We are now using a SQLite database to persist the code model between sessions. This reduces the memory needed by the X# project system. We are no longer keeping the entire code model in memory.
  • This also means that when you reopen an existing solution we will only have to parse files that have  changed since the last time they were processed. That should speed up loading of large VS solutions.
  • @@ -2239,7 +2239,7 @@
    Source code editor - +
  • Fixed a problem with the dropdown comboboxes above the editor when the cursor is in a line of code before the first entity.
  • Fixed a problem that functions in the editor after a class declaration had no collapsible regions
  • The code completion inside the editor now also picks up extension methods for the types themselves, but also extension methods for interfaces implemented by these types.
  • @@ -2248,21 +2248,21 @@
  • Fixed several problems in the "reformatting" code
  • Windows Forms editor - +
  • Some inline assignments to fields inside classes that are used by the Windows Forms could make the form unusable by the form editor. This has been fixed.
  • The Windows Forms editor was sometimes removing blank lines between entities. This has been fixed.
  • User Defined Commands in code parsed by the Windows Forms Editor were not recognized and disappeared when the form was changed and saved. This has been fixed.
  • Fixed a problem with setting images and similar properties with resources stored in the project resources file (which are prefixed with "global::" in the source code)
  • VOXporter - +
  • We have added support to export VO Forms from the AEFs to XML format
  • We have added support to export VO Menus from the AEFs to XML format
  • Changes in 2.4.1.0 (Bandol GA 2.4a) Compiler - +
  • Bracketed strings are now no longer supported in the Core dialect to avoid problems with single line external property declarations that contain attributes between the GET and SET keywords
  • The PROPERTY keyword was not properly recognized after an EXTERN modifier.
  • Fixed a XS9021 warning for a IIF expressions with 2 numeric constants
  • @@ -2270,7 +2270,7 @@
  • We have added a new compiler option -fox2. This option makes local variables visible to the macro compiler and should also be used when you use SQL statements with embedded parameters. This compiler option must be used in combination with -memvar and the FoxPro dialect
  • Runtime - +
  • Fixed a problem in the DELIM Rdd that would occur when using DbServer:AppendDelimited() and DbServer:CopyDelimited().
  • Fixed a problem with DbSetOrder() returning TRUE even when the order was not found.
  • Fixed a problem where the File() function would return FALSE when using wildcard characters
  • @@ -2287,11 +2287,11 @@
  • IVarGet() and Send() now return Empty strings when a method returns a NULL_STRING and the return type  is STRING
  • RDD - +
  • Getting the OrdKeyNo for a scoped index was resetting the index position to the top of the index. This would affect scrollbars in browsers for scoped indexes
  • VOSDK - +
  • The Console classes assembly is now marked as AnyCpu.
  • Fixed a problem introduced in the previous build with the calling convention for certain functions imported from Shell32.DLL such as the Drag and Drop support.
  • Fixed a problem in the PrintingDevice constructor for reading of printers when running on a Remote Desktop
  • @@ -2300,7 +2300,7 @@
  • Improved "column scatter" code for the DataBrowser class
  • Visual Studio Integration - +
  • If you removed all the characters from the "Commit Completion List" control in the XSharp editor options, then after restarting VS all default characters would appear. We now remember that you have cleared the list and will not refill the list again.
  • Fixed a problem that caused the editor not to rescan the current buffer for changed entities
  • Added project property for the new -fox2 compiler option
  • @@ -2312,7 +2312,7 @@ Changes in 2.4.0.0 (Bandol GA 2.4) Compiler - +
  • Fixed problems where certain operations on integers would still return the wrong variable type
  • The Unary Minus operator on unsigned integral types (BYTE, WORD, DWORD, UINT64) was returning the same type as the original, so it was not returning a negative value. This has been changed. The return value of this operator is now the next larger signed integral type.
  • Using a compiler macro, such as __VERSION__ in an interpolated string was causing an internal error in the compiler. This has been fixed.
  • @@ -2320,7 +2320,7 @@
  • Bracketed strings are now also recognized after a RETURN and GET keyword.
  • Runtime - +
  • Fixed problems when subtracting a dword from a date (related to the signed/unsigned problems in the compiler)
  • LUpdate() now returns a NULL_DATE for workareas have no open table.
  • Added the missing ErrorStack() function (thanks Leonid)
  • @@ -2336,7 +2336,7 @@
  • Fixed several incompatibilities with VO for FLOAT->STRING conversions
  • RDD System - +
  • Fixed a problem with skipping backward in a DBFCDX table with a scope
  • Fixed a problem with creating unique indexes with the DBFCDX and DBFNTX drivers
  • Writing NULL values to DBF columns is now always supported. When the column is a Nullable column in a DBFVFP table then the null flags are set. For other RDDs a NULL value will be written as a blank value.
  • @@ -2349,31 +2349,31 @@
    RddSetDefault("DBFNTX")
    DbUseArea(TRUE,"DBFNTX", "c:\Test\TEST.DBF")
    DbCopyDelim("C:\test\test.txt")             // this uses the DELIM RDD

    RuntimeState.DelimRDD := "CSV"              // Tell the runtime to use the CSV RDD for delimited writes
    DbCopyDelim("C:\test\test.csv")             // this uses the CSV RDD

    RuntimeState.DelimRDD := "TSV"              // Tell the runtime to use the TSV RDD for delimited writes
    DbCopyDelim("C:\test\test.tsv")             // this uses the TSV RDD
    DbZap()

    RuntimeState.DelimRDD := "CSV"              // Tell the runtime to use the CSV RDD for delimited reads
    DbAppDelim("C:\test\test.csv")              // this uses the CSV RDD
    VO SDK - +
  • PrintingDevice:Init() no longer tries to read the default printer from win.ini but from the registry
  • Several other locations where the code was still accessing win.ini (with the GetProfile..() funcitons) have been updated.
  • The GUI Classes were delay loading several calls to common dialog DLL and winspool.drv. This has changed because that is no longer needed in .Net.
  • Cleaned up all PSZ(_CAST operations in GUI Classes.
  • Visual Studio integration - +
  • Parameter tips for OUT variables were shown as REF
  • XML descriptions for member with REF or OUT parameters were not found
  • Fixed an exception in the VS Editor
  • VOXporter - +
  • No changes in this build
  • Changes in 2.3.2 (Bandol GA 2.3b) Compiler - +
  • Added support for Bracketed Strings ([Some String containing quotes: '' and ' ] )
  • Added support for Support for PRIVATE/PUBLIC syntax with &Id and &Id.Suffix notation
  • EXE files were created without manifest before, unless you were using a WIN32 resource with a manifest. This manifest is now correctly added to exe files when no manifest is supplied.
  • The handling of unmanaged resources in relation to version resources and manifests has changed:
  • - +
  • When the compiler detects native resources it will now check to see if there is a version and/or manifest resource included.
  • When there is no manifest resource, then the default manifest resource will be added to the resources from the Win32 resource file.
  • When there is a version resource then this version resource will be replaced by the version resource that the compiler generates from the Assembly attributes.
  • @@ -2381,18 +2381,18 @@
  • Of course we have added a command line option to suppress this: if you use the commandline option "-usenativeversion" then the native version that is included in the Win32 resource will be used. If there is no version resource included in the Win32 resource file, then this commandline option is ignored.
  • - +
  • PCOUNT() and ARGCOUNT() are now supported inside ACCESS/ASSIGN methods. The number of parameters that you can pass is still fixed, but both functions will now return the # of parameters defined in ACCESS and/or ASSIGN methods.
  • We fixed a problem that a compiler error "Failed to emit module" was produced instead of showing the real problem in the code (a missing type) .
  • Extended match markers in the preprocessor, such as <(file)>  in the USE udc, now also properly match file names.
  • Improved the detection algorithm that distinguishes parenthesized expressions and typecasts. This algorithm is now:
  • - +
  • Built in type names between parentheses are always seen as a typecast. For example (DWORD), (SHORT) etc.
  • Other type names between parentheses may be treated as typecast but also as parenthesized expression. This depends on the token following the closing parenthesis. When this token is an operator such as +, -, / or * then this is seen as parenthesized expression. When the token following the closing parenthesis is an opening parenthesis then the expression is seen as a typecast. Some examples:
  • ? (DWORD) +42       // this is a typecast
    ? (System.UInt32) +42   // this is a parenthesized expression and will NOT compile
    ? (System.UInt32) 42    // this is a typecast because there is no operator before 42
    ? (System.UInt32) (+42) // this is a typecast because +42 is between parentheses
    - +
  • Code that calls the Axit() method now generates  a compiler error.
  • We have implemented the /vo11 compiler option
  • We have fixed several signed/unsigned warnings
  • @@ -2400,7 +2400,7 @@
  • The lexer now recognizes (in the FoxPro dialect) the For() and Field() functions and you do not need to prefix these with @@ anymore.
  • Runtime - +
  • Fix for StrZero() with negative values
  • Fix for IsSpace() crashing with empty or null string
  • AFill() in the VFP dialect now fills also elements in subarrays (for multi dimensional arrays)
  • @@ -2421,18 +2421,18 @@
  • We have added DBOI_COLLATION and DBS_CAPTION for FoxPro specific properties
  • VO SDK - +
  • We have removed the versioninfo resource from the GUI classes sourcecode. The version info is now generated from the Assembly attributes
  • We have cleaned up the code and removed the warnings 9020 and 9021 from the suppressed warnings, since the compiler now handles this correctly.
  • RDD system - +
  • The DBFVP driver no longer fails to open a DBF when the DBC file is used exclusively by someone else
  • Added support for reading captions with DBS_CAPTION and collations with DBOI_COLLATION
  • The DBFNTX driver was not setting the HPLocking flag properly when creating new indexes
  • Visual Studio integration - +
  • The type lookup for variables declared with a VAR keyword could sometimes go into an infinite loop. This has been fixed.
  • Members starting with '__' are now only hidden from completion lists when the 'Hide Advanced members' checkbox in the general editor options is checked
  • Added support for colorizing BRACKETED_STRING constants
  • @@ -2442,18 +2442,18 @@
  • You can now enable/disable /vo11 in the project properties dialog
  • VOXporter - +
  • When porting from Clipboard contents, now VOXporter puts back the modified code to the clipboard
  • Added option to remove ~ONLYEARLY pragmas
  • Installer - +
  • The installer now has a new command line parameter "-nouninstall" that prevents the automatic installation of a previous version. This allows you to install multiple versions of X# side by side.
    Please note that the installer sets a registry key to the location where X# is last installed. This location will be used by the Visual Studio integration to locate the compiler.
    If you don't change this then all VS installations will always use the version of X# that is last installed. See the topic about the build process in VS and with MsBuild for information about how this mechanism works.
    Also if you choose to install the X# runtime assemblies in the GAC then newer versions of these runtime DLLs will/may overwrite older versions. This depends on the fact if the newer DLLs have a new Assembly version.
    At this moment all X# runtime DLLs (still) have version 2.1.0.0 even when X# itself is now on version 2.3.2.
  • The installer now lists all found instances of VS 2017 and VS 2019, including the Visual Studio Buildtools, so you can choose to install in a particular instance of these versions of Visual Studio or simply in all instances.
    Please note that when you run X# with the -nouninstall command line option, this will prevent the installer from removing X# from VS installations where it was previously installed.
  • We have added some documentation about all the installer command line options to the help file.
  • Documentation - +
  • Fixed errors in the documentation of escape codes
  • We have added a chapter with tips and tricks that contains the following topics at this moment.
  • Added description of the installer command line arguments
  • @@ -2466,42 +2466,42 @@ Changes in 2.3.1.0 (Bandol GA 2.3a) Compiler - +
  • When compiling in case sensitive mode, the compiler now checks to see if a child class declares a method that only differs from a method in its parent class by case
  • - +
  • The warning message about assigning to a foreach iterator variable has been changed from "Cannot assign" to "Should not assign"
  • #pragma warnings was not working with the xs1234 syntax but only with numbers. This has been corrected
  • Runtime - +
  • Added the SetFieldExtent method to the IRdd interface
  • The USUAL type no longer "caches" the dialect setting
  • Fixed some problems with ACopy() with skipped or negative arguments.
  • The return value for Alias() is now in upper case.
  • VO SDK - +
  • The VO SDK Console class now uses the System.Console class internally. The only functionality that is no longer available is:
  • - +
  • It does not respond to the mouse anymore
  • Creating a "new" console window is not supported.
  • RDD system - +
  • Fixed a problem in the Advantage RDDs that was caused by a casing problem (a method in a child class had a different case than the method in the parent class that it tried to override). This is why we also added a check to the compiler.
  • Creating an NTX with the DBFNTX driver could fail in some situations due to timing issues. This has been fixed.
  • Visual Studio integration - +
  • Fixed a problem in keyword case synchronization that could corrupt the editor contents.
  • Changes in 2.3.0.0 (Bandol GA 2.3) Compiler - +
  • Syntax errors (1003) or Parser errors (9002) in a source file could lead to multiple errors in the error list. We are now only reporting the first of these error types in a source file.
  • Implemented the -cs (Case Sensitive identifiers) compiler option
  • The compiler now includes the source for a compiletime codeblock as string in that codeblock. Calling ToString() on a compile time codeblock will retrieve this string.
  • @@ -2517,7 +2517,7 @@
  • Added support for #pragma options. See the #pragma options topic in the help file for more info.
  • Runtime - +
  • Added XSharp.Data.DLL which contains support code for .Net SQL based data access used by the RDD system and the new Unicode SQL classes.
  • DbEval() was throwing an exception when no FOR block or no WHILE block was passed
  • DbEval() was throwing an exception when the block that is evaluated was not returning a logical expression
  • @@ -2527,7 +2527,7 @@
  • Added a fix for converting USUAL values of type STRING with NULL to STRING
  • Fixed a problem in __FIeldSetWa() when the area was NIL or "M".
  • - +
  • Added the FoxPro CURRENCY type. These are also supported in USUAL variables. Internally the values of a CURRENCY variable are stored as Decimal but rounded to 4 decimal places.
  • Most runtime DLLs are now compiled in Case Sensitive mode.
  • Fixed a problem in the STOD() function, so it allows strings that are longer than 8 characters.
  • @@ -2536,13 +2536,13 @@
  • Fixed problems in ACopy(), Transform(), Str()
  • VOSDK Classes - +
  • Added DbServer:FieldGetBytes() and DbServer:FieldPutBytes() to read the 'raw' bytes of a string field. Please note that (in ccOptimistic mode) the bytes value is NOT cached and that you have to manually lock and unlock the server when calling FieldPutBytes().
  • Added several missing defines
  • Synchronized the VO SDK to the VO 2.8 SP4 SDK. The only changes that are not included are the ones from the DateTimePicker class. These changes were causing conflicts with the existing code in the X# VOSDK.
  • RDD System - +
  • Querying the header size for the Advantage RDD would cause an exception. This has been fixed
  • Fixed a problem with DbRlockList() and the advantage RDD
  • Skipping in a cursor for the Advantage RDDs was not refreshing the EOF and BOF flags for related tables
  • @@ -2555,66 +2555,66 @@
  • The DBFCDX RDD now implements the BLOB_GET and also BlobExport() and BlobImport()
  • Packing, Zapping or Rebuilding a CDX index with a Custom or Unique flag would not keep these flags. This has been fixed.
  • When you create a file with the DBFVFP driver you can now include Field Flags in the field type of the DbCreate() array by following the type with a colon and one or more flags, where flags is one of:
    N or 0:Nullable
    BBinary
    +AutoIncrement
    UUnicode.  (not supported by FoxPro)
    Other flags may follow ( for example Harbour also has E = Encrypted and C = Compressed)
    Note:
  • - +
  • Please note that the size of the field is the # of bytes, so {"NAME","C:U",20,0} declares a Unicode character field of 10 Unicode characters and 20 bytes.
  • We do not validate combinations of flags. For example AutoIncrement is only working for fields of type Integer.
  • - +
  • DbFieldInfo(DBS_PROPERTIES) returns 5 for all RDDs with the exception of the DBFVFP driver. That driver returns 6. The 6th property is the FLAGS field. This field is a combination of the DBFFieldFlags enum values.
  • Fixed a problem with AppendDb() and CopyDb() for the Advantage RDD
  • Fixed a problem in the Append() code of the DBF RDD. When Append() was called and no data was written then the record that was written to disk could be corrupted. The Append() method now directly writes the new record with blanks..
  • The Fully qualified names of the Advantage RDDs inside XSharp.RDD.DLL are now the same as in the AdvantageRDD.DLL for Vulcan.
  • - +
  • We have added a FileCommit event to the notifications. This sent when a workarea is committed.
  • Macro compiler - +
  • The macro compiler now also recognizes the Array(), Date() and DateTime() functions.
  • Fixed problems with Aliased expressions
  • On the place where the macro compiler expects a single expression you can now also have an expression list between parentheses. The last expression in the list is seen as the return value of the expression list
  • Visual Studio integration - +
  • The option to compile case sensitive has been enabled in the VS project system
  • - +
  • The speed of 'Format Document' has improved a lot.
  • The XSharp Intellisense Optionspage in Tools/Options now has a scroll bar when needed
  • The ToolPalette in the VO Window editor now has icons
  • - +
  • We have added templates for VO MDI windows and VO SDI windows.
  • Build System - +
  • When compiling native resources the resource compiler now automatically includes a file with some defines such as VS_VERSION_INFO
  • Debugger - +
  • When you enter a watch expression in the debugger or a breakpoint condition, you can now use 1 based array indices. Our debugger will now automatically subtract 1 when evaluating the expression.
  • VOXporter - +
  • Fixed a problem in the Windows Forms code generation
  • - +
  • You can now also export single MEF files, single PRG files and data from the Clipboard.
  • Code between #ifdef .. #endif is not touched by VOXPorter
  • Changes in 2.2.1.0 (Bandol GA 2.2a) Compiler - +
  • When compiling code that contained an assign and not an access then trying to read the access could lead to a compiler exception. This has been fixed.
  • Runtime - +
  • Added a missing _Run() function
  • Visual Studio integration / Build system - +
  • Fixed a problem that caused a dialog to be shown with the message "The 'XSharp Project System' package did not load correctly."
  • Fixed a problem with writing response files for the resource compiler when the source file names contained ASCII characters with accents or other  characters > 128. Even though this is now fixed we still recommend not go to crazy with file names, because these names have to be converted from Unicode to Ansi, since the resource compiler can only read response files in Ansi format.
  • Fixed a problem for certain QuickInfo / Tooltip windows
  • @@ -2623,14 +2623,14 @@
  • Expressions in the Watch window, Breakpoint conditions etc may now contain SELF, SUPER and a colon separator. Unfortunately they are still case sensitive.
  • VOXPorter - +
  • we now detect that a class has fieldnames and accesses/assigns with the same name. This was allowed in VO but no longer in .Net. The field names will be prefixed with an underscore inside the class.
  • We now prefix the name "Trace" with @@ because this is quite often used to conditional compile tracing code in VS.
  • Changes in 2.2.0.0 (Bandol GA 2.2) Compiler - +
  • The compiler now recognizes the functions Date(), DateTime() and Array(), even though their names are the same as type names.
    Date() with 1 parameter will still be seen as a cast from that parameter to a Date(), like in the following example
    LOCAL dwJulianDate AS DWORD
    LOCAL dJulianDate  AS DATE
    dwJulianDate       := DWORD( 1901.01.01)
    dJulianDate        := DATE(dwJulianDate) // This is still a cast from Date to DWORD
    However when Date is called with 0 or 3 parameters then either the current date is returned (like with Today()) or a date is constructed from the 3 parameters (like in ConDate())
    The DateTime() function takes 3 or more parameters and constructs a DateTime() value.
    The Array() function takes the same parameters as the ArrayNew() function.
  • When choosing overloads for String.Format() and a usual expression is passed as first reference we no longer allow the compiler to choose one of the overloads that expects an IFormatProvider interface.
  • Parameters passed by reference to untyped methods/functions now have the IsByRef flag set. You can query for "By Reference" parameters by checking the parameter with IsByRef(uParameter). Please note that after assigning a new value to a parameter, this flag will be cleared.
  • @@ -2639,12 +2639,12 @@
    Macrocompiler - +
  • The macro compiler now recognizes and compiles nested codeblocks, such as
    LOCAL cb := {|e| IIF(e, {||SomeFunc()}, {||SomeOtherFunc}) } AS CODEBLOCK
    cb := Eval(cb, TRUE)   // cb will now contain {||SomeFunc()}
    ? Eval(cb)
  • In the FoxPro dialect the macro compiler now recognizes AND, OR, NOT and XOR as logical operators
  • Runtime - +
  • Added some Xbase++ compatible functions, such as DbCargo(), DbDescend() and DbSetDescend().
  • The DateCountry Enum now also the values System and Windows, which both read the date format from the Regional settings in the System.
  • We have added a WrapperRDD class that you can inherit from. This allows you to wrap an existing RDD and subclass methods of your choice. See the documentation of WrapperRDD for an example.
  • @@ -2658,7 +2658,7 @@
    RDD system - +
  • Fixed locking problems in the DBFCDX RDD that were causing problems when opening files shared between multiple apps but also between multiple threads. The RDD now should properly detect that the CDX was updated by another process or thread.
  • Fixed a problem with the File IO system when running multiple threads
  • Fixed a problem with the File() and FPathName() functions when running multiple threads
  • @@ -2668,11 +2668,11 @@
  • Fix a read error at EOF for the DBF RDD.
  • VOSDK - +
  • Fixed a problem in the DbServer destructor when called at application shutdown for a server that was already closed.
  • Visual Studio integration - +
  • Fixed speed problem in the "Brace Matching" code with the help of a user (thanks Fergus!)
  • You should no longer be able to edit source code when the debugger is running.
  • We have added a property "Register for COM Interop" to the build options of the Project Properties.
  • @@ -2689,18 +2689,18 @@
  • The Code Generator for Windows Forms, Settings and Resources now respect the keyword case setting from the Tools - Options TextEditor/XSharp page.
  • VOXPorter - +
  • Folder names ending with a backslash could confuse VOXPorter
  • Changes in 2.1.1.0 (Bandol GA 2.11) Compiler - +
  • We have added new syntaxes for OUT parameters. You can now use one of the following syntaxes

  •   LOCAL cString as STRING
      cString := "12345"
      IF Int32.TryParse(cString, OUT VAR result)      
    // this declares the out variable inline, the type is derived from the method call
         ? "Parsing succeeded, result is ", result
      ENDIF
      IF Int32.TryParse(cString, OUT result2 AS Int32)  
    // this declares the out variable inline, the type is specified by us
         ? "Parsing succeeded, result is ", result2
      ENDIF
      IF Int32.TryParse(cString, OUT NULL)      
    // this tells the compiler to generate an out variable, we are not interested in the result
         ? "Parsing succeeded"
      ENDIF
      IF Int32.TryParse(cString, OUT VAR _)      
    // this tells the compiler to generate an out variable, we are not interested in the result.
    // The name "_" has a special meaning "ignore this"
         ? "Parsing succeeded"
      ENDIF
    - +
  • The compiler now allows the function names Date(), DateTime() and Array(). The runtime has these functions (see below)
  • Fixed a preprocessor problem where the <token> match marker inside UDCs was stopping matching tokens when the .not. or ! operator was found after another logical operator such as .AND. or .OR..
  • Added support for <usualValue> IS <SomeType>. The compiler will automatically extract the contents of the USUAL and wrap it in an object and then apply the normal IS <SomeType> operation.
  • @@ -2711,7 +2711,7 @@   USE Invoices
      Customer = MyCustomerObject{}
      SCAN
         ? Customer.LastName, Invoice.Total
      END SCAN
      USE
    You can also use the M prefix to indicate a local variable or memory variable. The compiler will try to resolve the variable to the local first and when that fails it will try to resolve the variable to a memory variable (when dynamic memory variables are enabled). Runtime - +
  • We have added support functions for the FoxPro cursor access syntax.
  • In the Vulcan dialect the NoMethod() method now receives the methodname as first parameter (this is NOT compatible with VO)
  • Added functions Date() (can have 0 or 3 parameters, equivalent to Today() and ConDate()), DateTime() and Array().
  • @@ -2720,7 +2720,7 @@
    RDD - +
  • There was a problem reading negative numbers from DBFs. This has been fixed
  • Fixed an exception when FPT drivers were writing data blocks in the FPT file with a 0 byte length.
  • The DBF() function returns the Full filename in the FoxPro dialect and the alias in the other dialects.
  • @@ -2729,7 +2729,7 @@ Changes in 2.1.0.0 (Bandol GA 2.1) Compiler - +
  • We have added support for parameters by reference to function and method calls for untyped parameters
  • In the Xbase++ and FoxPro dialect arguments passed with '@' are always treated as BY REF arguments because these dialects do not support the 'AddressOf' functionality
  • When /undeclared was used and an entity added a new private then this private was not cleared when the entity went out of scope. This has been fixed.
  • @@ -2740,7 +2740,7 @@
  • We have added support for several SET commands, such as SET DEFAULT, SET PATH, SET DATE, SET EXACT etc.
  • Runtime - +
  • We have made some changes to get XSharp.Core to run on Linux
  • We have fixed a problem in the Subtract operator for the Date type. This changes the signature of the Subtract operator which has forced us to increase the Assemblyversion of the runtime.
  • The Xbase++ dialect now allows the [] operator on a string inside a usual. This returns a substring of 1 character for the given position.
  • @@ -2759,7 +2759,7 @@
  • The DateCountry settings now include a System setting which will read the date format from the settings for the current culture.
  • Macrocompiler - +
  • When the macro compiler detects an ambiguous method or constructor it now includes the signatures of these in the error message
  • We have added a new IMacroCompiler2 interface that adds an extra property "Resolver". This property will may receive a Delegate of type "MacroCompilerResolveAmbiguousMatch". This delegate has the following prototype:
    DELEGATE MacroCompilerResolveAmbiguousMatch(m1 as MemberInfo, m2 as MemberInfo, args as System.Type[]) AS LONG
  • The delegate will be called when the macro compiler detects an ambiguous match and receives the System.Reflection.MemberInfo for possible candidates and an array of the detected types of the arguments (detected at compile time). The delegate can return 1 or 2 to choose between either candidate. Any other value means that the delegate does not know which of the ambiguous members to choose.
    If the macro compiler finds more than 2 alternatives, it first calls the delegate with alternatives 1 & 2, and then the selected delegate from these 2 and alternative 3 etc.
  • @@ -2771,13 +2771,13 @@
  • PCount() for macro compiled codeblocks was always returning 1. This has been fixed.
  • VOSDK - +
  • Fixes a problem with DbServer objects that were not closed in code.
    The existing code was trying to close the workarea from the destructor. But in .Net the destructor runs in a separate thread and in that GC Thread there where no files open...
  • Removed unneeded calls to DbfDebug()
  • The AdsSqlServer class is now added to the VORDDClasses assembly
  • RDD - +
  • We have fixed a problem with parsing incorrect or empty dates
  • We have fixed a problem with reading Dates in the Advantage RDD that could cause a Heap error when reading dates.
  • We have added several 'missing' functions for Advantage support that were in the 'Ace.Aef' for VO
  • @@ -2793,7 +2793,7 @@
  • Visual Studio integration - +
  • The WCF Service template has been fixed
  • We have migrated the project system to the Asynchronous API. This should make loading of solutions with a large number of X# projects a bit faster.
  • Fixed a problem in the Keyword Case synchronization that could lock up the UI for several seconds
  • @@ -2803,7 +2803,7 @@
  • We have improved the type lookup between X# projects.
  • VOXPorter - +
  • DbServer and FieldSpec entities are now also exported
  • VOXPorter now also can genarate a separate project/application that contains Windows Forms versions of the VO GUI windows found in the VO Applications.
  • When running VOXPorter you now can choose to export to XIDE, Visual Studio or Both.
  • @@ -2811,7 +2811,7 @@ Changes in 2.0.8.1 (Bandol GA 2.08a) Compiler - +
  • Fixed a recursion problem in the preprocessor
  • MEMVAR-> and FIELD-> were no longer correcty detected This has been fixed.
  • We have fixed several issues in  dbcmd.xh
  • @@ -2819,12 +2819,12 @@
  • The = Expression() statements (FoxPro dialect) was not generating any code. This has been fixed.
  • Runtime - +
  • XPP.Abstract.NoMethod() and XPP.DataObject.NoMethod() were still expecting the method name as 1st parameter.This has been fixed.
  • StretchBitmap() was doing the same as ShowBitmap() because of an incorrect parameter. This has been fixed.
  • Visual Studio integration - +
  • Improved the Format-Document code
  • Fixed a problem in the VS Parser when looking up the type for variables defined with the VAR keyword which could send VS in an endless loop.
  • The contents of the TEXT .. ENDTEXT block and the line after the \ and \\ tokens now has its own color
  • @@ -2832,7 +2832,7 @@ Changes in 2.0.8 (Bandol GA 2.08) Compiler - +
  • The compiler had a problem with the "return" attribute target
  • Errors inside the "statementblock" rule are now better detected and the compiler will no longer report many errors after these for correct lines of code.
  • Fixed a problem with Casts to logic
  • @@ -2840,12 +2840,12 @@
  • Improved the code generation for FIELDs, MEMVARs and undeclared variables for prefix operation, postfix operations and assignments.
  • Improved the code generation for method calls where the parameter is a ref or out variable when default parameters are involved. The compiler now generates extra temporary variables for these calls.
  • - +
  • In the dialects where this relevant the compiler now also supports ENDFOR as alias for NEXT and FOR EACH as alias for FOREACH.
  • Added support for the DO <proc> [WITH arguments] syntax
  • Runtime - +
  • The DbCreate() function now creates a unique alias when the base filename of the file to create is already opened as an alias
  • The Numeric overflow checking for USUAL values now follows the overflow checks of the main app
  • DbUnLock() now accepts an (optional) record number as parameter
  • @@ -2862,11 +2862,11 @@
  • Fixed a problem with transform and "@ez" picture.
  • VOSDK - +
  • Fixed a problem in the SQLSelect class when re-opening a cursor.
  • RDD System - +
  • Fixed a problem reading Advantage MEMO fields
  • Improved the error messages when an index cannot be opened due to an index expression with an error (for example a missing function)
  • We have added the option to install an event handler in the RDD system. See the topic Workarea Events for more information.
  • @@ -2876,7 +2876,7 @@
  • DbSetRelation() was not working correctly. This has been fixed.
  • VS Integration - +
  • Fixed a problem with the code generation for DbServer and FieldSpec entities
  • Added support for the Import and Export buttons in the DbServer Editor
  • Improved entity parsing inside the editor in the Xbase++ dialect.
  • @@ -2887,11 +2887,11 @@
  • Added compiler option to the Project Property pages to suppress generating a default Win32 manifest.
  • VOXporter - +
  • VOXPorter was ignoring entities that were not properly prototyped in VO. This has been fixed
  • FoxPro dialect - +
  • We have added a compiler option /fox1 that controls the class hierarchy for objects. With /fox1 enabled (the default in the FoxPro dialect) all classes must inherit from the Custom class. The code generation for properties stores the values for properties in a collection inside the Custom class. With /fox1- properties will be generated as "auto" properties with a backing field.
  • We have added support for FoxPro classes. See the topic FoxPro class syntax for more information about what works and what doesn't work.
  • We have added support for DIMENSION and DECLARE statements (which create a MEMVAR initialized with an array)
  • @@ -2899,14 +2899,14 @@ Changes in 2.0.7 (Bandol GA 2.07) Possible breaking change - +
  • We have removed the #define CRLF from the standard header file. There is a DEFINE CRLF in XSharp.Core now. If you are compiling against Vulcan and you are seeing an error about a missing CRLF then you may want to add the following to your code:
    DEFINE CRLF := e”\r\n”
  • Compiler - +
  • UDCs that were resulting in an empty list of tokens were triggering a compiler error in the preprocessor. This has been fixed.
  • - +
  • Calling a method on an array would be translated to a ASend() with the method name as parameter when the method does not exist in the underlying array class.
    The compiler will generate a warning now when this happens,.
  • The compiler was producing incorrect code for (USUAL) casts. This has been fixed. In rare cases this may produce a compilation error. If that happens to you then simply create a usual by calling the USUAL constructor:  USUAL{somevalue}
  • Fixed several problems with methods declared outside of a CLASS .. END CLASS
  • @@ -2916,14 +2916,14 @@
  • Incorrect use of language features (such as using a VOSTRUCT in the Core or FoxPro dialect) is now detected earlier by the compiler leading to somewhat faster compile times for incorrect code.
  • The compiler now also initialized multi dimensional string arrays with an empty string when /vo2 is enabled, like in the code below:
    CLASS TestClass
      EXPORT DIM aDim[3,3] AS STRING
    END CLASS
  • - +
  • In previous builds you could not set breakpoints on the source code line with a SELF() or SUPER() call if this line was immediately after the CONSTRUCTOR(). This has been fixed.
  • When a project contains "_DLL METHOD", "_DLL ASSIGN" or "_DLL ACCESS" (after exporting from VO) then the compiler will now generate a more meaningful errormessage.
  • The compiler will no longer produce hundreds of the same error messages when a source file contains many of the same error. After 10 errors per source file the compiler will only report unique error numbers. So if your source code has 20 different error messages then you will still see 20 errors reported, but if your source contains the same error type 100 times then the list will be truncated after 10 errors.
  • The compiler no longer allows code behind end tokens such as ENDIF or NEXT. The standard header file 'XSharpDefs.xh' now includes rules that will eliminate these tokens.
  • Runtime - +
  • The ++ and -- operators for the usualtype were not working for Date and Datetime values
  • FErase() and FRename() now set FError() to 2 when the source file does not exist
  • The File() function was throwing an exception for paths with invalid characters. It now returns FALSE and sets the Ferror()
  • @@ -2939,7 +2939,7 @@
  • AEval and AEvalOld() now both pass the array index as second parameter to the codeblock that is evaluated
  • RDD System - +
  • Fixed a problem that EOF and BOF were not both set to true when opening an empty DBF with an index
  • Fixed a problem with DbSeek() and Found() for DBFNTX and DBFCDX
  • The DBF class was not properly decoding field names and/or index expressions that contain Ascii characters > 127 (field names like STRAßE)
  • @@ -2950,7 +2950,7 @@
  • Fixed a small incompatibility between DBFCDX and AXDBFCDX
  • VS Integration - +
  • The Core Classlibrary template had a typo in a file name which caused it not to be loaded correctly
  • The code generator for the Windows Forms editor was duplicating USING statements. This has been fixed. Duplicate using statements will be deleted when a form is opened and saved in the designer.
  • The compilation messages on the output window for the compile time and the number of warnings and errors is now only shown for the build verbosity normal and higher. The warnings and errors message is also shown for lower build verbosity if there are compiler errors.
  • @@ -2960,24 +2960,24 @@
  • The Properties folder is now placed as first child in the tree of a Project, and the VO Binaries items are placed before resource items in the list of children of a source item in the tree.
  • VOXporter - +
  • VOXPorter now prefixes Debug tokens with @@
  • VOXPorter now removes INSTANCE declaration for properties that are also declared as ACCESS/ASSIGN
  • VOXPorter now adds spaces between variable names that are delimited with .AND. or .OR.. So  "a.and.b" becomes "a .and. b"
  • Documentation - +
  • We have "lifted" some of the documentation of the Visual Objects runtime functions and added these to our runtime documentation. This is 'work in progress', some topics will need some extra work.
  • Changes in 2.0.6.0 (Bandol GA 2.06) General - +
  • We received a request to keep the version numbering simpler. For that reason this new build is called Bandol 2.06 and the file versions for this build are also 2.06. The assembly versions for the runtime assemblies are all 2.0, and we intend to keep those stable as long as possible, so you will not be forced to recompile code that depends on the runtime assemblies.
  • Several fixes that were meant to be included in 2.0.5.0 were not included in that build. This has been corrected in 2.0 6.0
  • Compiler - +
  • A missing ENDTEXT keyword now produces an error XS9086
  • Unbalanced textmerge delimiters produce a warning XS9085
  • The TEXT keyword in the FoxPro dialect is now only recognized when it is the first non whitespace token on a line. As a result of this you can use tokens like <text> in Preprocessor commands again.
  • @@ -2985,7 +2985,7 @@
    Runtime - +
  • Runtime errors in late bound code were always shown as TargetInvocationException. The true cause of the error was hidden that way. We are now unpacking the error and rethrowing the original error, including the callstack that was leading to that error
  • Some texts in the string resources were updated
  • Calling the Str() function with a -1 value for length and/or decimals produced results that were not compatible with VO. This was fixed.
  • @@ -2995,25 +2995,25 @@
    RDD System - +
  • The code to read and write to columns in an Advantage workarea now uses separate column objects, just like the code for the DBF RDD. This makes the code a bit easier to understand and should make the code a bit faster.
  • VS Integration - +
  • The text block between TEXT and ENDTEXT is now displayed in the same color as literal strings
  • The VO compatible Project Item templates no longer automatically add references to your project
  • Project files from version 2.01.0 and later will no longer be "touched" when opening with this version of the X# project system, since there have been no changes to the project file format since that build.
  • VOXporter - +
  • The CATCH block in the generated Start function now calls ErrorDialog() to show the errors. This uses the new language resources to display the full error with VO compatible error information (Gencode, Subcode etc)
  • Changes in 2.0.5.0 (Bandol GA 2.01) Compiler - +
  • Blank lines after an END PROPERTY could confuse the compiler. This has been fixed
  • The TEXT .. ENDTEXT command has been implemented in the compiler (FoxPro dialect only)
  • The \ and \\ commands have been implemented (FoxPro dialect only)
  • @@ -3021,11 +3021,11 @@
  • Error messages no longer refer to Xbase types by their internal names (XSharp.__Usual) but by their normal name (USUAL).
  • MacroCompiler - +
  • Creating classes with a namespace prefix was not working. This has been fixed.
  • Runtime - +
  • Fixed a problem with ArrayNew() and multiple dimensions
  • When calling constructor of the Array class with a number the elements were already initialized. This was not compatible with Vulcan.NET. There is now an extra constructor whtich takes a logical parameter lFill which can be used to automatically fill the array
  • The text for the ERROR_STACK language resource has been updated
  • @@ -3036,26 +3036,26 @@
  • We have added several FoxPro system variables (only _TEXT does something at this moment)
  • RDDs - +
  • Zap and Pack operations were not properly setting the DBF file size
  • An Append() in shared mode was not properly setting the RecCount
  • Opening a file with one of the Advantage SQL RDDs was not working. This has been fixed.
  • Writing DateTime.Minvalue to a DBF would not write an empty date but the date 1.1.1 This has been fixed.
  • VO SDK - +
  • Fixed a problem in ListView:EnsureVisible().
  • Some questionable casts (such as the one that cause the previous problem) have been cleaned up
  • Visual Studio Integration - +
  • Parameter tips for constructor calls were off by one parameter. This has been fixed.
  • When looking for types, the XSharp namespace is now the first namespace that is searched.
  • Changes in 2.0.4.0 (Bandol GA) Compiler - +
  • Fix a problem in assignment expressions where the Left side is an aliased expression with a workarea in parentheses:
    (nArea)->LastName := AnotherArea->LastName
  • Multiline statements, such as FOR blocks, no longer generate Multiline breakpoints in the debugger.
  • Fixed a problem where blank lines or lines with 'inactive' preprocessor comments after a class definition would generate a compiler error.
  • @@ -3066,12 +3066,12 @@
  • Indexing PSZ values is no longer affected by the /az compiler option
  • MacroCompiler - +
  • Fixed a problem with some aliased expressions
  • The macro compiler now detects that you are overriding a built-in function in your own code and will no longer throw an "ambigous method" exception but will choose function from your code over functions defined in the X# runtime
  • Runtime - +
  • FIxed several problems in the Directory() function
  • Fixed problem with indexing PSZ values
  • Added StackTrace property on the Error object so also errors caught in a BEGIN SEQUENCE will have stack information.
  • @@ -3085,7 +3085,7 @@
  • Added a Turkish language resource.
  • RDD System - +
  • Fix locking problem in FPT files
  • Fixed several problems with OrdKeyCount() and filters, scopes and SetDeleted() setting
  • Some DBF files have a value in the Decimals byte for field definitions for field types that do not support decimals. This was causing problems. These decimals are now ignored.
  • @@ -3095,24 +3095,24 @@
  • Fixed several problems with OrdKeyCount() in combination with Filters, SetDeleted() and scopes.
  • VO SDK Classes - +
  • Most of the libraries now compile with "Late Binding" disabled for better performance.
    To help in doing this some typed properties have been added such as SqlStatement:__Connection which is typed as SQLConnection.
  • Visual Studio integration - +
  • Fixed a problem in the Brace matching code
  • Improved Brace matching for keywords. Several BEGIN .. END constructs have now been included as well as CASE statements inside DO CASE and SWITCH, RECOVER, FINALLY, ELSE, ELSEIF and OTHERWISE
  • Fix a problem with adding and deleting references when unloaded or unavailable references existed.
  • VOXPorter - +
  • The program is now able to comment, uncomment and delete source code lines from the VO code when exporting to XSharp.
    You have to add comments at the end of the line. The following comments are supported:
  • // VXP-COM : comments the line when exporting it
    // VXP-UNC : uncomments the line
    // VXP-DEL : deletes the line contents

    example:
    // METHOD ThisMethodDoesNotGetDefinedInVOcode() // VXP-UNC
    // RETURN NIL // VXP-UNC
    Changes in 2.0.3.0 (Bandol RC3) Compiler - +
  • Code generation for STATIC LOCALs of type STRING was not initializing the variables to an empty string when /vo2 was selected. We have also improved code generation for STATIC LOCALs when they are initialized with a compile time constant
  • In preparation for the support for variables passed by reference to functions/methods with clipper calling convention we are now assigning back the locals variables to the parameter array at the end of a function/method with clipper calling convention.
  • The compiler would not complain if you were assigning a value of one enum to a variable of another enum. This has been fixed.
  • @@ -3124,14 +3124,14 @@
  • The compiler was allowing you to use the '+' operator between variables/ expressions of type string and logic. This is now flagged as an error.
  • MacroCompiler - +
  • Fixed a problem with resolving Field names that were identical to keywords or keyword abbreviations (for example DATE and CODE) and for Field names that are equal to built-in function names (such as SET)
  • Fixed a problem where a complicated expression evaluated with an alias prefix was not evaluated correctly.
  • The macro compiler initializes itself from the Dialect option in the runtime to enable/disable certain behavior.
  • The macro compiler now recognizes the "." operator for workarea access and memvar access when running in the FoxPro dialect.
  • Runtime - +
  • Added functions FieldPutBytes() and FieldGetBytes()
  • Added function ShowArray()
  • Added several defines that were missing, such as MAX_ALLOC and ASC_A.
  • @@ -3148,7 +3148,7 @@
  • Casts from USUAL values to SHORT, WORD, BYTE and SBYTE are no longer checked to be compatible with VO.
  • RDD System - +
  • Added support for different block sizes in DBFFPT.
  • DBFFPT now allows to override the block size (when creating) from the users code. Please note that block sizes < 32 bytes prevent the FPT from opening in Visual FoxPro.
  • Added support for reading various Flexfile memo field types, including arrays.
  • @@ -3172,18 +3172,18 @@ So this creates a nullable date: "D0" and this creates an autoincremental integer "I+". Auto increment columns are initialized with a counter that starts with 1 and a step size of 1. You can change that by calling DbFieldInfo: DbFieldInfo(DBS_COUNTER, 1, 100) // sets the counter for field 1 to 100
            DbFieldInfo(DBS_STEP, 1, 2)   // sets the step size for field 1 to 2
    - +
  • Fixed a locking problem with FPT files opened in shared mode
  • Fixed several problems related to OrderKeyCount() and various settings of Scopes and SetDeleted()  in the DBFCDX RDD.
  • VO SDK Classes - +
  • Fixed a problem in the DateTimePicker class when assigning only a time value.
  • System classes and RDD classes have been cleaned up somewhat and now compile in AnyCPU mode. So this means that you can use the DbServer class in a 64 bit program !
    The projects for these two libraries also no longer have the "Late Binding" compiler option enabled. There is still some late bound code in these libraries but this code now uses explicit late bound calls such as Send(), IVarGet() and IVarPut().
  • Because of the change in the handling of __DEBUG__ some SDK assemblies are not better optimized.
  • Visual Studio integration - +
  • Added support for WITH .. END WITH blocks in the editor
  • When generating Native Resources (RC files) the BuildSystem now sets a #define __VERSION__. This will have the fileversion number of the XSharp.Build.DLL without the dots. (2.1.0.0 will be written as "2100")
  • The XSharp help item in the VS Help menu now opens the local Help (CHM) file
  • @@ -3196,13 +3196,13 @@
  • We have made some improvements to the presentation of QuickInfo in the source code editor.
  • Tools - +
  • VOXporter now also exports VERSIONINFO resources
  • Changes in 2.0.2.0 (Bandol RC 2) Compiler - +
  • File wide PUBLIC declarations (for MEMVARs) were incorrectly parsed as GLOBALs. Therefore they were initialized with NIL and not with FALSE. They are now generated correctly as public Memvars. The creation of the memvars and the initialization is done in after the Init3 procedures in the assembly have run.
  • Instance variable initializers now can refer other fields and are allowed to use the SELF keyword. This is still not recommended. The order in which fields are initialized is the order in which they are found in the source code. So make sure the field initializers are defined in the right order in your code.
  • AUTO properties are now also initialized with an empty string when /vo2 is enabled.
  • @@ -3210,10 +3210,10 @@
  • When the compiler detects 2 ambiguous symbols with different types (for example a LOCAL and a CLASS with the same name) then the error message now clearly indicates the type for each of these symbols.
  • Fixed an exception in the Preprocessor
  • - +
  • Added support for the FoxPro runtime DLL.
  • - +
  • The ANY keyword (an alias for USUAL) is no longer supported.
  • Keywords that appear after a COLON (":") DOT (".") or ALIAS (->) operator are no longer parsed as keyword but as identifier. This should solve issues with parsing code that for example accesses the Date property of a DateTime class.
  • We have added support for the WITH .. END WITH statement block:

    LOCAL oPerson as Person
    oPerson := Person{}
    WITH oPerson
      :FirstName := "John"
      :LastName := "Doe"
      :Speak()
    END WITH
    You can also use the DOT (.) as prefix for the names. The only expressions allowed inside WITH .. ENDWITH are assignments and method calls (like you can see above)
  • @@ -3309,19 +3309,19 @@
    - Name + 名称 - Usual Type Number + Usual 类型值
    - +
  • The compiler now registers the Dialect of the main in the Dialect property of the RuntimeState (Non Core dialects only)
  • MacroCompiler - +
  • Fixed a problem with escaped literal strings
  • - +
  • Fixed a problem with implicit narrowing conversions
  • Fixed a problem with macro compiled alias operations  (Customer)->&fieldName
  • Runtime - +
  • Fixed a problem in the Round() function.
  • Fixed a problem in the ExecName() function.
  • Added FoxPro runtime DLL.
  • @@ -3331,13 +3331,13 @@
  • converting a NULL to a symbol would cause an exception. This has been fixed.
  • RDD system - +
  • Fixed several problems in the ADS RDD
  • The DBFCDX RDD is now included
  • The DBFVFP RDD is now included. This RDD can be used to access files with DBF/FPT/CDX extension and support the Visual Foxpro field types, such as Integer, Double, DateTime and VarChar. Reading files should be fully supported. Writing should also work with the exception of the Picture and General formats and with the exception of the AutoIncremental Integer fields. You can also use the RDD to open the various "definition" files from VFP such as projects, forms and reports. The RDD 'knows' about the different extensions for indexes and memos. You can also open DBC files as normal tables. In a future version we will support the VFP database functionality.
  • Visual Studio Integration - +
  • You can now specify that multi line statements should indent on the 2nd and subsequent lines.
  • Type lookup for functions inside a BEGIN NAMESPACE .. END NAMESPACE did not include the types in this namespace.
  • Started intellisense for INLINE methods in the Xbase++ dialect
  • @@ -3346,7 +3346,7 @@
  • Several other (smaller) improvements.
  • Tools - +
  • VOXporter now writes DEFINES in the RC files and no longer literal values.
  • VOXporter: fix for module names with invalid chars for filenames
  • @@ -3355,7 +3355,7 @@ Changes in 2.0.1.0 (Bandol RC 1) Compiler - +
  • Added support for the so called IF Pattern Expression syntax, which consists of an IS test and an assignment to a variable, prefixed with the VAR keyword:
    IF x is Foo VAR oFoo
      ? oFoo:DoSomething()
    ENDIF

    The variable oFoo introduced in the expression will only be visible inside the IF statement.
    Of course you can also use the pattern on other places, such as ELSEIF blocks, CASE statements, WHILE expressions etc:

    IF x is Foo VAR oFoo
      ? oFoo:DoSomething()
    ELSEIF x is Bar VAR oBar
      ? oBar:DoSomethingElse()
    ENDIF
  • Fixed a problem with method modifiers and generic methods
  • Fixed a problem with partial classes with different casing and destructors
  • @@ -3375,7 +3375,7 @@
  • The Roslyn code was not marking some variables as 'assigned but not read' to be compatible with the old C# compiler. We are now flagging these assignments with a warning. This may produce a lot of warnings in your code that were not detected before.
    To support this we have received some requests to "open up" the support for 1 based indexes in the compiler. In the past the compiler would only allow 1 based indexing for variables of type System.Array or of the XBase ARRAY Type.
    We have now added a couple of interfaces to the runtime. If your type implements one of these interfaces then the compiler will recognize this and allow you to use 1 based indexes in your code and then the compiler will automatically subtract 1 from the numeric index parameter. The XSharp ARRAY type and ARRAY OF type now also implement (one of) these interfaces/
    The interfaces are:
       INTERFACE IIndexer
           PUBLIC PROPERTY SELF[index PARAMS INT[]] AS USUAL GET SET
       END INTERFACE

       INTERFACE IIndexedProperties
           PROPERTY SELF[index AS INT   ] AS USUAL GET SET
           PROPERTY SELF[name  AS STRING] AS USUAL GET SET
       END INTERFACE
      INTERFACE INamedIndexer
         PUBLIC PROPERTY SELF[index AS INT, name AS STRING] AS USUAL GET SET
      END INTERFACE
  • Runtime - +
  • Fixed some problems in the OrderInfo() function
  • Fixed several problems with DB..() functions in the runtime
  • Fixed several problems with the macro compiler
  • @@ -3395,7 +3395,7 @@
  • Changed implementation of the functions used by the compiler for Aliased operations
  • RDD system - +
  • Added support for DBF character fields up to 64K.
  • Implemented the DBFCDX RDD
  • Fixed several problems related to the DBFNTX RDD
  • @@ -3403,7 +3403,7 @@
  • Macro compiled index expressions are not of the type _CodeBlock and not of the type RuntimeCodeBlock (the RuntimeCodeblock is encapsulated inside the _CodeBlock object).
    That prevents problems when storing these expressions inside a USUAL
  • Visual Studio integration - +
  • Fixed an exception that could occur when typing a VAR expression
  • When the project system makes a backup of a project file, we are now making sure that Readonly flags are cleared before writing to or deleting existing files.
  • Reading intellisense data from C++ projects could send the intellisense engine into an infinite loop. This has been fixed.
  • @@ -3421,7 +3421,7 @@
  • Sometimes a type lookup for intellisense was triggered inside a comments region. This has been fixed.
  • Tools - +
  • VOXPorter was not removing calling conventions when creating delegates. This has been fixed
  • VOXporter was sometimes generating project files with many duplicates of resource items. This has been fixed.
  • VOXporter now marks prefix identifiers that conflict with one of the new keywords with "@@"
  • @@ -3431,17 +3431,17 @@ Changes in 2.0.0.9 (Bandol Beta 9) Compiler - +
  • The Lexer (the part of the compiler that recognizes keywords, literals etc) has been rewritten and is slightly faster.
  • The compiler now supports digit separators for numeric literals. So you can now write 1 million as:
    1_000_000
  • - +
  • Fixed problem where static local variables were not initialized with "" even when compiler option -vo2 was selected
  • #ifdef commands using preprocessor macros such as __XSHARP_RT__ were not working correctly.
  • The Xbase++ dialect now also supports the 'normal' class syntax.
  • We had changed the 'Entrypoint' algorithm in Beta 8. This has been restored now and the -main command line option now works again as well. In stead the "body" of the Start method is now encapsulated in an anonymous function.
  • - +
  • Duplicate include files no longer produce an error but a warning
  • Fix for problem with default parameter values with 'L' or 'U' suffix
  • Added compiler error when specifying default parameter values for methods/functions with clipper calling convention
  • @@ -3458,7 +3458,7 @@
  • CASE statements without CASE block but only a OTHERWISE block would crash the compiler. This has been fixed and an warning about an empty CASE statement has been added.
  • Runtime - +
  • Several changes to the Macro compiler, such as the parsing of Hex literals, case sensitivity of parameters (they are no longer case sensitive) and limited support for function overloading.
  • Several missing functions have been added, such as _Quit(),
  • The return value of several Ord..() functions was incorrect. This has been fixed.
  • @@ -3471,7 +3471,7 @@
  • SetDecimalSep() and SetThousandSep() now also set the numeric separators in the current culture.
  • The USUAL -> STRING conversion now calls AsString()
  • - +
  • Added support for Dbase style dynamic memory variables (MEMVAR, PUBLIC, PRIVATE, PARAMETERS). See the Memory Variables topic in the help file for more information.
  • The IsDate() function now also returns TRUE for USUALs of type DateTIme. There is also a separate IsDateTime() function. We have also added IsFractional() (FLOAT or DECIMAL) and IsInteger (LONG or INT64) and IsInt64()
  • Added missing Cargo slot to the Error class. Also improved Error:ToString()
  • @@ -3479,15 +3479,15 @@
  • And many more small changes.
  • Visual Studio Integration - +
  • We have added a new tab page in the Project Properties dialog: Dialect. This contains dialect specific language options.
  • 2 options from the Build options page (which is configuration dependent) have been moved to the Language page (which is build INdepedent), because that makes more sense:
  • - +
  • Include Path
  • NoStdDef
  • - +
  • We have also added a project property on the Language page to specify an alternative standard header file (in stead of XSharpDefs.xh)
  • The XSharp.__Array type was shown in the intellisense with the wrong name
  • We have added entries on the Project Properties dialog pages to enable MEMVAR support and to enable Undeclared variables
  • @@ -3502,26 +3502,26 @@
  • Commenting a single line in the editor will now always use the // comment format
  • Tools - +
  • No changes in this release.
  • Changes in 2.0.0.8 (Bandol Beta 8) Compiler - +
  • The compiler source code has been upgraded to Roslyn 2.10 (C# 7.3). As a result of that there are some new compiler options, such as /refout and we also support the combination of the "PRIVATE PROTECTED" modifier that defines a type member as accessible for subclasses in the same assembly but not for subclasses in other assemblies
  • We have added support for Xbase++ class declarations. See the Xbase++ class declaration topic for more information about the syntax and what is supported and what not.
  • We have added support for simple macros with the &Identifier syntax
  • We have added support for late bound property access:
  • - +
  • The <Expression>:&<Identifier> syntax.
    This translates to IVarGet(<Expression>, <Identifier>).
  • The <Expression>:&(<Expression2>) syntax.
    This translates to IVarGet(<Expression>, <Expression2>).
  • Both of these can also be used for assignments and will be translated to IVarPut:
    <Expression>:&<Identifier> := <Value>
    This becomes IVarPut(<Expression>, <Identifier>, <Value>)
  • All of these will work even when Late Binding is not enabled.
  • - +
  • We have added a new compiler options /stddefs that allows you to change the standard header file (which defaults to XSharpDefs.xh)
  • We have added a new preprocessor Match marker <#idMarker> which matches a single token (all characters until the first whitespace character)
  • When you select a dialect now, then the compiler will automatically add some compiler macros. The VO dialect declares the macro __VO__, the Vulcan dialect declares the macro __VULCAN__ the harbour dialect declares the macro __HARBOUR__ and the Xbase++ dialect declares the macro __XPP__.
  • @@ -3530,7 +3530,7 @@
  • We have also added a warning that will be shown when you assign a value from a larger integral type into a smaller integral type to warn you about possible overflow problems.
  • Runtime - +
  • This build includes a new faster macro compiler. It should be fully compatible with the VO macro compiler. Some of the .Net features are not available yet in the macro compiler.
  • We moved most of the generic XBase code to XSharp.RT.DLL. XSharp.VO.DLL now only has VO specific code. We have also added XSharp.XPP.DLL for XPP
  • Fix Ansi2OEM problem with FRead3(), FWrite3() and FReadStr
  • @@ -3551,7 +3551,7 @@
  • DebOut32 was not outputting data to the debug terminal if the runtime was compiled in release mode. This has been fixed.
  • Visual Studio Integration - +
  • Fixed filtering on 'current project' in the error list
  • Type lookup for local variables was sometimes failing. This has been fixed
  • Fixed a problem with Brace Matching that could cause an exception in VS
  • @@ -3564,7 +3564,7 @@
  • PRG files that are not part of a X# project and not part of a Vulcan project are now also colorized in the editor.
  • Tools - +
  • VulcanXPorter was always adjusting the referenced VO libraries and  was ignoring the "Use X# Runtime" checkbox
  • VOXPorter now has an option to copy the resources referenced in the AEF files to the Resources subfolder in the project
  • VOXPorter now also copies the cavowed, cavofed and cavoded template files to the properties folders in your project.
  • @@ -3573,7 +3573,7 @@ Changes in 2.0.0.7 (Bandol Beta 7) Compiler - +
  • When calling a runtime function with a USUAL parameter the compiler now automatically prefers methods or functions with "traditional' VO types over the ones with enhanced .Net types. For example when there are 2 overloads, one that takes a byte[] and another that takes a string, then the overload that takes a string will get preference over the overload that takes a byte[].
  • Resolved a problem with .NOT. expressions inside IIF() expressions
  • Improved debugger break point generation for Invoke expressions ( like String.Compare())
  • @@ -3582,7 +3582,7 @@
  • The code generated by the compiler for Array operations now uses the new interfaces declared in the X# runtime (see below).
  • Runtime - +
  • We have added several missing functions, such as _GetCmdLine, Oem2AnsiA() and XSharpLoadLibrary
  • Fixed problems in CreateInstance, IVarGet, IVarPut(), CtoDAnsi() and more.
  • Added VO Compatible overload for FRead4()
  • @@ -3591,25 +3591,25 @@
  • We have added a new FException() function that returns the last exception that occurred for a low level file operation
  • Casting a usual containing a PTR to a LONG or DWORD is now supported
  • Some new interfaces have been added related to array handling. The compiler no longer inserts a cast to Array inside the code, but inserts a cast to one of these interfaces depending on the type of the index parameter. The USUAL type implements IIndexer and IIndexProperties and dispatches the call to the objects inside the usual when this objects exposes the interface. This is used for indexed access of properties when using AEval or AScan on an ARRAY OF <type>
  • - +
  • XSharp.IIndexer
  • XSharp.INamedIndexer
  • XSharp.IIndexedProperties
  • SDK Classes - +
  • We have added the Hybrid UI classes from Paul Piko (with permission from Paul)
  • Tools - +
  • The Vulcan XPorter now also has an option to replace the runtime and SDK references with references to the X# runtime
  • Changes in 2.0.0.6 (Bandol Beta 6) Compiler - +
  • The compiler was sometimes still generating warnings for unused variables generated by the compiler. This has been fixed.
  • The compiler will now produce a warning that #pragmas are not supported yet (9006)
  • Added compiler macro __FUNCTION__ that returns the current function/method name in original casing.
  • @@ -3629,7 +3629,7 @@
  • Fixed a problem in the PDB line number generation that would cause incorrect line numbers in the debugger
  • Visual Studio integration - +
  • The source code editor was not always showing the correct 'active' region for #defines defined in #include files.
  • Opening a source file without entities (e.g. a header file) could result in an error message inside VS.
  • Fixed a null reference exception in the editor
  • @@ -3640,16 +3640,16 @@
  • Added an option to select the Harbour dialect on the project properties page.
  • The Build System - +
  • The Build system did not recognize that begin NAMESPACE lines in source code were commented out. This has been fixed.
  • VOXporter - +
  • We have added an option to sort the entities in alphabetical order in the output file.
  • We have added an option so you can choose to add the X# Runtime as reference to your application (otherwise the Vulcan runtime is used)
  • Runtime - +
  • The SetCentury setting was incorrect after calling SetInternational(#Windows). This has been fixed.
  • The Descend function for dates now returns a number just like in VO
  • The functions ChrA and AscA have been renamed to Chr() and Asc() and the original functions Chr() and Asc() have been removed. The original functions were using the DOS (Oem) codepage and this is not compatible with Visual Objects.
  • @@ -3659,13 +3659,13 @@
  • All String - PSZ routines (String2PSz(), StringAlloc() etc) now use the Windows Codepage to convert the unicode strings to ansi.
  • If you library is compiled with 'Compatible String comparisons' but the main app isn't, then the string comparisons in the library will follow the same rules as the main app because the main app registers the /vo13  setting with the runtime. The "compatible" stringcomparison routines in the runtime now detect that the main app does not want to do VO compatible string comparisons and will simply call the normal .Net comparison routines.
    We therefore recommend that 3rd party products always use the Compatible String comparisons in their code.
  • - +
  • Preliminary documentation for the runtime was generated from source code comments and has been included as chapter in this documentation.
  • The VO SDK - +
  • This build includes the first version of the VO SDK compiled against the X# runtime. We have included the following class libraries
  • - +
  • Win32API
  • System Classes
  • RDD Classes
  • @@ -3676,14 +3676,14 @@
  • Report Classes
  • - +
  • All assemblies are named VO<Name>.DLL and the classes in these assemblies are in the VO namespace.
  • This SDK is based on the VO 2.8 SP3 source code. The differences between VO 2.8 SP3 and VO 2.8 SP4 will be merged in the source later,
  • The Libraries for OLE, OleServer and Internet Server are not included. The OleAutoObject class and its support classes is included in the XSharp.VO library. OleControl and OleObject are not included.
  • Preliminary documentation for these classes was generated from source code comments and has been included as chapter in this documentation.
  • The RDD system - +
  • This build includes the first version of the RDD system. DBF-DBT is ready now. Other RDDs will follow in the next builds. Also most of the RDD related functions are working in this build.
  • This build also includes the first version of the Advantage RDD. With this RDD you can access DBF/DBT/NTX files , DBF/FPT/CDX files and ADT/ADM/ADI files. The RDD names are the same as the RDD names for Vulcan. (AXDBFCDX, AXDBFNTX, ADSADT). We also support the AXDBFVFP format and the AXSQLCDX, AXSQLNTX, AXSQLVFP. For more information about the differences and possibilities of these RDD look in the Advantage documentation.
    We have coded the Advantage RDD on top of the Advantage Client Engine. Our RDD system detects if you are running in x86 or x64 mode and calls functions in Ace32 or Ace64 accordingly.
    To use Advantage you copy the support DLLs from an Advantage Vulcan RDD to the folder of your application. Look at the Advantage docs for Vulcan to see the list of the DLLs. The Advantage RDD is part of the standard XSharp.RDD.DLL which therefore replaces the AdvantageRDD.Dll for Vulcan.
  • The XSharp.Core DLL now also has RDD support. We have chosen NOT to implement this in functions, but as static methods inside the CoreDb class. Old code that uses the VoDb..() functions can be simply ported by changing "VoDb" to "CoreDb."
    The parameters and return values that are USUAL in VO and Vulcan are implemented as OBJECT in the CoreDb class.
    The ..Info() methods have 2 overloads. One that takes an Object and one that takes a reference to an object.
    The methods inside CoreDb return success or failure with a logical value like the VODB..() functions in VO. If you want to know what the error was during the last operation then you can access that with the method CoreDb._ErrInfoPtr() . This returns the last exception that occurred in a RDD operation.
  • @@ -3697,31 +3697,31 @@ Changes in 2.0.0.5 (Bandol Beta 5) Compiler - +
  • The strong named key for assemblies with native resources was invalid. This has been fixed
  • When an include file was included twice for the same source (PRG) file then a large number of compiler warnings for duplicate #defines would be generated. Especially when the Vulcan VOWin32APILibrary.vh was included twice then over 15000 compiler warnings would be generated per source file where this happened. This large number of warnings could lead to excessive memory usage by the compiler. We are now outputting a compilation error when we detect that the same file was included twice. We have also added a limit of 500 preprocessor errors per source (PRG) file.
  • A change in Beta 4 could result in compiler warnings about unused variables that were introduced automatically by the X# compiler. This warning will no longer be generated.
  • The compiler now correctly stores some compiler options in the runtime state of XSharp.
  • Runtime - +
  • Fixed a problem in the Ansi2OEM and OEM2Ansi functions.
  • Fixed a problem in the sorting for SetCollation(#Windows)
  • Fixed a problem with string comparisons in runtime functions like ASort(). This now also respects the new runtime property CompilerOptionVO13 to control the sorting
  • Visual Studio integration - +
  • The sorting of the members in the editor dropdown for members was on methodname and propertyname and did not include the typename. When a source file contained more than one type then the members would be mixed in the members dropdown
  • Build System - +
  • The default value for VO15 has been changed back from false to undefined.
  • Changes in 2.0.0.4 (Bandol Beta 4) Compiler - +
  • POSSIBLY BREAKING CHANGE: Functions now always take precedence over same named methods. If you want to call a method inside the same class you need to either prefix it with the typename (for static methods) or with the SELF: prefix. If there is no conflicting function name then you can still call the method with just its name. We recommend to prefix the method calls to make your code easier to read.
  • The compiler was accepting just an identifier without a INSTANCE, EXPORT or other prefix and without a type inside a class declaration. It would create a public field of type USUAL. That is no longer possible.
  • Improved the positional keyword detection algorithm (this also affects the source code editor)
  • @@ -3730,13 +3730,13 @@
    And will compile this with a warning that you should use the assignment operator (:=). We have added this because many people (including we) copy examples from VB and C# where the operator is a single equals token. - +
  • Error messages about conflicting types now include the fully qualified type name.
  • The compiler no longer includes the width for literal Floats. This is compatible with VO.
  • A Default parameter of type Enum is now allowed.
  • Runtime - +
  • Added several functions that were missing, such as __Str() and DoEvents()
  • Fixed a problem in the macro compiler with non-english culctures.
  • Added several overloads for Is..() functions that take a PSZ instead of a string, such as IsAlpha() and IsUpper().
  • @@ -3750,7 +3750,7 @@
  • Fixes for the Str() family of functions in combination with SetFixed() and SetDigitFixed().
  • Visual Studio integration - +
  • Fixed a problem when building projects in the latest build of Visual Studio
  • Several 'keywords' were not case synchronized before, such as TRUE, FALSE, NULL_STRING etc,
  • Keywords are not case synchronized on the current line as long as the user has the cursor on them or immediately after them. That means that when you type String and want to continue to change it to StringComparer then the formatter will no longer kick in and change "String" to the keyword case before you have the chance to complete the word.
  • @@ -3762,13 +3762,13 @@
  • Fixed a problem when debugging in X64 mode.
  • Fixed an exception when comparing source code files with SCC integration.
  • Fixed several problems w.r.t. the XAML editor:
  • - +
  • Code is now generated with STRICT calling convention to avoid problems when compiler option "Impliciting CLIPPER calling convention" is enabled
  • WPF and other templates now include STRICT calling convention for the same reason
  • The XAML editor could not properly load the current DLL or EXE and had therefore problems resolving namespaces and adding user controls to the tool palette. This has been fixed.
  • - +
  • We have added an option to the Tools/Editor/XSharp/Intellisense options that allow you to control how the member combobox in the editor works. You can choose to only show methods & properties of the current type or all entities in the right combobox. The left combobox always shows all types in the file.
  • Some of the project and item templates have been updated. Methods and constructors without parameters now have a STRICT calling convention. Also the compiler option /vo15 has been explicitly disabled in templates for the Core dialect.
  • @@ -3776,21 +3776,21 @@ Changes in 2.0.0.3 (Bandol Beta 3) Compiler - +
  • When 2 method overloads have matching prototypes the compiler now prefers the non generic one over the generic one
  • Fixed an exception that could occur when compiling a single line of source code with a preprocessor command in it.
  • Runtime - +
  • Added Mod() function
  • Added ArrayNew() overload with no parameters
  • - +
  • Fixed problem in __StringNotEquals() when length(RHS) > length(LHS) and SetExact() == FALSE
  • Added missing string resource for USUAL overflow errors
  • Visual Studio integration - +
  • Improved keyword case synchronization and indenting. Also a source file is 'Keyword Case' synchronized when opened.
  • Opening a source file by double clicking the find results window no longer opens a new window for the same source file
  • Improved type lookup speed for intellisense
  • @@ -3802,18 +3802,18 @@
  • Fixed problem in the window editor with generating code for tab pages
  • Vulcan XPorter - +
  • Project dependencies defined in the solution file were not properly converted
  • VO XPorter - +
  • Fixed a problem where resource names were replaced with the value of a define
  • Changes in 2.0.0.2 (Bandol Beta 2) Compiler - +
  • The compiler now transparently accepts both Int and Dword parameters for XBase Array indices
  • When the compiler finds a weakly typed function in XSharp.VO and a strongly typed version in XSharp.Core then it will choose the strongly typed version in XSharp.Core now.
  • In the VO and Vulcan dialect sometimes an (incorrect) warning 'duplicate usings' was displayed. This is now suppressed.
  • @@ -3823,7 +3823,7 @@
  • /vo6, /vo7 and /vo11 are now only supported in the VO/Vulcan dialect
  • Runtime - +
  • Removed DWORD overloads for Array indexers
  • Fixed overload problem for ErrString()
  • Fixed overload problem for _DebOut()
  • @@ -3832,7 +3832,7 @@
  • Fixed memory blocks now get filled with 0xFF when they are released to help detect problems
  • Visual Studio - +
  • Fix 'Hang' in VS2017 when building
  • Fix 'Hang' in VS2017 when a tooltip (QuickInfo) was displayed
  • Fixed problem with debugging x64 apps
  • @@ -3842,7 +3842,7 @@
  • Enhancements in the Goto Definition
  • Build System - +
  • Fix problem with CRLF in embedded resource commandline option
  • @@ -3850,14 +3850,14 @@ Changes in 2.0.0.1 (Bandol Beta 1) Compiler New features - +
  • Added support for ARRAY OF language construct. See the Runtime chapter  for more information about this.
  • Added support for the X# Runtime assemblies when compiling in the VO or Vulcan dialects.
  • Added support for the "Pseudo" function ARGCOUNT() that returns the # of declared parameters in a function/method compiled with clipper calling convention.
  • Added a new warning number for assigning values to a foreach local variable. Assigning to USING and FIXED locals will generate an error.
  • Optimizations - +
  • Optimized the code generation for Clipper calling convention functions/methods
  • The /cf and /norun compiler options are no longer supported
  • The preprocessor no longer strips white space. This should result in better error messages when compiling code that uses the preprocessor.
  • @@ -3866,7 +3866,7 @@
  • The preprocessor now generates an error when it detects recursive #include files.
  • Bug fixes - +
  • Fixed a problem when using the [CallerMemberAttribute] on parameters when compiling in Vulcan or VO Dialect
  • Abstract properties should no longer generate a warning about a body
  • You can now correctly use ENUM values as array indexes.
  • @@ -3876,14 +3876,14 @@
  • Fixed an issue where the declaration LOCAL x[10] was not compiled correctly. This now compiles into a local VO Array with 10 elements.
  • Visual Studio Integration - +
  • Build 1.2.1 introduced a problem that could cause output files to be locked by the intellisense engine. This has been fixed
  • The editor parser had problems with nested types. This has been fixed
  • Enum members were not included in code completion for enums inside X# projects
  • Some improvements in the code reformatting
  • Added option on the Tools/Options for the editor to include keywords in the "All tokens" completion list
  • - +
  • Fixed a problem where assemblies that could not be loaded to retrieve meta information would be retried 'for ever'
  • Fixed a problem with retrieving type information from assemblies that contained both managed and unmanaged code.
  • Added some properties for referenced assemblies to the IDE Properties window
  • @@ -3894,22 +3894,22 @@
  • Fixed a problem where the codemodel was sometimes locking output DLLs for Project references
  • Build System - +
  • Fixed a problem with the naming of the XML documentation file.
  • Runtime - +
  • Added XSharp.Core.DLL, XSharp.VO.DLL and XSharp.Macrocompiler.DLL.
    Most runtime functions are implemented and supported. See the X# Runtime chapter for more information
  • VO XPorter - +
  • SDK related options have been removed. They will be moved to a new tool later.
  • Changes in 1.2.1 Compiler - +
  • Fixed a problem where a compilation error resulted in the message "Failed to emit module" without further information
  • Fixed a problem with ++, -- += and similar operations in aliased expressions (like CUSTOMER->CUSTNO++)
  • Constructor initializers and Collection initializers were not working after a constructor with parameters. That has been fixed.
  • @@ -3918,7 +3918,7 @@
      CATCH ID AS ExceptionType
      CATCH ID                  // defaults to Exception type
      CATCH AS ExceptionType  
      CATCH            // defaults to Exception type
    Visual Studio Integration - +
  • Improved the speed of the background code scanning
  • Improved the speed of the background parser inside the editor
  • Fixed a problem in the codedom provider that is used by the windows forms editor
  • @@ -3927,7 +3927,7 @@ Changes in 1.2.0 Compiler - +
  • You can now pass NULL for parameters declared by reference for compatibility with VO & Vulcan.
    We STRONGLY advise not to do this, unless you make sure that the function expects this and does not assign to the reference parameter without checking for a NULL reference first. This will only work when the /vo7 compiler option is enabled.
  • We have made some optimizations in the Lexer. The compiler should be a little faster because of that
  • We fixed a problem with the automatic constructor generation (/vo16) for classes that inherit from classes defined in an external DLL
  • @@ -3942,7 +3942,7 @@
  • The compiler now generates a warning when the #pragma command is used
  • Visual Studio Integration - +
  • More performance improvements in the editor. Especially large source files with incorrect code could slow down the editor.
  • The editor parser no longer tries to parse include files repeatedly when these files contain #defines only (like the Vulcan header files)
  • The source code editor tried to show intellisense for words in a comment region. That has been fixed.
  • @@ -3952,19 +3952,19 @@
  • Matching keywords, such as IF .. ENDIF and FOR .. NEXT should now be highlighted in the editor
  • If you select an identifier in the editor then that identifier will be highlighted in the current method/function on all places where it is used
  • We have added several features that you need to enable/disable on the Tools/Options/Text Editor/XSharp/Intellisense dialog:
  • - +
  • The code completion in the editor also supports instance member completion when a dot is pressed.
    Please note that the compiler ONLY accepts this in the Core language, not in the VO & Vulcan dialect. So the option has no effect inside projects with other dialects.
  • We have added some options to control the sorting of the DropDown comboboxes in the editor, as well as if fields/instance variables should be included in these comboboxes. When you do not sort, then the entries in the dropdown box will be shown in the order in which they are found in the source file.
  • We have added the option to autocomplete identifiers when typing. This includes locals, parameters, class fields, namespaces, types etc.
  • - +
  • Overridden methods in subclasses with the same signature as the parent methods they override are no longer counted as overloads in completionlists
  • A missing reference DLL could "kill" the intellisense engine. This no longer happens. Of course the type info from a missing referenced DLL is not included.
  • Properties and methods in the generated source files for XAML code (the .g.prg files in the OBJ folder) are now also parsed and included in the completion lists in intellisense and in the Class Browser and Object Browser windows.
  • VOXPorter - +
  • The installer now includes the correct version of VOXPorter <g>
  • VOXporter now supports the following commandline options:
    /s:<source folder or aef>
  • @@ -3972,7 +3972,7 @@ /r:<runtime folder> /nowarning - +
  • Some code corrections were added for issues found in the GUI classes
  • The template files can now also be found when VOXPorter is run from a different working directory
  • @@ -3980,19 +3980,19 @@ Changes in 1.1.2 Compiler - +
  • Added compiler warning for code that contains a #pragma
  • Fixed a problem with iif() functions and negative literal values
  • Visual Studio Integration - +
  • Fixed a slowness in the editor after typing a send (: ) operator
  • Enum values are now properly decoded in the debugger
  • Fixed the CodeDom provider for handling literal FALSE values and negative numbers. As a result, more (Vulcan created) winforms should open without problems
  • Some positional keywords (such as ADD and REMOVE) are no longer colored as keyword in the editor for incomplete code when they appear after a colon ‘:’ or dot ‘.’;
  • VOXPorter - +
  • Fixes for exporting the VO RDD Classes from the SDK
  • @@ -4000,7 +4000,7 @@ Changes in 1.1.1 Compiler - +
  • Fixed a problem with Debugger Breakpoints for DO CASE and OTHERWISE
  • Fixed a problem with Debugger Breakpoints for sourcecode that is defined in #included files
  • Added support for the Harbour Global Syntax where the GLOBAL keyword is optional
  • @@ -4010,14 +4010,14 @@
  • Prepared the compiler for Xbase type names and function names in the XSharp Runtime
  • Preprocessor - +
  • Fixed a crash in the preprocessor
  • The preprocessor was generating an error "Optional block does not contain a match marker" for blocks without match marker. This is now allowed.
    (for example for the ALL clause in some of the Database UDCs )
  • When the same include files was used by multiple source files, and different sections of this file were included because of different #ifdef conditions, then the preprocessor would get "confused". This has been fixed.
  • Debugger file/line number information from source code imported from #include files is not processed correctly.
  • Visual Studio Integration - +
  • Fixed several issues with the Windows Form Editor
  • The class declaration generated by the VO compatible editors now included the PARTIAL modifier.
  • @@ -4025,7 +4025,7 @@ Changes in 1.1 Compiler - +
  • Fixed a problem with Codeblocks used in late bound code after the release of X# 1.0.3
  • Fixed a problem with overriding properties in a subclass that inherit from a class where only the Assign (Set) or Access (Get) are defined.
  • The compiler option /vo16: automatically generate VO Clipper constructors has been implemented.
  • @@ -4046,7 +4046,7 @@
    Visual Studio Source code editor - +
  • Added Goto Definition for Functions and Procedures
  • Improved Info tips for Functions and Procedures
  • Improved case synchronization
  • @@ -4058,7 +4058,7 @@
  • Performance improvements for the background file scanner. This scanner is also paused during the build process to improve the compilation speed.
  • Project System and MsBuild - +
  • Fixed a problem in the project files with conditioned property groups. Existing projects will be updated automatically
  • Added support for the /vo16 compiler option in MsBuild and the VS Project Property pages.
  • Fixed a problem with the /nostddef compiler option which was not working as expected.
  • @@ -4070,19 +4070,19 @@
  • The MSBuild support DLL was unable to find the location of the compiler and native resource compiler when running inside a 64 bit process
  • Form Editor - +
  • Improved Windows Form Editor support for types defined in project references. We will now detect the location of the output files for these projects, like the C# and VB project systems.
  • The Code parser for the Form Editor was having problems with untyped methods. This has been fixed.
  • VO Window and Menu Editor - +
  • The code generator for the Window and Menu editor will delete old unused defines.
  • Changed the item template for VO windows to fix a problem when adding an event handler to a window that has not been saved yet
  • The code generator for the Window editor was not outputting a style for WS_VISIBLE. This has been fixed.
  • Debugger This build introduces a first version of the XSharp debugger support - +
  • The Visual Studio debugger now shows the language X# in the callstack window and other places
  • Functions, Methods and procedures are now displayed in the X# language style in the callstack window
  • Compiler generated variables are no longer shown in the locals list
  • @@ -4090,12 +4090,12 @@
  • X# predefined types such as WORD, LOGIC etc are shown with their X# type names in the locals window
  • Testing - +
  • Added support for the Test Explorer window
  • Added templates for unit testing with XUnit, NUnit and Microsoft Test
  • Other - +
  • Added warning when Vulcan was (re)installed after XSharp, which could cause a problem in the Visual Studio integration
  • The VS Parser was marking Interfaces as structure in stead of interface. This has been fixed.
  • The tool XPorter tools have better names in the VS Tools Menu
  • @@ -4103,11 +4103,11 @@
  • Several changes were made to the templates that come with X#
  • XPorter - +
  • Fix problem in propertygroup conditions.
  • VOXPorter - +
  • Generate clipper constructors is now disabled by default
  • Fixed a problem in the VS Template files.
  • @@ -4115,7 +4115,7 @@ Changes in 1.0.3 Compiler - +
  • Fixed a problem with the index calculation for Vulcan Arrays indexed with a usual argument
  • Fixed a problem with the generation of automatic return values for code that ends with a begin sequence statement or a try statement
  • Optimized the runtime performance for literal symbols.
    The compiler now generates a symbol table for the literal symbols and each literal symbol used in your app is only created once.
    You may experience a little delay at startup if your app uses a LOT (thousands) of literal symbols. But the runtime performance should be better.
  • @@ -4125,7 +4125,7 @@ Changes in 1.0.2 Compiler - +
  • Added support for XML doc generation. We support the same tags that the C# compiler and other .Net compiler support.
  • Improved some parser errors.
  • Created separate projects for portable and non portable (.Net framework 4.6) for the compiler and scripting
  • @@ -4139,11 +4139,11 @@
  • Some compiler warnings for unused variables were being suppressed in the VO/Vulcan dialect. They are activated again.
  • Scripting - +
  • The scripting was not working in release 1.01
  • Visual Studio Integration - +
  • QuickInfo could generate a 'hang' in the VS editor. This has been fixed
  • Added quickinfo for globals and defines
  • Added completionlists for globals and defines
  • @@ -4157,7 +4157,7 @@
  • Fixed a 'hang' that could occur with Visual Studio 2017 version 15.3 and later
  • VO Xporter - +
  • Fixed a problem when importing certain VO 2.7 AEF files
  • Fixed a problem with acceptable characters in the solution folder name
  • VO Form and menu entities are also included in the xsproj file
  • @@ -4167,27 +4167,27 @@ Changes in General Release (1.0.1.1) Compiler - +
  • Fixed a problem with VERY old versions of the Vulcan Runtime
  • Variables declared as DIM Byte[] and similar are now Pinned by the compiler
  • [Return] attribute was not properly handled by the compiler. This has been fixed
  • Compound Assignment (u+= f or -=) from USUAL and FLOAT were causing a stackoverflow at runtime caused by a problem in the Vulcan Runtime. These expressions now generate a compiler error with the suggestion to change to a simple assignment ( u := u + f)
  • Visual Studio Integration - +
  • Project References between XSharp Projects were also loaded as assemblyreference when resolving types. This could lead to speed problems and unnecessary memory usage
  • Improved the speed of the construction of Completion Lists (such as methods and fields for a type).
  • We have also added Completion List Tabs, where you can see fields, properties, methods etc. on separate tabs. You can enable/disable this in the Tools/Options/Text Editor/XSharp/Intellisense options page.
  • VO XPorter - +
  • We have added a check to make sure that the default namespace for a X# project cannot contain a whitespace character
  • Changes in General Release (1.0.1) New Features - +
  • We have added support for ENUM Basetypes (ENUM Foo AS WORD)
  • We have added a separate syntax for Lambda Expressions
  • We have added support for Anonymous Method Expressions
  • @@ -4195,7 +4195,7 @@
  • Methods with the ExtensionAttribute and Parameters with the ParamArrayAttribute attributes now compile correctly, but with a warning
  • Compiler - +
  • Fixed a problem with a late bound assign of a literal codeblock
  • Resolved several name conflicts
  • Improved several of the error messages
  • @@ -4209,7 +4209,7 @@
  • When an ambiguity is detected between a function and a static method then a warning is displayed
  • Visual Studio - +
  • Added parameter tips for Functions and methods from "Using Static" classes
  • Added parameter tips for Clipper Calling Convention functions and methods
  • Added support for generics in Intellisense
  • @@ -4228,14 +4228,14 @@
  • Added a menu option to start the VO Xporter tool
  • Added background scanning for dependent items, to make sure that newly generated code is scanned and available for intellisense.
  • Several changes to the Windows Forms editor and project system:
  • - +
  • Added support for adding ActiveX controls
  • Added support for Form Inheritance. Our forms are also visible in the C# Inherited form wizard
  • Added support to add our Windows Forms Custom Controls to the ToolBox in Visual Studio
  • Some performance enhancements in the Codedom Parser that is used by the Windows Form Editor. You should notice this for larger forms.
  • - +
  • Fixed several crashes reported by users
  • Native Resource files (.rc) now open in the Source code editor
  • Improved background parsing speed
  • @@ -4243,24 +4243,24 @@
  • Improved handling of Type and Member dropdowns in the editor
  • Tools - +
  • Added a first version of the VO Xporter tool
  • The installer now registers .xsproj files, .prg, .ppo. .vh, .xh and .xs files so they will be opened with Visual Studio
  • Documentation - +
  • We have added some chapters on how to convert your VO AEF and/or PRG files to a XIDE project and/or a Visual Studio solution.
  • Changes in 0.2.12 Scripting - +
  • We have added the ability to use X# scripts. Some documentation about how this works can be found here. You can also find scripting examples in the
    c:\Users\Public\Documents\XSharp\Scripting folder
  • Compiler All dialects - +
  • The compiler is now based on the Roslyn source code for C# 7.
  • Accesses and Assigns with the same name for the same (partial) class in separate source files are now merged into one property. This will slow down the compiler somewhat. We recommend that you define the ACCESS and ASSIGN in the same source file.
  • Added support for repeated result markers in the preprocessor
  • @@ -4271,12 +4271,12 @@
  • We made some changes to the character literal rules. For the VO and Harbour dialect there are now other rules then for Core and Vulcan. See the help topic for more information
  • VO and Vulcan Dialect - +
  • Several VO compatibility issues have been fixed
  • The QUIT, ACCEPT, WAIT, DEFAULT TO and STORE command are now removed from the compiler and defined in our standard header file "XSharpDefs.xh" which is located in the \Program Files(x86)\XSharp\Include folder. These commands are not compiled in the core dialect
  • Added support for CONSTRUCTOR() CLASS MyClass and DESTRUCTOR CLASS MyClass (in other words, outside the CLASS .. ENDCLASS construct
  • - +
  • The # (not equal) operator is now recognized when used without space before the keywords NIL, NULL_STRING, NULL_OBJECT etc. so #NIL is not seen as the symbol NIL but as Not Equal To NIL
  • SizeOf and _TypeOf were special tokens in VO and could not be abbreviated. We have changed the X# behavior to match this. This prevents name conflicts with variables such as _type.
  • We have added support for DLL entrypoints with embedded @ signs, such as "CAVOADAM.AdamCleanupProtoType@12"
  • @@ -4285,11 +4285,11 @@
  • Fixed several cases of "incorrect" code that would be compiled by VO, such as a codeblock that looks like:
    cb := { |x|, x[1] == 1 }
    Note the extra comma.
    This now compiled into the same codeblock as:
  • cb := { |x| x[1] == 1 } - +
  • The /vo16 compiler option has been disabled for now (does not do anything) because it had too many side effects.
  • Visual Studio Integration - +
  • Deleted files and folders are moved them to the Trash can.
  • Fixed an intellisense problem in the XAML editor
  • Added support for Code Completion between different X# projects
  • @@ -4297,7 +4297,7 @@
  • Added support for parameter info
  • Documentation - +
  • We have added (generated) topics for all undocumented compiler errors. Some topics only contain the text that is shown by the compiler. More documentation will follow. Also some documentation for the X# Scripting has been added.
  • @@ -4305,40 +4305,40 @@ Changes in 0.2.11 Compiler All dialects - +
  • Improved some error messages, such as for unterminated strings
  • Added support for the /s (Syntax Check only) command line option
  • Added support for the /parseonly command line option which is used by the intellisense parser
  • - +
  • Added some compiler errors and warnings for invalid code
  • The preprocessor did not properly handle 4 letter abbreviations for #command and #translate. This has been fixed
  • Fixed some problems found with the preprocessor
  • We switched to a new Antlr parser runtime. This should result in slightly better performance.
  • Changed the way literal characters and strings are defined:
  • - +
  • In the Vulcan dialect a literal string that is enclosed with single quotes is a char literal. Double quotes are string literals
  • In the Core and VO dialect a literal string that is enclosed with single quotes is a string literal. Double quotes are also string literals.
    To specify a char literal in Core and VO you need to prefix the literal with a 'c':
  •      LOCAL cChar as CHAR
         cChar := c'A'
    - +
  • Changed the way literal characters and strings are defined:
  • sizeof() and _sizeof() no longer generate a warning that they require 'unsafe' code, when compiling for x86 or x64. When compiling for AnyCpu the warning is still produced.
  • When the includedir environment variable was not set then the XSharp\Include folder would also not be found automatically.
  • VO/Vulcan Compatibility - +
  • Added /vo16 compiler option to automatically generate constructors with Clipper calling convention for classes without constructor
  • Harbour Compatibilty - +
  • Started work on the Harbour dialect. This is identical with the VO/Vulcan dialect. The only difference so far is that the IIF() expressions are optional
  • Visual Studio New features / changed behavior: - +
  • Added Brace Matching
  • Added Peek definition (Alt-F12)
  • All keywords are not automatically part of the Completionlist
  • @@ -4350,12 +4350,12 @@
  • Prevent crashes when the X# language buffer is fed with "garbage" such as C# code
  • Installer - +
  • The local template cache and components cache for VS2017 was not cleared properly this has been fixed.
  • Added code to properly unregister an existing CodeDomProvider when installing
  • Documentation - +
  • Several empty chapters are now hidden.
  • Added description of the templates
  • @@ -4365,7 +4365,7 @@ This build focuses on the last remaining issues in the VO and Vulcan compatibility and adds a lot of new features to the Visual Studio integration. Compiler VO/Vulcan Compatibility - +
  • We have completed support for the DEFINE keyword. The type clause is now optional. The compiler will figure out the type of the define when no type is specified.
    The DEFINEs will be compiled to a Constant field of the Functions class, or a Readonly Static field, when the expression cannot be determined at compile time (such as for Literal dates or symbols).
  • We have extended the preprocessor . It now has support for #command, #translate, #xcommand and #xtranslate. Also "Pseudo function" defines are supported, such as :

    #define MAX(x,y) IIF((x) > (y), (x), (y))

    This works just like a #xtranslate, with the exception that the define is case sensitive (unless you have enabled the "VO compatible preprocessor" option (/vo8).
    The only thing that is not working in the preprocessor is the repeated result marker.
  • In VO/Vulcan mode the compiler now accepts "garbage" between keywords such as ENDIF and NEXT and the end of the statement, just like the VO compiler.
    So you no longer have to remove "comment" tokens after a NEXT or ENDIF. This will compile without changes in the VO and Vulcan dialect:

      IF X == Y
          DoSomething()
      ENDIF X == Y
    or
      FOR I := 1 to 10
         DoSomething()
      NEXT I
    We do not recommend this coding style, but this kind of code is very common...
  • @@ -4373,12 +4373,12 @@
  • In VO and Vulcan dialect when the compiler option /vo1 is used then RETURN statements without value or with a return value of SELF are allowed for the Init() and Axit() methods. Other return values will trigger a compiler warning and will be ignored.
  • New features / changed behavior: - +
  • The compiler now produces an error when a source file ends with an unterminated multi line comment
  • Added ASTYPE expression, similar to the AS construct in other languages. This will assign a value of the correct type or NULL when the expression is not of the correct type:
  • VAR someVariable := <AnExpression> ASTYPE <SomeType>
    - +
  • The Chr() and _Chr() functions are now converted to a string or character literal when the parameter is a compile time constant
  • Compilation speed for assemblies with larger numbers of functions, procedures, defines, globals or _dll functions has been improved.
  • _DLL FUNCTIONS now automatically are marked with CharSet.Auto
  • @@ -4387,10 +4387,10 @@
    Visual Studio New features / changed behavior: - +
  • Tested and works with the release version of Visual Studio 2017
  • - +
  • We have added support for regions inside the VS editor. At this moment most "entities" are collapsible as well as statement blocks, regions and lists of usings, #includes and comments.
  • We have added support for member and type drop downs in the VS Editor
  • We have added support for Code completion in the VS editor
  • @@ -4399,7 +4399,7 @@
  • We have added help links to the errors in the VS error list. The help links will bring you to the appropriate page on the X# website. Not all the help pages are complete yet, but at least the infrastructure is working.
  • We have added support for snippets and included several code snippets in the installer
  • We have made several changes to the project properties dialogs
  • - +
  • The pre and post build events are now on a separate page for the Project Properties. These are now also not defined per configuration but are shared between the various configurations.
    If you want to copy output results to different folders for  different configurations you should use the $(Configuration) and $(Platform) variables
  • We have  moved the Platform and Prefer32Bits properties to the Build page to make them configuration dependent
  • Fixed a problem with casing of the AnyCPU platform which would result in duplicate items in the VS Platform combobox
  • @@ -4408,24 +4408,24 @@
  • We have added a project property to control how Managed file resources are included:  Use Vulcan Compatible Managed Resources
    When 'True' then resources files are included in the assembly without namespace prefix. When 'False' then the resource files are prefixed with the namespace of the app, just like in other .Net languages, such as C#
  • - +
  • We have fixed some code generation problems
  • The parser that is used in the Windows Forms editor now also properly handles background images. Both images in the resx for the form and also background images in the shared project resources
  • We have added Nuget support for our project system.
  • We have made several changes to fix problems in project files
  • - +
  • The project system now silently fixes problems with duplicate items
  • Fixed a problem with dependencies between xaml files and their dependent designer.prg files and other dependent files
  • Fixed a problem with dependent items in sub folders or in a folder tree that includes a dot in a folder name.
  • Fixed a problem in the WPF template
  • - +
  • Fixed a refresh problem when deleting a references node
  • Added implementation of the OAProject.Imports property, which is used by JetBrains
  • XPorter - +
  • Fixed a problem converting WPF style projects
  • @@ -4435,10 +4435,10 @@ With this build you can compile the Vulcan SDK without changes, except for some obvious errors in the Vulcan SDK that Vulcan did not find!
    We consider the Vulcan Compatibility of the compiler finished with the current state of the compiler. All Vulcan code should compile without proble now.
    VO/Vulcan Compatibility New features / changed behavior: - +
  • All Init procedures are now properly called at startup. So not only the init procedures in the VOSDK libraries but also init procedures in other libraries and the main exe
  • Changed the method and type resolution code:
  • - +
  • A method with a single object parameter is now preferred over a method with an Object[] parameter
  • When both a function (static method) exists and an instance method we will now call the static method in code inside methods that does not have a SELF: or SUPER: prefix.
  • In situations where the @ operator is used to pass variables by reference.
  • @@ -4449,12 +4449,12 @@
  • When 2 identical functions or types are detected in referenced assemblies we now choose the one in the first referenced assembly like Vulcan does, and generate warning 9043
  • - +
  • The sizeof operator now returns a DWORD to be compatible with VO and Vulcan.
  • Added support for EXIT PROCEDURES (PROCEDURE MyProcedure EXIT). These procedures will automatically be called during program shutdown, just before all the global variables are cleared.
    The compiler now generates an $Exit function for each assembly in which the exit procedures will be called and the reference globals in an assembly will be cleared. In the main app a $AppExit() function is created that will call the $Exit functions in all references X# assemblies. When a Vulcan compiled assembly is referenced, then all the public reference globals will be cleared from the $AppExit() function.
  • Added support for PCALL and PCALLNATIVE
  • Added support for several Vulcan compatible compiler options:
  • - +
  • /vo1 Allow Init() and Axit() for constructor and destruction
  • /vo6 Allow (global) function pointers. DotNet does not "know" these. They are compiled to IntPtr. The function information is preserved so you can use these pointer in a PCALL()
  • /ppo. Save the preprocessed compiler output to a file
  • @@ -4466,15 +4466,15 @@
  • WAIT command
  • - +
  • Several code generation changes:
  • - +
  • Changed the code generation for DIM elements inside VOStruct arrays because the Vulcan compiler depends on a specific naming scheme and did not recognize our names.
  • Improved the code generation inside methods with CLIPPER calling convention.
  • Bug fixes - +
  • Implicit namespaces are now only used when the /ins compiler option is enabled. In Vulcan dialect the namespace Vulcan is always included.
  • Fixed several problems with the @ operator and VOSTRUCT types
  • Fixed a problem with DIM arrays of VOSTRUCT types
  • @@ -4494,15 +4494,15 @@
    All dialects New features / changed behavior: - +
  • Several code generation changes:
  • - +
  • The code generation for ACCESS and ASSIGN has changed. There are no longer separate methods in the class, but the content of these methods is now inlined in the generated Get and Set methods for the generated property.
  • Optimized the code generation for IIF statements.
  • The debugger/step information has been improved. The debugger should now also stop on IF statements, FOR statements, CASE statements etc.
  • - +
  • Indexed access to properties defined with the SELF keyword can now also use the "Index" property name
  • Functions and Procedures inside classes are not allowed (for now)
  • RETURN <LiteralValue> inside an ASSIGN method will no longer allocate a variable and produce an warning
  • @@ -4510,7 +4510,7 @@
    You can see that the Visual Studio language support also recognizes that INTERFACE and OPERATOR are not used as keywords in this context Bug fixes - +
  • Fixed a problem with the REPEAT UNTIL statement
  • Fixed a crash for code with a DO CASE without a matching END CASE
  • Fixed several issues for the code generation for _DLL FUNCTIONs and _DLL PROCEDUREs
  • @@ -4531,7 +4531,7 @@
  • And many more changes.
  • Visual Studio Integration - +
  • Added support for all compiler options in the UI and the build system
  • Fixed problems with dependent file items in subfolders
  • The Optimize compiler option was not working
  • @@ -4543,7 +4543,7 @@
    Documentation - +
  • We have added many descriptions to the commandline options
  • We have added a list of the most common compiler errors and warnings.
  • @@ -4552,7 +4552,7 @@ Changes in 0.2.8 Compiler VO/Vulcan Compatibility - +
  • Default Parameters are now handled like VO and Vulcan do. This means that you can also have date constants, symbolic constants etc as default parameter
  • String Single Equals rules are now 100% identical with Visual Objects. We found one case where Vulcan does not return the same result as Visual Objects. We have chosen to be compatible with VO.
  • When compiling in VO/Vulcan mode then the init procedures in the VO SDK libraries are automatically called. You do not have to call these in your code anymore
    Also Init procedures in the main assembly are called at startup.
  • @@ -4567,7 +4567,7 @@
  • Fixed several numeric conversion problems
  • New features - +
  • We have added support for Collection Initializers and Object Initializers
  • Anonymous type members no longer have to be named. If you select a property as an anonymous type member then the same property name will be used for the anonymous type as well.
  • Missing closing keywords (such as NEXT, ENDIF, ENDCASE and ENDDO) now produce better error messages
  • @@ -4575,7 +4575,7 @@
    FUNCTION IsEven(nValue as LONG) AS LOGIC
      LOCAL lEven as LOGIC
      IIF( nValue %2 == 0, lEven := TRUE, lEven := FALSE)
    RETURN lEven
    We really do not encourage to hide assignments like this, but in case you have used this coding style,it works now <g>. - +
  • AS VOID is now allowed as (the only) type specification for PROCEDUREs
  • We have added a .config file to the exe for the shared compiler that should make it faster
  • The XSharpStdDefs.xh file in the XSharp is now automatically included when compiling. This file declares the CRLF constant for now.
  • @@ -4585,7 +4585,7 @@
  • Compiler error messages for unexpected tokens have been improved
  • Bug fixes - +
  • Several command-line options with a minus sign were not properly handled by the compiler
  • Fixed several crashes related to assigning NULL_OBJECT or NULL to late bound properties have been fixed
  • Partial class no longer are required to specify the parent type on every source code location. When specified, the parent type must be the same of course. Parent interfaces implemented by a class can also be spread over multiple locations
  • @@ -4598,22 +4598,22 @@
    Visual Studio Integration We have changed the way the error list and output window are updated. In previous version some lines could be missing on the output window, and the error code column was empty. This should work as expected now. - +
  • We have merged some code from some other MPF based project systems, such as WIX (called Votive), NodeJS and Python (PTVS) to help extend our project system. As a result:
  • - +
  • Our project system now has support for Linked files
  • Our project system now has support for 'Show All Files' and you can now Include and Exclude files. This setting is persisted in a .user file, so you can exclude this from SCC if you want.
  • We have made some changes to support better 'Drag and Drop'
  • - +
  • We have fixed several issues with regard to dependent items
  • When you include a file that contains a form or user control, this is now recognized and the appropriate subtype is set in the project file, so you can open the windows forms editor
  • We are now supporting source code generation for code behind files for .Settings and .Resx files
  • The combobox in the Managed Resource editor and Managed Settings tool to choose between internal code and public code is now enabled. Selecting a different value in the combobox will change the tool in the files properties.
  • The last response file for the compiler and native resource compiler are now saved in the users Temp folder to aid in debugging problems.
  • - +
  • The response file now has each compiler option to a new line to make it easier to read and debug when this is necessary.
  • The code generation now preserves comments between entities (methods)
  • We fixed several minor issues in the templates
  • @@ -4626,13 +4626,13 @@ Changes in 0.2.7.1 Compiler - +
  • The compiler was not accepting wildcard strings for the AssemblyFileVersion Attribute and the AssemblyInformationVersion attribute. This has been fixed
  • The #Pragma commands #Pragma Warnings(Push) and #Pragma Warnings(Pop) were not recognized. This has been fixed.
  • The compiler was not recognizing expressions like global::System.String.Compare(..). This has been fixed
  • Visual Studio Integration - +
  • Dependent items in subfolders of a project were not recognized properly and could produce an error when opening a project
  • Fixed a problem in the VulcanApp Template
  • The Windows Forms Editor would not open forms in a file without begin namespace .. end namespace. This has been fixed
  • @@ -4645,7 +4645,7 @@
  • Added 'Copy to Output Directory' property to the properties window
  • Setup - +
  • The installer, exe files and documentation are now signed with a certificate
  • @@ -4653,7 +4653,7 @@ Changes in 0.2.7 Compiler New features: - +
  • Added support for the VOSTRUCT and UNION types
  • Added support for Types as Numeric values, such as in the construct
    IF UsualType(uValue) == LONG
  • Added a FIXED statement and FIXED modifier for variables
  • @@ -4664,14 +4664,14 @@
  • The FOX version of the compiler is now distributed in Release mode and much faster. A debug version of the compiler is also installed in case it is needed to aid in finding compiler problems.
  • Changed behavior - +
  • The compiler generated Globals class for the Core dialect is now called Functions and no longer Xs$Globals.
  • Overriding functions in VulcanRTFuncs can now be done without specifying the namespace:
    When the compiler finds two candidate functions and one of them is inside VulcanRTFuncs then the function that is not in VulcanRTFuncs is chosen.
  • Warning 9001 (unsafe modifier implied) is now suppressed for the VO/Vulcan dialect. You MUST pass the /unsafe compiler option if you are compiling unsafe code though!
  • Improved the error messages for the Release mode of the compiler
  • Bug fixes - +
  • RETURN and THROW statements inside a Switch statement would generate an 'unreachable code' warning. This has been fixed
  • Fixed several problems with mixing signed and unsigned Array Indexes
  • Fixed several problems with the FOR .. NEXT statement. The "To" expression will now be evaluated for every iteration of the loop, just like in VO and Vulcan.
  • @@ -4680,7 +4680,7 @@
  • Fixed a visibility problem with static variables inside static functions
  • Visual Studio Integration - +
  • Fixed a problem that the wrong Language Service was selected when XSharp and Vulcan.NET were used in the same Visual Studio and when files were opened from the output window or the Find Results window
  • Fixed some problems with 'abnormal' line endings in generated code
  • Fixed a problem in the Class Library template
  • @@ -4689,7 +4689,7 @@ Changes in 0.2.6 Compiler - +
  • Added alternative syntax for event definition. See EVENT keyword in the documentation
  • Added Code Block Support
  • Implemented /vo13 (VO compatible string comparisons)
  • @@ -4707,7 +4707,7 @@
  • Fixed a crash for properties defined with parentheses or square brackets, but without actual parameters
  • Visual Studio Integration - +
  • Completed support for .designer.prg for Windows.Forms
  • Fixed an issue in the CodeDom generator for generating wrappers for Services
  • The XSharp Language service will no longer be used for Vulcan PRG files in a Side by Side installation
  • @@ -4717,11 +4717,11 @@ Changes in 0.2.51 Visual Studio Integration & Build System - +
  • The Native Resource compiler now "finds" header files, such as "VOWin32APILibrary.vh" in the Vulcan.NET include folder. Also the output of the resource compiler is now less verbose when running in "normal" message mode. When running in "detailed" or "diagnostics" mode the output now also includes the verbose output of the resource compiler.
  • Compiler - +
  • Fixed a problem that would make PDB files unusable
  • The error "Duplicate define with different value" (9012) has been changed to warning, because our preprocessor does a textual comparison and does not "see" that "10" and "(10)" are equal as well as "0xA" and "0xa". It is your responsibility of course to make sure that the values are indeed the same.
  • Exponential REAL constants were only working with a lower case 'e'. This is now case insensitive
  • @@ -4731,7 +4731,7 @@ Changes in 0.2.5 Visual Studio Integration - +
  • Fixed a problem where the output file name would contain a pipe symbol when building for WPF
  • Fixed a problem with the Item type for WPF forms, pages and user controls
  • The installer now has an option to not take away the association for PRG, VH and PPO items from an installed Vulcan project system.
  • @@ -4740,40 +4740,40 @@
  • Added several item templates for WPF, RC, ResX, Settings, Bitmap, Cursor etc.
  • Build System - +
  • Added support for the new /vo15 command line switch.
  • Added support for compiling native resources.
  • Compiler - +
  • A reference to VulcanRT and VulcanRTFuncs is now mandatory when compiling in VO/Vulcan dialect
  • Added support for indexed access for VO/Vulcan Arrays
  • Added support for VO/Vulcan style Constructor chaining (where SUPER() or SELF() call is not the first call inside the constructor body)
  • Added support for the &() macro operator in the VO/Vulcan dialect
  • Added support for the FIELD statement in the VO/Vulcan dialect
  • - - + +
  • The statement is recognized by the compiler
  • Fields listed in the FIELD statement now take precedence over local variables or instance variables with the same name
  • - +
  • Added support for the ALIAS operator (->) in the VO/Vulcan dialect, with the exception of the aliased expressions (AREA->(<Expression>))
  • Added support for Late bound code (in the VO/Vulcan dialect)
  • - - + +
  • Late bound method calls
  • Late bound property get
  • Late bound property set
  • Late bound delegate invocation
  • - +
  • Added a new /vo15 command line option (Allow untyped Locals and return types):
    By default in the VO/Vulcan dialect missing types are allowed and replaced with the USUAL type.
    When you specify /vo15- then untyped locals and return types are not allowed and you must specify them.
    Of course you can also specify them as USUAL
  • - +
  • The ? and ?? statement are now directly mapped to the appropriate VO/Vulcan runtime function when compiling for the VO/Vulcan dialect
  • We now also support the VulcanClassLibrary attribute and VulcanCompilerVersion attribute for the VO & Vulcan dialect.
    With this support the Vulcan macro compiler and Vulcan Runtime should be able to find our functions and classes
  • The generated static class name is now more in par with the class name that Vulcan generates in the VO & Vulcan dialect.
  • @@ -4783,43 +4783,43 @@
  • Fixed a problem with case sensitive namespace comparisons
  • Fixed a problem with operator methods
  • - +
  • Added preprocessor macros __DIALECT__, __DIALECT_CORE__, __DIALECT_VO__ and __DIALECT_VULCAN__
  • The _Chr() pseudo function will now be mapped to the Chr() function
  • - +
  • Added support for missing arguments in arguments lists (VO & Vulcan dialect only)
  • Fixed a crash when calculating the position of tokens in header files
  • The installer now offers to copy the Vulcan Header files to the XSharp Include folder
  • Added support for skipping arguments in (VO) literal array constructors
  • Documentation - +
  • Added the XSharp documentation to the Visual Studio Help collection
  • Added reference documentation for the Vulcan Runtime
  • Changes in 0.2.4 Visual Studio Integration - +
  • Double clicking errors in the error browser now correctly opens the source file and positions the cursor
  • Fixed several problems in the project and item templates
  • The installer now also detects Visual Studio 15 Preview and installs our project system in this environment.
  • Build System - +
  • Fixed a problem with the /unsafe compiler option
  • Fixed a problem with the /doc compiler option
  • Treat warnings as error was always enabled. This has been fixed.
  • Compiler - +
  • Added support for Lambda expressions with an expression list
  • LOCAL dfunc AS System.Func<Double,Double> dfunc := {|x| x := x + 10, x^2} ? dfunc(2) - +
  • Added support for Lambda expressions with a statement list
  • LOCAL dfunc AS System.Func<Double,Double> @@ -4827,7 +4827,7 @@ ? 'square of', x RETURN x^2 } - +
  • Added support for the NAMEOF intrinsic function
  • FUNCTION Test(cFirstName AS STRING) AS VOID @@ -4835,7 +4835,7 @@ IF String.IsNullOrEmpty(cFirstName) THROW ArgumentException{"Empty argument", nameof(cFirstName)} ENDIF - +
  • Added support for creating methods and functions with Clipper calling convention (VO and Vulcan dialect only)
  • Using Statement now can contain a Variable declaration:
  • @@ -4849,11 +4849,11 @@ BEGIN USING VAR ms := System.IO.MemoryStream{} // do the work END USING - +
  • Added support for /vo10 (Compatible IIF behavior). In the VO and Vulcan dialect the expressions are cast to USUAL. In the core dialect the expressions are cast to OBJECT.
  • New language features for the VO and Vulcan dialect - +
  • Calling the SELF() or SUPER() constructor is now allowed anywhere inside a constructor (VO and Vulcan dialect only). The Core dialect still requires constructor chaining as the first expression inside the constructor body
  • Added support for the PCOUNT, _GETFPARAM and _GETMPARAM intrinsic functions
  • Added support for String2Psz() and Cast2Psz()
  • @@ -4861,7 +4861,7 @@
  • Added support for BREAK
  • Fixed several problems: - +
  • Nested array initializers
  • Crash for BREAK statements
  • Assertion error for generic arguments
  • @@ -4873,7 +4873,7 @@ Changes in 0.2.3 Visual Studio Integration - +
  • We have changed to use the MPF style of Visual Studio Integration.
  • We have added support for the Windows Forms Editor
  • We have added support for the WPF Editor
  • @@ -4882,15 +4882,15 @@
  • We have added several templates
  • Build System - +
  • Added support for several new commandline options, such as /dialect
  • The commandline options were not reset properly when running the shared compiler. This has been fixed.
  • - +
  • The build system will limit the # of errors passed to Visual Studio to max. 500 per project. The commandline compiler will still show all errors.
  • Compiler - +
  • We have started work on the Bring Your Own Runtime support for Vulcan. See separate heading below.
  • The __SIG__ and __ENTITY__ macros are now also supported, as well as the __WINDIR__, __SYSDIR__ and __WINDRIVE__ macros
  • The debugger instructions have been improved. You should have a much better debugging experience with this build
  • @@ -4903,7 +4903,7 @@
  • Fixed a problem for the DYNAMIC type.
  • BYOR - +
  • XBase type names are resolved properly (ARRAY, DATE, SYMBOL, USUAL etc)
  • Literal values are now resolved properly (ARRAY, DATE, SYMBOL)
  • NULL_ literals are resolved properly (NULL_STRING follows the /vo2 compiler option, NULL_DATE, NULL_SYMBOL)
  • @@ -4919,7 +4919,7 @@ Changes in 0.2.2 Visual Studio Integration - +
  • Added more project properties. One new property is the "Use Shared Compiler" option. This will improve compilation speed, but may have a side effect that some compiler (parser) errors are not shown in details.
    If you experience this, then please disable this option.
  • Added more properties to the Build System. All C# properties should now also be supported for X#, even though some of them are not visible in the property dialogs inside VS.
  • Added a CreateManifest task to the Build System so you will not get an error anymore for projects that contain managed resources
  • @@ -4927,7 +4927,7 @@
  • Marking and unmarking text blocks as comment would not always be reflected in the editor colors. This has been fixed.
  • Compiler - +
  • We have added a first version of the preprocessor. This preprocessor supports the #define command, #ifdef, #ifndef, #else, #endif, #include, #error and #warning. #command and #translate (to add user defined commands) are not supported yet.
  • Missing types (in parameter lists, field definitions etc) were sometimes producing unclear error messages. We have changed the compiler to produce a "Missing Type" error message.
  • We rolled the underlying Roslyn code forward to VS 2015 Update 1. Not that you see much of this from the outside <g>, but several fixes and enhancements have made their way into the compiler.
  • @@ -4945,14 +4945,14 @@ Changes in 0.2.1 Visual Studio Integration - +
  • Added and improved several project properties
  • Fix a problem with the "Additional Compiler Options"
  • Improved coloring in the editor for Keywords, Comments etc. You can set the colors from the Tools/Options dialog under General/Fonts & Colors. Look for the entries with the name "XSharp Keyword" etc.
  • Added Windows Forms Template
  • Compiler - +
  • Several errors have been demoted to warnings to be more compatible with VO/Vulcan
  • Added support for Comment lines that start with an asterisk
  • Added support for the DEFINE statement. For now the DEFINE statement MUST have a type
    DEFINE WM_USER := 0x0400 AS DWORD
  • @@ -4961,7 +4961,7 @@
    Changes in 0.1.7 - +
  • The "ns" (add default namespace to classes without namespace) has been implemented
  • The "vo3" compiler option (to make all methods virtual ) has been implemented
  • Fixed an issue where the send operator on an expression between parentheses was not compiling properly
  • @@ -4976,7 +4976,7 @@
    Changes in 0.1.6 - +
  • This version now comes with an installer
  • This version includes a first version of the Visual Studio Integration. You can edit, build, run and debug inside Visual Studio. There is no "intellisense" available.
  • The compiler now uses 1-based arrays and the “az” compiler option has been implemented to switch the compiler to use 0-based arrays.
  • @@ -4990,7 +4990,7 @@
    Changes in 0.1.5 - +
  • When an error occurs in the parsing stage, X# no longer enters the following stages of the compiler to prevent crashes. In addition to the errors from the parser also an error 9002 is displayed.
  • Parser errors now also include the source file name in the error message and have the same format as other error messages. Please note that we are not finished yet with handling these error messages. There will be improvements in the format of these error messages in the upcoming builds.
  • The compiler will display a “feature not available” (8022) error when a program uses one of the Xbase types (ARRAY, DATE, FLOAT, PSZ, SYMBOL, USUAL).
  • @@ -4999,7 +4999,7 @@
    Changes in 0.1.4 - +
  • Several changes to allow calculations with integers and enums
  • Several changes to allow VO compatible _OR, _AND, _NOT an _XOR operations
  • Fix interface/abstract VO properties
  • @@ -5022,7 +5022,7 @@
    Changes in 0.1.3 - +
  • Change inconsistent field accessibility error to warning and other similar errors
  • Added commandline support for Vulcan arguments. These arguments no longer result in an error message, but are not really implemented, unless an equivalent argument exists for the Roslyn (C#) compiler. For example: /ovf and /fovf are both mapped to /checked, /wx is mapped to /warnaserror. /w should not be used because that has a different meaning /warning level). /nowarn:nnnn should be used in stead
  • Fixed problem where the PUBLIC modifier was assigned to Interface Members or Destructors
  • @@ -5041,7 +5041,7 @@
    Changes in 0.1.2.1 - +
  • Added default expression
  • Fixed problem with events
  • Fixed some small lexer problems
  • @@ -5049,7 +5049,7 @@
    Changes in 0.1.2 - +
  • Fixed problem with handling escape sequences in extended strings
  • Fixed issue in FOR.. NEXT statements
  • Fixed a problem with SWITCH statements
  • diff --git a/docs/Help_ZH-CN/Topics/Visual-Studio-Integration.xml b/docs/Help_ZH-CN/Topics/Visual-Studio-Integration.xml index 8a49366610..ad9198500c 100644 --- a/docs/Help_ZH-CN/Topics/Visual-Studio-Integration.xml +++ b/docs/Help_ZH-CN/Topics/Visual-Studio-Integration.xml @@ -1,34 +1,36 @@  - - Using X# in Visual Studio + + 在 Visual Studio 中使用 X#
    - Using X# in Visual Studio + 在 Visual Studio 中使用 X#
    - XSharp comes with 2 options for development environments: - -
  • Chris Pyrgas has adjusted his existing IDE to support XSharp (it is now called XIDE, and compiled in XSharp !)
  • -
  • We supply Visual Studio integration for Visual Studio 2015 and later. If you do not have Visual Studio, you can download a (free!) community edition from Visual Studio from the web:
  • + + XSharp 有两种开发环境可供选择: + + +
  • Chris Pyrgas 调整了他现有的集成开发环境用以支持 XSharp( XIDE,并以 XSharp 编译)。
  • +
  • 我们为 Visual Studio 2015 及更高版本提供 Visual Studio 集成。如果您没有Visual Studio,可以从网上下载Visual Studio社区版(免费!):
  • https://www.visualstudio.com/en-us/downloads/download-visual-studio-vs.aspx - The Visual Studio integration is also work in progress. What is supported in this version is: - -
  • Edit
  • -
  • Compile
  • -
  • Debug
  • -
  • Source control
  • -
  • Windows Forms Editor
  • -
  • WPF Editor
  • -
  • Resource editor
  • -
  • Settings editor
  • + Visual Studio 集成工作也在进行中。该版本支持以下功能: + +
  • 编辑
  • +
  • 编译
  • +
  • 调试
  • +
  • 源代码控制
  • +
  • Windows Forms 编辑器
  • +
  • WPF编辑器
  • +
  • 资源编辑器
  • +
  • 设置编辑器
  • - Known issues: - -
  • Some of the intellisense features are not supported yet.
  • -
  • There are no editors for VO Binary entities yet
  • -
  • No support yet for .Net Core, .Net Standard, Portable class libraries and shared projects
  • + 已知问题: + +
  • 有些 intellisense 特性尚不支持。
  • +
  • 尚未提供 VO 二进制编辑器
  • +
  • 尚未支持 .Net Core、.Net Standard、可移植类库和共享项目
  • diff --git a/docs/Help_ZH-CN/Topics/WORD.xml b/docs/Help_ZH-CN/Topics/WORD.xml index 1696c6adde..4e10e637db 100644 --- a/docs/Help_ZH-CN/Topics/WORD.xml +++ b/docs/Help_ZH-CN/Topics/WORD.xml @@ -1,6 +1,6 @@  - + WORD WORD @@ -9,7 +9,8 @@
    WORD
    - The WORD keyword denotes an integral type that stores unsigned 16-bit values with values ranging from 0 to 65535. + + WORD 关键字表示一种整数类型,用于存储无符号的 16 位值,取值范围从 0 到 65535。 diff --git a/docs/Help_ZH-CN/Topics/Workarea-Events.xml b/docs/Help_ZH-CN/Topics/Workarea-Events.xml index dbfad81f6d..2913d120b4 100644 --- a/docs/Help_ZH-CN/Topics/Workarea-Events.xml +++ b/docs/Help_ZH-CN/Topics/Workarea-Events.xml @@ -1,42 +1,45 @@  - - Workarea Events + + Workarea 事件
    - Workarea Events + Workarea 事件
    - In build 2.08 we have added the option to register an event handler that receives workarea events. This can be used to monitor access to workareas and for example write this information to a log file. - There are 2 ways to install this event handler: - -
  • You create a function/ method that implements the DbNotifyEventHandler delegate.

    PUBLIC DELEGATE XSharp.DbNotifyEventHandler(osender AS XSharp.RDD.IRDD, e AS XSharp.DBNotifyEventArgs) AS VOID
  • -
  • You create a class that implements the IDbnotify interface, which only has a method named Notify() with the same prototype as the delegate from 1)
  • + 在 Build 2.08 中,我们添加了用于注册接收工作区事件的事件处理程序的选项。这可用于监视对工作区的访问,例如将此信息写入日志文件。 + + + 有 2 种方法可以安装此事件处理程序: + + +
  • 创建实现 DbNotifyEventHandler 委托的函数/方法。

    PUBLIC DELEGATE XSharp.DbNotifyEventHandler(osender AS XSharp.RDD.IRDD, e AS XSharp.DBNotifyEventArgs) AS VOID
  • +
  • 您创建一个实现 IDbnotify 接口的类,该接口只有一个名为 Notify() 的方法,其原型与 1) 中的委托相同。
  • - Important - -
  • Your event handler should do as little as possible if you don't want to slow down the whole RDD system.
  • -
  • Do not manipulate any workareas from within your event handler to avoid recursion.
  • -
  • Unregister your event handler as soon as possible.
  • -
  • If you use an object for event handling you are responsible yourself to manage the life time of this object. And be sure to unregister the object before it runs out of scope
  • -
  • In some cases (operations that work on more than one workarea, such as DbCommitAll() , DbUnLockAll() )  the event handler will not always receive a sender parameter. Be prepared for that !
  • -
  • The events are sent from the CoreDb level. So if a method inside an RDD calls another method inside that RDD (for example CreateOrder() might call GoTop() after creating the order) then you will not see that second event, only the events related to the method that was called from the CoreDb() level, so the events related to the Ordercreation in this example.
  • + 重要 + +
  • 如果你不想拖慢整个 RDD 系统的运行速度,那么你的事件处理程序就应该尽量少做一些事情。
  • +
  • 不要在事件处理程序中操作任何工作区,以避免递归。
  • +
  • 尽快取消注册事件处理程序。
  • +
  • 如果您使用对象进行事件处理,您就有责任管理该对象的生命周期。请务必在对象超出范围之前取消注册。
  • +
  • 在某些情况下(对多个工作区进行操作,如 DbCommitAll() 和 DbUnLockAll()),事件处理程序并不总能收到发送者参数。请做好准备!
  • +
  • 事件是从 CoreDb 层发送的。因此,如果 RDD 中的一个方法调用了该 RDD 中的另一个方法(例如,创建订单后,CreateOrder() 可能会调用 GoTop()),那么您将看不到第二个事件,只能看到与从 CoreDb() 层调用的方法相关的事件,因此在本例中与创建订单相关的事件。
  • - Examples + 示例 - If you use approach 1 then you need to add the event handler to CoreDb.Notify like in the following example: + 如果使用方法 1,则需要在 CoreDb.Notify 中添加事件处理程序,如下例所示: + FUNCTION NotifyRDDOperations(oRDD AS XSharp.RDD.IRdd, oEvent AS XSharp.DbNotifyEventArgs) AS VOID
       IF oRDD != NULL
           ? oRDD:Alias, oEvent:Type:ToString(), oEvent:Data
       ELSE
           ? "(no area)",oEvent:Type:ToString(), oEvent:Data
       ENDIF
       RETURN

    FUNCTION Start() AS VOID
      CoreDb.Notify += NotifyRDDOperations
       ? DbCreate("Test", {{"FLD1" , "C" , 10 , 0} })    // 这将触发一个通知
    CoreDb.Notify -= NotifyRDDOperations   // 请不要忘记取消注册!
      WAIT
    RETURN
    + 该函数的参数为: - FUNCTION NotifyRDDOperations(oRDD AS XSharp.RDD.IRdd, oEvent AS XSharp.DbNotifyEventArgs) AS VOID
       IF oRDD != NULL
           ? oRDD:Alias, oEvent:Type:ToString(), oEvent:Data
       ELSE
           ? "(no area)",oEvent:Type:ToString(), oEvent:Data
       ENDIF
       RETURN

    FUNCTION Start() AS VOID
      CoreDb.Notify += NotifyRDDOperations
       ? DbCreate("Test", {{"FLD1" , "C" , 10 , 0} })    // This will trigger a notification
    CoreDb.Notify -= NotifyRDDOperations  // Do not forget to unregister!
      WAIT
    RETURN
    - The parameters to the function are: - oRDDThe RDD for which the event is triggered. This may be NULL for events that involve multiple workareas, such as DbUnlockAll() - oEventAn event handler object that has 2 properties - TypeA Value of the DbNotificationType enum - DataAn object that has additional information about the event, such as the fieldname for a PieldPut and the recordnumber for a Append or Delete event.. + oRDD  触发事件的 RDD。对于涉及多个工作区的事件,如 DbUnlockAll() ,该值可能为 NULL。 + oEvent  一个事件处理程序对象,它有 2 个属性 + TypeDbNotificationType 枚举值 + Data包含事件附加信息的对象,如 PieldPut 的字段名和 Append 或 Delete 事件的记录编号。 - For the second approach you create a class and register the class with the DbRegisterClient() function and unregister the class with the DbUnRegisterClient function - The method in the class will get the same arguments as the event handler function: - CLASS Notifier IMPLEMENTS IDbnotify
        METHOD Notify(oRDD AS XSharp.RDD.IRdd, oEvent AS XSharp.DbNotifyEventArgs) AS VOID
          IF oRDD != NULL
             ? oRDD:Alias, oEvent:Type:ToString(), oEvent:Data
          ELSE
             ? "(no area)",oEvent:Type:ToString(), oEvent:Data
          ENDIF
          RETURN
    END CLASS

    FUNCTION Start() AS VOID
      LOCAL oNot AS Notifier
      oNot := Notifier{}
      DbRegisterClient(oNot)  
      ? DbCreate("Test", {{"FLD1" , "C" , 10 , 0} })    // This will trigger a notification
      DbUnRegisterClient(oNot)  // Do not forget to unregister!
     
      WAIT
    RETURN
    - See Also + 第二种方法是创建一个类,使用 DbRegisterClient() 函数注册该类,然后使用 DbUnRegisterClient 函数取消注册该类。 + 类中的方法将获得与事件处理函数相同的参数: + CLASS Notifier IMPLEMENTS IDbnotify
        METHOD Notify(oRDD AS XSharp.RDD.IRdd, oEvent AS XSharp.DbNotifyEventArgs) AS VOID
          IF oRDD != NULL
             ? oRDD:Alias, oEvent:Type:ToString(), oEvent:Data
          ELSE
             ? "(no area)",oEvent:Type:ToString(), oEvent:Data
          ENDIF
          RETURN
    END CLASS

    FUNCTION Start() AS VOID
      LOCAL oNot AS Notifier
      oNot := Notifier{}
      DbRegisterClient(oNot)  
      ? DbCreate("Test", {{"FLD1" , "C" , 10 , 0} })    // 这将触发一个通知
      DbUnRegisterClient(oNot)    // 请不要忘记取消注册!
     
      WAIT
    RETURN
    + 参看 DbNotificationType DbRegisterClient() DbUnRegisterClient diff --git a/docs/Help_ZH-CN/Topics/X-Examples.xml b/docs/Help_ZH-CN/Topics/X-Examples.xml index 780163dd0d..24a88d9a27 100644 --- a/docs/Help_ZH-CN/Topics/X-Examples.xml +++ b/docs/Help_ZH-CN/Topics/X-Examples.xml @@ -1,11 +1,12 @@  - - - X# Examples + + + X# 示例
    - X# Examples + X# 示例
    - The following X# Examples will also be installed as an example solution on your machine in the Users\Public\XSharp\Examples folder. + + 以下 X# 示例也将作为示例解决方案安装在你的计算机上,位于 Users\Public\XSharp\Examples 文件夹中。
    diff --git a/docs/Help_ZH-CN/Topics/X-Programming-guide.xml b/docs/Help_ZH-CN/Topics/X-Programming-guide.xml index 21151cd40f..c44be8267b 100644 --- a/docs/Help_ZH-CN/Topics/X-Programming-guide.xml +++ b/docs/Help_ZH-CN/Topics/X-Programming-guide.xml @@ -1,10 +1,10 @@  - - X# Programming guide + + X# 程序员指南
    - X# Programming guide + X# 程序员指南
    diff --git a/docs/Help_ZH-CN/Topics/X-Scripting.xml b/docs/Help_ZH-CN/Topics/X-Scripting.xml index 7fed442b1c..7111927923 100644 --- a/docs/Help_ZH-CN/Topics/X-Scripting.xml +++ b/docs/Help_ZH-CN/Topics/X-Scripting.xml @@ -1,7 +1,7 @@  - - X# Scripting + + X# 脚本 #LOAD #R @@ -13,51 +13,53 @@
    - X# Scripting + X# 脚本
    - Below is the text from the presentation from the session that Nikos did in Cologne during the XBase.Future 2017 conference. - The examples from this session are stored during the installation of X# in the folder c:\Users\Public\Documents\XSharp\Scripting + + 以下是尼科斯在科隆举行的 XBase.Future 2017 会议上的演讲内容。 + + 本次会议的示例在安装 X# 时保存在 c:\Users\Public\Documents\XSharp\Scripting 文件夹中。 Why endorse scripting? - +
  • Dynamic behavior at runtime
  • - +
  • Extensibility and flexibility
  • User-defined behavior
  • - +
  • Platform independence
  • - +
  • System operations defined in a script
  • - +
  • Behavior as data
  • - +
  • Stored in files, database, cloud
  • Updated at runtime
  • - +
  • Rapid prototyping
  • Scripting is... - +
  • Expression evaluation
  • - - + +
  • Built-in interpreter
  • Self-contained functionality
  • Simple expressions or full statements
  • - +
  • Source file(s) without a project
  • - - + +
  • Single file (multiple sources may be loaded by a single script)
  • No need for a full IDE or SDK
  • Dynamic compilation without an IDE
  • @@ -65,15 +67,15 @@
    X# as a scripting language - +
  • Roslyn script engine
  • - +
  • C# scripting
  • - +
  • Standalone expressions
  • - +
  • No START function
  • Global statements, expressions
  • Similar to the macro compiler (but not the same!)
  • @@ -81,320 +83,320 @@
    X# as a scripting language - +
  • Complex declarations allowed
  • - +
  • Types, functions can be declared
  • No namespaces!
  • - +
  • External references
  • - +
  • Loading assemblies
  • No implicit access to host assembly
  • No isolation (e.g. separate AppDomain)
  • The X-Sharp interpreter (xsi.exe) - +
  • Read-Eval-Print Loop (REPL)
  • Console application
  • Return values are printed to the console
  • - +
  • With pretty formatting!
  • - +
  • Maintain context
  • Declare LOCAL variables
  • The X-Sharp interpreter (xsi.exe) - +
  • Can load assemblies, script files
  • - +
  • .PRGX extension
  • #R directive
  • #LOAD directive
  • - +
  • Can runs scripts from command line
  • - +
  • Xsi.exe <script.prgx>
  • - +
  • Passes command-line arguments to scripts
  • - +
  • Xsi.exe <script.prgx> <arg> ...
  • Alternative ways to run scripts - +
  • Setting xsi.exe as default app for .prgx
  • - +
  • Also creates file association, but without args
  • Edit file association in registry
  • - +
  • Manually setting file association
  • - +
  • assoc, ftype
  • - +
  • Invoking without the .prgx extension
  • - +
  • PATHEXT
  • - +
  • Run without console?
  • - +
  • Not possible with xsi.exe since it is a console application
  • Scripting internals: the submission - +
  • Every script is compiled into a “submission”
  • - +
  • Roslyn terminology
  • - +
  • Every line given to the xsi prompt creates a new submission
  • - +
  • Inherits previous submission
  • Previously declared variables remain visible
  • - +
  • Cannot be inspected directly
  • - +
  • “SELF” and “SUPER” are not accessible
  • Scripting internals: the global object - +
  • Statements execute in the context of the global object
  • Generated by xsi.exe
  • - +
  • InteractiveScriptGlobals class
  • - +
  • Provides access to command-line arguments
  • Print function with pretty-formatting options
  • Scripting internals: script declarations - +
  • Are LOCALs declared in a script really local?
  • - +
  • Not when they are declared outside of a method
  • They become fields of the submission class
  • - +
  • What about FUNCTIONs and PROCEDUREs?
  • - +
  • They become methods of the submission class
  • - +
  • Declared types? (CLASSes, STRUCTUREs, ENUMs)
  • - +
  • They become nested types in the submission class
  • Not possible to have extension methods!
  • Application scripting: the first steps - +
  • Add scripting capabilities to your application!
  • Reference the script hosting and code analysis assemblies
  • - +
  • XSharp.CodeAnalysis.dll
  • XSharp.Scripting.dll
  • - +
  • Important namespaces
  • - +
  • LanguageService.CodeAnalysis.Scripting
  • LanguageService.CodeAnalysis.Xsharp.Scripting
  • - +
  • Run a script
  • - +
  • XSharpScript.RunAsync("? 'HELLO'")
  • CompilationErrorException is thrown if the source has errors
  • Problem: how to pass arguments to a script? - +
  • Passing arguments: the globals object
  • The script can access public members of the globals object
  • - +
  • The type of the globals object can be custom
  • - +
  • An instance of the globals object can be passed to RunAsync()
  • - +
  • Public fields of the globals object can be used to pass arguments to the script
  • The script will access them as variables
  • Problem: how to provide an API to the script? Script API: the globals object - +
  • Public members of the globals object are accessible by the script
  • - +
  • Remember: the script is compiled and executed in a different assembly in-memory!
  • - +
  • Not an elegant method to give access to types
  • - +
  • But excellent for a function-based API
  • Self-contained, not prone to errors
  • - +
  • The script does not have direct access to all application types
  • Not a security measure!
  • - +
  • The script is run in the same AppDomain (in a dynamic assembly)
  • Script API: using a common assembly - +
  • Scripts can reference assemblies
  • - +
  • Through the #R directive
  • Through the options passed to the RunAsync() call
  • - +
  • Move functions and types that should be accessible by the script to a separate assembly
  • - +
  • The assembly can then be referenced by the script
  • - +
  • Can be used in conjunction with the globals object
  • Problem: how to get results back from a script? Script result: return value - +
  • Scripts can return a value with a RETURN statement
  • - +
  • ...or from a standalone expression!
  • EvalAsync() returns that value
  • RunAsync() returns a ScriptState object, from which the return value can also be fetched
  • Script result: examine script state - +
  • Variables declared by the script can be examined
  • - +
  • The ScriptState object returned by RunAsync() includes methods to examine the variables
  • - +
  • ScriptState.GetVariable(string name)
  • Advanced topics: handling errors - +
  • Compilation errors
  • - +
  • CompilationErrorException thrown
  • Roslyn API provides access to compilation messages
  • Create script object with XsharpScript.Create()
  • Compile with script:Compile()
  • - +
  • Returns list of diagnostic messages
  • Runtime errors
  • - +
  • Exception is thrown
  • - +
  • AggregateException because script is ran as a Task
  • e:InnerException property contains the real exception
  • Advanced topics: strong-typed return value - +
  • By default a script returns OBJECT
  • Custom return type can be specified
  • - +
  • Create<T>()
  • RunAsync<T>()
  • EvaluateAsync<T>()
  • Advanced topics: performance tuning - +
  • Pre-compile scripts
  • - +
  • Script:Compile()
  • Compiled scripts can be ran multiple times
  • Similar to macros
  • - +
  • Delegate can be created with script:CreateDelegate()
  • Native image with ngen.exe
  • - +
  • Speed-up initial compilation
  • 64-bit version of ngen must be used for 64-bit CLR!!!
  • Useful for command-line scripts (xsi.exe)
  • Advanced topics: functional scripts - +
  • A script cannot be used exactly like a function
  • - +
  • Does not accept arguments
  • - +
  • Instead, it needs a global object instance
  • - +
  • Is run via a script hosting object
  • - +
  • Additional overhead
  • But scripts can evaluate to functions!
  • - +
  • Lamda functions or delegates as return type
  • Advanced topics: accessing application - +
  • Provide a reference to current assembly inmemory
  • - +
  • Assembly.GetExecutingAssembly()
  • Does not work with CoreCLR
  • - +
  • Entities declared in current assembly can be used
  • - +
  • Functions & procedures
  • Types (classes, structures, etc.)
  • Namespaces
  • Advanced topics: support for dynamics - +
  • Need to reference the proper assembly
  • - +
  • Microsoft.Csharp.dll
  • diff --git a/docs/Help_ZH-CN/Topics/X-Walkthroughs.xml b/docs/Help_ZH-CN/Topics/X-Walkthroughs.xml index 2bcaec978b..55bf7b2923 100644 --- a/docs/Help_ZH-CN/Topics/X-Walkthroughs.xml +++ b/docs/Help_ZH-CN/Topics/X-Walkthroughs.xml @@ -1,11 +1,11 @@  - - - X# Walkthroughs + + + X# 演练
    - X# Walkthroughs + X# 演练
    - Enter topic text here. +
    diff --git a/docs/Help_ZH-CN/Topics/XBase-Specific-Types.xml b/docs/Help_ZH-CN/Topics/XBase-Specific-Types.xml index cd13d9db96..c021b0f809 100644 --- a/docs/Help_ZH-CN/Topics/XBase-Specific-Types.xml +++ b/docs/Help_ZH-CN/Topics/XBase-Specific-Types.xml @@ -1,21 +1,21 @@  - - xBase Specific Types + + xBase 特定类型 SYMBOL
    - xBase Specific Types + xBase 特定类型
    diff --git a/docs/Help_ZH-CN/Topics/XBase-Types.xml b/docs/Help_ZH-CN/Topics/XBase-Types.xml index 1e0f0fce44..d82bf069cd 100644 --- a/docs/Help_ZH-CN/Topics/XBase-Types.xml +++ b/docs/Help_ZH-CN/Topics/XBase-Types.xml @@ -1,22 +1,22 @@  - - XBase Types + + XBase 类型
    - XBase Types + XBase 类型
    - The table below shows the type mapping between XBase types in X#. - All types in the namespace XSharp are implemented in XSharp.VO.DLL and are only supported when NOT compiling in the Core dialect + 下表显示了 X# 中 XBase 类型之间的类型映射。 + 命名空间 XSharp 中的所有类型都是在 XSharp.VO.DLL 中实现的,只有在不使用 Core 方言编译时才受支持。
    - Type + 类型 - Description + 描述
    diff --git a/docs/Help_ZH-CN/Topics/XML-Documentation-Comments.xml b/docs/Help_ZH-CN/Topics/XML-Documentation-Comments.xml index a7e1ff1bf1..9bc823ec1e 100644 --- a/docs/Help_ZH-CN/Topics/XML-Documentation-Comments.xml +++ b/docs/Help_ZH-CN/Topics/XML-Documentation-Comments.xml @@ -1,19 +1,19 @@  - - XML Documentation Comments + + XML 文档注释
    - XML Documentation Comments + XML 文档注释
    - In X#, you can create documentation for your code by including XML elements in special comment fields (indicated by triple slashes) in the source code directly before the code block to which the comments refer, for example. - /// <summary>
    ///  This class performs an important function.
    /// </summary>
    CLASS MyClass
    .
    .
    END CLASS
    - When you compile with the -doc option, the compiler will search for all XML tags in the source code and create an XML documentation file. To create the final documentation based on the compiler-generated file, you can create a custom tool or use a tool such Sandcastle. + 在 X# 中,您可以将 XML 元素包含在源代码中的特殊注释字段(用三斜线表示)中,直接放在注释指向的代码块之前,为代码创建文档。 - To refer to XML elements (for example, your function processes specific XML elements that you want to describe in an XML documentation comment), you can use the standard quoting mechanism (< and >). To refer to generic identifiers in code reference (cref) elements, you can use either the escape characters (for example, cref="List<T>") or braces (cref="List{T}"). As a special case, the compiler parses the braces as angle brackets to make the documentation comment less cumbersome to author when referring to generic identifiers. + /// <summary>
    ///  该类具有一项重要功能。
    /// </summary>
    CLASS MyClass
    .
    .
    END CLASS
    + 使用 -doc 选项编译时,编译器会搜索源代码中的所有 XML 标记,并创建一个 XML 文档文件。要根据编译器生成的文件创建最终文档,可以创建自定义工具或使用 Sandcastle 等工具。 - Since we use the same documentation engine that C# does we refer to the C# documentation for the documentation tags that are allowed: + 要引用 XML 元素(例如,您想在 XML 文档注释中描述的函数处理特定 XML 元素),您可以使用标准引号机制(< 和 >)。要引用代码引用 (cref) 元素中的通用标识符,可以使用转义字符(例如,cref=“List<T>”)或大括号(cref=“List{T}”)。作为一种特殊情况,编译器会将大括号解析为角括号,以便在引用通用标识符时减少文档注释的编写麻烦。 + 由于我们使用与 C# 相同的文档引擎,因此允许使用的文档标记 可参考 C# 文档 。
    diff --git a/docs/Help_ZH-CN/Topics/XPorter.xml b/docs/Help_ZH-CN/Topics/XPorter.xml index 2fffed8b66..21acfe9319 100644 --- a/docs/Help_ZH-CN/Topics/XPorter.xml +++ b/docs/Help_ZH-CN/Topics/XPorter.xml @@ -1,6 +1,6 @@  - + XPorter XPorter @@ -9,6 +9,6 @@
    XPorter
    - Enter topic text here. +
    diff --git a/docs/Help_ZH-CN/Topics/XSharp.xml b/docs/Help_ZH-CN/Topics/XSharp.xml index 206cf209a5..83ff2808c1 100644 --- a/docs/Help_ZH-CN/Topics/XSharp.xml +++ b/docs/Help_ZH-CN/Topics/XSharp.xml @@ -1,6 +1,6 @@  - + X# 文档 版本历史 @@ -10,16 +10,17 @@ X# (XSharp) 欢迎使用 X# (XSharp) <%TXTVERSION%> + Powered By:Deepl  And Cursor(ChartGPT) - + 版本历史 已知问题 X# 是基于 xBase 语言的 .NET 开源开发语言。 它包含不同的方言,如 Core、Visual Objects、Vulcan.NET、xBase++、Harbour、Foxpro 等。 当前版本的 X# 支持 Core 方言以及 VO、Vulcan 和 Harbour 方言。
    - + 本文档仍在不断的完整过程中。文档中的某些部分尚不完整。 diff --git a/docs/Help_ZH-CN/Topics/_EditorConfig-files.xml b/docs/Help_ZH-CN/Topics/_EditorConfig-files.xml index 450e4fc61a..aa0aa904c8 100644 --- a/docs/Help_ZH-CN/Topics/_EditorConfig-files.xml +++ b/docs/Help_ZH-CN/Topics/_EditorConfig-files.xml @@ -1,7 +1,7 @@  - - .EditorConfig files + + .EditorConfig 文件 .editorconfig align_do_case @@ -18,41 +18,47 @@
    - .EditorConfig files + .EditorConfig 文件
    - Since X# 2.8 we now support the use of .editorconfig files. These files can be used in your solution or project to control the source code editor settings for several options, such as: - This allows you to synchronize the editor settings for a team and ignore individual differences between team members. - -
  • use tab or space
  • -
  • tab with
  • -
  • encoding for the source files
  • + 自 X# 2.8 起,我们开始支持使用 .editorconfig 文件。这些文件可在解决方案或项目中用于控制源代码编辑器设置的多个选项,例如: + + 这样就可以同步团队的编辑器设置,忽略团队成员之间的个体差异。 + + +
  • 用制表符或空格
  • +
  • 制表符
  • +
  • 为源文件编码
  • - We are supporting the default tokens for .editorconfig as listed on https://editorconfig.org/: - -
  • indent_style (tab or space)
  • -
  • indent_size (number)
  • -
  • tab_width (number)
  • + + 我们支持 https://editorconfig.org/ 上列出的 .editorconfig 的默认令牌: + + +
  • indent_style (制表符或空格)
  • +
  • indent_size (数字)
  • +
  • tab_width (数字)
  • end_of_line (cr, lf or crlf)
  • charset (latin1, utf-8, utf-8-bom, utf-16be or utf-16le)
  • trim_trailing_whitespace (true or false)
  • insert_final_newline (true or false)
  • - Additionally we have added a few X# specific options - + + 此外,我们还添加了一些 X# 专用选项 + +
  • keyword_case (upper, lower, title or none)
  • identifier_case (true or false)
  • - +
  • indent_namespace (true or false)
  • - +
  • indent_type_members (true or false)
  • indent_type_fields (true or false)
  • - +
  • indent_entity_content (true or false)
  • indent_block_content (true or false)
  • indent_case_label (true or false)
  • @@ -62,8 +68,6 @@
    - The settings inside the .editorconfig overrule the settings on Tools/Options for the X# editor. - - + .editorconfig 中的设置将取代 X# 编辑器在 "工具/选项 "中的设置。
    diff --git a/docs/Help_ZH-CN/Topics/compat-FoxPro.xml b/docs/Help_ZH-CN/Topics/compat-FoxPro.xml index d36cbafef3..d337fe1d3f 100644 --- a/docs/Help_ZH-CN/Topics/compat-FoxPro.xml +++ b/docs/Help_ZH-CN/Topics/compat-FoxPro.xml @@ -1,44 +1,44 @@  - + Differences with FoxPro
    - Differences with FoxPro + 与 FoxPro 的不同
    - Compiler + 编译器
    - XBase Type + XBase 类型 - Implemented in type + 类型实现
    - - - -
    - Operation + + 操作 - Difference + + 不同
    - Bracketed strings + + 括号内的字符串 - The preprocessor in FoxPro translates #defines inside bracketed strings. X# does not touch the contents of bracketed strings in the preprocessor + + FoxPro 中的预处理器会翻译括号字符串内的 #defines。在预处理器中,X# 不会触及带括号字符串的内容
    - Runtime functions + 运行时函数 - - - -
    - Function + + 函数 - Difference + + 不同
    + +
    diff --git a/docs/Help_ZH-CN/Topics/debugger-Globals-Window.xml b/docs/Help_ZH-CN/Topics/debugger-Globals-Window.xml index 03fc6151a4..ce0fc576a5 100644 --- a/docs/Help_ZH-CN/Topics/debugger-Globals-Window.xml +++ b/docs/Help_ZH-CN/Topics/debugger-Globals-Window.xml @@ -1,17 +1,18 @@  - - Globals Window + + Globals Window(全局窗口)
    - Globals Window + Globals Window(全局窗口)
    - On the Globals window you can see a global variables in your app and the referenced class libraries that are loaded from your app. + + 在 "全局 "窗口中,您可以看到应用程序中的全局变量以及从应用程序加载的引用类库。 - When your app does not include the X# runtime then a message will be shown that the runtime has not been loaded: - + 如果应用程序不包含 X# 运行时,则会显示一条运行时未加载的消息: +
    diff --git a/docs/Help_ZH-CN/Topics/debugger-Publics-and-Privates-Window.xml b/docs/Help_ZH-CN/Topics/debugger-Publics-and-Privates-Window.xml index 0eb20464e8..dde4793b25 100644 --- a/docs/Help_ZH-CN/Topics/debugger-Publics-and-Privates-Window.xml +++ b/docs/Help_ZH-CN/Topics/debugger-Publics-and-Privates-Window.xml @@ -1,17 +1,18 @@  - - Publics and Privates Window + + Publics and Privates Window(公共和私有窗口)
    - Publics and Privates Window + Publics and Privates Window(公共和私有窗口)
    - On this window you will see the publics and privates that are available at the current line of your source code: + + 在该窗口中,您将看到源代码当前行中可用的 public 和 priv: - You can use the checkboxes on the top to filter which type of variables you want to display. + 您可以使用顶部的复选框来筛选要显示的变量类型。 - When your app does not include the X# runtime then a message will be shown that the runtime has not been loaded: + 如果应用程序不包含 X# 运行时,则会显示一条运行时尚未加载的消息: diff --git a/docs/Help_ZH-CN/Topics/debugger-Settings-Window.xml b/docs/Help_ZH-CN/Topics/debugger-Settings-Window.xml index 0e71666def..00d6f4e6dc 100644 --- a/docs/Help_ZH-CN/Topics/debugger-Settings-Window.xml +++ b/docs/Help_ZH-CN/Topics/debugger-Settings-Window.xml @@ -1,17 +1,19 @@  - - Settings Window + + Settings Window(设置窗口)
    - Settings Window + Settings Window(设置窗口)
    - On this window you will see the various settings at the current line of your source code, and for the current thread. - You can sort these by name of by number. + + 在该窗口中,您将看到源代码当前行和当前线程的各种设置。 + + 您可以按名称或编号对这些设置进行排序。 - When your app does not include the X# runtime then a message will be shown that the runtime has not been loaded: + 如果应用程序不包含 X# 运行时,则会显示一条运行时未加载的消息: diff --git a/docs/Help_ZH-CN/Topics/debugger-Toolbar-and-Menu.xml b/docs/Help_ZH-CN/Topics/debugger-Toolbar-and-Menu.xml index 60c819ed76..839537a51a 100644 --- a/docs/Help_ZH-CN/Topics/debugger-Toolbar-and-Menu.xml +++ b/docs/Help_ZH-CN/Topics/debugger-Toolbar-and-Menu.xml @@ -1,30 +1,34 @@  - - Toolbar and Menu + + 工具栏和菜单
    - Toolbar and Menu + 工具栏和菜单
    - When the Visual Studio integration for XSharp is installed then you will have see new menu entry when debugging. This menu entry can be found in the Debug menu and is called "XSharp". - From that menu you can open 4 different windows with XSharp specific information. + + 安装 Visual Studio 集成 XSharp 后,调试时将会看到新的菜单项。该菜单项位于调试菜单中,名为 "XSharp"。 + + 通过该菜单,你可以打开 4 个不同的窗口,其中包含 XSharp 的特定信息。 + -
  • Globals
  • -
  • Publics and Privates
  • -
  • Workareas
  • -
  • Settings
  • +
  • Globals(全局)
  • +
  • Publics and Privates(公共和私有)
  • +
  • Workareas(工作区)
  • +
  • Settings(设置)
  • - These windows are shown as pane windows in the lower half of the debugger. - The location of these windows are (initially) associated with existing Visual Studio windows in the following way + 这些窗口在调试器的下半部分显示为窗格窗口。 + + 这些窗口的位置(最初)与现有的 Visual Studio 窗口关联,关联方式如下 @@ -32,7 +36,7 @@ Globals @@ -40,7 +44,7 @@ Publics and Privates @@ -48,7 +52,7 @@ Workareas @@ -56,15 +60,15 @@ Settings
    - Window + 窗口 - Associated with + 关联
    - Watch window + 监视窗口
    - Output window + 输出窗口
    - Autos window + 自动窗口
    - Callstack window + 调用堆栈窗口
    - If you move these windows to another location then Visual Studio will remember that new location + 如果您将这些窗口移动到其他位置,Visual Studio 会记住新的位置。 - There is also an X# Debugger toolbar with buttons for these windows + 还有一个 X# 调试器工具栏,上面有用于这些窗口的按钮。 diff --git a/docs/Help_ZH-CN/Topics/debugger-Workareas-window.xml b/docs/Help_ZH-CN/Topics/debugger-Workareas-window.xml index e430093817..97e7ea148f 100644 --- a/docs/Help_ZH-CN/Topics/debugger-Workareas-window.xml +++ b/docs/Help_ZH-CN/Topics/debugger-Workareas-window.xml @@ -1,19 +1,21 @@  - - Workareas window + + Workareas window(工作区窗口)
    - Workareas window + Workareas window(工作区窗口)
    - On this window you will see the workareas are open at the current line of your source code, for the current thread. - The currently selected areas is marked with a checkbox. + + 在该窗口中,您将看到当前线程的源代码当前行打开的工作区。 + + 当前选中的区域用复选框标记。 - In the future we may extend this window so you can see the properties of an area (such as BoF(), EoF() and RecNo()) and/or the field names and their values for the current record. + 今后,我们可能会扩展该窗口,以便您可以查看某个区域的属性(如 BoF()、EoF() 和 RecNo())和/或当前记录的字段名称及其值。 - When your app does not include the X# runtime then a message will be shown that the runtime has not been loaded: + 如果您的应用程序不包含 X# 运行时,则会显示一条运行时尚未加载的消息: diff --git a/docs/Help_ZH-CN/Topics/editor-Blocks.xml b/docs/Help_ZH-CN/Topics/editor-Blocks.xml index 3f9b967f25..78bebd7098 100644 --- a/docs/Help_ZH-CN/Topics/editor-Blocks.xml +++ b/docs/Help_ZH-CN/Topics/editor-Blocks.xml @@ -1,17 +1,18 @@  - - Blocks + + Blocks(块) Blocks
    - Blocks + Blocks(块)
    - Visual Studio makes it straightforward to select, cut, copy, and paste sections of your code. Rectangular blocks of code can be highlighted and selected by using Alt + Drag on the code block. The formatting within this block selection is retained when pasting the block. - Block selections can also be edited to modify text on multiple lines at once. A zero-width block selection can be used to place the caret in front of many lines at once, and allows typing identical text on multiple lines: + Visual Studio 可以直接选择、剪切、复制和粘贴代码块。在代码块上使用 Alt + 拖动可以突出显示和选择矩形代码块。在粘贴代码块时,该代码块选区中的格式将被保留。 + + 还可以对代码块选区进行编辑,以同时修改多行文本。零宽度的块选区可用于同时在多行前放置刻度线,并允许在多行上键入相同的文本: diff --git a/docs/Help_ZH-CN/Topics/editor-Brace-matching.xml b/docs/Help_ZH-CN/Topics/editor-Brace-matching.xml index 7fcd3d2c60..6609ca80aa 100644 --- a/docs/Help_ZH-CN/Topics/editor-Brace-matching.xml +++ b/docs/Help_ZH-CN/Topics/editor-Brace-matching.xml @@ -1,17 +1,21 @@  - - Brace matching + + Brace matching(大括号匹配) Brace matching
    - Brace matching + Brace matching(大括号匹配)
    - When using Visual Studio, if your cursor is next to a brace it will highlight the corresponding opening or closing brace on screen. + + 使用 Visual Studio 时,如果光标位于括号旁边,屏幕上会高亮显示相应的开头或结尾括号。 + - The color for the brace matching can be set in the Tools/Options dialog under the Environment/Fonts and Colors node. - The X# specific colors all start with the text "X#" + + 可以工具/选项对话框中的环境/字体和颜色节点下设置括号匹配的颜色。 + + X# 专用颜色均以 "X#"开头。
    diff --git a/docs/Help_ZH-CN/Topics/editor-Code-Completion.xml b/docs/Help_ZH-CN/Topics/editor-Code-Completion.xml index 4b8c47413a..7ee36bb276 100644 --- a/docs/Help_ZH-CN/Topics/editor-Code-Completion.xml +++ b/docs/Help_ZH-CN/Topics/editor-Code-Completion.xml @@ -1,18 +1,19 @@  - - Code Completion + + Code Completion(代码补全) Code Completion
    - Code Completion + Code Completion(代码补全)
    - IntelliSense is an invaluable resource when you're coding. It can show you information about available members of a type, or parameter details for different overloads of a method. You can also use IntelliSense to complete a word after you type enough characters to disambiguate it. - While typing bits of code, you see IntelliSense show you Quick Info about the query symbol. - To insert the rest of the word query by using IntelliSense's word completion functionality, press Tab. + 智能提示(IntelliSense)是编码时的宝贵资源。它可以向你显示一个类型的可用成员信息,或一个方法的不同重载的参数详情。在输入足够多的字符以消除歧义后,您还可以使用 IntelliSense 来补全单词。 + + 在键入代码时,你会看到 IntelliSense 向你显示有关查询符号的快速信息。 + 要使用 IntelliSense 的单词补全功能插入单词查询的其余部分,请按 Tab 键。 diff --git a/docs/Help_ZH-CN/Topics/editor-Formatting-code.xml b/docs/Help_ZH-CN/Topics/editor-Formatting-code.xml index 33b564b380..f515fefae3 100644 --- a/docs/Help_ZH-CN/Topics/editor-Formatting-code.xml +++ b/docs/Help_ZH-CN/Topics/editor-Formatting-code.xml @@ -1,17 +1,20 @@  - - Indenting code + + Indenting code(缩进代码) Formatting code
    - Indenting code + Indenting code(缩进代码)
    - Visual studio automatically formats your code, so that you have a clearer overview of your code, and which parts do what. - This only happens if you have set the Indenting option on the Tabs page to "Smart" - The rules for the formatting are defined on the Indentation page + + Visual studio 会自动格式化你的代码,这样你就能更清楚地看到代码的全貌,以及哪些部分在做什么。 + + 只有将Tabs page页面上的  Indenting(缩进)选项设置为 "Smart(智能) "时,才会出现这种情况。 + + 格式化规则在Indentation(缩进)页面中定义。 diff --git a/docs/Help_ZH-CN/Topics/editor-Goto-definition.xml b/docs/Help_ZH-CN/Topics/editor-Goto-definition.xml index 6034a54bcf..390e037f41 100644 --- a/docs/Help_ZH-CN/Topics/editor-Goto-definition.xml +++ b/docs/Help_ZH-CN/Topics/editor-Goto-definition.xml @@ -1,16 +1,19 @@  - - Goto definition + + Goto definition(转到定义) Goto definition
    - Goto definition + Goto definition(转到定义)
    - The Visual Studio editor makes it easy to inspect the definition of a type, method, etc. One way is to navigate to the file that contains the definition, for example by choosing Go to Definition or pressing F12 anywhere the symbol is referenced. - To do this, right-click on any occurrence of string and choose Peek Definition from the content menu. Or, press Alt+F12. + + Visual Studio 编辑器可以方便地检查类型、方法等的定义。一种方法是导航到包含定义的文件,例如选择 "转到定义 "或在任何引用符号的地方按 F12 键。 + + 为此,右键单击任何出现的字符串,然后从内容菜单中选择 "转到定义"。或者按 Alt+F12。 +
    diff --git a/docs/Help_ZH-CN/Topics/editor-Highlighting-Errors.xml b/docs/Help_ZH-CN/Topics/editor-Highlighting-Errors.xml index 88ea449361..4a35e2f7bd 100644 --- a/docs/Help_ZH-CN/Topics/editor-Highlighting-Errors.xml +++ b/docs/Help_ZH-CN/Topics/editor-Highlighting-Errors.xml @@ -1,14 +1,15 @@  - - Highlighting Errors + + Highlighting Errors(高亮错误) Highlighting Errors
    - Highlighting Errors + Highlighting Errors(高亮错误)
    - At this moments errors are not highlighted in the source code editor. This is planned for a future version of X#. + + 目前,源代码编辑器不会高亮显示错误。计划在 X# 的未来版本中实现这一功能。
    diff --git a/docs/Help_ZH-CN/Topics/editor-Inactive-conditional-regions.xml b/docs/Help_ZH-CN/Topics/editor-Inactive-conditional-regions.xml index 8d0fae4021..0bf53b1cb5 100644 --- a/docs/Help_ZH-CN/Topics/editor-Inactive-conditional-regions.xml +++ b/docs/Help_ZH-CN/Topics/editor-Inactive-conditional-regions.xml @@ -1,16 +1,18 @@  - - Inactive conditional regions + + Inactive conditional regions(非活动条件区域) Inactive conditional regions
    - Inactive conditional regions + Inactive conditional regions(非活动条件区域)
    - If you use conditional compilation with #ifdef .. #endif regions then the inactive regions will be visible with different color in the editor: - Below is a piece of code from the CDX RDD. The CHECKVERSIONS define is not defined, so there is an inactive region in the editor, which is shown in light gray. + + 如果使用 #ifdef ... #endif 区域进行有条件编译,那么在编辑器中,非活动区域将以不同颜色显示: + + 下面是 CDX RDD 中的一段代码。CHECKVERSIONS 定义未定义,因此在编辑器中存在一个非活动区域,该区域显示为浅灰色。 diff --git a/docs/Help_ZH-CN/Topics/editor-Keyword-Coloring.xml b/docs/Help_ZH-CN/Topics/editor-Keyword-Coloring.xml index b336f16fad..232c1af2aa 100644 --- a/docs/Help_ZH-CN/Topics/editor-Keyword-Coloring.xml +++ b/docs/Help_ZH-CN/Topics/editor-Keyword-Coloring.xml @@ -1,34 +1,35 @@  - - Keyword Coloring + + Keyword Coloring(关键字颜色) Keyword Coloring
    - Keyword Coloring + Keyword Coloring(关键字颜色)
    - Visual studio gives keywords and other parts of the syntax colors based on their purpose, the following items are supported by X#: + Visual studio 会根据关键字和语法的其他部分的用途赋予其颜色,X# 支持以下项目: - Keywords - Identifiers - Comment  s  (single line, multi line etc) - Operators   (+. -, := etc) - String s    (also for Char constants) - Numbers     (also for date and datetime literals) - Literals   (NIL, Symbols, _AND, _OR, _NOT, _XOR) - Preprocessor keywords - * contents of Text .. EndText - Inactive/Hidden code inside #IFDEF - * Highlighted Word + 关键词 + 标识符 + 注释(单行、多行等) + 操作符(+. -, := etc) + 字符串(也用于字符常数) + 数字(也用于日期和日期时间字面量形式) + 字面量(NIL、符号、_AND、_OR、_NOT、_XOR) + 预处理器关键字 + * Text .. EndText 的文本内容 + #IFDEF 内的非活动/隐藏代码 + * 高亮显示的单词 - * These are special XSharp colors. The other colors take the default Visual Studio editor colors for that category + * 这些是特殊的 XSharp 颜色。其他颜色采用 Visual Studio 编辑器的默认颜色。 - You can change the options for this by going to Tools > Options > - Note that your settings will reset if you switch your color scheme in Visual Studio. + + 您可以通过 "工具">"选项">"设置 "来更改相关选项。 + 请注意,如果在 Visual Studio 中切换配色方案,您的设置将被重置。
    diff --git a/docs/Help_ZH-CN/Topics/editor-Parameter-Tips.xml b/docs/Help_ZH-CN/Topics/editor-Parameter-Tips.xml index 4568453b1c..8dd56f32ec 100644 --- a/docs/Help_ZH-CN/Topics/editor-Parameter-Tips.xml +++ b/docs/Help_ZH-CN/Topics/editor-Parameter-Tips.xml @@ -1,18 +1,18 @@  - - Parameter Tips + + Parameter Tips(参数提示) Parameter Tips
    - Parameter Tips + Parameter Tips(参数提示)
    - Parameter Info gives you information about the number, names, and types of parameters required by a method, attribute generic type parameter. - The parameter in bold indicates the next parameter that is required as you type the function. For overloaded functions, you can use the Up and Down arrow keys to view alternative parameter information for the function overloads. + Parameter Info(参数信息)可提供方法、属性通用类型参数所需的参数数量、名称和类型信息。 + 粗体参数表示键入函数时所需的下一个参数。对于重载函数,可以使用向上和向下箭头键查看重载函数的其他参数信息。 - When you annotate functions and parameters with XML Documentation comments, the comments will display as Parameter Info. For more information, see Supply XML code comments. - You can manually invoke Parameter Info by choosing Edit > IntelliSense > Parameter Info, by pressing Ctrl+Shift+Space, or by choosing the Parameter Info button on the editor toolbar. + 用 XML 文档注释注释函数和参数时,注释将显示为参数信息。有关详细信息,请参阅提供 XML 代码注释。 + 您可以通过选择 "编辑"(Edit)>"智能提示"(IntelliSense)>"参数信息"(Parameter Info)、按 Ctrl+Shift+Space 或选择编辑器工具栏上的 "参数信息 "按钮手动调用参数信息。
    diff --git a/docs/Help_ZH-CN/Topics/editor-Peek-definition.xml b/docs/Help_ZH-CN/Topics/editor-Peek-definition.xml index e3906a5a1b..96e11550b1 100644 --- a/docs/Help_ZH-CN/Topics/editor-Peek-definition.xml +++ b/docs/Help_ZH-CN/Topics/editor-Peek-definition.xml @@ -1,18 +1,22 @@  - - Peek definition + + Peek definition(快速预览) Peek definition
    - Peek definition + Peek definition(快速预览)
    - The Visual Studio editor makes it easy to inspect the definition of a type, method, etc. One way is to navigate to the file that contains the definition, for example by choosing Peek Definition anywhere the symbol is referenced. - To do this, right-click on any occurrence of string and choose Peek Definition from the content menu. Or, press Alt+F12. - A pop-up window appears with the definition of the String class. You can scroll within the pop-up window, or even peek at the definition of another type from the peeked code. - Close the peeked definition window by choosing the small box with an "x" at the top right of the pop-up window. + + Visual Studio 编辑器可以方便地检查类型、方法等的定义。一种方法是导航到包含定义的文件,例如在任何引用符号的地方选择 "速览"。 + + 为此,右键单击任何出现的字符串,然后从内容菜单中选择 "速览定义"。或者按 Alt+F12。 + + 这时会弹出一个窗口,显示字符串类的定义。你可以在弹出窗口中滚动,甚至可以从被窥视的代码中窥视其他类型的定义。 + + 选择弹出窗口右上方带有 "x "的小方框,关闭偷看的定义窗口。 diff --git a/docs/Help_ZH-CN/Topics/editor-Quick-Info.xml b/docs/Help_ZH-CN/Topics/editor-Quick-Info.xml index 56d4c724aa..34b32e4abb 100644 --- a/docs/Help_ZH-CN/Topics/editor-Quick-Info.xml +++ b/docs/Help_ZH-CN/Topics/editor-Quick-Info.xml @@ -1,19 +1,19 @@  - - Quick Info + + Quick Info(快速信息) Quick Info
    - Quick Info + Quick Info(快速信息)
    - Quick Info displays the complete declaration for any identifier in your code. When you select a member from the List Members box, Quick Info also appears. + 快速信息会显示代码中任何标识符的完整声明。从 "成员列表 "框中选择成员时,也会显示快速信息。 - You can manually invoke Quick Info by choosing Edit > IntelliSense > Quick Info, by pressing Ctrl+I, or by choosing the Quick Info button on the editor toolbar. + 您可以通过选择 "编辑">"IntelliSense">"快速信息"、按 Ctrl+I 或选择编辑器工具栏上的 "快速信息 "按钮手动调用快速信息。 - If a function is overloaded, IntelliSense may not display information for all forms of the overload. + 如果函数被重载,IntelliSense 可能不会显示重载的所有形式的信息。 diff --git a/docs/Help_ZH-CN/Topics/editor-Regions.xml b/docs/Help_ZH-CN/Topics/editor-Regions.xml index 552f8cdb4e..01bf2b89a9 100644 --- a/docs/Help_ZH-CN/Topics/editor-Regions.xml +++ b/docs/Help_ZH-CN/Topics/editor-Regions.xml @@ -1,17 +1,18 @@  - - Regions + + Regions(区域))() Regions
    - Regions + Regions(区域)
    - To unclutter your view of the code, choose the small gray box with the minus sign inside it in the margin of the first line of the constructor or place the cursor anywhere in the constructor code and press Ctrl+M, Ctrl+M. - The code block collapses to just the first line, followed by an ellipsis. To expand the code block again, click the same gray box that now has a plus sign in it, or press Ctrl+M, Ctrl+M again. This feature is called Outlining and is especially useful when you're collapsing long methods or entire classes. + 要使代码视图更加整洁,请选择构造函数第一行空白处带有减号的灰色小方框,或者将光标放在构造函数代码的任意位置,然后按 Ctrl+M、Ctrl+M。 + + 代码块就会折叠为第一行,后面跟着一个省略号。要再次展开代码块,请单击现在带有加号的灰色方框,或再次按下 Ctrl+M、Ctrl+M。这项功能称为 "大纲",在折叠长方法或整个类时特别有用。 diff --git a/docs/Help_ZH-CN/Topics/editor-Snippets.xml b/docs/Help_ZH-CN/Topics/editor-Snippets.xml index 6ed8b4c01b..2f11226bd2 100644 --- a/docs/Help_ZH-CN/Topics/editor-Snippets.xml +++ b/docs/Help_ZH-CN/Topics/editor-Snippets.xml @@ -1,21 +1,27 @@  - - Snippets + + Snippets(片段) Snippets
    - Snippets + Snippets(片段)
    - Visual Studio provides useful code snippets that you can use to quickly and easily generate commonly used code blocks. - To do this, place your cursor just above the final closing brace in the file, a pop-up dialog box appears with information about the code snippet. + + Visual Studio 提供了有用的代码片段,可用于快速、轻松地生成常用代码块。 + + 为此,请将光标放在文件中最后一个收尾括号的上方,弹出的对话框会显示代码片段的相关信息。 + - You can fill in the yellow sections, press tab to switch between these sections. + + 您可以填写黄色部分,按制表符在这些部分之间切换。 + - You can look at the available code snippets for X# by choosing Edit > IntelliSense > Insert Snippet or right-click > Snippet > Insert Snippet or pressing Ctrl+K, Ctrl+X. - The list includes snippets for creating a class, a constructor, a for loop, an if or switch statement, and more. + 您可以选择 "编辑"(Edit)>"智能提示"(IntelliSense)>"插入片段"(Insert Snippet),或右键单击 "片段"(> Snippet)>"插入片段"(Insert Snippet),或按 Ctrl+K、Ctrl+X 查看 X# 的可用代码片段。 + + 该列表包括用于创建类、构造函数、for 循环、if 或 switch 语句等的片段。 diff --git a/docs/Help_ZH-CN/Topics/optPage-Debugger.xml b/docs/Help_ZH-CN/Topics/optPage-Debugger.xml index 065e0fbcfd..94a154d7aa 100644 --- a/docs/Help_ZH-CN/Topics/optPage-Debugger.xml +++ b/docs/Help_ZH-CN/Topics/optPage-Debugger.xml @@ -1,7 +1,7 @@  - - Debugger + + 调试器 breakpoint breakpoint conditions @@ -14,15 +14,22 @@
    - Debugger + 调试器
    - The debugger inside Visual Studio is language agnostic. We have added support for our X# language, so you will see variables in the locals and autos windows with X# specific types and so you can enter expressions for breakpoint conditions, in the watch window and in the intermediate window in X# (case insensitive for example). - Behind the debugger expression evaluator (that's how this is called) is the complete X# compiler. - We have added an options page to Visual Studio from where you can control how the X# debugger Expression evaluator parses and compiles expressions. - Normally the debugger works with the settings from the main application. - However, when the startup application is not a X# application then the settings from this dialog are used. - The first 2 options work always. - When your application uses late binding and you see problems with late binding in the debugger, then you can disable late binding from this dialog. + + Visual Studio 内的调试器与语言无关。我们增加了对 X# 语言的支持,因此你可以在本地窗口和自动窗口中看到 X# 特定类型的变量,也可以在观察窗口和中间窗口中输入 X# 表达式(例如,不区分大小写),用于断点条件。 + + 在调试器表达式评估器(这就是它的名称)的背后是完整的 X# 编译器。 + + 我们在 Visual Studio 中添加了一个选项页,你可以通过它来控制 X# 调试器表达式评估器如何解析和编译表达式。 + + 通常情况下,调试器按照主程序的设置工作。 + + 但是,如果启动应用程序不是 X# 应用程序,则会使用该对话框中的设置。 + + 前两个选项始终有效。 + + 如果您的应用程序使用了后期绑定,并且您在调试器中看到了后期绑定的问题,那么您可以在此对话框中禁用后期绑定。 diff --git a/docs/Help_ZH-CN/Topics/project_references_Assembly.xml b/docs/Help_ZH-CN/Topics/project_references_Assembly.xml index a5203cf601..a3eeeba7d1 100644 --- a/docs/Help_ZH-CN/Topics/project_references_Assembly.xml +++ b/docs/Help_ZH-CN/Topics/project_references_Assembly.xml @@ -1,16 +1,17 @@  - + .Net
    External .Net Assemblies
    - The page with assembly references shows the list of assemblies that were found on the developers machine. - You can select a reference from this list and this reference will be used without extra work. + + 程序集引用页面显示在开发者机器上找到的程序集列表。 + 您可以从该列表中选择一个引用,无需额外工作即可使用该引用。 - + diff --git a/docs/Help_ZH-CN/Topics/project_references_COM.xml b/docs/Help_ZH-CN/Topics/project_references_COM.xml index 8907383549..04ba59f7e2 100644 --- a/docs/Help_ZH-CN/Topics/project_references_COM.xml +++ b/docs/Help_ZH-CN/Topics/project_references_COM.xml @@ -1,19 +1,24 @@  - + COM
    External COM Components
    - The COM page in the Add Reference dialog lists the COM components that were found in the registry on your machine. - You can select a component from this list. - - However, these components cannot be consumed directly by the X# compiler. Therefore Visual Studio calls a tool (tlbimp.exe) that reads the typelibrary from the COM component and produces a managed wrapper around this COM object. This wrapper usually has a name that starts with "interop". In the Email example this is the case for the Internet Explorer component for which a Interop.SHDocVw.dll is generated. - If the COM component is an ActiveX then a second assembly will be generated that has code that declares an object that inherits from System.Windows.Forms.AxHost, for the ActiveX control. Visual Stdio calls the tool "aximp.exe" for this. The file names for these wrappers usually start with "axinterop", such as "AxInterop.SHDocVw.dll" - Some COM components are used a lot and for these components a so called "Primary Interop Assembly" is installed on your machines. For these components no "interop" assemblies will be generated but the primary interop assemblies will be used when compiling. For example for ADO there is a primary interop assembly in the GAC. - - + + 添加引用对话框中的 COM 页面列出了在计算机注册表中找到的 COM 组件。 + + 您可以从中选择一个组件。 + + + 但是,X# 编译器不能直接使用这些组件。因此,Visual Studio 会调用一个工具(tlbimp.exe)来读取 COM 组件的类型库,并生成一个围绕 COM 对象的托管封装器。该封装器的名称通常以 "interop "开头。在Email 示例中,Internet Explorer 组件就属于这种情况,因此会生成 Interop.SHDocVw.dll。 + + 如果 COM 组件是 ActiveX,则将生成第二个程序集,其中的代码将为 ActiveX 控件声明一个继承于 System.Windows.Forms.AxHost 的对象。Visual Stdio 为此调用了 "aximp.exe "工具。这些封装器的文件名通常以 "axinterop "开头,如 "AxInterop.SHDocVw.dll"。 + + 有些 COM 组件使用频率很高,这些组件需要在计算机上安装所谓的 "主要互操作程序集"。对于这些组件,不会生成 "互操作 "程序集,但在编译时会使用主要互操作程序集。例如,ADO 的 GAC 中就有一个主要互操作程序集。 + +
    diff --git a/docs/Help_ZH-CN/Topics/project_references_Project.xml b/docs/Help_ZH-CN/Topics/project_references_Project.xml index 21128c6745..14e8c398fa 100644 --- a/docs/Help_ZH-CN/Topics/project_references_Project.xml +++ b/docs/Help_ZH-CN/Topics/project_references_Project.xml @@ -1,17 +1,18 @@  - + Project
    References to other Visual Studio projects
    - A third type of dependency is between Visual Studio projects. When you add a dependency of this type then Visual Studio (or actually MsBuild) will try to build that project first before building the project that depends on it. Unlike in Visual Objects you do not have to import a prototype library for the output generated by the project. Visual Studio (and our editor integration) will directly consume the output from the other projects. - If the other project is also a X# Project then our source code editor support code will be able to jump between the declaration of a type and the place where it is used, even if it is in another project. When your X# project depends on project in another languages (such as C#) then we will consume the output of that project like we do with "normal" external .Net assemblies. + 第三种依赖关系是 Visual Studio 项目之间的依赖关系。当您添加这种类型的依赖关系时,Visual Studio(实际上是 MsBuild)会尝试先构建该项目,然后再构建依赖于它的项目。与 Visual Objects 不同,您不必为项目生成的输出导入原型库。Visual Studio(和我们的编辑器集成)将直接使用其他项目的输出。 + 如果其他项目也是 X# 项目,那么我们的源代码编辑器支持代码将能在类型声明和使用该类型的地方之间跳转,即使该类型是在其他项目中。当您的 X# 项目依赖于其他语言(如 C#)的项目时,我们将像使用 "普通 "外部 .Net 程序集一样,使用该项目输出。 - + +
    diff --git a/src/Runtime/XSharp.RT/Types/Usual.prg b/src/Runtime/XSharp.RT/Types/Usual.prg index 2d70dfa641..0965f8d192 100644 --- a/src/Runtime/XSharp.RT/Types/Usual.prg +++ b/src/Runtime/XSharp.RT/Types/Usual.prg @@ -44,12 +44,9 @@ PUBLIC STRUCTURE __Usual IMPLEMENTS IConvertible, ; #region constants [NOSHOW] PRIVATE CONST STR_NIL := "NIL" AS STRING - [NOSHOW] PRIVATE CONST STR_NULL := "Null" AS STRING - [NOSHOW] PRIVATE CONST STR_NULL_STRING := "NULL_STRING" AS STRING - [NOSHOW] PRIVATE CONST STR_NULL_PSZ := "NULL_PSZ" AS STRING + [NOSHOW] PRIVATE CONST STR_NULL := "NULL" AS STRING [NOSHOW] PRIVATE CONST STR_NULL_ARRAY := "NULL_ARRAY" AS STRING [NOSHOW] PRIVATE CONST STR_NULL_CODEBLOCK := "NULL_CODEBLOCK" AS STRING - [NOSHOW] PRIVATE CONST STR_NULL_OBJECT := "NULL_OBJECT" AS STRING [NOSHOW] PRIVATE CONST STR_USUAL := "USUAL" AS STRING #endregion @@ -2932,8 +2929,7 @@ PUBLIC STRUCTURE __Usual IMPLEMENTS IConvertible, ; CASE __UsualType.Int64 ; strResult := SELF:_i64Value:ToString() CASE __UsualType.Logic ; strResult := IIF(!SELF:_logicValue , ".F." , ".T.") CASE __UsualType.Ptr ; strResult := SELF:_ptrValue:ToString() - //CASE __UsualType.Psz ; strResult := IIF (SELF:_refData == NULL, STR_NULL_PSZ, SELF:_stringValue) - CASE __UsualType.String ; strResult := IIF (SELF:_refData == NULL, STR_NULL_STRING, SELF:_stringValue) + CASE __UsualType.String ; strResult := IIF (SELF:_refData == NULL, STR_NULL+" ( String ) " , SELF:_stringValue) CASE __UsualType.Symbol ; strResult := SELF:_symValue:ToString() CASE __UsualType.Void ; strResult := STR_NIL CASE __UsualType.Null ; strResult := STR_NULL @@ -3409,17 +3405,15 @@ PUBLIC STRUCTURE __Usual IMPLEMENTS IConvertible, ; IF SELF:IsNull strValue := STR_NULL ELSEIF SELF:IsNil - IF SELF:IsArray - strValue := STR_NULL_ARRAY - ELSEIF SELF:IsString - strValue := STR_NULL_STRING - ELSEIF SELF:IsCodeblock - strValue := STR_NULL_CODEBLOCK - ELSEIF SELF:IsObject - strValue := STR_NULL_OBJECT - ELSE + SWITCH self:_usualType + CASE __UsualType.Array + CASE __UsualType.String + CASE __UsualType.Codeblock + CASE __UsualType.Object + strValue := STR_NULL + " ( " + _usualType:ToString() + " )" + OTHERWISE strValue := "("+STR_NIL+")" - ENDIF + END SWITCH ELSE strValue := SELF:Value:ToString() +" ( " IF SELF:IsByRef