Skip to content

Commit

Permalink
Merge branch 'Release' into feature/XSharpCompiler
Browse files Browse the repository at this point in the history
  • Loading branch information
RobertvanderHulst committed Jun 10, 2024
2 parents ca5cf92 + f805230 commit b035e8a
Show file tree
Hide file tree
Showing 163 changed files with 3,627 additions and 3,259 deletions.
486 changes: 243 additions & 243 deletions docs/Help_ZH-CN/Maps/table_of_contents.xml

Large diffs are not rendered by default.

28 changes: 16 additions & 12 deletions docs/Help_ZH-CN/Topics/ARRAY-(FoxPro).xml
Original file line number Diff line number Diff line change
@@ -1,24 +1,28 @@
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="../helpproject.xsl" ?>
<topic template="Default" lasteditedby="robert" version="2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../helpproject.xsd">
<topic template="Default" modified="2024-06-10T20:35:42.672+08:00" lasteditedby="Design" version="2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../helpproject.xsd">
<title>ARRAY (FoxPro)</title>
<body>
<header>
<para styleclass="Heading1">ARRAY (FoxPro)</para>
</header>
<para styleclass="Normal">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.<br/>The following lines of code all generate a FoxPro compatible array:</para>
<para styleclass="Normal"></para>
<para styleclass="Code Example"><text style="font-weight:bold; font-style:normal; color:#ff0000;">LOCAL</text><text style="font-weight:normal; font-style:normal; color:#000000;">&#32;</text><text style="font-weight:bold; font-style:normal; color:#ff0000;">ARRAY</text><text style="font-weight:normal; font-style:normal; color:#000000;"> aTest(1,2) &#160; &#160; &#160;</text><text style="font-weight:bold; font-style:italic; color:#339966;">// LOCAL ARRAY</text><br/><text style="font-weight:bold; font-style:normal; color:#ff0000;">PUBLIC</text><text style="font-weight:normal; font-style:normal; color:#000000;">&#32;</text><text style="font-weight:bold; font-style:normal; color:#ff0000;">ARRAY</text><text style="font-weight:normal; font-style:normal; color:#000000;"> aPublicArray[10] &#160; </text><text style="font-weight:bold; font-style:italic; color:#339966;">// PUBLIC ARRAY</text><br/><text style="font-weight:bold; font-style:normal; color:#ff0000;">DIMENSION</text><text style="font-weight:normal; font-style:normal; color:#000000;"> AnotherArray(3,4) &#160; </text><text style="font-weight:bold; font-style:italic; color:#339966;">// DIMENSION with parentheses , but angled brackets are supported too</text><br/><text style="font-weight:bold; font-style:normal; color:#ff0000;">DECLARE</text><text style="font-weight:normal; font-style:normal; color:#000000;"> ThirdArray[10] &#160; &#160; &#160;</text><text style="font-weight:bold; font-style:italic; color:#339966;">// DIMENSION with angled brackets, but parentheses are supported too</text></para>
<para styleclass="Normal">The elements of a Foxpro compatible array are all USUAL.<br/>FoxPro arrays cannot be dynamically sized with AAdd(). To resize them you need to add a DIMENSION statement with new dimensions.</para>
<para styleclass="Normal">Internally FoxPro arrays are single dimensional arrays. But you can also (re)dimension them as two dimensional. <br/>So the 3rd array in this example can also be treated as a single dimensional array of 12 elements.</para>
<para styleclass="Normal">X# 中的 FoxPro 方言有自己的 Array 类型。这种类型不是用 AS 关键字声明的,而是根据上下文推导出数组类型。</para>
<para styleclass="Normal"></para>
<para styleclass="Normal">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.</para>
<para styleclass="Normal">If you want to use parentheses to access FoxPro array elements you need to enable the <link displaytype="text" defaultstyle="true" type="topiclink" href="opt-fox2">/fox </link>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.</para>
<para styleclass="Normal">以下代码行都生成兼容 FoxPro 的数组:</para>
<para styleclass="Code Example"><text style="font-weight:bold; font-style:normal; color:#ff0000;">LOCAL</text><text style="font-weight:normal; font-style:normal; color:#000000;">&#32;</text><text style="font-weight:bold; font-style:normal; color:#ff0000;">ARRAY</text><text style="font-weight:normal; font-style:normal; color:#000000;"> aTest(1,2) &#160; &#160; &#160;</text><text style="font-weight:bold; font-style:italic; color:#339966;">// LOCAL ARRAY</text><br/><text style="font-weight:bold; font-style:normal; color:#ff0000;">PUBLIC</text><text style="font-weight:normal; font-style:normal; color:#000000;">&#32;</text><text style="font-weight:bold; font-style:normal; color:#ff0000;">ARRAY</text><text style="font-weight:normal; font-style:normal; color:#000000;"> aPublicArray[10] &#160; </text><text style="font-weight:bold; font-style:italic; color:#339966;">// PUBLIC ARRAY</text><br/><text style="font-weight:bold; font-style:normal; color:#ff0000;">DIMENSION</text><text style="font-weight:normal; font-style:normal; color:#000000;"> AnotherArray(3,4) &#160; </text><text style="font-weight:bold; font-style:italic; color:#339966;">// DIMENSION 也支持方括号</text><br/><text style="font-weight:bold; font-style:normal; color:#ff0000;">DECLARE</text><text style="font-weight:normal; font-style:normal; color:#000000;"> ThirdArray[10] &#160; &#160; &#160;</text><text style="font-weight:bold; font-style:italic; color:#339966;">// DECLARE 使用方括号,但也支持使用括号</text></para>
<para styleclass="Normal">FoxPro 兼容数组的元素都是 USUAL 类型的。<br/>FoxPro 数组不能使用 AAdd() 动态调整大小。要调整它们的大小,需要使用 DIMENSION 语句和新的维度。</para>
<para styleclass="Normal">在内部,FoxPro 数组是单维数组。但也可以将它们重新定义为二维数组。<br/>因此,这个示例中的第三个数组也可以被视为包含 12 个元素的单维数组。</para>
<para styleclass="Normal"></para>
<para styleclass="Normal">Internally FoxPro arrays are implemented as a class that derives from the generic XBase array type.</para>
<para styleclass="Normal">So all functions in the X# runtime that take an array as parameter will also accept a FoxPro array.<br/>When there is different behavior between the FoxPro implementation of a function or the Xbase implementation then this will be handled at runtime.</para>
<para styleclass="Heading3">Implementation</para>
<para styleclass="Normal">The ARRAY type is implemented in the class XSharp.__FoxArray. </para>
<para styleclass="Normal">The Usualtype of ARRAY has the value 5</para>
<para styleclass="Normal">建议使用尖括号来访问 FoxPro 数组的元素。这样不会产生歧义,编译器可以在编译时解析。</para>
<para styleclass="Normal">如果想要使用括号来访问 FoxPro 数组元素,需要启用 <link displaytype="text" defaultstyle="true" type="topiclink" href="opt-fox2">/fox</link> &#160;编译选项。此编译选项还会启用将单个值分配给 FoxPro 数组的所有元素的行为。</para>
<para styleclass="Normal"></para>
<para styleclass="Normal">在内部,FoxPro 数组是作为从通用 XBase 数组类型派生的类实现的。</para>
<para styleclass="Normal">因此,X# 运行时中接受数组作为参数的所有函数也将接受 FoxPro 数组。<br/>当函数的 FoxPro 实现与 Xbase 实现之间存在不同行为时,这将在运行时处理。</para>
<para styleclass="Normal"></para>
<para styleclass="Heading3">实现</para>
<para styleclass="Normal">ARRAY 类型在类 XSharp.__FoxArray 中实现。</para>
<para styleclass="Normal"></para>
<para styleclass="Normal">ARRAY 的 Usualtype 值为 5</para>
</body>
</topic>
13 changes: 8 additions & 5 deletions docs/Help_ZH-CN/Topics/ARRAY.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="../helpproject.xsl" ?>
<topic template="Default" lasteditedby="robert" version="2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../helpproject.xsd">
<topic template="Default" modified="2024-06-04T23:12:48.339+08:00" lasteditedby="Design" version="2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../helpproject.xsd">
<title>ARRAY</title>
<keywords>
<keyword>ARRAY</keyword>
Expand All @@ -9,9 +9,12 @@
<header>
<para styleclass="Heading1">ARRAY</para>
</header>
<para styleclass="Normal">The ARRAY type is a dynamic array of USUAL values. Each element of the array may contain another array, so arrays can be multidimensional.</para>
<para styleclass="Heading3">Implementation</para>
<para styleclass="Normal">The ARRAY type is implemented in the class XSharp.__Array. </para>
<para styleclass="Normal">The Usualtype of ARRAY has the value 5</para>
<para styleclass="Normal"></para>
<para styleclass="Normal">ARRAY 类型是由 USUAL 值组成的动态数组。数组的每个元素都可以包含另一个数组,因此数组可以是多维的。</para>
<para styleclass="Normal"></para>
<para styleclass="Heading3">实现</para>
<para styleclass="Normal">ARRAY 类型在 XSharp.__Array 类中实现。</para>
<para styleclass="Normal"></para>
<para styleclass="Normal">ARRAY 的 Usualtype 值为 5。</para>
</body>
</topic>
Loading

0 comments on commit b035e8a

Please sign in to comment.