diff --git a/docs/API/DataClassClass.md b/docs/API/DataClassClass.md
index 768871ed39465b..dff84253be03d2 100644
--- a/docs/API/DataClassClass.md
+++ b/docs/API/DataClassClass.md
@@ -1243,14 +1243,21 @@ var $results := ds.MyClass.query("myVectorField <= :1"; $comparisonVector)
The **order by** statement is supported in the query string so that entities in the resulting entity selection are sorted by similarity. For example:
```4d
-var $results := ds.MyClass.query("myVectorField > :1 order by myVectorField"; $comparisonVector)
- //default order, the first entity is the most similar
+var $results := ds.MyClass.query("myVectorField > :1 order by myVectorField desc"; $comparisonVector)
+ //the first entity is the most similar
```
+:::note
+
+The default order is ascending, although a descending order is usually the most useful for vector similarity queries. Thus, you will usually have to add the `desc` keyword in your vector similarity query strings.
+
+:::
+
+
If the same vector appears multiple times in the query string, the order by will be applied to the results of the first one, for example:
```4d
-var $results := ds.MyClass.query("myVectorField > :1 and myVectorField > :2 order by myVectorField" desc; /
+var $results := ds.MyClass.query("myVectorField > :1 and myVectorField > :2 order by myVectorField desc"; /
{vector : $myVector1 };{vector : $myVector2 }) //myVectorField > :1 is used for the order by
```
diff --git a/docs/Concepts/dt_collection.md b/docs/Concepts/dt_collection.md
index 0b13103072c5a5..2841f0fe111c35 100644
--- a/docs/Concepts/dt_collection.md
+++ b/docs/Concepts/dt_collection.md
@@ -40,6 +40,8 @@ If you assign an element's index that surpasses the last existing element of the
//myCol[4]=null
```
+
+
## Instantiation
Collections must have been instantiated, otherwise trying to read or modify their elements will generate a syntax error.
@@ -112,6 +114,46 @@ You can create two types of collections:
For more information, refer to the [Shared objects and collections](shared.md) section.
+
+## Assignment
+
+Collection and [object](./dt_object.md) data types are handled in the 4D language through **references** (i.e., internal pointers), unlike scalar data types (integer, date, etc.). As a result, when assigning a collection to a variable (e.g. `$myVar:=[1;2;3]`), it is the **reference** that is assigned, not the value itself. Any subsequent modification of the *$myVar* variable will therefore be reflected everywhere the original collection is referenced. This follows the same principle as [pointers](./dt_collection.md), except that the *$myVar* variable does not need to be dereferenced.
+
+For example:
+
+```4d
+var $col1; $col2 : Collection
+var $o : Object
+
+$col1:=[1;2;3] //a reference to the collection is created
+$col2:=$col1 //both variables share the same collection reference
+$o:={ list:$col1 } //the object stores a reference to the same collection
+
+$col1.push(4)
+//$col2 = [1,2,3,4]
+//$o = {"list":[1,2,3,4]}
+
+$col2[0]:=10
+//$col1 = [10,2,3,4]
+//$o = {"list":[10,2,3,4]}
+
+$o.list.push(5)
+//$col1 = [10,2,3,4,5]
+//$col2 = [10,2,3,4,5]
+
+ASSERT($col1=$col2) //True
+```
+
+This principle applies wherever objects or collections are assigned, including in [parameters](./parameters.md) or [formula](../commands/formula) expressions.
+
+:::note
+
+If you want to create a **deep copy** of a collection, use the [`collection.copy()`](../API/CollectionClass.md#copy) function.
+
+:::
+
+
+
## Collection functions
4D collection references benefit from special class functions (sometimes named *member functions*). Collection functions are listed in the [Class API Reference](../API/CollectionClass.md) section.
diff --git a/docs/Concepts/dt_object.md b/docs/Concepts/dt_object.md
index 13e3e68512db76..56f60368d66359 100644
--- a/docs/Concepts/dt_object.md
+++ b/docs/Concepts/dt_object.md
@@ -29,7 +29,7 @@ Keep in mind that property names differentiate between upper and lower case.
:::
-You manage Object type variables, fields or expressions using the standard [object notation](#properties) or the commands available in the **Objects (Language)** theme. Note that specific commands of the **Queries** theme such as `QUERY BY ATTRIBUTE`, `QUERY SELECTION BY ATTRIBUTE`, or `ORDER BY ATTRIBUTE` can be used to carry out processing on object fields.
+You manage Object type variables, fields or expressions using the standard [object notation](#properties) or the commands available in the **Objects (Language)** theme.
Each property value accessed through the object notation is considered an expression. You can use such values wherever 4D expressions are expected:
@@ -37,6 +37,11 @@ Each property value accessed through the object notation is considered an expres
- in the Expression areas of the Debugger and the Runtime explorer,
- in the Property list of the Form editor for form objects: Variable or Expression field as well as various selection list box and columns expressions (Data Source, background color, style, or font color).
+
+
+
+
+
## Instantiation
Objects must have been instantiated, otherwise trying to read or modify their properties will generate a syntax error.
@@ -122,6 +127,37 @@ You can create two types of objects:
For more information, refer to the [Shared objects and collections](shared.md) section.
+## Assignment
+
+Object and [collection](./dt_collection.md) data types are handled in the 4D language through **references** (i.e., internal pointers), unlike scalar data types (integer, date, etc.). As a result, when assigning an object or a collection to a variable (e.g. `$myVar:={ a:2 }`), it is the **reference** that is assigned, not the value itself. Any subsequent modification of the *$myVar* variable will therefore be reflected everywhere the original object is referenced. This follows the same principle as [pointers](./dt_collection.md), except that the *$myVar* variable does not need to be dereferenced.
+
+For example:
+
+```4d
+var $o1; $o2 : Object
+var $col : Collection
+
+$col:=[1;2;3] //a reference to the collection is created
+$o1:={ a:2 ; b:$col } //a reference to the object is created
+$o2:=$o1 //both variables $o1 and $o2 share the reference to the same object
+
+$o1.a:=10 //$o2 = {"a":10,"b":[1,2,3]}
+$o2.a:=20 //$o1 = {"a":20,"b":[1,2,3]}
+$col.push(4)
+//$o1 = {"a":20,"b":[1,2,3,4]}
+//$o2 = {"a":20,"b":[1,2,3,4]}
+ASSERT($o1=$o2) //True
+```
+
+This principle applies wherever objects or collections are used, including in [parameters](./parameters.md) or [formula](../commands/formula) expressions.
+
+
+:::note
+
+If you want to create a **deep copy** of an object, use the [`OB COPY`](../commands/ob-copy) command.
+
+:::
+
## Properties {#properties}
diff --git a/docs/Concepts/flow-control.md b/docs/Concepts/flow-control.md
index 51a18d47d67092..66776000bc18e7 100644
--- a/docs/Concepts/flow-control.md
+++ b/docs/Concepts/flow-control.md
@@ -799,3 +799,25 @@ logConsole($message)
```
+## defer (expression)
+
+History
+
+|Release|Changes|
+|---|---|
+|21 R4|Added
+
+
+
+The [`defer`](../commands/defer) command allows you to stack one or more expression(s) that will automatically execute when the current method or function **finishes running**.
+
+Whether you are managing document closings, resetting interprocess flags, or freeing up resources, ensuring that your housekeeping tasks execute flawlessly no matter how or where your function terminates can be handled by `defer` keywords.
+
+
+```4d
+ //make sure some code is executed at exit
+defer(myCleaningMethod)
+ //Do something...
+```
+
+See the [`defer`](../commands/defer) command description for more information.
\ No newline at end of file
diff --git a/docs/Concepts/methods.md b/docs/Concepts/methods.md
index 9083e73d5daeeb..8c7ec211e2217e 100644
--- a/docs/Concepts/methods.md
+++ b/docs/Concepts/methods.md
@@ -21,6 +21,6 @@ In the 4D Language, there are several categories of methods. The category depend
|**Form method**|Automatic, when an event involves the form to which the method is attached|No|Property of a form. You can use a form method to manage data and objects, but it is generally simpler and more efficient to use an object method for these purposes.|
|**Trigger** (aka *Table method*)|Automatic, each time that you manipulate the records of a table (Add, Delete and Modify)|No|Property of a table. Triggers are methods that can prevent "illegal" operations with the records of your database.|
|**Database method**|Automatic, when a working session event occurs|Yes (predefined)|There are 16 database methods in 4D. |
-|**Class**|Automatically called when an object of the class is instantiated or when a function of the class is executed on an object instance in any other methods or in a [database field](../Develop/field-properties.md#class).|yes (class functions)|A **Class** is used to declare and configure the class [constructor](./classes.md#class-constructor), [properties](./classes.md#property), and [functions](./classes.md#function) of objects. See [**Classes**](classes.md) |
+|**Class**|Automatically called when an object of the class is instantiated or when a function of the class is executed on an object instance in any other methods or in a [database field](../Develop/field-properties.md#class).|yes (class functions)|A **Class** is used to declare and configure the class [constructor](./classes.md#class-constructor), [properties](./classes.md#property), and [functions](./classes.md#function) of objects. See [**Classes**](classes.md) and [**Function** class](../API/FunctionClass.md). |
diff --git a/docs/Concepts/operators.md b/docs/Concepts/operators.md
index d15c09b5e9319c..e816769552ce9c 100644
--- a/docs/Concepts/operators.md
+++ b/docs/Concepts/operators.md
@@ -24,15 +24,18 @@ The values that operators affect are operands. In the expression `1 + 2`, the +
The **assignment operator** (`a:=b`) initializes or updates the value of `a` with the value of `b`:
```4d
-$myNumber:=3 //assigns 3 to MyNumber variable
-$myDate:=!2018/01/21! //assigns a date literal
+$myNumber:=3 //assigns 3 to $myNumber variable
+$myDate:=!2026/01/21! //assigns a date literal
$myLength:=Length("Acme") //assigns the result of the command (4) to $myLength
$col:=New collection //$col is initialized with an empty collection
+$myObject:={ a:2 ; b:$col } //assigns an object reference to $myObject
+$myObject.a:=3 //assigns a value to an object property
```
> Do NOT confuse the assignment operator `:=` with the equality comparison operator `=`. A different assignment operator (and not `=`) was deliberately chosen to avoid issues and confusion which often occur with == or === in other programming languages. Such errors are often difficult to recognize by the compiler and lead to time-consuming troubleshooting.
+
## Basic operators
Operator results depend on the **data types** they are applied to. 4D supports different operators on scalar data types. They are described with the data types, in the following sections:
diff --git a/docs/Notes/updates.md b/docs/Notes/updates.md
index 5beafdd9d94a1a..c6b70c075008d7 100644
--- a/docs/Notes/updates.md
+++ b/docs/Notes/updates.md
@@ -3,6 +3,16 @@ id: updates
title: Release Notes
---
+## 4D 21 R4
+
+Read [**What’s new in 4D 21 R4**](https://blog.4d.com/whats-new-in-4d-21-r4/), the blog post that lists all new features and enhancements in 4D 21 R4.
+
+#### Highlights
+
+- New [`defer`](../commands/defer) command to declare some code to be always executed at method or function exit.
+
+
+
## 4D 21 R3
Read [**What’s new in 4D 21 R3**](https://blog.4d.com/whats-new-in-4d-21-r3/), the blog post that lists all new features and enhancements in 4D 21 R3.
diff --git a/docs/language-legacy/Formulas/execute-formula.md b/docs/language-legacy/Formulas/execute-formula.md
index 94503e0742c6da..a687d70bc8aa35 100644
--- a/docs/language-legacy/Formulas/execute-formula.md
+++ b/docs/language-legacy/Formulas/execute-formula.md
@@ -33,7 +33,7 @@ displayed_sidebar: docs
The statement string must be one line. If *statement* is an empty string, **EXECUTE FORMULA** does nothing. The rule of thumb is that if the *statement* can be executed as a one-line method, then it will execute properly. Use **EXECUTE FORMULA** sparingly, as it can slow down execution speed. In a compiled database, the line of code is not compiled. This means that *statement* will be executed, but it will not have been checked by the compiler at compilation time.
-**Note:** Executing formulas in compiled mode can be optimized using a cache (see *Cache for formulas in compiled mode* below).
+**Note:** Executing formulas in compiled mode can be optimized using a cache (see [Cache for formulas in compiled mode](#cache-for-formulas-in-compiled-mode) below).
The *statement* can include the following elements:
@@ -46,7 +46,7 @@ The *statement* can include the following elements:
* If *statement* is a project method, it is recommended to use the [EXECUTE METHOD](../commands/execute-method) that allows you to pass parameters.
* It is not recommend to call any variable declaration in *statement* since it can generate conflicts in the code.
-The formula can include process variables and interprocess variables. However, the statement cannot contain control of flow statements (If, While, etc.), because it must be in one line of code.
+The formula can include process variables and interprocess variables. However, the statement cannot contain control of flow statements (If, While, Return, Break, etc.), because it must be in one line of code. These keywords will be ignored.
To ensure that the *statement* will be evaluated correctly regardless of the 4D language or version used, we recommend using the *token* syntax for elements whose name might vary between different versions (commands, tables, fields, constants). For example, to insert the [Current time](../commands/current-time) command, enter '**Current time:C178**'. For more information about this, refer to *Using tokens in formulas*.
diff --git a/docs/language-legacy/Formulas/formula.md b/docs/language-legacy/Formulas/formula.md
index c28488aa386901..b060f56d3d90b0 100644
--- a/docs/language-legacy/Formulas/formula.md
+++ b/docs/language-legacy/Formulas/formula.md
@@ -32,7 +32,7 @@ displayed_sidebar: docs
## Description
-The `Formula` command creates a `4D Function` object based upon the *formulaExp* expression. *formulaExp* can be as simple as a single value or complex, such as a project method with parameters.
+The `Formula` command creates a `4D Function` object based upon the *formulaExp* expression. *formulaExp* can be as simple as a single value or complex, such as a project method with parameters. For more information on what *formulaExp* can contain, please refer to the [`EXECUTE FORMULA`](../commands/execute-formula) command description.
Having a formula as an object allows it to be passed as a parameter (calculated attribute) to commands or methods or to be executed from various components without needing to declare them as "shared by components and host database". When called, the formula object is evaluated within the context of the database or component that created it.
diff --git a/docs/language-legacy/Interruptions/defer.md b/docs/language-legacy/Interruptions/defer.md
new file mode 100644
index 00000000000000..4bdf5d0cc8a256
--- /dev/null
+++ b/docs/language-legacy/Interruptions/defer.md
@@ -0,0 +1,127 @@
+---
+id: defer
+title: defer
+slug: /commands/defer
+displayed_sidebar: docs
+---
+
+**defer** ( *exitFormula* : Expression )
+
+
+
+| Parameter | Type | | Description |
+| --- | --- | --- | --- |
+| exitFormula | Expression | → | Expression to be executed at exit|
+
+
+
+
+History
+
+|Release|Changes|
+|---|---|
+|21 R4|Created|
+
+
+
+
+## Description
+
+The `defer` command declares an *exitFormula* expression that will always be executed when the method or function exits, even if an error has been thrown or a `return` has been executed. Using a `defer` command allows you to ensure that a method or function ends correctly by executing completion code on exit. In addition, this command saves you from having to duplicate the same exit code for every return or catch block.
+
+:::tip Related blog post
+
+[Streamline Your Clean-Up Code with the “defer” Command](https://blog.4d.com/streamline-your-clean-up-code-with-the-defer-command)
+
+:::
+
+
+The `defer` command can be called anywhere in the method or function code, and you can insert as many `defer` expressions as you want in the code. During execution, all encountered *exitFormula* expressions are stacked. When the code execution stops, whatever the reason (normal flow, break, error, user abort, return...), all expressions in the "deferred stack" are popped and executed in LIFO (*Last In First Out)* order.
+
+For example:
+
+```4d
+defer(ALERT("1"))
+defer(ALERT("2"))
+// At exit, alerts will display "2" and then "1"
+```
+
+In *exitFormula*, you pass the expression that you want to be evaluated upon method or function exit, whatever the way it exited. Behind the scenes, every time a `defer` is called, 4D converts *exitFormula* into a [formula](../../commands/formula) and adds it to a stack associated with the method or function. When the method or function ends, all formulas stored in the stack are evaluated in the order they appear in the collection.
+
+As for all [formulas](../../commands/formula), if the *exitFormula* expression uses local variables, their current values are copied and stored in the formula object returned **when it is put in the *deferred stack***. When executed, the formula uses these copied values rather than the current values of the local variables.
+
+:::note Notes
+
+- Keep in mind that local variables store **references** for [object](../../Concepts/dt_object.md#assignment) and [collection](../../Concepts/dt_collection.md#assignment) values.
+- If *exitFormula* contains another `defer` statement, an error is thrown.
+
+:::
+
+If the *exitFormula* expression throws an error, it is automatically intercepted and ignored and the execution flow continues without any interruption.
+
+
+
+## Example 1
+
+These examples illustrate the various supported *exitFormula* expressions:
+
+```4d
+// Method call
+defer(aMethod)
+
+// Object function call
+defer(myObject.aFunction(something))
+
+// Singleton function call
+defer(cs.aClass.me.aFunction(something))
+```
+
+## Example 2
+
+You want to make sure an XML reference will be always properly released, to avoid potential memory leaks:
+
+```4d
+var $xmlRef:=DOM Create XML ref("theRoot")
+defer(DOM CLOSE XML($xmlRef))
+...
+```
+
+## Example 3
+
+You want to make sure the activity monitoring stops at the end of the method:
+
+```4d
+START MONITORING ACTIVITY(0.001;Activity all)
+defer(STOP MONITORING ACTIVITY())
+...
+```
+
+## Example 4
+
+You want to control your log generation:
+
+```4d
+$logRecording:=Get database parameter(Diagnostic log recording)
+SET DATABASE PARAMETER(Diagnostic log recording; 1)
+defer(SET DATABASE PARAMETER(Diagnostic log recording; $logRecording))
+
+$logLevel:=Get database parameter(Diagnostic log level)
+SET DATABASE PARAMETER(Diagnostic log level; Log trace)
+defer(SET DATABASE PARAMETER(Diagnostic log level; $logLevel))
+```
+
+## See also
+
+[throw](../commands/throw)
+[Last errors](../commands/last-errors)
+[ON ERR CALL](../commands/on-err-call)
+
+## Properties
+
+| | |
+| --- | --- |
+| Command number | 1805 |
+| Thread safe | no |
+
+
+
diff --git a/docs/language-legacy/Interruptions/throw.md b/docs/language-legacy/Interruptions/throw.md
index 17dd63ec419ef0..45e5f8b70691db 100644
--- a/docs/language-legacy/Interruptions/throw.md
+++ b/docs/language-legacy/Interruptions/throw.md
@@ -38,7 +38,7 @@ Errors thrown using the **throw** command are managed by the 4D runtime as any n
The command supports three syntaxes:
-### **throw(errorCode{; description})**
+### throw(errorCode{; description})
It specifies the error code and an optional description text, the error is thrown immediately.
If no description is provided, it is filled with:
@@ -46,7 +46,7 @@ If no description is provided, it is filled with:
* Error code errorCode: (host) in the host application
* Error code errorCode: (C00x) in a component
-### **throw(errorObj)**
+### throw(errorObj)
*errorObj* object allows for more detailed error information and control over error handling. It can contain the following properties, as well as any custom property that you can refer to using placeholders within the **message** property.
@@ -61,7 +61,7 @@ When you use this syntax, the *errorObj* object is returned in [Last errors](../
**Note:** It is possible to call the command several times in the same project method to generate several errors. You can use the deferred option to send all errors at once.
-### **throw**
+### throw
It throws all current errors in **deferred mode**, meaning they will be added to a stack and handled when the calling method returns. This is typically done from within an [ON ERR CALL](../commands/on-err-call) callback.
@@ -111,7 +111,8 @@ throw({componentSignature: "xbox"; errCode: 600; name: "myFileName"; path: "myFi
## See also
[ASSERT](../commands/assert)
-[Last errors](../commands/last-errors)
+[defer](../commands/defer)
+[Last errors](../commands/last-errors)
[ON ERR CALL](../commands/on-err-call)
## Properties
diff --git a/docs/language-legacy/Printing/accumulate.md b/docs/language-legacy/Printing/accumulate.md
index 7386ab66773f1c..e39883fdc4a8db 100644
--- a/docs/language-legacy/Printing/accumulate.md
+++ b/docs/language-legacy/Printing/accumulate.md
@@ -5,13 +5,14 @@ slug: /commands/accumulate
displayed_sidebar: docs
---
-**ACCUMULATE** ( *...data* : Field, Variable)
+**ACCUMULATE** ( {*...dataField* : Field} {; *...dataVar* : Variable )
| Parameter | Type | | Description |
| --- | --- | --- | --- |
-| data | Field, Variable | → | Numeric field or variable on which to accumulate |
+| dataField | Field | → | Numeric field on which to accumulate |
+| dataVar | Variable | → | Numeric variable on which to accumulate |
diff --git a/i18n/es/docusaurus-plugin-content-docs/current/API/DataClassClass.md b/i18n/es/docusaurus-plugin-content-docs/current/API/DataClassClass.md
index 2c13cb567b8fc6..efc843f388794b 100644
--- a/i18n/es/docusaurus-plugin-content-docs/current/API/DataClassClass.md
+++ b/i18n/es/docusaurus-plugin-content-docs/current/API/DataClassClass.md
@@ -1256,7 +1256,7 @@ var $results := ds.MyClass.query("myVectorField > :1 order by myVectorField"; $c
Si el mismo vector aparece varias veces en la cadena de consulta, el orden por se aplicará a los resultados del primero, por ejemplo:
```4d
-var $results := ds.MyClass.query("myVectorField > :1 and myVectorField > :2 order by myVectorField" desc; /
+var $results := ds.MyClass.query("myVectorField > :1 and myVectorField > :2 order by myVectorField desc"; /
{vector : $myVector1 };{vector : $myVector2 }) //myVectorField > :1 is used for the order by
```
diff --git a/i18n/es/docusaurus-plugin-content-docs/current/API/IMAPTransporterClass.md b/i18n/es/docusaurus-plugin-content-docs/current/API/IMAPTransporterClass.md
index 01e379e63108be..41d21b39a9eda2 100644
--- a/i18n/es/docusaurus-plugin-content-docs/current/API/IMAPTransporterClass.md
+++ b/i18n/es/docusaurus-plugin-content-docs/current/API/IMAPTransporterClass.md
@@ -1467,6 +1467,10 @@ $flags["$seen"]:=True
$status:=$transporter.removeFlags(IMAP all;$flags)
```
+#### Ver también
+
+[`.addFlags()`](#addflags)
+
diff --git a/i18n/es/docusaurus-plugin-content-docs/current/FormObjects/properties_Text.md b/i18n/es/docusaurus-plugin-content-docs/current/FormObjects/properties_Text.md
index 0501444d9b75d2..aa07ad6735566d 100644
--- a/i18n/es/docusaurus-plugin-content-docs/current/FormObjects/properties_Text.md
+++ b/i18n/es/docusaurus-plugin-content-docs/current/FormObjects/properties_Text.md
@@ -434,7 +434,84 @@ Por defecto, esta opción no está activa.
#### Comandos
-[LISTBOX Get property](../commands/listbox-get-property) - [LISTBOX SET PROPERTY](../commands/listbox-set-property) - [OBJECT Is styled text](../commands/object-is-styled-text) -
+[LISTBOX Get property](../commands/listbox-get-property) - [LISTBOX SET PROPERTY](../commands/listbox-set-property) - [OBJECT Is styled text](../commands/object-is-styled-text)
+
+### Supported tags
+
+You can use the following tags in 4D multi-style text areas.
+
+#### 4D Expression
+
+```html
+
+```
+
+This tag inserts a 4D expression (expression, method, field, variable, command, etc.) in the text. The expression is tokenized and evaluated:
+
+- when the expression is inserted
+- when the object is loaded
+- when the `computeExpressions` standard action is called from an interface object or by the [`INVOKE ACTION`](../commands/invoke-action) command
+- when the [`ST COMPUTE EXPRESSIONS`](../commands/st-compute-expressions) command is executed
+- when the [`ST FREEZE EXPRESSIONS`](../commands/st-freeze-expressions) command is executed, if the second `*` parameter is passed.
+
+The evaluated value of the expression is not saved in the `` tag, only its reference is.
+
+Note: To ensure that expressions will be evaluated correctly regardless of the 4D language or version used, we recommend using the token syntax for elements whose name might vary between different versions (commands, tables, fields, constants). Por ejemplo, para insertar el comando `Current time`, ingrese `Current time:C178`. For more information about this, refer to *Using tokens in formulas*.
+
+#### URL
+
+```html
+Visible label
+```
+
+This tag inserts a URL in the text. Ejemplo:
+
+```html
+4D Web Site
+```
+
+#### User link
+
+```html
+Click here
+```
+
+"User links" look the same as URLs, but when you click them, they do not automatically open the source. You can pass any string you want as reference, and it is up to the developer to program any custom actions that occur when it is clicked. This means you can create links which are not URLs but references to files, 4D methods, and so on, that you can open or execute when they are clicked. The [`ST Get content type`](../commands/st-get-content-type) command detects if a user link has been clicked.
+
+User links are defined using the [`ST SET TEXT`](../commands/st-set-text) command. Por ejemplo:
+
+```4d
+ST SET TEXT(txtVar;"This is a user link: User Label";$start;$end)
+```
+
+#### Custom tags
+
+You can insert any tag in plain text, for example `
`. It is stored in the code of the plain text without being interpreted or displayed. This is particularly useful in the context of e-mails in HTML format and including pictures for example.
+
+#### Style tags
+
+This paragraph lists the attributes of \ tags that are supported by 4D in rich text areas. You can use these tags to implement custom style handling. Only the tags listed below are supported by 4D for style variations.
+
+- Font name: ` ... `
+- Font size: ` ... `
+- Estilo de fuente:
+ - Bold ` ... `
+ - Italic ` ... `
+ - Normal ` ... `
+ - Underline ` ... `
+ - Strikethrough `...`
+
+*Note: The "strikethrough" style is not supported under macOS, but this tag can still be managed by programming.*
+
+- Font colors: ` ... ` or `...`
+- Background colors: ` ... ` or `...`
+
+#### Color values
+
+For font color and background color attributes, the color value can be either the hexadecimal code for an RGB color, or the name of one of the 16 HTML colors defined for standard CSS by the W3C:
+
+
+
---
diff --git a/i18n/es/docusaurus-plugin-content-docs/current/assets/en/FormObjects/colors1.png b/i18n/es/docusaurus-plugin-content-docs/current/assets/en/FormObjects/colors1.png
new file mode 100644
index 00000000000000..fc0759ba0abc00
Binary files /dev/null and b/i18n/es/docusaurus-plugin-content-docs/current/assets/en/FormObjects/colors1.png differ
diff --git a/i18n/es/docusaurus-plugin-content-docs/current/assets/en/FormObjects/colors2.png b/i18n/es/docusaurus-plugin-content-docs/current/assets/en/FormObjects/colors2.png
new file mode 100644
index 00000000000000..48d25eafd90071
Binary files /dev/null and b/i18n/es/docusaurus-plugin-content-docs/current/assets/en/FormObjects/colors2.png differ
diff --git a/i18n/es/docusaurus-plugin-content-docs/current/assets/en/FormObjects/multistyle-ex1.png b/i18n/es/docusaurus-plugin-content-docs/current/assets/en/FormObjects/multistyle-ex1.png
new file mode 100644
index 00000000000000..715de8bdb44813
Binary files /dev/null and b/i18n/es/docusaurus-plugin-content-docs/current/assets/en/FormObjects/multistyle-ex1.png differ
diff --git a/i18n/es/docusaurus-plugin-content-docs/current/assets/en/FormObjects/multistyle-ex2.png b/i18n/es/docusaurus-plugin-content-docs/current/assets/en/FormObjects/multistyle-ex2.png
new file mode 100644
index 00000000000000..2ea1e2de1b9d12
Binary files /dev/null and b/i18n/es/docusaurus-plugin-content-docs/current/assets/en/FormObjects/multistyle-ex2.png differ
diff --git a/i18n/es/docusaurus-plugin-content-docs/current/commands/theme/Styled_Text.md b/i18n/es/docusaurus-plugin-content-docs/current/commands/theme/Styled_Text.md
index f614bcfa6d8058..03e2179a0a671d 100644
--- a/i18n/es/docusaurus-plugin-content-docs/current/commands/theme/Styled_Text.md
+++ b/i18n/es/docusaurus-plugin-content-docs/current/commands/theme/Styled_Text.md
@@ -22,3 +22,94 @@ slug: /commands/theme/Styled-Text
| [](../../commands/st-set-options)
|
| [](../../commands/st-set-plain-text)
|
| [](../../commands/st-set-text)
|
+
+## Working with text handling commands
+
+### Interfaz de usuario
+
+The commands that can be used to manipulate text objects by programming do not take any style tags integrated into the text into account. They act upon displayed text only. This concerns the following commands:
+
+- [User Interface](./User_Interface.md) theme commands
+- [`HIGHLIGHT TEXT`](../../commands/highlight-text)
+- [`GET HIGHLIGHT`](../../commands/get-highlight)
+
+When you use these commands with commands that manipulate character strings, it is necessary to filter the formatting characters using the [`ST Get plain text`](../../commands/st-get-plain-text) command:
+
+```4d
+ HIGHLIGHT TEXT([Products]Notes;1;Length(ST Get plain text([Products]Notes))+1)
+```
+
+### Objetos (formularios)
+
+The commands that can be used to modify the style of objects (for example, [`OBJECT SET FONT`](../../commands/object-set-font)) apply to the whole object and not to the selection.
+
+If the object does not have the focus when the command is executed, the modification is applied simultaneously to the object (the text area) and to its associated variable. If the object does have the focus, the modification is carried out on the object but not on the associated variable. The modification is only applied to the variable when the object loses the focus. Keep this principle in mind when programming text areas.
+
+:::note
+
+If the [**Store with default style tags**](../../FormObjects/properties_Text.md#store-with-default-style-tags) option is checked for the object, the use of these commands will cause a modification of the tags saved with each object.
+
+:::
+
+Note also that only default properties are affected by these commands (as well as any properties saved by means of default tags). Custom style tags remain as they are. For example, given a multi-style area where default tags were saved:
+
+
+
+The plain text of the area is as follows:
+
+```html
+This is the word red
+```
+
+Si ejecuta el siguiente código:
+
+```4d
+OBJECT SET COLOR(*;"myArea";-(Blue+(256*Yellow)))
+```
+
+The red color remains:
+
+
+
+and code is:
+
+```html
+This is the word red
+```
+
+The following commands are concerned:
+
+- [`OBJECT SET RGB COLORS`](../../commands/object-set-rgb-colors)
+- [`OBJECT SET FONT`](../../commands/object-set-font)
+- [`OBJECT SET FONT STYLE`](../../commands/object-set-font-style)
+- [`OBJECT SET FONT SIZE`](../../commands/object-set-font-size)
+
+In the context of multi-style areas, such commands should be used to set default styles only. To manage styles during database execution, we recommend using the commands of the "Styled Text" theme.
+
+### Get edited text
+
+When it is used with a rich text area, the [`Get edited text`](../../commands/get-edited-text) command returns the text of the current area including any style tags.
+
+To retrieve the "plain" text (text without tags) being edited, you must use the [`ST Get plain text`](../../commands/st-get-plain-text) command:
+
+```4d
+ST Get plain text(Get edited text)
+```
+
+### Query and order by commands
+
+Queries and sorts carried out among multi-style objects take into account any style tags saved in the object. If a style modification has been made within a word, searching for the word will not be successful.
+
+To be able to carry out valid searches and sorts, you must use the [`ST Get plain text`](../../commands/st-get-plain-text) command. Por ejemplo:
+
+```4d
+QUERY BY FORMULA([MyTable];ST Get plain text([MyTable]MyFieldStyle)="very well")
+```
+
+## Automatic normalization of line endings
+
+In order to ensure multi-platform compatibility of texts handled in the database, 4D automatically normalizes line endings so that they occupy a single character: `\r` (carriage return). This normalization is carried out at the level of form objects (variables or fields) hosting plain or multi-style text. Line endings that are not native, or that use a mix of several characters (for example `\r\n`), are considered as a single `\r`.
+
+Note that in compliance with the XML standard (multi-style text format), the multi-style text commands also normalize line endings for text variables that are not associated with objects.
+
+This principle makes it easier to use multi-style text commands or commands such as [`HIGHLIGHT TEXT`](../../commands/highlight-text) in a multi-platform context. However, you must take this into account in your processing when you work with texts from heterogeneous sources.
\ No newline at end of file
diff --git a/i18n/es/docusaurus-plugin-content-docs/current/commands/theme/System_Documents.md b/i18n/es/docusaurus-plugin-content-docs/current/commands/theme/System_Documents.md
index 3eacb05cca4096..cfae8bdf1a06c9 100644
--- a/i18n/es/docusaurus-plugin-content-docs/current/commands/theme/System_Documents.md
+++ b/i18n/es/docusaurus-plugin-content-docs/current/commands/theme/System_Documents.md
@@ -63,46 +63,64 @@ When it is called from a [preemptive process](../../Develop/preemptive.md), a *D
## The Document system variable
-`Open document`, `Create document`, `Append document` and `Select document` enable you to access a document using the standard Open or Save file dialog boxes. When you access a document through a standard dialog, 4D returns the full pathname of the document in the [`Document` system variable](../../Concepts/variables.md#system-variables). This system variable has to be distinguished from the *document* parameter that appears in the parameter list of the commands.
+[`Open document`](../../commands/open-document), [`Create document`](../../commands/create-document), [`Append document`](../../commands/append-document`) and [`Select document`](../../commands/select-document) commands enable you to access a document using the standard Open or Save file dialog boxes. When you access a document through a standard dialog, 4D returns the full pathname of the document in the [`Document` system variable](../../Concepts/variables.md#system-variables). This system variable has to be distinguished from the *document* parameter that appears in the parameter list of the commands.
## Ruta absoluta o relativa
-Most of the routines of this section accept document names, relative pathnames or absolute pathnames:
+Most of the routines of this section accept **document names**, **relative pathnames** or **absolute pathnames**.
+
+- **Relative pathnames** define a location with respect to a folder located on disk. Si sólo se pasa el nombre del documento, se considera que se está utilizando una ruta relativa. In 4D, a relative pathname is usually expressed with respect to the [project folder](../../Project/architecture.md#project-folder), i.e. the folder containing the .project file. Los nombres de ruta relativos son especialmente útiles cuando se despliegan aplicaciones en entornos heterogéneos.
+- **Absolute pathnames** define a location with respect to the root of the volume and so they do not depend on the current location of the project folder.
-Los nombres de ruta relativos definen una ubicación con respecto a una carpeta situada en el disco. Si sólo se pasa el nombre del documento, se considera que se está utilizando una ruta relativa. In 4D, a relative pathname is usually expressed with respect to the database folder, i.e. the folder containing the structure file. Los nombres de ruta relativos son especialmente útiles cuando se despliegan aplicaciones en entornos heterogéneos.
-Absolute pathnames define a location with respect to the root of the volume and so they do not depend on the current location of the database folder.
Para determinar si una ruta pasada a un comando debe ser interpretada como absoluta o relativa, 4D aplica un algoritmo específico en cada plataforma.
-Windows
-If the parameter contains only two characters and if the second one is a ':',
-or if the text contains ':' and '\' as the second and third character,
-or if the text starts with "\\",
-then the pathname is absolute.
+### Windows
+
+- If the parameter contains only two characters and if the second one is a ':'
+- or if the text contains ':' and '\' as the second and third character,
+- or if the text starts with "\\",
+- then the pathname is absolute.
In all other cases, the pathname is relative.
-Ejemplos con el comando CREATE FOLDER:
+Examples with the [`CREATE FOLDER`](../../commands/create-folder) command:
+
+```4d
+ CREATE FOLDER("lundi") // relative path
+ CREATE FOLDER("\Monday") // relative path
+ CREATE FOLDER("\Monday\Tuesday") // relative path
+ CREATE FOLDER("c:") // absolute path
+ CREATE FOLDER("d:\Monday") // absolute path
+ CREATE FOLDER("\\srv-Internal\temp") // absolute path
+```
+
+:::note
+
+The code editor of 4D allows the use of [escape sequences](../../Concepts/quick-tour.md#escape-sequences). An escape sequence begins with a backslash `\`, followed by a character. For example, `\t` is the escape sequence for the Tab character.
-CREATE FOLDER("lundi") // relative path
-CREATE FOLDER("\Monday") // relative path
-CREATE FOLDER("\Monday\Tuesday") // relative path
-CREATE FOLDER("c:") // absolute path
-CREATE FOLDER("d:\Monday") // absolute path
-CREATE FOLDER("\\srv-Internal\temp") // absolute path
+The `\` character is also used as the separator in pathnames in Windows. In general, 4D will correctly interpret Windows pathnames that are entered in the method editor by replacing single backslashes `\` with double backslashes `\\`. For example, `C:\Folder` will become `C:\\Folder`.
-macOS
-Si el texto comienza con un separador de carpetas ':',
-o si no contiene ninguno,
-entonces la ruta es relativa.
+However, if you write `C:\MyDocuments\New`, 4D will display `C:\\MyDocuments\New`. In this case, the second `\` is incorrectly interpreted as `\N` (an existing escape sequence). Por lo tanto, debe introducir un doble "-" cuando quiera insertar una barra invertida antes de un caracter que se utiliza en una de las secuencias de escape reconocidas por 4D.
+
+:::
+
+### macOS
+
+- If the text starts with a folder separator ':',
+- or if does not contain any,
+- then the path is relative.
En los demás casos, es absoluta.
-Ejemplos con el comando CREATE FOLDER:
+Examples with the [`CREATE FOLDER`](../../commands/create-folder) command:
+
+```4d
-CREATE FOLDER("Monday") // relative path
-CREATE FOLDER("macintosh hd:") // absolute path
-CREATE FOLDER("Monday:Tuesday") // absolute path (a volume must be called Monday)
-CREATE FOLDER(":Monday:Tuesday") // relative path
+ CREATE FOLDER("Monday") // relative path
+ CREATE FOLDER("macintosh hd:") // absolute path
+ CREATE FOLDER("Monday:Tuesday") // absolute path (a volume must be called Monday)
+ CREATE FOLDER(":Monday:Tuesday") // relative path
+```
:::note
@@ -112,8 +130,8 @@ See also [**Absolute and relative pathnames** in the Concepts section](../../Con
## Extracción del contenido de una ruta
-Puede manejar el contenido de las rutas utilizando los comandos Path to object y Object to path. En particular, usando estos comandos, se puede extraer de una ruta:
+You can handle pathname contents using the [`Path to object`](../../commands/path-to-object) and [`Object to path`](../../commands/object-to-path) commands. En particular, usando estos comandos, se puede extraer de una ruta:
-a file name,
-the parent folder path,
-the file or folder extension.
\ No newline at end of file
+- a file name,
+- the parent folder path,
+- the file or folder extension.
\ No newline at end of file
diff --git a/i18n/es/docusaurus-plugin-content-docs/current/commands/theme/Web_Services_Client.md b/i18n/es/docusaurus-plugin-content-docs/current/commands/theme/Web_Services_Client.md
index 96b3dba914cc05..0489d9e5b0c38d 100644
--- a/i18n/es/docusaurus-plugin-content-docs/current/commands/theme/Web_Services_Client.md
+++ b/i18n/es/docusaurus-plugin-content-docs/current/commands/theme/Web_Services_Client.md
@@ -13,3 +13,9 @@ slug: /commands/theme/Web-Services-Client
| [](../../commands/web-service-get-result)
|
| [](../../commands/web-service-set-option)
|
| [](../../commands/web-service-set-parameter)
|
+
+A Web Service is a set of functions published on a network. These functions can be called and used by any application compatible with Web Services and connected to the network. Web Services can carry out all types of tasks, such as supervising the routing of packages at a transporter’s, e-commerce, monitoring market values, etc.
+
+Subscription to Web Services with 4D is easy to carry out using the [Web Services Wizard](https://doc.4d.com/4Dv21/4D/21/Subscribing-to-a-Web-Service-in-4D.300-7676804.en.html). In most cases, this Wizard will be sufficient for you to be able to use Web Services. However, if you want to customize certain mechanisms, you must use the client SOAP commands of 4D.
+
+Note: By convention, the terms “SOAP” and “Web Service” have been used to differentiate between command (and constant) names on the server and client side, respectively. These two concepts refer to the same technology.
\ No newline at end of file
diff --git a/i18n/es/docusaurus-plugin-content-docs/current/commands/theme/Web_Services_Server.md b/i18n/es/docusaurus-plugin-content-docs/current/commands/theme/Web_Services_Server.md
index 202998e73b9c9c..ce0f9560ea8ca7 100644
--- a/i18n/es/docusaurus-plugin-content-docs/current/commands/theme/Web_Services_Server.md
+++ b/i18n/es/docusaurus-plugin-content-docs/current/commands/theme/Web_Services_Server.md
@@ -12,3 +12,7 @@ slug: /commands/theme/Web-Services-Server
| [](../../commands/soap-reject-new-requests)
|
| [](../../commands/soap-request)
|
| [](../../commands/soap-send-fault)
|
+
+Publication of Web Services with 4D is carried out easily using [options in the method properties](../../Project/project-method-properties.md#web-services). In most cases, this operation will be sufficient to enable you to publish Web Services. However, if you want to customize certain mechanisms, use data arrays, etc., you must use the server SOAP commands of 4D.
+
+Note: By convention, the terms “SOAP” and “Web Service” have been used to differentiate between command (and constant) names on the server and client side, respectively. These two concepts refer to the same technology.
\ No newline at end of file
diff --git a/i18n/es/docusaurus-plugin-content-docs/current/commands/theme/XML.md b/i18n/es/docusaurus-plugin-content-docs/current/commands/theme/XML.md
index 1a17eb22685040..8bb4bf595adb8d 100644
--- a/i18n/es/docusaurus-plugin-content-docs/current/commands/theme/XML.md
+++ b/i18n/es/docusaurus-plugin-content-docs/current/commands/theme/XML.md
@@ -16,7 +16,7 @@ slug: /commands/theme/XML
:::note
-For XML support, 4D uses a library named Xerces.dll developed by the Apache Foundation company.
+For XML support, 4D uses the [Xerces.dll library](../../Notes/updates.md#library-table) developed by the Apache Foundation company.
:::
diff --git a/i18n/es/docusaurus-plugin-content-docs/current/language-legacy/Formulas/execute-formula.md b/i18n/es/docusaurus-plugin-content-docs/current/language-legacy/Formulas/execute-formula.md
index 30ed3f64e238c7..6fe5b3cfd1d432 100644
--- a/i18n/es/docusaurus-plugin-content-docs/current/language-legacy/Formulas/execute-formula.md
+++ b/i18n/es/docusaurus-plugin-content-docs/current/language-legacy/Formulas/execute-formula.md
@@ -33,7 +33,7 @@ displayed_sidebar: docs
La cadena de instrucción debe ser de una sola línea. Si *instruccion* es una cadena vacía, **EXECUTE FORMULA** no hace nada. La regla es que si la instrucción puede ejecutarse como un método de una línea, entonces se ejecutará correctamente. El comando **EXECUTE FORMULA** debe utilizarse con precaución, ya que disminuye la velocidad de ejecución. En una base compilada, el código de la instrucción no está compilado. Esto significa que la instrucción será ejecutada, pero no será verificada por el compilador en el momento de la compilación.
-**Nota:** la ejecución de fórmulas en modo compilado se puede optimizar utilizando una memoria caché (ver *Caché para fórmulas en modo compilado* abajo).
+**Nota:** la ejecución de fórmulas en modo compilado se puede optimizar utilizando una memoria caché (ver [Caché para fórmulas en modo compilado](#cache-para-formulas-en-modo-compilado) abajo).
La *instrucción* puede incluir los siguientes elementos:
@@ -41,7 +41,7 @@ La *instrucción* puede incluir los siguientes elementos:
* una llamada a un comando 4D
* una tarea
-La fórmula puede incluir variables proceso e interproceso. La instrucción no puede contener instrucciones de control de flujo (If, While, etc.), porque la instrucción debe tener sólo una línea de código.
+La fórmula puede incluir variables proceso e interproceso. La instrucción no puede contener instrucciones de control de flujo (If, While, Return, Break, etc.), porque la instrucción debe tener sólo una línea de código. Estas palabras clave se ignorarán.
Para asegurarse de que la *instruccion* sea evaluada correctamente independientemente del lenguaje o versión 4D utilizada, se recomienda utilizar la sintaxis tokenizada para los elementos cuyo nombre puede variar entre las diferentes versiones (comandos, tablas, campos, constantes). Por ejemplo, para insertar el comando [Current time](../commands/current-time), introduzca **'Current time:C178'**. Para más información, consulte *Utilizar tokens en fórmulas*.
@@ -50,7 +50,7 @@ Para asegurarse de que la *instruccion* sea evaluada correctamente independiente
* Si la *instruccion* es un método proyecto, se recomienda utilizar [EXECUTE METHOD](../commands/execute-method) que le permite pasar parámetros.
* No se recomienda llamar a ningún comando de declaración de variable como *C\_DATE* en *instruccion* ya que puede generar conflictos en el código.
-La fórmula puede incluir variables de proceso y variables entre procesos. Sin embargo, la declaración no puede contener el control de las instrucciones de flujo (If, While, etc.), ya que debe estar en una línea de código.
+La fórmula puede incluir variables de proceso y variables entre procesos. Sin embargo, la declaración no puede contener el control de las instrucciones de flujo (If, While, Return, Break, etc.), ya que debe estar en una línea de código. Estas palabras clave se ignorarán.
Para garantizar que la *instrucción* se evalúe correctamente, independientemente del lenguaje 4D o la versión utilizada, se recomienda utilizar la sintaxis del *token* para los elementos cuyo nombre puede variar entre diferentes versiones (comandos, tablas, campos, constantes). Por ejemplo, para insertar el comando \[#cmd id="178"/\], introduzca '**Current time:C178**'. Para más información al respecto, consulte *Utilizar tokens en fórmulas*.
diff --git a/i18n/es/docusaurus-plugin-content-docs/current/language-legacy/Formulas/formula.md b/i18n/es/docusaurus-plugin-content-docs/current/language-legacy/Formulas/formula.md
index 1457c6f40ef403..8233830fd8c001 100644
--- a/i18n/es/docusaurus-plugin-content-docs/current/language-legacy/Formulas/formula.md
+++ b/i18n/es/docusaurus-plugin-content-docs/current/language-legacy/Formulas/formula.md
@@ -32,7 +32,7 @@ displayed_sidebar: docs
## Descripción
-El comando `Formula` crea un objeto `4D Function` basado en la expresión *formulaExp*. *formulaExp* puede ser tan simple como un valor único o complejo, como un método proyecto con parámetros.
+El comando `Formula` crea un objeto `4D Function` basado en la expresión *formulaExp*. *formulaExp* puede ser tan simple como un valor único o complejo, como un método proyecto con parámetros. Para más información sobre lo que puede contener *formulaExp*, consulte la descripción del comando [`EXECUTE FORMULA`](../commands/execute-formula).
Tener una fórmula como objeto permite pasarla como parámetro (atributo calculado) a los comandos o a los métodos o ejecutarla desde varios componentes sin necesidad de declararla como "compartida por los componentes y la base de datos local". Cuando se llama, el objeto fórmula se evalúa en el contexto de la base de datos o del componente que lo creó.
diff --git a/i18n/es/docusaurus-plugin-content-docs/current/language-legacy/Interruptions/defer.md b/i18n/es/docusaurus-plugin-content-docs/current/language-legacy/Interruptions/defer.md
new file mode 100644
index 00000000000000..4202d4f7c22d63
--- /dev/null
+++ b/i18n/es/docusaurus-plugin-content-docs/current/language-legacy/Interruptions/defer.md
@@ -0,0 +1,121 @@
+---
+id: defer
+title: defer
+slug: /commands/defer
+displayed_sidebar: docs
+---
+
+**defer** ( *exitFormula* : Expression )
+
+
+
+| Parámetro | Tipo | | Descripción |
+| --- | --- | --- | --- |
+| exitFormula | Expression | → | Expresión a ejecutar al salir |
+
+
+
+
+Historial
+
+|Versión|Cambios|
+|---|---|
+|21 R4|Creado|
+
+
+
+
+## Descripción
+
+El comando `defer` declara una expresión *exitFormula* que siempre se ejecutará al salir del método o de la función, incluso si se ha lanzado un error o se ha ejecutado un `return`. Usar `defer` le permite garantizar que un método o una función termine correctamente ejecutando código de finalización al salir. Además, este comando evita duplicar el mismo código de salida en cada bloque de retorno o captura de errores.
+
+:::tip Entrada de blog relacionada
+
+[Streamline Your Clean-Up Code with the “defer” Command](https://blog.4d.com/streamline-your-clean-up-code-with-the-defer-command)
+
+:::
+
+El comando `defer` puede llamarse en cualquier parte del código del método o de la función, y puede insertar tantas expresiones `defer` como desee. Durante la ejecución, todas las expresiones *exitFormula* encontradas se apilan. Cuando se detiene la ejecución, sea cual sea el motivo (flujo normal, break, error, interrupción del usuario, return...), todas las expresiones de la pila diferida se desapilan y se ejecutan en orden LIFO (*Last In First Out*).
+
+Por ejemplo:
+
+```4d
+defer(ALERT("1"))
+defer(ALERT("2"))
+// Al salir, las alertas mostrarán "2" y luego "1"
+```
+
+En *exitFormula*, usted pasa la expresión que desea evaluar al salir del método o función, sin importar cómo haya terminado. Internamente, cada vez que se llama a `defer`, 4D convierte *exitFormula* en una [formula](../../commands/formula) y la añade a una pila asociada al método o función. Cuando finaliza el método o función, todas las fórmulas almacenadas en la pila se evalúan en el orden en que aparecen en la colección.
+
+Como ocurre con todas las [formulas](../../commands/formula), si la expresión *exitFormula* usa variables locales, sus valores actuales se copian y se almacenan en el objeto fórmula devuelto **cuando se coloca en la pila diferida**. Al ejecutarse, la fórmula utiliza esos valores copiados en lugar de los valores actuales de las variables locales.
+
+:::note Notas
+
+- Tenga en cuenta que las variables locales almacenan **referencias** para valores [object](../../Concepts/dt_object.md#assignment) y [collection](../../Concepts/dt_collection.md#assignment).
+- Si *exitFormula* contiene otra instrucción `defer`, se lanza un error.
+
+:::
+
+Si la expresión *exitFormula* lanza un error, este se intercepta e ignora automáticamente y el flujo de ejecución continúa sin interrupción.
+
+## Ejemplo 1
+
+Estos ejemplos ilustran las distintas expresiones *exitFormula* compatibles:
+
+```4d
+// Llamada a método
+defer(aMethod)
+
+// Llamada a función de objeto
+defer(myObject.aFunction(something))
+
+// Llamada a función singleton
+defer(cs.aClass.me.aFunction(something))
+```
+
+## Ejemplo 2
+
+Quiere asegurarse de que una referencia XML siempre se libere correctamente, para evitar posibles fugas de memoria:
+
+```4d
+var $xmlRef:=DOM Create XML ref("theRoot")
+defer(DOM CLOSE XML($xmlRef))
+...
+```
+
+## Ejemplo 3
+
+Quiere asegurarse de que la supervisión de actividad se detenga al final del método:
+
+```4d
+START MONITORING ACTIVITY(0.001;Activity all)
+defer(STOP MONITORING ACTIVITY())
+...
+```
+
+## Ejemplo 4
+
+Quiere controlar la generación de registros:
+
+```4d
+$logRecording:=Get database parameter(Diagnostic log recording)
+SET DATABASE PARAMETER(Diagnostic log recording; 1)
+defer(SET DATABASE PARAMETER(Diagnostic log recording; $logRecording))
+
+$logLevel:=Get database parameter(Diagnostic log level)
+SET DATABASE PARAMETER(Diagnostic log level; Log trace)
+defer(SET DATABASE PARAMETER(Diagnostic log level; $logLevel))
+```
+
+## Ver también
+
+[throw](../commands/throw)
+[Last errors](../commands/last-errors)
+[ON ERR CALL](../commands/on-err-call)
+
+## Propiedades
+
+| | |
+| --- | --- |
+| Número de comando | 1805 |
+| Hilo seguro | no |
diff --git a/i18n/es/docusaurus-plugin-content-docs/current/language-legacy/Interruptions/throw.md b/i18n/es/docusaurus-plugin-content-docs/current/language-legacy/Interruptions/throw.md
index 1715a8b6c3d718..caa4c5195dbeaf 100644
--- a/i18n/es/docusaurus-plugin-content-docs/current/language-legacy/Interruptions/throw.md
+++ b/i18n/es/docusaurus-plugin-content-docs/current/language-legacy/Interruptions/throw.md
@@ -38,7 +38,7 @@ Los errores lanzados utilizando el comando **throw** son gestionados por el runt
El comando admite tres sintaxis:
-### **throw(errorCode{; description})**
+### throw(errorCode{; description})
Especifica el código de error y un texto de descripción opcional, el error se lanza inmediatamente.
Si no se indica ninguna descripción: se llena con:
@@ -46,7 +46,7 @@ Si no se indica ninguna descripción: se llena con:
* Código de error (errorCode): (host) en la aplicación local
* Código de error (errorCode): (C00x) en un componente
-### **throw(errorObj)**
+### throw(errorObj)
El objeto *errorObj* permite obtener información de error más detallada y controlar la gestión de errores. Puede contener las siguientes propiedades, así como toda propiedad personalizada a la que pueda hacer referencia la propiedad **message**.
@@ -63,7 +63,7 @@ Cuando se utiliza esta sintaxis, el objeto *errorObj* se devuelve en Últimos er
**Nota:** es posible llamar al comando varias veces en el mismo método proyecto para generar varios errores. Puede utilizar la opción diferido para enviar todos los errores a la vez.
-### **throw**
+### throw
Lanza todos los errores actuales en **modo diferido**, lo que significa que se añadirán a una pila y se gestionarán cuando vuelva el método que los llama. Esto se hace típicamente desde dentro de una retrollamada [ON ERR CALL](../commands/on-err-call).
@@ -113,6 +113,7 @@ throw({componentSignature: "xbox"; errCode: 600; name: "myFileName"; path: "myFi
## Ver también
[ASSERT](../commands/assert)
+[defer](../commands/defer)
[Last errors](../commands/last-errors)
[ON ERR CALL](../commands/on-err-call)
diff --git a/i18n/es/docusaurus-plugin-content-docs/version-21-R2/API/DataClassClass.md b/i18n/es/docusaurus-plugin-content-docs/version-21-R2/API/DataClassClass.md
index deb05751093cd7..6eb287a67a1d2e 100644
--- a/i18n/es/docusaurus-plugin-content-docs/version-21-R2/API/DataClassClass.md
+++ b/i18n/es/docusaurus-plugin-content-docs/version-21-R2/API/DataClassClass.md
@@ -1254,7 +1254,7 @@ var $results := ds.MyClass.query("myVectorField > :1 order by myVectorField"; $c
Si el mismo vector aparece varias veces en la cadena de consulta, el orden por se aplicará a los resultados del primero, por ejemplo:
```4d
-var $results := ds.MyClass.query("myVectorField > :1 and myVectorField > :2 order by myVectorField" desc; /
+var $results := ds.MyClass.query("myVectorField > :1 and myVectorField > :2 order by myVectorField desc"; /
{vector : $myVector1 };{vector : $myVector2 }) //myVectorField > :1 is used for the order by
```
diff --git a/i18n/es/docusaurus-plugin-content-docs/version-21-R3/API/DataClassClass.md b/i18n/es/docusaurus-plugin-content-docs/version-21-R3/API/DataClassClass.md
index 32469ff5304d20..23a47badc0c3da 100644
--- a/i18n/es/docusaurus-plugin-content-docs/version-21-R3/API/DataClassClass.md
+++ b/i18n/es/docusaurus-plugin-content-docs/version-21-R3/API/DataClassClass.md
@@ -1256,7 +1256,7 @@ var $results := ds.MyClass.query("myVectorField > :1 order by myVectorField"; $c
Si el mismo vector aparece varias veces en la cadena de consulta, el orden por se aplicará a los resultados del primero, por ejemplo:
```4d
-var $results := ds.MyClass.query("myVectorField > :1 and myVectorField > :2 order by myVectorField" desc; /
+var $results := ds.MyClass.query("myVectorField > :1 and myVectorField > :2 order by myVectorField desc"; /
{vector : $myVector1 };{vector : $myVector2 }) //myVectorField > :1 is used for the order by
```
diff --git a/i18n/fr/docusaurus-plugin-content-docs/current/API/IMAPTransporterClass.md b/i18n/fr/docusaurus-plugin-content-docs/current/API/IMAPTransporterClass.md
index 921c033da43ca2..1eb40cafa5e608 100644
--- a/i18n/fr/docusaurus-plugin-content-docs/current/API/IMAPTransporterClass.md
+++ b/i18n/fr/docusaurus-plugin-content-docs/current/API/IMAPTransporterClass.md
@@ -1471,6 +1471,10 @@ If ($status.success)
End if
```
+#### Voir également
+
+[`.addFlags()`](#addflags)
+
diff --git a/i18n/fr/docusaurus-plugin-content-docs/current/FormObjects/properties_Text.md b/i18n/fr/docusaurus-plugin-content-docs/current/FormObjects/properties_Text.md
index d2542d339e528b..b23c8ba313491c 100644
--- a/i18n/fr/docusaurus-plugin-content-docs/current/FormObjects/properties_Text.md
+++ b/i18n/fr/docusaurus-plugin-content-docs/current/FormObjects/properties_Text.md
@@ -434,7 +434,84 @@ Par défaut, cette option n'est pas activée.
#### Commandes
-[LISTBOX Get property](../commands/listbox-get-property) - [LISTBOX SET PROPERTY](../commands/listbox-set-property) - [OBJECT Is styled text](../commands/object-is-styled-text) -
+[LISTBOX Get property](../commands/listbox-get-property) - [LISTBOX SET PROPERTY](../commands/listbox-set-property) - [OBJECT Is styled text](../commands/object-is-styled-text)
+
+### Supported tags
+
+You can use the following tags in 4D multi-style text areas.
+
+#### 4D Expression
+
+```html
+
+```
+
+This tag inserts a 4D expression (expression, method, field, variable, command, etc.) in the text. The expression is tokenized and evaluated:
+
+- when the expression is inserted
+- when the object is loaded
+- when the `computeExpressions` standard action is called from an interface object or by the [`INVOKE ACTION`](../commands/invoke-action) command
+- when the [`ST COMPUTE EXPRESSIONS`](../commands/st-compute-expressions) command is executed
+- when the [`ST FREEZE EXPRESSIONS`](../commands/st-freeze-expressions) command is executed, if the second `*` parameter is passed.
+
+The evaluated value of the expression is not saved in the `` tag, only its reference is.
+
+Note: To ensure that expressions will be evaluated correctly regardless of the 4D language or version used, we recommend using the token syntax for elements whose name might vary between different versions (commands, tables, fields, constants). Par exemple, pour insérer la commande `Current time`, entrez `Current time:C178`. For more information about this, refer to *Using tokens in formulas*.
+
+#### Variable URL
+
+```html
+Visible label
+```
+
+This tag inserts a URL in the text. Exemple :
+
+```html
+4D Web Site
+```
+
+#### User link
+
+```html
+Click here
+```
+
+"User links" look the same as URLs, but when you click them, they do not automatically open the source. You can pass any string you want as reference, and it is up to the developer to program any custom actions that occur when it is clicked. This means you can create links which are not URLs but references to files, 4D methods, and so on, that you can open or execute when they are clicked. The [`ST Get content type`](../commands/st-get-content-type) command detects if a user link has been clicked.
+
+User links are defined using the [`ST SET TEXT`](../commands/st-set-text) command. Par exemple :
+
+```4d
+ST SET TEXT(txtVar;"This is a user link: User Label";$start;$end)
+```
+
+#### Custom tags
+
+You can insert any tag in plain text, for example `
`. It is stored in the code of the plain text without being interpreted or displayed. This is particularly useful in the context of e-mails in HTML format and including pictures for example.
+
+#### Style tags
+
+This paragraph lists the attributes of \ tags that are supported by 4D in rich text areas. You can use these tags to implement custom style handling. Only the tags listed below are supported by 4D for style variations.
+
+- Font name: ` ... `
+- Font size: ` ... `
+- Style de police:
+ - Bold ` ... `
+ - Italic ` ... `
+ - Normal ` ... `
+ - Underline ` ... `
+ - Strikethrough `...`
+
+*Note: The "strikethrough" style is not supported under macOS, but this tag can still be managed by programming.*
+
+- Font colors: ` ... ` or `...`
+- Background colors: ` ... ` or `...`
+
+#### Color values
+
+For font color and background color attributes, the color value can be either the hexadecimal code for an RGB color, or the name of one of the 16 HTML colors defined for standard CSS by the W3C:
+
+
+
---
diff --git a/i18n/fr/docusaurus-plugin-content-docs/current/assets/en/FormObjects/colors1.png b/i18n/fr/docusaurus-plugin-content-docs/current/assets/en/FormObjects/colors1.png
new file mode 100644
index 00000000000000..fc0759ba0abc00
Binary files /dev/null and b/i18n/fr/docusaurus-plugin-content-docs/current/assets/en/FormObjects/colors1.png differ
diff --git a/i18n/fr/docusaurus-plugin-content-docs/current/assets/en/FormObjects/colors2.png b/i18n/fr/docusaurus-plugin-content-docs/current/assets/en/FormObjects/colors2.png
new file mode 100644
index 00000000000000..48d25eafd90071
Binary files /dev/null and b/i18n/fr/docusaurus-plugin-content-docs/current/assets/en/FormObjects/colors2.png differ
diff --git a/i18n/fr/docusaurus-plugin-content-docs/current/assets/en/FormObjects/multistyle-ex1.png b/i18n/fr/docusaurus-plugin-content-docs/current/assets/en/FormObjects/multistyle-ex1.png
new file mode 100644
index 00000000000000..715de8bdb44813
Binary files /dev/null and b/i18n/fr/docusaurus-plugin-content-docs/current/assets/en/FormObjects/multistyle-ex1.png differ
diff --git a/i18n/fr/docusaurus-plugin-content-docs/current/assets/en/FormObjects/multistyle-ex2.png b/i18n/fr/docusaurus-plugin-content-docs/current/assets/en/FormObjects/multistyle-ex2.png
new file mode 100644
index 00000000000000..2ea1e2de1b9d12
Binary files /dev/null and b/i18n/fr/docusaurus-plugin-content-docs/current/assets/en/FormObjects/multistyle-ex2.png differ
diff --git a/i18n/fr/docusaurus-plugin-content-docs/current/commands/theme/Styled_Text.md b/i18n/fr/docusaurus-plugin-content-docs/current/commands/theme/Styled_Text.md
index fe90565451a6eb..f3c0b0828d660e 100644
--- a/i18n/fr/docusaurus-plugin-content-docs/current/commands/theme/Styled_Text.md
+++ b/i18n/fr/docusaurus-plugin-content-docs/current/commands/theme/Styled_Text.md
@@ -22,3 +22,94 @@ slug: /commands/theme/Styled-Text
| [](../../commands/st-set-options)
|
| [](../../commands/st-set-plain-text)
|
| [](../../commands/st-set-text)
|
+
+## Working with text handling commands
+
+### Interface utilisateur
+
+The commands that can be used to manipulate text objects by programming do not take any style tags integrated into the text into account. They act upon displayed text only. This concerns the following commands:
+
+- [User Interface](./User_Interface.md) theme commands
+- [`HIGHLIGHT TEXT`](../../commands/highlight-text)
+- [`GET HIGHLIGHT`](../../commands/get-highlight)
+
+When you use these commands with commands that manipulate character strings, it is necessary to filter the formatting characters using the [`ST Get plain text`](../../commands/st-get-plain-text) command:
+
+```4d
+ HIGHLIGHT TEXT([Products]Notes;1;Length(ST Get plain text([Products]Notes))+1)
+```
+
+### Objets (Formulaires)
+
+The commands that can be used to modify the style of objects (for example, [`OBJECT SET FONT`](../../commands/object-set-font)) apply to the whole object and not to the selection.
+
+If the object does not have the focus when the command is executed, the modification is applied simultaneously to the object (the text area) and to its associated variable. If the object does have the focus, the modification is carried out on the object but not on the associated variable. The modification is only applied to the variable when the object loses the focus. Keep this principle in mind when programming text areas.
+
+:::note
+
+If the [**Store with default style tags**](../../FormObjects/properties_Text.md#store-with-default-style-tags) option is checked for the object, the use of these commands will cause a modification of the tags saved with each object.
+
+:::
+
+Note also that only default properties are affected by these commands (as well as any properties saved by means of default tags). Custom style tags remain as they are. For example, given a multi-style area where default tags were saved:
+
+
+
+The plain text of the area is as follows:
+
+```html
+This is the word red
+```
+
+Si vous exécutez le code suivant :
+
+```4d
+OBJECT SET COLOR(*;"myArea";-(Blue+(256*Yellow)))
+```
+
+The red color remains:
+
+
+
+and code is:
+
+```html
+This is the word red
+```
+
+The following commands are concerned:
+
+- [`OBJECT SET RGB COLORS`](../../commands/object-set-rgb-colors)
+- [`OBJECT SET FONT`](../../commands/object-set-font)
+- [`OBJECT SET FONT STYLE`](../../commands/object-set-font-style)
+- [`OBJECT SET FONT SIZE`](../../commands/object-set-font-size)
+
+In the context of multi-style areas, such commands should be used to set default styles only. To manage styles during database execution, we recommend using the commands of the "Styled Text" theme.
+
+### Get edited text
+
+When it is used with a rich text area, the [`Get edited text`](../../commands/get-edited-text) command returns the text of the current area including any style tags.
+
+To retrieve the "plain" text (text without tags) being edited, you must use the [`ST Get plain text`](../../commands/st-get-plain-text) command:
+
+```4d
+ST Get plain text(Get edited text)
+```
+
+### Query and order by commands
+
+Queries and sorts carried out among multi-style objects take into account any style tags saved in the object. If a style modification has been made within a word, searching for the word will not be successful.
+
+To be able to carry out valid searches and sorts, you must use the [`ST Get plain text`](../../commands/st-get-plain-text) command. Par exemple :
+
+```4d
+QUERY BY FORMULA([MyTable];ST Get plain text([MyTable]MyFieldStyle)="very well")
+```
+
+## Automatic normalization of line endings
+
+In order to ensure multi-platform compatibility of texts handled in the database, 4D automatically normalizes line endings so that they occupy a single character: `\r` (carriage return). This normalization is carried out at the level of form objects (variables or fields) hosting plain or multi-style text. Line endings that are not native, or that use a mix of several characters (for example `\r\n`), are considered as a single `\r`.
+
+Note that in compliance with the XML standard (multi-style text format), the multi-style text commands also normalize line endings for text variables that are not associated with objects.
+
+This principle makes it easier to use multi-style text commands or commands such as [`HIGHLIGHT TEXT`](../../commands/highlight-text) in a multi-platform context. However, you must take this into account in your processing when you work with texts from heterogeneous sources.
\ No newline at end of file
diff --git a/i18n/fr/docusaurus-plugin-content-docs/current/commands/theme/System_Documents.md b/i18n/fr/docusaurus-plugin-content-docs/current/commands/theme/System_Documents.md
index 003b1f930d1a06..b98f37d0794dc4 100644
--- a/i18n/fr/docusaurus-plugin-content-docs/current/commands/theme/System_Documents.md
+++ b/i18n/fr/docusaurus-plugin-content-docs/current/commands/theme/System_Documents.md
@@ -63,46 +63,64 @@ When it is called from a [preemptive process](../../Develop/preemptive.md), a *D
## The Document system variable
-`Open document`, `Create document`, `Append document` and `Select document` enable you to access a document using the standard Open or Save file dialog boxes. When you access a document through a standard dialog, 4D returns the full pathname of the document in the [`Document` system variable](../../Concepts/variables.md#system-variables). This system variable has to be distinguished from the *document* parameter that appears in the parameter list of the commands.
+[`Open document`](../../commands/open-document), [`Create document`](../../commands/create-document), [`Append document`](../../commands/append-document`) and [`Select document`](../../commands/select-document) commands enable you to access a document using the standard Open or Save file dialog boxes. When you access a document through a standard dialog, 4D returns the full pathname of the document in the [`Document` system variable](../../Concepts/variables.md#system-variables). This system variable has to be distinguished from the *document* parameter that appears in the parameter list of the commands.
## Absolute or relative pathname
-Most of the routines of this section accept document names, relative pathnames or absolute pathnames:
+Most of the routines of this section accept **document names**, **relative pathnames** or **absolute pathnames**.
+
+- **Relative pathnames** define a location with respect to a folder located on disk. Passing only a document name is considered as using a relative pathname. In 4D, a relative pathname is usually expressed with respect to the [project folder](../../Project/architecture.md#project-folder), i.e. the folder containing the .project file. Relative pathnames are especially useful when deploying applications in heterogenous environments.
+- **Absolute pathnames** define a location with respect to the root of the volume and so they do not depend on the current location of the project folder.
-Relative pathnames define a location with respect to a folder located on disk. Passing only a document name is considered as using a relative pathname. In 4D, a relative pathname is usually expressed with respect to the database folder, i.e. the folder containing the structure file. Relative pathnames are especially useful when deploying applications in heterogenous environments.
-Absolute pathnames define a location with respect to the root of the volume and so they do not depend on the current location of the database folder.
To determine whether a pathname passed to a command must be interpreted as absolute or relative, 4D applies a specific algorithm on each platform.
-Windows
-If the parameter contains only two characters and if the second one is a ':',
-or if the text contains ':' and '\' as the second and third character,
-or if the text starts with "\\",
-then the pathname is absolute.
+### Windows
+
+- If the parameter contains only two characters and if the second one is a ':'
+- or if the text contains ':' and '\' as the second and third character,
+- or if the text starts with "\\",
+- then the pathname is absolute.
In all other cases, the pathname is relative.
-Examples with the CREATE FOLDER command:
+Examples with the [`CREATE FOLDER`](../../commands/create-folder) command:
+
+```4d
+ CREATE FOLDER("lundi") // relative path
+ CREATE FOLDER("\Monday") // relative path
+ CREATE FOLDER("\Monday\Tuesday") // relative path
+ CREATE FOLDER("c:") // absolute path
+ CREATE FOLDER("d:\Monday") // absolute path
+ CREATE FOLDER("\\srv-Internal\temp") // absolute path
+```
+
+:::note
+
+The code editor of 4D allows the use of [escape sequences](../../Concepts/quick-tour.md#escape-sequences). An escape sequence begins with a backslash `\`, followed by a character. For example, `\t` is the escape sequence for the Tab character.
-CREATE FOLDER("lundi") // relative path
-CREATE FOLDER("\Monday") // relative path
-CREATE FOLDER("\Monday\Tuesday") // relative path
-CREATE FOLDER("c:") // absolute path
-CREATE FOLDER("d:\Monday") // absolute path
-CREATE FOLDER("\\srv-Internal\temp") // absolute path
+The `\` character is also used as the separator in pathnames in Windows. In general, 4D will correctly interpret Windows pathnames that are entered in the method editor by replacing single backslashes `\` with double backslashes `\\`. For example, `C:\Folder` will become `C:\\Folder`.
-macOS
-If the text starts with a folder separator ':',
-or if does not contain any,
-then the path is relative.
+However, if you write `C:\MyDocuments\New`, 4D will display `C:\\MyDocuments\New`. In this case, the second `\` is incorrectly interpreted as `\N` (an existing escape sequence). Vous devez donc saisir un double `\\` lorsque vous souhaitez insérer une barre oblique inversée devant un caractère utilisé dans l'une des séquences d'échappement reconnues par 4D.
+
+:::
+
+### macOS
+
+- If the text starts with a folder separator ':',
+- or if does not contain any,
+- then the path is relative.
In all other cases, it is absolute.
-Examples with the CREATE FOLDER command:
+Examples with the [`CREATE FOLDER`](../../commands/create-folder) command:
+
+```4d
-CREATE FOLDER("Monday") // relative path
-CREATE FOLDER("macintosh hd:") // absolute path
-CREATE FOLDER("Monday:Tuesday") // absolute path (a volume must be called Monday)
-CREATE FOLDER(":Monday:Tuesday") // relative path
+ CREATE FOLDER("Monday") // relative path
+ CREATE FOLDER("macintosh hd:") // absolute path
+ CREATE FOLDER("Monday:Tuesday") // absolute path (a volume must be called Monday)
+ CREATE FOLDER(":Monday:Tuesday") // relative path
+```
:::note
@@ -112,8 +130,8 @@ See also [**Absolute and relative pathnames** in the Concepts section](../../Con
## Extracting pathname contents
-You can handle pathname contents using the Path to object and Object to path commands. In particular, using these commands, you can extract from a pathname:
+You can handle pathname contents using the [`Path to object`](../../commands/path-to-object) and [`Object to path`](../../commands/object-to-path) commands. In particular, using these commands, you can extract from a pathname:
-a file name,
-the parent folder path,
-the file or folder extension.
\ No newline at end of file
+- a file name,
+- the parent folder path,
+- the file or folder extension.
\ No newline at end of file
diff --git a/i18n/fr/docusaurus-plugin-content-docs/current/commands/theme/Web_Services_Client.md b/i18n/fr/docusaurus-plugin-content-docs/current/commands/theme/Web_Services_Client.md
index 96b3dba914cc05..0489d9e5b0c38d 100644
--- a/i18n/fr/docusaurus-plugin-content-docs/current/commands/theme/Web_Services_Client.md
+++ b/i18n/fr/docusaurus-plugin-content-docs/current/commands/theme/Web_Services_Client.md
@@ -13,3 +13,9 @@ slug: /commands/theme/Web-Services-Client
| [](../../commands/web-service-get-result)
|
| [](../../commands/web-service-set-option)
|
| [](../../commands/web-service-set-parameter)
|
+
+A Web Service is a set of functions published on a network. These functions can be called and used by any application compatible with Web Services and connected to the network. Web Services can carry out all types of tasks, such as supervising the routing of packages at a transporter’s, e-commerce, monitoring market values, etc.
+
+Subscription to Web Services with 4D is easy to carry out using the [Web Services Wizard](https://doc.4d.com/4Dv21/4D/21/Subscribing-to-a-Web-Service-in-4D.300-7676804.en.html). In most cases, this Wizard will be sufficient for you to be able to use Web Services. However, if you want to customize certain mechanisms, you must use the client SOAP commands of 4D.
+
+Note: By convention, the terms “SOAP” and “Web Service” have been used to differentiate between command (and constant) names on the server and client side, respectively. These two concepts refer to the same technology.
\ No newline at end of file
diff --git a/i18n/fr/docusaurus-plugin-content-docs/current/commands/theme/Web_Services_Server.md b/i18n/fr/docusaurus-plugin-content-docs/current/commands/theme/Web_Services_Server.md
index d4bf174aa6d79b..440c4f0bd797f8 100644
--- a/i18n/fr/docusaurus-plugin-content-docs/current/commands/theme/Web_Services_Server.md
+++ b/i18n/fr/docusaurus-plugin-content-docs/current/commands/theme/Web_Services_Server.md
@@ -12,3 +12,7 @@ slug: /commands/theme/Web-Services-Server
| [](../../commands/soap-reject-new-requests)
|
| [](../../commands/soap-request)
|
| [](../../commands/soap-send-fault)
|
+
+Publication of Web Services with 4D is carried out easily using [options in the method properties](../../Project/project-method-properties.md#web-services). In most cases, this operation will be sufficient to enable you to publish Web Services. However, if you want to customize certain mechanisms, use data arrays, etc., you must use the server SOAP commands of 4D.
+
+Note: By convention, the terms “SOAP” and “Web Service” have been used to differentiate between command (and constant) names on the server and client side, respectively. These two concepts refer to the same technology.
\ No newline at end of file
diff --git a/i18n/fr/docusaurus-plugin-content-docs/current/commands/theme/XML.md b/i18n/fr/docusaurus-plugin-content-docs/current/commands/theme/XML.md
index 2542923df2b336..a778b0ad0fe8c1 100644
--- a/i18n/fr/docusaurus-plugin-content-docs/current/commands/theme/XML.md
+++ b/i18n/fr/docusaurus-plugin-content-docs/current/commands/theme/XML.md
@@ -16,7 +16,7 @@ slug: /commands/theme/XML
:::note
-For XML support, 4D uses a library named Xerces.dll developed by the Apache Foundation company.
+For XML support, 4D uses the [Xerces.dll library](../../Notes/updates.md#library-table) developed by the Apache Foundation company.
:::
diff --git a/i18n/fr/docusaurus-plugin-content-docs/current/commands/theme/XML_DOM.md b/i18n/fr/docusaurus-plugin-content-docs/current/commands/theme/XML_DOM.md
index d90873f85bebef..a514d730a1dccb 100644
--- a/i18n/fr/docusaurus-plugin-content-docs/current/commands/theme/XML_DOM.md
+++ b/i18n/fr/docusaurus-plugin-content-docs/current/commands/theme/XML_DOM.md
@@ -43,25 +43,25 @@ slug: /commands/theme/XML-DOM
| [](../../commands/dom-set-xml-element-name)
|
| [](../../commands/dom-set-xml-element-value)
|
-## Overview of XML DOM Commands
+## Présentation des commandes XML DOM
-See [XML, DOM, and SAX](../theme/XML.md#xml-dom-and-sax) section for a definition of XML DOM.
+Voir la section [XML, DOM et SAX](../theme/XML.md#xml-dom-and-sax) pour une définition de XML DOM.
-### Creating, opening and closing XML documents via DOM
+### Créer, ouvrir et fermer des documents XML via DOM
-Objects created, modified or parsed by the 4D DOM commands can be text, URLs, documents or BLOBs. The DOM commands used for opening XML objects in 4D are [`DOM Parse XML source`](../../commands/dom-parse-xml-source) and [`DOM Parse XML variable`](../../commands/dom-parse-xml-variable).
+Les objets créés, modifiés ou analysés par les commandes DOM de 4D peuvent être des textes, des URLs, des documents ou des BLOBs. Les commandes DOM utilisées pour ouvrir les objets XML dans 4D sont [`DOM Parse XML source`](../../commands/dom-parse-xml-source) et [`DOM Parse XML variable`](../../commands/dom-parse-xml-variable).
-Many commands then let you read, parse and write the elements and attributes. Errors are recovered using the [`XML GET ERROR`](../../commands/xml-get-error) command. Do not forget to call the [`DOM CLOSE XML`](../../commands/dom-close-xml) command to close the source in the end.
+De nombreuses commandes permettent ensuite de lire, d'analyser et d'écrire les éléments et les attributs. Les erreurs sont récupérées à l'aide de la commande [`XML GET ERROR`](../../commands/xml-get-error). N'oubliez pas d'appeler la commande [`DOM CLOSE XML`](../../commands/dom-close-xml) pour fermer la source à la fin.
-Note about use of XML BLOB parameters: For historical reasons, XML commands such as [`DOM Parse XML variable`](../../commands/dom-parse-xml-variable) accept BLOB type parameters. However, it is highly recommended to store XML structures as Text. The use of BLOBs is reserved for processing binary data. In conformity with XML specifications, binary data are automatically encoded in Base64, even when the BLOB contains text.
+Note sur l'usage de paramètres BLOBs XML : Pour des raisons historiques, les commandes XML telles que [`DOM Parse XML variable`](../../commands/dom-parse-xml-variable) acceptent les paramètres de type BLOB. Cependant, il est fortement recommandé de stocker les structures XML sous forme de texte. L'utilisation des BLOBs est réservée au traitement des données binaires. Conformément aux spécifications XML, les données binaires sont automatiquement encodées en Base64, même si le BLOB contient du texte.
-### Support of XPath notation
+### Prise en charge de la notation XPath
-Several XML DOM commands ([`DOM Create XML element`](../../commands/dom-create-xml-element), [`DOM Find XML element`](../../commands/dom-find-xml-element), [`DOM Create XML element arrays`](../../commands/dom-create-xml-element-arrays) and [`DOM SET XML ELEMENT VALUE`](../../commands/dom-set-xml-element-value)) support some XPath expressions for accessing XML elements.
+Plusieurs commandes XML DOM ([`DOM Create XML element`](../../commands/dom-create-xml-element), [`DOM Find XML element`](../../commands/dom-find-xml-element), [`DOM Create XML element arrays`](../../commands/dom-create-xml-element-arrays) et [`DOM SET XML ELEMENT VALUE`](../../commands/dom-set-xml-element-value)) prennent en charge certaines expressions XPath pour accéder aux éléments XML.
-XPath notation comes from the XPath language, designed to navigate within XML structures. It allows the setting of elements directly within an XML structure via a "pathname" type syntax, without necessarily having to indicate the complete pathname in order to reach it.
+La notation XPath provient du langage XPath, conçu pour naviguer dans les structures XML. Elle permet de définir des éléments directement dans une structure XML via une syntaxe de type "pathname", sans qu'il soit nécessaire d'indiquer le chemin complet pour y accéder.
-For example, given the following structure:
+Soit par exemple la structure suivante :
```xml
@@ -73,9 +73,9 @@ For example, given the following structure:
```
-XPath notation allows you to access element 3 using the */RootElement/Elem1/Elem2/Elem3* syntax.
+La notation XPath vous permet d'accéder à l'élément 3 en utilisant la syntaxe */RootElement/Elem1/Elem2/Elem3*.
-4D also accepts indexed XPath elements using the *Element[ElementNum]* syntax. For example, given the following structure:
+4D accepte également les éléments XPath indexés à l'aide de la syntaxe *Element[ElementNum]*. Soit par exemple la structure suivante :
```xml
@@ -87,19 +87,19 @@ XPath notation allows you to access element 3 using the */RootElement/Elem1/Elem
```
-XPath notation allows you to access the "ccc" value using the */RootElement/Elem1/Elem2[3]* syntax.
+La notation XPath vous permet d'accéder à la valeur "ccc" en utilisant la syntaxe */RootElement/Elem1/Elem2[3]*.
-For a comprehensive list of supported XPath expressions, refer to the [`DOM Find XML element`](../../commands/dom-find-xml-element) command description.
+Pour une liste complète des expressions XPath prises en charge, se référer à la description de la commande [`DOM Find XML element`](../../commands/dom-find-xml-element).
:::note Compatibilité
-Starting with 4D 18 R3, the XPath implementation has been modified to be more compliant and to support a wider set of expressions. If you want to benefit from the extended features in your converted databases, you need to select the **Use standard XPath** option of the [Compatibility page](../../settings/compatibility.md).
+À partir de 4D 18 R3, la mise en œuvre de XPath a été modifiée pour être plus conforme et pour prendre en charge un plus grand nombre d'expressions. Si vous souhaitez bénéficier des fonctionnalités étendues dans vos bases de données converties, vous devez sélectionner l'option **Utiliser XPath standard** de la [page de compatibilité](../../settings/compatibility.md).
:::
-### Error Handling
+### Gestion des erreurs
-Many functions in this theme return an XML element reference. If an error occurs during function execution (for example, if the root element reference is not valid), the *OK* variable is set to 0 and an error is generated.
+De nombreuses fonctions de ce thème renvoient une référence à un élément XML. Si une erreur se produit pendant l'exécution de la fonction (par exemple, si la référence à l'élément racine n'est pas valide), la variable *OK* est mise à 0 et une erreur est générée.
-In addition, the reference returned in this case is a sequence of 32 zero "0" characters.
+En outre, la référence renvoyée dans ce cas est une séquence de 32 caractères zéro "0".
diff --git a/i18n/fr/docusaurus-plugin-content-docs/current/language-legacy/Formulas/execute-formula.md b/i18n/fr/docusaurus-plugin-content-docs/current/language-legacy/Formulas/execute-formula.md
index 841dd197b185d2..5a3fa1dffedc69 100644
--- a/i18n/fr/docusaurus-plugin-content-docs/current/language-legacy/Formulas/execute-formula.md
+++ b/i18n/fr/docusaurus-plugin-content-docs/current/language-legacy/Formulas/execute-formula.md
@@ -33,7 +33,7 @@ displayed_sidebar: docs
La chaîne d'instructions doit comporter une seule ligne. Si *instruction* est une chaîne vide, **EXECUTE FORMULA** ne fait rien. Le principe est que si *instruction* peut être exécutée comme une méthode d'une seule ligne, alors elle s'exécutera correctement. La commande **EXECUTE FORMULA** doit être utilisée avec précautions, car elle ralentit la vitesse d'exécution. Dans une base compilée, le code d'*instruction* n'est pas compilé. Cela signifie que l'*instruction* sera bien exécutée, mais ne sera pas vérifiée par le compilateur au moment de la compilation.
-**Note :** L'exécution de formules en mode compilé peut être optimisée à l'aide d'un cache (cf. paragraphe "Cache de formules en mode compilé" ci-dessous).
+**Note :** L'exécution de formules en mode compilé peut être optimisée à l'aide d'un cache (voir [Cache de formules en mode compilé](#cache-de-formules-en-mode-compile) ci-dessous).
L'*instruction* peut notamment contenir les éléments suivants :
@@ -46,7 +46,7 @@ L'*instruction* peut notamment contenir les éléments suivants :
* Si *instruction* est une méthode projet, il est recommandé d'utiliser [EXECUTE METHOD](../commands/execute-method) qui permet de passer des paramètres.
* Il est déconseillé d'appeler des commandes de déclaration de variables telles que *C\_DATE* dans *instruction* afin d'éviter tout risque de conflit de type.
-La formule peut utiliser des variables process et interprocess. En revanche, *instruction* ne doit pas contenir d'instructions de contrôle de flux (Si, Tant que...) car le code doit "tenir" sur une seule ligne.
+La formule peut utiliser des variables process et interprocess. En revanche, *instruction* ne doit pas contenir d'instructions de contrôle de flux (Si, Tant que, Return, Break, etc.) car le code doit "tenir" sur une seule ligne. Ces mots-clés seront ignorés.
Pour assurer une évaluation correcte de l'*instruction* quelle que soit la langue ou la version de 4D, il est recommandé d'utiliser la syntaxe *tokenisée* pour les éléments dont le nom peut varier au fil des versions (commandes, tables, champs, constantes). Par exemple, pour insérer la commande [Current time](../commands/current-time), saisissez '**Current time:C178**'. Pour plus d'informations sur ce point, reportez-vous à la section *Utiliser des tokens dans les formules*.
diff --git a/i18n/fr/docusaurus-plugin-content-docs/current/language-legacy/Formulas/formula.md b/i18n/fr/docusaurus-plugin-content-docs/current/language-legacy/Formulas/formula.md
index 3cb432c80bdb60..eabb4a1eff1df6 100644
--- a/i18n/fr/docusaurus-plugin-content-docs/current/language-legacy/Formulas/formula.md
+++ b/i18n/fr/docusaurus-plugin-content-docs/current/language-legacy/Formulas/formula.md
@@ -32,7 +32,7 @@ displayed_sidebar: docs
## Description
-La commande `Formula` crée un objet `4D Function` basé sur l'expression *formulaExp*. *formulaExp* peut être simple comme une valeur unique ou complexe comme une méthode projet avec des paramètres.
+La commande `Formula` crée un objet `4D Function` basé sur l'expression *formulaExp*. *formulaExp* peut être simple comme une valeur unique ou complexe comme une méthode projet avec des paramètres. Pour plus d'informations sur ce que *formulaExp* peut contenir, consultez la description de la commande [`EXECUTE FORMULA`](../commands/execute-formula).
Le fait d'avoir une formule en tant qu'objet permet de la passer en tant que paramètre (champ calculé) à des commandes ou à des méthodes ou de l'exécuter à partir de divers composants sans avoir à les déclarer comme "partagés par les composants et la base de données hôte". Lorsqu'il est appelé, l'objet formula est évalué dans le contexte de la base de données ou du composant qui l'a créé.
diff --git a/i18n/fr/docusaurus-plugin-content-docs/current/language-legacy/Interruptions/defer.md b/i18n/fr/docusaurus-plugin-content-docs/current/language-legacy/Interruptions/defer.md
new file mode 100644
index 00000000000000..751e148df9b7cf
--- /dev/null
+++ b/i18n/fr/docusaurus-plugin-content-docs/current/language-legacy/Interruptions/defer.md
@@ -0,0 +1,121 @@
+---
+id: defer
+title: defer
+slug: /commands/defer
+displayed_sidebar: docs
+---
+
+**defer** ( *exitFormula* : Expression )
+
+
+
+| Paramètre | Type | | Description |
+| --- | --- | --- | --- |
+| exitFormula | Expression | → | Expression à exécuter à la sortie |
+
+
+
+
+Historique
+
+|Version|Changements|
+|---|---|
+|21 R4|Créé|
+
+
+
+
+## Description
+
+La commande `defer` déclare une expression *exitFormula* qui sera toujours exécutée à la sortie de la méthode ou de la fonction, même si une erreur a été levée ou si un `return` a été exécuté. L'utilisation de `defer` vous permet de garantir qu'une méthode ou une fonction se termine correctement en exécutant du code de finalisation à la sortie. De plus, cette commande évite de dupliquer le même code de sortie dans chaque bloc de retour ou de capture d'erreur.
+
+:::tip Article de blog associé
+
+[Streamline Your Clean-Up Code with the “defer” Command](https://blog.4d.com/streamline-your-clean-up-code-with-the-defer-command)
+
+:::
+
+La commande `defer` peut être appelée n'importe où dans le code d'une méthode ou d'une fonction, et vous pouvez insérer autant d'expressions `defer` que nécessaire. Pendant l'exécution, toutes les expressions *exitFormula* rencontrées sont empilées. Quand l'exécution s'arrête, quelle qu'en soit la raison (flux normal, break, erreur, interruption utilisateur, return...), toutes les expressions de la pile différée sont dépilées et exécutées dans l'ordre LIFO (*Last In First Out*).
+
+Par exemple:
+
+```4d
+defer(ALERT("1"))
+defer(ALERT("2"))
+// A la sortie, les alertes afficheront "2" puis "1"
+```
+
+Dans *exitFormula*, vous passez l'expression à évaluer à la sortie de la méthode ou de la fonction, quelle que soit la manière dont elle se termine. En interne, à chaque appel de `defer`, 4D convertit *exitFormula* en [formula](../../commands/formula) et l'ajoute à une pile associée à la méthode ou à la fonction. Quand la méthode ou la fonction se termine, toutes les formules stockées dans la pile sont évaluées dans l'ordre où elles apparaissent dans la collection.
+
+Comme pour toutes les [formulas](../../commands/formula), si l'expression *exitFormula* utilise des variables locales, leurs valeurs courantes sont copiées et stockées dans l'objet formule retourné **au moment où il est placé dans la pile différée**. Lors de l'exécution, la formule utilise ces valeurs copiées et non les valeurs courantes des variables locales.
+
+:::note Notes
+
+- Gardez à l'esprit que les variables locales stockent des **références** pour les valeurs de type [object](../../Concepts/dt_object.md#assignment) et [collection](../../Concepts/dt_collection.md#assignment).
+- Si *exitFormula* contient une autre instruction `defer`, une erreur est générée.
+
+:::
+
+Si l'expression *exitFormula* génère une erreur, celle-ci est automatiquement interceptée et ignorée, et l'exécution continue sans interruption.
+
+## Exemple 1
+
+Ces exemples illustrent les différentes expressions *exitFormula* prises en charge:
+
+```4d
+// Appel de méthode
+defer(aMethod)
+
+// Appel d'une fonction d'objet
+defer(myObject.aFunction(something))
+
+// Appel d'une fonction singleton
+defer(cs.aClass.me.aFunction(something))
+```
+
+## Exemple 2
+
+Vous voulez vous assurer qu'une référence XML est toujours correctement libérée, afin d'éviter des fuites mémoire potentielles:
+
+```4d
+var $xmlRef:=DOM Create XML ref("theRoot")
+defer(DOM CLOSE XML($xmlRef))
+...
+```
+
+## Exemple 3
+
+Vous voulez vous assurer que la surveillance d'activité s'arrête à la fin de la méthode:
+
+```4d
+START MONITORING ACTIVITY(0.001;Activity all)
+defer(STOP MONITORING ACTIVITY())
+...
+```
+
+## Exemple 4
+
+Vous voulez contrôler la génération de logs:
+
+```4d
+$logRecording:=Get database parameter(Diagnostic log recording)
+SET DATABASE PARAMETER(Diagnostic log recording; 1)
+defer(SET DATABASE PARAMETER(Diagnostic log recording; $logRecording))
+
+$logLevel:=Get database parameter(Diagnostic log level)
+SET DATABASE PARAMETER(Diagnostic log level; Log trace)
+defer(SET DATABASE PARAMETER(Diagnostic log level; $logLevel))
+```
+
+## Voir aussi
+
+[throw](../commands/throw)
+[Last errors](../commands/last-errors)
+[ON ERR CALL](../commands/on-err-call)
+
+## Propriétés
+
+| | |
+| --- | --- |
+| Numéro de commande | 1805 |
+| Thread safe | no |
diff --git a/i18n/fr/docusaurus-plugin-content-docs/current/language-legacy/Interruptions/throw.md b/i18n/fr/docusaurus-plugin-content-docs/current/language-legacy/Interruptions/throw.md
index f895f3edf98ca0..37737d7b011e83 100644
--- a/i18n/fr/docusaurus-plugin-content-docs/current/language-legacy/Interruptions/throw.md
+++ b/i18n/fr/docusaurus-plugin-content-docs/current/language-legacy/Interruptions/throw.md
@@ -41,7 +41,7 @@ Les erreurs générées à l'aide de la commande **throw** sont gérées par le
La commande prend en charge trois syntaxes :
-### **throw(errorCode{; description})**
+### throw(errorCode{; description})
Elle spécifie le code d'erreur et un texte de description facultatif ; l'erreur est immédiatement déclenchée.
Si aucune description n'est fournie, elle est remplie par :
@@ -64,7 +64,7 @@ Lorsque vous utilisez cette syntaxe, l'objet *errorObj* est renvoyé dans [Last
**Note :** Il est possible d'appeler la commande plusieurs fois dans la même méthode de projet pour générer plusieurs erreurs. Vous pouvez utiliser l'option **deferred** pour envoyer toutes les erreurs en une seule fois.
-### **throw**
+### throw
Elle lance toutes les erreurs courantes en ***mode différé***, ce qui signifie qu'elles seront ajoutées à une pile et traitées au retour de la méthode appelante. Ceci est typiquement fait à l'intérieur d'un [ON ERR CALL](../commands/on-err-call) callback.
@@ -116,6 +116,7 @@ throw({componentSignature: "xbox"; errCode: 600; name: "myFileName"; path: "myFi
## Voir aussi
[ASSERT](../commands/assert)
+[defer](../commands/defer)
[Last errors](../commands/last-errors)
[ON ERR CALL](../commands/on-err-call)
diff --git a/i18n/ja/docusaurus-plugin-content-docs/current/API/DataClassClass.md b/i18n/ja/docusaurus-plugin-content-docs/current/API/DataClassClass.md
index a362766ecf2410..bcc626e4d37235 100644
--- a/i18n/ja/docusaurus-plugin-content-docs/current/API/DataClassClass.md
+++ b/i18n/ja/docusaurus-plugin-content-docs/current/API/DataClassClass.md
@@ -1256,7 +1256,7 @@ var $results := ds.MyClass.query("myVectorField > :1 order by myVectorField"; $c
同じベクトルがクエリ文字列内に複数回出現した場合、order by は最初のものの結果に適用されます。例:
```4d
-var $results := ds.MyClass.query("myVectorField > :1 and myVectorField > :2 order by myVectorField" desc; /
+var $results := ds.MyClass.query("myVectorField > :1 and myVectorField > :2 order by myVectorField desc"; /
{vector : $myVector1 };{vector : $myVector2 }) //myVectorField > :1 は order by に使用されます。
```
diff --git a/i18n/ja/docusaurus-plugin-content-docs/current/API/IMAPTransporterClass.md b/i18n/ja/docusaurus-plugin-content-docs/current/API/IMAPTransporterClass.md
index 4f2b8e973d6459..11a642b7aa1341 100644
--- a/i18n/ja/docusaurus-plugin-content-docs/current/API/IMAPTransporterClass.md
+++ b/i18n/ja/docusaurus-plugin-content-docs/current/API/IMAPTransporterClass.md
@@ -1471,6 +1471,10 @@ $flags["$seen"]:=True
$status:=$transporter.removeFlags(IMAP all;$flags)
```
+#### 参照
+
+[`.addFlags()`](#addflags)
+
diff --git a/i18n/ja/docusaurus-plugin-content-docs/current/FormObjects/properties_Text.md b/i18n/ja/docusaurus-plugin-content-docs/current/FormObjects/properties_Text.md
index 67b977cfaf67e6..b8897e912a4815 100644
--- a/i18n/ja/docusaurus-plugin-content-docs/current/FormObjects/properties_Text.md
+++ b/i18n/ja/docusaurus-plugin-content-docs/current/FormObjects/properties_Text.md
@@ -530,7 +530,84 @@ End if
#### コマンド
-[LISTBOX Get property](../commands/listbox-get-property) - [LISTBOX SET PROPERTY](../commands/listbox-set-property) - [OBJECT Is styled text](../commands/object-is-styled-text) -
+[LISTBOX Get property](../commands/listbox-get-property) - [LISTBOX SET PROPERTY](../commands/listbox-set-property) - [OBJECT Is styled text](../commands/object-is-styled-text)
+
+### Supported tags
+
+You can use the following tags in 4D multi-style text areas.
+
+#### 4D Expression
+
+```html
+
+```
+
+This tag inserts a 4D expression (expression, method, field, variable, command, etc.) in the text. The expression is tokenized and evaluated:
+
+- when the expression is inserted
+- when the object is loaded
+- when the `computeExpressions` standard action is called from an interface object or by the [`INVOKE ACTION`](../commands/invoke-action) command
+- when the [`ST COMPUTE EXPRESSIONS`](../commands/st-compute-expressions) command is executed
+- when the [`ST FREEZE EXPRESSIONS`](../commands/st-freeze-expressions) command is executed, if the second `*` parameter is passed.
+
+The evaluated value of the expression is not saved in the `` tag, only its reference is.
+
+Note: To ensure that expressions will be evaluated correctly regardless of the 4D language or version used, we recommend using the token syntax for elements whose name might vary between different versions (commands, tables, fields, constants). たとえば、`Current time` コマンドを挿入するには、"`Current time:C178`"と入力します。 For more information about this, refer to *Using tokens in formulas*.
+
+#### URL
+
+```html
+Visible label
+```
+
+This tag inserts a URL in the text. 例:
+
+```html
+4D Web Site
+```
+
+#### User link
+
+```html
+Click here
+```
+
+"User links" look the same as URLs, but when you click them, they do not automatically open the source. You can pass any string you want as reference, and it is up to the developer to program any custom actions that occur when it is clicked. This means you can create links which are not URLs but references to files, 4D methods, and so on, that you can open or execute when they are clicked. The [`ST Get content type`](../commands/st-get-content-type) command detects if a user link has been clicked.
+
+User links are defined using the [`ST SET TEXT`](../commands/st-set-text) command. 例:
+
+```4d
+ST SET TEXT(txtVar;"This is a user link: User Label";$start;$end)
+```
+
+#### Custom tags
+
+You can insert any tag in plain text, for example `
`. It is stored in the code of the plain text without being interpreted or displayed. This is particularly useful in the context of e-mails in HTML format and including pictures for example.
+
+#### Style tags
+
+This paragraph lists the attributes of \ tags that are supported by 4D in rich text areas. You can use these tags to implement custom style handling. Only the tags listed below are supported by 4D for style variations.
+
+- Font name: ` ... `
+- Font size: ` ... `
+- フォントスタイル:
+ - Bold ` ... `
+ - Italic ` ... `
+ - Normal ` ... `
+ - Underline ` ... `
+ - Strikethrough `...`
+
+*Note: The "strikethrough" style is not supported under macOS, but this tag can still be managed by programming.*
+
+- Font colors: ` ... ` or `...`
+- Background colors: ` ... ` or `...`
+
+#### Color values
+
+For font color and background color attributes, the color value can be either the hexadecimal code for an RGB color, or the name of one of the 16 HTML colors defined for standard CSS by the W3C:
+
+
+
---
diff --git a/i18n/ja/docusaurus-plugin-content-docs/current/assets/en/FormObjects/colors1.png b/i18n/ja/docusaurus-plugin-content-docs/current/assets/en/FormObjects/colors1.png
new file mode 100644
index 00000000000000..fc0759ba0abc00
Binary files /dev/null and b/i18n/ja/docusaurus-plugin-content-docs/current/assets/en/FormObjects/colors1.png differ
diff --git a/i18n/ja/docusaurus-plugin-content-docs/current/assets/en/FormObjects/colors2.png b/i18n/ja/docusaurus-plugin-content-docs/current/assets/en/FormObjects/colors2.png
new file mode 100644
index 00000000000000..48d25eafd90071
Binary files /dev/null and b/i18n/ja/docusaurus-plugin-content-docs/current/assets/en/FormObjects/colors2.png differ
diff --git a/i18n/ja/docusaurus-plugin-content-docs/current/assets/en/FormObjects/multistyle-ex1.png b/i18n/ja/docusaurus-plugin-content-docs/current/assets/en/FormObjects/multistyle-ex1.png
new file mode 100644
index 00000000000000..715de8bdb44813
Binary files /dev/null and b/i18n/ja/docusaurus-plugin-content-docs/current/assets/en/FormObjects/multistyle-ex1.png differ
diff --git a/i18n/ja/docusaurus-plugin-content-docs/current/assets/en/FormObjects/multistyle-ex2.png b/i18n/ja/docusaurus-plugin-content-docs/current/assets/en/FormObjects/multistyle-ex2.png
new file mode 100644
index 00000000000000..2ea1e2de1b9d12
Binary files /dev/null and b/i18n/ja/docusaurus-plugin-content-docs/current/assets/en/FormObjects/multistyle-ex2.png differ
diff --git a/i18n/ja/docusaurus-plugin-content-docs/current/commands/theme/Styled_Text.md b/i18n/ja/docusaurus-plugin-content-docs/current/commands/theme/Styled_Text.md
index ee0c79e1a83032..4a5c2b6c192022 100644
--- a/i18n/ja/docusaurus-plugin-content-docs/current/commands/theme/Styled_Text.md
+++ b/i18n/ja/docusaurus-plugin-content-docs/current/commands/theme/Styled_Text.md
@@ -22,3 +22,94 @@ slug: /commands/theme/Styled-Text
| [](../../commands/st-set-options)
|
| [](../../commands/st-set-plain-text)
|
| [](../../commands/st-set-text)
|
+
+## Working with text handling commands
+
+### ユーザーインターフェース
+
+The commands that can be used to manipulate text objects by programming do not take any style tags integrated into the text into account. They act upon displayed text only. This concerns the following commands:
+
+- [User Interface](./User_Interface.md) theme commands
+- [`HIGHLIGHT TEXT`](../../commands/highlight-text)
+- [`GET HIGHLIGHT`](../../commands/get-highlight)
+
+When you use these commands with commands that manipulate character strings, it is necessary to filter the formatting characters using the [`ST Get plain text`](../../commands/st-get-plain-text) command:
+
+```4d
+ HIGHLIGHT TEXT([Products]Notes;1;Length(ST Get plain text([Products]Notes))+1)
+```
+
+### オブジェクト (フォーム)
+
+The commands that can be used to modify the style of objects (for example, [`OBJECT SET FONT`](../../commands/object-set-font)) apply to the whole object and not to the selection.
+
+If the object does not have the focus when the command is executed, the modification is applied simultaneously to the object (the text area) and to its associated variable. If the object does have the focus, the modification is carried out on the object but not on the associated variable. The modification is only applied to the variable when the object loses the focus. Keep this principle in mind when programming text areas.
+
+:::note
+
+If the [**Store with default style tags**](../../FormObjects/properties_Text.md#store-with-default-style-tags) option is checked for the object, the use of these commands will cause a modification of the tags saved with each object.
+
+:::
+
+Note also that only default properties are affected by these commands (as well as any properties saved by means of default tags). Custom style tags remain as they are. For example, given a multi-style area where default tags were saved:
+
+
+
+The plain text of the area is as follows:
+
+```html
+This is the word red
+```
+
+以下のコードを実行した場合:
+
+```4d
+OBJECT SET COLOR(*;"myArea";-(Blue+(256*Yellow)))
+```
+
+The red color remains:
+
+
+
+and code is:
+
+```html
+This is the word red
+```
+
+The following commands are concerned:
+
+- [`OBJECT SET RGB COLORS`](../../commands/object-set-rgb-colors)
+- [`OBJECT SET FONT`](../../commands/object-set-font)
+- [`OBJECT SET FONT STYLE`](../../commands/object-set-font-style)
+- [`OBJECT SET FONT SIZE`](../../commands/object-set-font-size)
+
+In the context of multi-style areas, such commands should be used to set default styles only. To manage styles during database execution, we recommend using the commands of the "Styled Text" theme.
+
+### Get edited text
+
+When it is used with a rich text area, the [`Get edited text`](../../commands/get-edited-text) command returns the text of the current area including any style tags.
+
+To retrieve the "plain" text (text without tags) being edited, you must use the [`ST Get plain text`](../../commands/st-get-plain-text) command:
+
+```4d
+ST Get plain text(Get edited text)
+```
+
+### Query and order by commands
+
+Queries and sorts carried out among multi-style objects take into account any style tags saved in the object. If a style modification has been made within a word, searching for the word will not be successful.
+
+To be able to carry out valid searches and sorts, you must use the [`ST Get plain text`](../../commands/st-get-plain-text) command. 例:
+
+```4d
+QUERY BY FORMULA([MyTable];ST Get plain text([MyTable]MyFieldStyle)="very well")
+```
+
+## Automatic normalization of line endings
+
+In order to ensure multi-platform compatibility of texts handled in the database, 4D automatically normalizes line endings so that they occupy a single character: `\r` (carriage return). This normalization is carried out at the level of form objects (variables or fields) hosting plain or multi-style text. Line endings that are not native, or that use a mix of several characters (for example `\r\n`), are considered as a single `\r`.
+
+Note that in compliance with the XML standard (multi-style text format), the multi-style text commands also normalize line endings for text variables that are not associated with objects.
+
+This principle makes it easier to use multi-style text commands or commands such as [`HIGHLIGHT TEXT`](../../commands/highlight-text) in a multi-platform context. However, you must take this into account in your processing when you work with texts from heterogeneous sources.
\ No newline at end of file
diff --git a/i18n/ja/docusaurus-plugin-content-docs/current/commands/theme/System_Documents.md b/i18n/ja/docusaurus-plugin-content-docs/current/commands/theme/System_Documents.md
index b70983c4cbf0d3..aa4b3a0ea7af20 100644
--- a/i18n/ja/docusaurus-plugin-content-docs/current/commands/theme/System_Documents.md
+++ b/i18n/ja/docusaurus-plugin-content-docs/current/commands/theme/System_Documents.md
@@ -63,46 +63,64 @@ When it is called from a [preemptive process](../../Develop/preemptive.md), a *D
## The Document system variable
-`Open document`, `Create document`, `Append document` and `Select document` enable you to access a document using the standard Open or Save file dialog boxes. When you access a document through a standard dialog, 4D returns the full pathname of the document in the [`Document` system variable](../../Concepts/variables.md#system-variables). This system variable has to be distinguished from the *document* parameter that appears in the parameter list of the commands.
+[`Open document`](../../commands/open-document), [`Create document`](../../commands/create-document), [`Append document`](../../commands/append-document`) and [`Select document`](../../commands/select-document) commands enable you to access a document using the standard Open or Save file dialog boxes. When you access a document through a standard dialog, 4D returns the full pathname of the document in the [`Document` system variable](../../Concepts/variables.md#system-variables). This system variable has to be distinguished from the *document* parameter that appears in the parameter list of the commands.
## Absolute or relative pathname
-Most of the routines of this section accept document names, relative pathnames or absolute pathnames:
+Most of the routines of this section accept **document names**, **relative pathnames** or **absolute pathnames**.
+
+- **Relative pathnames** define a location with respect to a folder located on disk. Passing only a document name is considered as using a relative pathname. In 4D, a relative pathname is usually expressed with respect to the [project folder](../../Project/architecture.md#project-folder), i.e. the folder containing the .project file. Relative pathnames are especially useful when deploying applications in heterogenous environments.
+- **Absolute pathnames** define a location with respect to the root of the volume and so they do not depend on the current location of the project folder.
-Relative pathnames define a location with respect to a folder located on disk. Passing only a document name is considered as using a relative pathname. In 4D, a relative pathname is usually expressed with respect to the database folder, i.e. the folder containing the structure file. Relative pathnames are especially useful when deploying applications in heterogenous environments.
-Absolute pathnames define a location with respect to the root of the volume and so they do not depend on the current location of the database folder.
To determine whether a pathname passed to a command must be interpreted as absolute or relative, 4D applies a specific algorithm on each platform.
-Windows
-If the parameter contains only two characters and if the second one is a ':',
-or if the text contains ':' and '\' as the second and third character,
-or if the text starts with "\\",
-then the pathname is absolute.
+### Windows
+
+- If the parameter contains only two characters and if the second one is a ':'
+- or if the text contains ':' and '\' as the second and third character,
+- or if the text starts with "\\",
+- then the pathname is absolute.
In all other cases, the pathname is relative.
-Examples with the CREATE FOLDER command:
+Examples with the [`CREATE FOLDER`](../../commands/create-folder) command:
+
+```4d
+ CREATE FOLDER("lundi") // relative path
+ CREATE FOLDER("\Monday") // relative path
+ CREATE FOLDER("\Monday\Tuesday") // relative path
+ CREATE FOLDER("c:") // absolute path
+ CREATE FOLDER("d:\Monday") // absolute path
+ CREATE FOLDER("\\srv-Internal\temp") // absolute path
+```
+
+:::note
+
+The code editor of 4D allows the use of [escape sequences](../../Concepts/quick-tour.md#escape-sequences). An escape sequence begins with a backslash `\`, followed by a character. For example, `\t` is the escape sequence for the Tab character.
-CREATE FOLDER("lundi") // relative path
-CREATE FOLDER("\Monday") // relative path
-CREATE FOLDER("\Monday\Tuesday") // relative path
-CREATE FOLDER("c:") // absolute path
-CREATE FOLDER("d:\Monday") // absolute path
-CREATE FOLDER("\\srv-Internal\temp") // absolute path
+The `\` character is also used as the separator in pathnames in Windows. In general, 4D will correctly interpret Windows pathnames that are entered in the method editor by replacing single backslashes `\` with double backslashes `\\`. For example, `C:\Folder` will become `C:\\Folder`.
-macOS
-If the text starts with a folder separator ':',
-or if does not contain any,
-then the path is relative.
+However, if you write `C:\MyDocuments\New`, 4D will display `C:\\MyDocuments\New`. In this case, the second `\` is incorrectly interpreted as `\N` (an existing escape sequence). 従って、4D のエスケープシーケンスで使用される文字の前にバックスラッシュを挿入したいときは、\ となるよう手入力しなければなりません。
+
+:::
+
+### macOS
+
+- If the text starts with a folder separator ':',
+- or if does not contain any,
+- then the path is relative.
In all other cases, it is absolute.
-Examples with the CREATE FOLDER command:
+Examples with the [`CREATE FOLDER`](../../commands/create-folder) command:
+
+```4d
-CREATE FOLDER("Monday") // relative path
-CREATE FOLDER("macintosh hd:") // absolute path
-CREATE FOLDER("Monday:Tuesday") // absolute path (a volume must be called Monday)
-CREATE FOLDER(":Monday:Tuesday") // relative path
+ CREATE FOLDER("Monday") // relative path
+ CREATE FOLDER("macintosh hd:") // absolute path
+ CREATE FOLDER("Monday:Tuesday") // absolute path (a volume must be called Monday)
+ CREATE FOLDER(":Monday:Tuesday") // relative path
+```
:::note
@@ -112,8 +130,8 @@ See also [**Absolute and relative pathnames** in the Concepts section](../../Con
## Extracting pathname contents
-You can handle pathname contents using the Path to object and Object to path commands. In particular, using these commands, you can extract from a pathname:
+You can handle pathname contents using the [`Path to object`](../../commands/path-to-object) and [`Object to path`](../../commands/object-to-path) commands. In particular, using these commands, you can extract from a pathname:
-a file name,
-the parent folder path,
-the file or folder extension.
\ No newline at end of file
+- a file name,
+- the parent folder path,
+- the file or folder extension.
\ No newline at end of file
diff --git a/i18n/ja/docusaurus-plugin-content-docs/current/commands/theme/Web_Services_Client.md b/i18n/ja/docusaurus-plugin-content-docs/current/commands/theme/Web_Services_Client.md
index 4328b6aac8dd04..0162ca6d62b445 100644
--- a/i18n/ja/docusaurus-plugin-content-docs/current/commands/theme/Web_Services_Client.md
+++ b/i18n/ja/docusaurus-plugin-content-docs/current/commands/theme/Web_Services_Client.md
@@ -13,3 +13,9 @@ slug: /commands/theme/Web-Services-Client
| [](../../commands/web-service-get-result)
|
| [](../../commands/web-service-set-option)
|
| [](../../commands/web-service-set-parameter)
|
+
+A Web Service is a set of functions published on a network. These functions can be called and used by any application compatible with Web Services and connected to the network. Web Services can carry out all types of tasks, such as supervising the routing of packages at a transporter’s, e-commerce, monitoring market values, etc.
+
+Subscription to Web Services with 4D is easy to carry out using the [Web Services Wizard](https://doc.4d.com/4Dv21/4D/21/Subscribing-to-a-Web-Service-in-4D.300-7676804.en.html). In most cases, this Wizard will be sufficient for you to be able to use Web Services. However, if you want to customize certain mechanisms, you must use the client SOAP commands of 4D.
+
+Note: By convention, the terms “SOAP” and “Web Service” have been used to differentiate between command (and constant) names on the server and client side, respectively. These two concepts refer to the same technology.
\ No newline at end of file
diff --git a/i18n/ja/docusaurus-plugin-content-docs/current/commands/theme/Web_Services_Server.md b/i18n/ja/docusaurus-plugin-content-docs/current/commands/theme/Web_Services_Server.md
index 839686cde20e41..ccb541760650a1 100644
--- a/i18n/ja/docusaurus-plugin-content-docs/current/commands/theme/Web_Services_Server.md
+++ b/i18n/ja/docusaurus-plugin-content-docs/current/commands/theme/Web_Services_Server.md
@@ -12,3 +12,7 @@ slug: /commands/theme/Web-Services-Server
| [](../../commands/soap-reject-new-requests)
|
| [](../../commands/soap-request)
|
| [](../../commands/soap-send-fault)
|
+
+Publication of Web Services with 4D is carried out easily using [options in the method properties](../../Project/project-method-properties.md#web-services). In most cases, this operation will be sufficient to enable you to publish Web Services. However, if you want to customize certain mechanisms, use data arrays, etc., you must use the server SOAP commands of 4D.
+
+Note: By convention, the terms “SOAP” and “Web Service” have been used to differentiate between command (and constant) names on the server and client side, respectively. These two concepts refer to the same technology.
\ No newline at end of file
diff --git a/i18n/ja/docusaurus-plugin-content-docs/current/commands/theme/XML.md b/i18n/ja/docusaurus-plugin-content-docs/current/commands/theme/XML.md
index 54fc67be87e6d3..7494f5e35e76f0 100644
--- a/i18n/ja/docusaurus-plugin-content-docs/current/commands/theme/XML.md
+++ b/i18n/ja/docusaurus-plugin-content-docs/current/commands/theme/XML.md
@@ -16,7 +16,7 @@ slug: /commands/theme/XML
:::note
-For XML support, 4D uses a library named Xerces.dll developed by the Apache Foundation company.
+For XML support, 4D uses the [Xerces.dll library](../../Notes/updates.md#library-table) developed by the Apache Foundation company.
:::
diff --git a/i18n/ja/docusaurus-plugin-content-docs/current/language-legacy/Formulas/execute-formula.md b/i18n/ja/docusaurus-plugin-content-docs/current/language-legacy/Formulas/execute-formula.md
index 7c56de0c71f14e..11ae99210ed996 100644
--- a/i18n/ja/docusaurus-plugin-content-docs/current/language-legacy/Formulas/execute-formula.md
+++ b/i18n/ja/docusaurus-plugin-content-docs/current/language-legacy/Formulas/execute-formula.md
@@ -33,7 +33,7 @@ displayed_sidebar: docs
ステートメントの文字列は必ず1行だけです。*statement* に空の文字列を指定した場合、**EXECUTE FORMULA**コマンドは何も行いません。*statement* が一行のメソッドとして実行されるかぎり、それは正しく実行される、というのが大原則です。**EXECUTE FORMULA** は実行速度を低下させるので、代替え手段として利用します。コンパイル済みデータベースにおいても、そのコードはコンパイルされていません。つまり*statement*は実行されますが、コンパイル時にコンパイラによるチェックはされません。
-**注:** コンパイル済みモードでのフォーミュラの実行はキャッシュを使用する事によって最適化することができます(以下の*コンパイル済みモードでのフォーミュラのキャッシュ*を参照して下さい)。
+**注:** コンパイル済みモードでのフォーミュラの実行はキャッシュを使用する事によって最適化することができます(以下の[コンパイル済みモードでのフォーミュラのキャッシュ](#コンパイル済みモードでのフォーミュラのキャッシュ)を参照して下さい)。
*statement* には以下をの要素を含めることができます:
@@ -46,7 +46,7 @@ displayed_sidebar: docs
* *statement* がプロジェクトメソッドである場合、引数を渡すことのできる[EXECUTE METHOD](../commands/execute-method) を使用することが推奨されます。
* *statement* 内にて、例えば*C\_DATE* のような、変数の宣言コマンドを呼び出すことは推奨されていません。コード内で衝突を起こす可能性があるためです。
-フォーミュラにはプロセス変数とインタープロセス変数を含めることができます。しかし*statement*は1行でなければならないため、(*If*, While, などの) フローコントロールを含めることはできません。
+フォーミュラにはプロセス変数とインタープロセス変数を含めることができます。しかし*statement*は1行でなければならないため、(*If*, While, Return, Break, などの) フローコントロールを含めることはできません。これらのキーワードは無視されます。
使用する4Dの言語やバージョンやに関わらず、*statement* が正常に評価されると言う事を保証するためには、異なるバージョン間において名前が変化する可能性のある要素(コマンド、テーブル、フィールド、定数)に対しては*トークン*シンタックスを使用する事が推奨されます。例えば、[Current time](../commands/current-time)コマンドを挿入するためには'**Current time:C178**'と入力します。この点についてのより詳細な情報については、*フォーミュラ内でのトークンの使用*を参照して下さい。
diff --git a/i18n/ja/docusaurus-plugin-content-docs/current/language-legacy/Formulas/formula.md b/i18n/ja/docusaurus-plugin-content-docs/current/language-legacy/Formulas/formula.md
index 944dd7383730e8..de9a038733e8b9 100644
--- a/i18n/ja/docusaurus-plugin-content-docs/current/language-legacy/Formulas/formula.md
+++ b/i18n/ja/docusaurus-plugin-content-docs/current/language-legacy/Formulas/formula.md
@@ -32,7 +32,7 @@ displayed_sidebar: docs
## 説明
-`Formula` コマンドは、 *formulaExp* の式に基づいた `4D Function` オブジェクトを作成します。 *formulaExp* には単一の値のようにシンプルなものから、引数を持つプロジェクトメソッドのように複雑なものまで指定することができます。
+`Formula` コマンドは、 *formulaExp* の式に基づいた `4D Function` オブジェクトを作成します。 *formulaExp* には単一の値のようにシンプルなものから、引数を持つプロジェクトメソッドのように複雑なものまで指定することができます。*formulaExp* に含められる内容の詳細については、[`EXECUTE FORMULA`](../commands/execute-formula) コマンドの説明を参照してください。
フォーミュラがオブジェクトとして存在することで、コマンドやメソッドに対して引数 (計算された属性) として渡したり、"コンポーネントとホストデータベース間で共有" として宣言せずとも様々なコンポーネントから実行したりできるようになります。 呼び出されたフォーミュラオブジェクトは、それを作成したデータベースあるいはコンポーネントのコンテキストにおいて評価されます。
diff --git a/i18n/ja/docusaurus-plugin-content-docs/current/language-legacy/Interruptions/defer.md b/i18n/ja/docusaurus-plugin-content-docs/current/language-legacy/Interruptions/defer.md
new file mode 100644
index 00000000000000..c93006f5020977
--- /dev/null
+++ b/i18n/ja/docusaurus-plugin-content-docs/current/language-legacy/Interruptions/defer.md
@@ -0,0 +1,121 @@
+---
+id: defer
+title: defer
+slug: /commands/defer
+displayed_sidebar: docs
+---
+
+**defer** ( *exitFormula* : Expression )
+
+
+
+| 引数 | 型 | | 説明 |
+| --- | --- | --- | --- |
+| exitFormula | Expression | → | 終了時に実行される式 |
+
+
+
+
+履歴
+
+|リリース|内容|
+|---|---|
+|21 R4|追加|
+
+
+
+
+## 説明
+
+`defer` コマンドは、*exitFormula* 式を宣言します。これはメソッドまたは関数の終了時に必ず実行され、エラーがスローされた場合や `return` が実行された場合でも実行されます. `defer` を使用すると、終了時に後処理コードを実行して、メソッドや関数を正しく終了させることができます。さらに、各 return や catch ブロックで同じ終了コードを重複して記述する必要がなくなります。
+
+:::tip 関連ブログ記事
+
+[Streamline Your Clean-Up Code with the “defer” Command](https://blog.4d.com/streamline-your-clean-up-code-with-the-defer-command)
+
+:::
+
+`defer` コマンドはメソッドまたは関数コード内の任意の場所で呼び出すことができ、必要な数だけ `defer` 式を記述できます。実行中に見つかった *exitFormula* 式はすべてスタックに積まれます。実行が停止すると、その理由が通常フロー、break、エラー、ユーザー中断、return などのいずれであっても、遅延スタック内の式が LIFO (*Last In First Out*) 順で取り出されて実行されます。
+
+例:
+
+```4d
+defer(ALERT("1"))
+defer(ALERT("2"))
+// 終了時に "2"、次に "1" の順でアラートが表示されます
+```
+
+*exitFormula* には、メソッドまたは関数終了時に評価させたい式を渡します。終了理由は問いません。内部的には、`defer` が呼ばれるたびに 4D は *exitFormula* を [formula](../../commands/formula) に変換し、メソッドまたは関数に関連付けられたスタックへ追加します。メソッドまたは関数が終了すると、スタックに保存されたすべての formula がコレクション内の順序に従って評価されます。
+
+すべての [formulas](../../commands/formula) と同様に、*exitFormula* がローカル変数を使用している場合、その時点の値は **遅延スタックに格納されるタイミングで** 返される formula オブジェクトへコピーされて保存されます。実行時には、ローカル変数の現在値ではなく、コピーされた値が使用されます。
+
+:::note 注記
+
+- ローカル変数は [object](../../Concepts/dt_object.md#assignment) 値および [collection](../../Concepts/dt_collection.md#assignment) 値について **参照** を保持することに注意してください。
+- *exitFormula* に別の `defer` ステートメントが含まれている場合、エラーがスローされます。
+
+:::
+
+*exitFormula* がエラーをスローした場合、そのエラーは自動的に補足されて無視され、実行フローは中断せずに継続します。
+
+## 例題 1
+
+以下は、サポートされる *exitFormula* 式の例です:
+
+```4d
+// メソッド呼び出し
+defer(aMethod)
+
+// オブジェクト関数呼び出し
+defer(myObject.aFunction(something))
+
+// シングルトン関数呼び出し
+defer(cs.aClass.me.aFunction(something))
+```
+
+## 例題 2
+
+メモリーリークの可能性を避けるため、XML 参照を必ず適切に解放したい場合:
+
+```4d
+var $xmlRef:=DOM Create XML ref("theRoot")
+defer(DOM CLOSE XML($xmlRef))
+...
+```
+
+## 例題 3
+
+メソッドの終了時にアクティビティ監視を確実に停止したい場合:
+
+```4d
+START MONITORING ACTIVITY(0.001;Activity all)
+defer(STOP MONITORING ACTIVITY())
+...
+```
+
+## 例題 4
+
+ログ出力を制御したい場合:
+
+```4d
+$logRecording:=Get database parameter(Diagnostic log recording)
+SET DATABASE PARAMETER(Diagnostic log recording; 1)
+defer(SET DATABASE PARAMETER(Diagnostic log recording; $logRecording))
+
+$logLevel:=Get database parameter(Diagnostic log level)
+SET DATABASE PARAMETER(Diagnostic log level; Log trace)
+defer(SET DATABASE PARAMETER(Diagnostic log level; $logLevel))
+```
+
+## 参照
+
+[throw](../commands/throw)
+[Last errors](../commands/last-errors)
+[ON ERR CALL](../commands/on-err-call)
+
+## プロパティ
+
+| | |
+| --- | --- |
+| コマンド番号 | 1805 |
+| スレッドセーフである | no |
diff --git a/i18n/ja/docusaurus-plugin-content-docs/current/language-legacy/Interruptions/throw.md b/i18n/ja/docusaurus-plugin-content-docs/current/language-legacy/Interruptions/throw.md
index 29fe950e20a601..c8948d6d6fa31d 100644
--- a/i18n/ja/docusaurus-plugin-content-docs/current/language-legacy/Interruptions/throw.md
+++ b/i18n/ja/docusaurus-plugin-content-docs/current/language-legacy/Interruptions/throw.md
@@ -39,7 +39,7 @@ displayed_sidebar: docs
このコマンドは 3つのシンタックスをサポートしています:
-### **throw(errorCode{; description})**
+### throw(errorCode{; description})
このシンタックスでは、エラーコードと説明のテキスト (任意) を指定し、エラーは即座にスローされます。
description 引数を渡さなかった場合には、次の情報が提示されます:
@@ -47,7 +47,7 @@ description 引数を渡さなかった場合には、次の情報が提示さ
* ホストアプリケーションでは: Error code {errorCode}: (host)
* コンポーネントでは: Error code {errorCode}: (C00x)
-### **throw(errorObj)**
+### throw(errorObj)
*errorObj* オブジェクト引数を使うことで、エラー情報をより詳細に指定し、エラー処理の管理をさらに強化できます。このオブジェクト引数には以下のプロパティのほか、**message**プロパティのプレースホルダーを置き換えるためのカスタムプロパティを含めることができます。
@@ -62,7 +62,7 @@ description 引数を渡さなかった場合には、次の情報が提示さ
**注記:** 同じプロジェクトメソッド内でこのコマンドを複数回呼び出して、複数のエラーを生成することができます。遅延モードを使って、これらのエラーを一度にスローできます。
-### **throw**
+### throw
このシンタックスは、カレントエラーをすべて**遅延モード**でスローします。つまり、これらのエラーはエラースタックに追加され、カレントメソッド終了時に処理されます。これは通常、[ON ERR CALL](../commands/on-err-call) コールバック内でおこなわれます。
@@ -112,6 +112,7 @@ throw({componentSignature: "xbox"; errCode: 600; name: "myFileName"; path: "myFi
## 参照
[ASSERT](../commands/assert)
+[defer](../commands/defer)
[Last errors](../commands/last-errors)
[ON ERR CALL](../commands/on-err-call)
diff --git a/i18n/ja/docusaurus-plugin-content-docs/version-20/API/CryptoKeyClass.md b/i18n/ja/docusaurus-plugin-content-docs/version-20/API/CryptoKeyClass.md
index 68a069e4f67aa8..e12d75818ae7bf 100644
--- a/i18n/ja/docusaurus-plugin-content-docs/version-20/API/CryptoKeyClass.md
+++ b/i18n/ja/docusaurus-plugin-content-docs/version-20/API/CryptoKeyClass.md
@@ -45,10 +45,10 @@ title: CryptoKey
-|Parameter|Type||Description|
+|引数|型||説明|
|---|---|----|---|
-|settings|Object|->|Settings to generate or load a key pair|
-|Result|4D.CryptoKey|<-|Object encapsulating an encryption key pair|
+|settings|Object|->|キーペアを生成または読み込むための設定|
+|戻り値|4D.CryptoKey|<-|Object encapsulating an encryption key pair|
@@ -164,11 +164,11 @@ ECDSA キーのみ: キーの楕円曲線
-|Parameter|Type||Description|
+|引数|型||説明|
|---|---|----|---|
-|message|Text|->|Message string to be decoded using `options.encodingEncrypted` and decrypted.|
-|options|Object|->|Decoding options|
-|Result|Object|<-|Status|
+|message|Text|->|`options.encodingEncrypted` を使用して暗号化し、復号化されるメッセージ。|
+|options|Object|->|復号化のオプション|
+|戻り値|Object|<-|Status|
@@ -213,11 +213,11 @@ ECDSA キーのみ: キーの楕円曲線
-|Parameter|Type||Description|
+|引数|型||説明|
|---|---|----|---|
-|message|Text|->|Message string to be encoded using `options.encodingDecrypted` and encrypted.|
-|options|Object|->|Encoding options|
-|Result|Text|<-|Message encrypted and encoded using the `options.encodingEncrypted`|
+|message|Text|->|`options.encodingDecrypted` を使用して暗号化し、符号化されるメッセージ。|
+|options|Object|->|エンコードのオプション|
+|戻り値|Text|<-|Message encrypted and encoded using the `options.encodingEncrypted`|
@@ -254,9 +254,9 @@ ECDSA キーのみ: キーの楕円曲線
-|Parameter|Type||Description|
+|引数|型||説明|
|---|---|----|---|
-|Result|Text|<-|Private key in PEM format|
+|戻り値|Text|<-|Private key in PEM format|
@@ -283,9 +283,9 @@ ECDSA キーのみ: キーの楕円曲線
-|Parameter|Type||Description|
+|引数|型||説明|
|---|----|---|---|
-|Result|Text|<-|Public key in PEM format|
+|戻り値|Text|<-|Public key in PEM format|
@@ -331,11 +331,11 @@ ECDSA キーのみ: キーの楕円曲線
-|Parameter|Type||Description|
+|引数|型||説明|
|---|----|---|---|
-|message|Text OR Blob|->|Message to sign|
-|options|Object|->|Signing options|
-|Result|Text|<-|Signature in Base64 or Base64URL representation, depending on "encoding" option|
+|message|Text OR Blob|->|署名するメッセージ|
+|options|Object|->|署名オプション|
+|戻り値|Text|<-|Signature in Base64 or Base64URL representation, depending on "encoding" option|
@@ -413,12 +413,12 @@ RSA キーのみ: キーのサイズ (ビッ
-|Parameter|Type||Description|
+|引数|型||説明|
|---|---|---|---|
-|message|Text OR Blob|->|Message that was used to produce the signature|
-|signature|Text|->|Signature to verify, in Base64 or Base64URL representation, depending on `options.encoding` value|
-|options|Object|->|Signing options|
-|Result|Object|<-|Status of the verification|
+|message|Text OR Blob|->|署名を生成するために使用されたメッセージ|
+|signature|Text|->|検証する署名、`options.encoding` の値に応じてBase64 または Base64URL 形式|
+|options|Object|->|署名オプション|
+|戻り値|Object|<-|Status of the verification|
diff --git a/i18n/ja/docusaurus-plugin-content-docs/version-20/API/DataClassClass.md b/i18n/ja/docusaurus-plugin-content-docs/version-20/API/DataClassClass.md
index 06ddd7b0eae1a1..66ed8071e7bbb7 100644
--- a/i18n/ja/docusaurus-plugin-content-docs/version-20/API/DataClassClass.md
+++ b/i18n/ja/docusaurus-plugin-content-docs/version-20/API/DataClassClass.md
@@ -137,10 +137,10 @@ var $firstnameAtt;$employerAtt;$employeesAtt : Object
-|Parameter|Type||Description|
+|引数|型||説明|
|---------|--- |:---:|------|
-|settings|Object|->|Build option: context|
-|Result|4D.EntitySelection|<-|References on all entities related to the Dataclass|
+|settings|Object|->|ビルドオプション: context|
+|戻り値|4D.EntitySelection|<-|References on all entities related to the Dataclass|
@@ -188,9 +188,9 @@ var $firstnameAtt;$employerAtt;$employeesAtt : Object
-|Parameter|Type||Description|
+|引数|型||説明|
|---------|--- |:---:|------|
-||||Does not require any parameters|
+||||引数を必要としません|
@@ -245,11 +245,11 @@ $ds.Persons.clearRemoteCache()
-|Parameter|Type||Description|
+|引数|型||説明|
|---------|--- |:---:|------|
-|objectCol |Collection|->|Collection of objects to be mapped with entities|
-|settings |Object|->|Build option: context|
-|Result|4D.EntitySelection|<-|Entity selection filled from the collection|
+|objectCol |Collection|->|エンティティにマップするオブジェクトのコレクション|
+|settings |Object|->|ビルドオプション: context|
+|戻り値|4D.EntitySelection|<-|Entity selection filled from the collection|
@@ -445,11 +445,11 @@ $ds.Persons.clearRemoteCache()
-|Parameter|Type||Description|
+|引数|型||説明|
|---------|--- |:---:|------|
-|primaryKey |Integer OR Text|->|Primary key value of the entity to retrieve|
-|settings |Object|->|Build option: context|
-|Result|4D.Entity|<-|Entity matching the designated primary key|
+|primaryKey |Integer OR Text|->|取得するエンティティのプライマリーキー値|
+|settings |Object|->|ビルドオプション: context|
+|戻り値|4D.Entity|<-|Entity matching the designated primary key|
@@ -530,9 +530,9 @@ $ds.Persons.clearRemoteCache()
-|Parameter|Type||Description|
+|引数|型||説明|
|---|---|---|---|
-|result|Integer|<-|Number of entities in the dataclass|
+|戻り値|Integer|<-|Number of entities in the dataclass|
@@ -572,9 +572,9 @@ $number:=$ds.Persons.getCount()
-|Parameter|Type||Description|
+|引数|型||説明|
|---------|--- |:---:|------|
-|Result|cs.DataStore|<-|Datastore of the dataclass|
+|戻り値|cs.DataStore|<-|Datastore of the dataclass|
@@ -628,9 +628,9 @@ $number:=$ds.Persons.getCount()
-|Parameter|Type||Description|
+|引数|型||説明|
|---|---|---|---|
-|Result|Object|<-|Information on the dataclass|
+|戻り値|Object|<-|Information on the dataclass|
@@ -703,9 +703,9 @@ $number:=$ds.Persons.getCount()
-|Parameter|Type||Description|
+|引数|型||説明|
|---|---|---|---|
-|result|Object|<-|Object describing the contents of the ORDA cache for the dataclass.|
+|戻り値|Object|<-|Object describing the contents of the ORDA cache for the dataclass.|
@@ -796,9 +796,9 @@ $cacheAddress:=$ds.Adress.getRemoteCache()
-|Parameter|Type||Description|
+|引数|型||説明|
|---|---|---|---|
-|Result|4D.Entity|<-|New entity matching the Dataclass|
+|戻り値|4D.Entity|<-|New entity matching the Dataclass|
@@ -844,10 +844,10 @@ $cacheAddress:=$ds.Adress.getRemoteCache()
-|Parameter|Type||Description|
+|引数|型||説明|
|---|---|---|---|
-|keepOrder |Integer |-> |`dk keep ordered`: creates an ordered entity selection,
`dk non ordered`: creates an unordered entity selection (default if omitted) |
-|Result|4D.EntitySelection|<-|New blank entity selection related to the dataclass|
+|keepOrder |Integer |-> |`dk keep ordered`: 順列ありのエンティティセレクションを作成します
`dk non ordered`: (あるいは省略時): 順列なしのエンティティセレクションを作成します|
+|戻り値|4D.EntitySelection|<-|New blank entity selection related to the dataclass|
@@ -890,13 +890,13 @@ $cacheAddress:=$ds.Adress.getRemoteCache()
-|Parameter|Type||Description|
+|引数|型||説明|
|---|---|---|---|
-|queryString |Text |-> |Search criteria as string|
-|formula |Object |-> |Search criteria as formula object|
-|value|any|->|Value(s) to use for indexed placeholder(s)|
-|querySettings|Object|->|Query options: parameters, attributes, args, allowFormulas, context, queryPath, queryPlan|
-|Result|4D.EntitySelection|<-|New entity selection made up of entities from dataclass meeting the search criteria specified in *queryString* or *formula*|
+|queryString |Text |-> |検索条件 (文字列)|
+|formula |Object |-> |検索条件 (フォーミュラオブジェクト)|
+|value|any|->|インデックスプレースホルダーで使用する値|
+|querySettings|Object|->|クエリオプション: parameters、 attributes、 args、 allowFormulas、 context、 queryPath、 queryPlan|
+|戻り値|4D.EntitySelection|<-|New entity selection made up of entities from dataclass meeting the search criteria specified in *queryString* or *formula*|
@@ -1572,9 +1572,9 @@ softwares:{
-|Parameter|Type||Description|
+|引数|型||説明|
|---|---|---|---|
-|settings|Object|->|Object that sets the timeout and maximum size of the ORDA cache for the dataclass.|
+|settings|Object|->|データクラスに対して、タイムアウトとORDA キャッシュの最大サイズを指定するオブジェクト|
diff --git a/i18n/ja/docusaurus-plugin-content-docs/version-20/API/DataStoreClass.md b/i18n/ja/docusaurus-plugin-content-docs/version-20/API/DataStoreClass.md
index 8dc1f76f286b4e..5eb0c365e18fca 100644
--- a/i18n/ja/docusaurus-plugin-content-docs/version-20/API/DataStoreClass.md
+++ b/i18n/ja/docusaurus-plugin-content-docs/version-20/API/DataStoreClass.md
@@ -49,10 +49,10 @@ title: DataStore
-|Parameter|Type||Description|
+|引数|型||説明|
|---|---|---|---|
-|localID|Text|->|Local ID of the remote datastore to return|
-|Result |cs.DataStore|<-|Reference to the datastore|
+|localID|Text|->|参照を取得したいリモートデータストアのローカルID|
+|戻り値|cs.DataStore|<-|Reference to the datastore|
@@ -263,9 +263,9 @@ ALERT("They are "+String($foreignStudents.Students.all().length)+" foreign stude
-|Parameter|Type||Description|
+|引数|型||説明|
|---------|--- |:---:|------|
-||||Does not require any parameters|
+||||引数を必要としません|
@@ -299,9 +299,9 @@ ALERT("They are "+String($foreignStudents.Students.all().length)+" foreign stude
-|Parameter|Type||Description|
+|引数|型||説明|
|---------|--- |:---:|------|
-||||Does not require any parameters|
+||||引数を必要としません|
@@ -812,9 +812,9 @@ ORDAリクエストログのフォーマットの詳細は、[**ORDAクライア
-|Parameter|Type||Description|
+|引数|型||説明|
|---------|--- |:---:|------|
-||||Does not require any parameters|
+||||引数を必要としません|
diff --git a/i18n/ja/docusaurus-plugin-content-docs/version-20/API/EntitySelectionClass.md b/i18n/ja/docusaurus-plugin-content-docs/version-20/API/EntitySelectionClass.md
index 8bd86e2a650cc8..65559d4afcf148 100644
--- a/i18n/ja/docusaurus-plugin-content-docs/version-20/API/EntitySelectionClass.md
+++ b/i18n/ja/docusaurus-plugin-content-docs/version-20/API/EntitySelectionClass.md
@@ -2001,9 +2001,9 @@ pathObjects コレクションには必要な数だけオブジェクトを追
-|Parameter|Type||Description|
+|引数|型||説明|
|---------|--- |:---:|------|
-||||Does not require any parameters|
+||||引数を必要としません|
diff --git a/i18n/ja/docusaurus-plugin-content-docs/version-20/API/FileClass.md b/i18n/ja/docusaurus-plugin-content-docs/version-20/API/FileClass.md
index 70c54bf6bcd0cc..56dca04fa25259 100644
--- a/i18n/ja/docusaurus-plugin-content-docs/version-20/API/FileClass.md
+++ b/i18n/ja/docusaurus-plugin-content-docs/version-20/API/FileClass.md
@@ -336,9 +336,9 @@ Windows 上では、常にショートカット (.lnk ファイル) が作成さ
-|Parameter|Type||Description|
+|引数|型||説明|
|---|---|---|---|
-|Result|Object|<-|Contents of .exe/.dll version resource or .plist file|
+|戻り値|Object|<-|Contents of .exe/.dll version resource or .plist file|
diff --git a/i18n/ja/docusaurus-plugin-content-docs/version-20/API/HTTPRequestClass.md b/i18n/ja/docusaurus-plugin-content-docs/version-20/API/HTTPRequestClass.md
index 5a06a5bce01e9e..6d6c054150ef67 100644
--- a/i18n/ja/docusaurus-plugin-content-docs/version-20/API/HTTPRequestClass.md
+++ b/i18n/ja/docusaurus-plugin-content-docs/version-20/API/HTTPRequestClass.md
@@ -319,9 +319,9 @@ authentication オブジェクトは `options.serverAuthentication` または `o
-|Parameter|Type||Description|
+|引数|型||説明|
|---------|--- |:---:|------|
-||||Does not require any parameters|
+||||引数を必要としません|
diff --git a/i18n/ja/docusaurus-plugin-content-docs/version-20/API/POP3TransporterClass.md b/i18n/ja/docusaurus-plugin-content-docs/version-20/API/POP3TransporterClass.md
index 3e2ba09a52f5cd..ce600ba21bcf1d 100644
--- a/i18n/ja/docusaurus-plugin-content-docs/version-20/API/POP3TransporterClass.md
+++ b/i18n/ja/docusaurus-plugin-content-docs/version-20/API/POP3TransporterClass.md
@@ -533,9 +533,9 @@ POP3 Transporter オブジェクトは [POP3 New transporter](#pop3-new-transpor
-|Parameter|Type||Description|
+|引数|型||説明|
|---------|--- |:---:|------|
-||||Does not require any parameters|
+||||引数を必要としません|
diff --git a/i18n/ja/docusaurus-plugin-content-docs/version-20/API/SessionClass.md b/i18n/ja/docusaurus-plugin-content-docs/version-20/API/SessionClass.md
index 165a055d568c83..35ec308563a9b7 100644
--- a/i18n/ja/docusaurus-plugin-content-docs/version-20/API/SessionClass.md
+++ b/i18n/ja/docusaurus-plugin-content-docs/version-20/API/SessionClass.md
@@ -103,9 +103,9 @@ IP:port/4DACTION/action_Session
-|Parameter|Type||Description|
+|引数|型||説明|
|---------|--- |:---:|------|
-||||Does not require any parameters|
+||||引数を必要としません|
diff --git a/i18n/ja/docusaurus-plugin-content-docs/version-20/API/SignalClass.md b/i18n/ja/docusaurus-plugin-content-docs/version-20/API/SignalClass.md
index 3243adfb3bb425..3213fc76f30236 100644
--- a/i18n/ja/docusaurus-plugin-content-docs/version-20/API/SignalClass.md
+++ b/i18n/ja/docusaurus-plugin-content-docs/version-20/API/SignalClass.md
@@ -236,9 +236,9 @@ Signal オブジェクトは共有オブジェクトのため、`Use...End use`
-|Parameter|Type||Description|
+|引数|型||説明|
|---------|--- |:---:|------|
-||||Does not require any parameters|
+||||引数を必要としません|
diff --git a/i18n/ja/docusaurus-plugin-content-docs/version-20/API/SystemWorkerClass.md b/i18n/ja/docusaurus-plugin-content-docs/version-20/API/SystemWorkerClass.md
index 4e3422d6bf8784..99855aafc55b04 100644
--- a/i18n/ja/docusaurus-plugin-content-docs/version-20/API/SystemWorkerClass.md
+++ b/i18n/ja/docusaurus-plugin-content-docs/version-20/API/SystemWorkerClass.md
@@ -270,9 +270,9 @@ Function _createFile($title : Text; $textBody : Text)
-|Parameter|Type||Description|
+|引数|型||説明|
|---------|--- |:---:|------|
-||||Does not require any parameters|
+||||引数を必要としません|
@@ -490,9 +490,9 @@ $output:=$worker.response
-|Parameter|Type||Description|
+|引数|型||説明|
|---------|--- |:---:|------|
-||||Does not require any parameters|
+||||引数を必要としません|
diff --git a/i18n/ja/docusaurus-plugin-content-docs/version-21-R2/API/DataClassClass.md b/i18n/ja/docusaurus-plugin-content-docs/version-21-R2/API/DataClassClass.md
index a68cfab13af65f..f97984d16353f8 100644
--- a/i18n/ja/docusaurus-plugin-content-docs/version-21-R2/API/DataClassClass.md
+++ b/i18n/ja/docusaurus-plugin-content-docs/version-21-R2/API/DataClassClass.md
@@ -1254,7 +1254,7 @@ var $results := ds.MyClass.query("myVectorField > :1 order by myVectorField"; $c
同じベクトルがクエリ文字列内に複数回出現した場合、order by は最初のものの結果に適用されます。例:
```4d
-var $results := ds.MyClass.query("myVectorField > :1 and myVectorField > :2 order by myVectorField" desc; /
+var $results := ds.MyClass.query("myVectorField > :1 and myVectorField > :2 order by myVectorField desc"; /
{vector : $myVector1 };{vector : $myVector2 }) //myVectorField > :1 は order by に使用されます。
```
diff --git a/i18n/ja/docusaurus-plugin-content-docs/version-21-R3/API/DataClassClass.md b/i18n/ja/docusaurus-plugin-content-docs/version-21-R3/API/DataClassClass.md
index 0a352d52d55775..31b4ade55aeb9a 100644
--- a/i18n/ja/docusaurus-plugin-content-docs/version-21-R3/API/DataClassClass.md
+++ b/i18n/ja/docusaurus-plugin-content-docs/version-21-R3/API/DataClassClass.md
@@ -1256,7 +1256,7 @@ var $results := ds.MyClass.query("myVectorField > :1 order by myVectorField"; $c
同じベクトルがクエリ文字列内に複数回出現した場合、order by は最初のものの結果に適用されます。例:
```4d
-var $results := ds.MyClass.query("myVectorField > :1 and myVectorField > :2 order by myVectorField" desc; /
+var $results := ds.MyClass.query("myVectorField > :1 and myVectorField > :2 order by myVectorField desc"; /
{vector : $myVector1 };{vector : $myVector2 }) //myVectorField > :1 は order by に使用されます。
```
diff --git a/i18n/pt/docusaurus-plugin-content-docs/current/API/DataClassClass.md b/i18n/pt/docusaurus-plugin-content-docs/current/API/DataClassClass.md
index fdbd665aa457ed..97c5b5f18c5b72 100644
--- a/i18n/pt/docusaurus-plugin-content-docs/current/API/DataClassClass.md
+++ b/i18n/pt/docusaurus-plugin-content-docs/current/API/DataClassClass.md
@@ -1244,14 +1244,14 @@ var $results := ds.MyClass.query("myVectorField <= :1"; $comparisonVector)
The **order by** statement is supported in the query string so that entities in the resulting entity selection are sorted by similarity. Por exemplo:
```4d
-var $results := ds.MyClass.query("myVectorField > :1 order by myVectorField"; $comparisonVector)
- //default order, the first entity is the most similar
+var $results := ds.MyClass.query("myVectorField > :1 order by myVectorField desc"; $comparisonVector)
+ //the first entity is the most similar
```
If the same vector appears multiple times in the query string, the order by will be applied to the results of the first one, for example:
```4d
-var $results := ds.MyClass.query("myVectorField > :1 and myVectorField > :2 order by myVectorField" desc; /
+var $results := ds.MyClass.query("myVectorField > :1 and myVectorField > :2 order by myVectorField desc"; /
{vector : $myVector1 };{vector : $myVector2 }) //myVectorField > :1 is used for the order by
```
diff --git a/i18n/pt/docusaurus-plugin-content-docs/current/API/IMAPTransporterClass.md b/i18n/pt/docusaurus-plugin-content-docs/current/API/IMAPTransporterClass.md
index 2957639ae9baeb..e6f0d3fd1cbb17 100644
--- a/i18n/pt/docusaurus-plugin-content-docs/current/API/IMAPTransporterClass.md
+++ b/i18n/pt/docusaurus-plugin-content-docs/current/API/IMAPTransporterClass.md
@@ -1467,6 +1467,10 @@ $flags["$seen"]:=True
$status:=$transporter.removeFlags(IMAP all;$flags)
```
+#### Veja também
+
+[`.addFlags()`](#addflags)
+
diff --git a/i18n/pt/docusaurus-plugin-content-docs/current/FormObjects/properties_Text.md b/i18n/pt/docusaurus-plugin-content-docs/current/FormObjects/properties_Text.md
index 5022f68a511bf5..186a34fc6f4e0c 100644
--- a/i18n/pt/docusaurus-plugin-content-docs/current/FormObjects/properties_Text.md
+++ b/i18n/pt/docusaurus-plugin-content-docs/current/FormObjects/properties_Text.md
@@ -433,7 +433,84 @@ Por defeito, esta opção não está activada.
#### Comandos
-[LISTBOX Get property](../commands/listbox-get-property) - [LISTBOX SET PROPERTY](../commands/listbox-set-property) - [OBJECT Is styled text](../commands/object-is-styled-text) -
+[LISTBOX Get property](../commands/listbox-get-property) - [LISTBOX SET PROPERTY](../commands/listbox-set-property) - [OBJECT Is styled text](../commands/object-is-styled-text)
+
+### Supported tags
+
+You can use the following tags in 4D multi-style text areas.
+
+#### 4D Expression
+
+```html
+
+```
+
+This tag inserts a 4D expression (expression, method, field, variable, command, etc.) in the text. The expression is tokenized and evaluated:
+
+- when the expression is inserted
+- when the object is loaded
+- when the `computeExpressions` standard action is called from an interface object or by the [`INVOKE ACTION`](../commands/invoke-action) command
+- when the [`ST COMPUTE EXPRESSIONS`](../commands/st-compute-expressions) command is executed
+- when the [`ST FREEZE EXPRESSIONS`](../commands/st-freeze-expressions) command is executed, if the second `*` parameter is passed.
+
+The evaluated value of the expression is not saved in the `` tag, only its reference is.
+
+Note: To ensure that expressions will be evaluated correctly regardless of the 4D language or version used, we recommend using the token syntax for elements whose name might vary between different versions (commands, tables, fields, constants). Por exemplo, para inserir o comando `Current time` (tempo atual), digite `Current time:C178`. For more information about this, refer to *Using tokens in formulas*.
+
+#### URL
+
+```html
+Visible label
+```
+
+This tag inserts a URL in the text. Exemplo:
+
+```html
+4D Web Site
+```
+
+#### User link
+
+```html
+Click here
+```
+
+"User links" look the same as URLs, but when you click them, they do not automatically open the source. You can pass any string you want as reference, and it is up to the developer to program any custom actions that occur when it is clicked. This means you can create links which are not URLs but references to files, 4D methods, and so on, that you can open or execute when they are clicked. The [`ST Get content type`](../commands/st-get-content-type) command detects if a user link has been clicked.
+
+User links are defined using the [`ST SET TEXT`](../commands/st-set-text) command. Por exemplo:
+
+```4d
+ST SET TEXT(txtVar;"This is a user link: User Label";$start;$end)
+```
+
+#### Custom tags
+
+You can insert any tag in plain text, for example `
`. It is stored in the code of the plain text without being interpreted or displayed. This is particularly useful in the context of e-mails in HTML format and including pictures for example.
+
+#### Style tags
+
+This paragraph lists the attributes of \ tags that are supported by 4D in rich text areas. You can use these tags to implement custom style handling. Only the tags listed below are supported by 4D for style variations.
+
+- Font name: ` ... `
+- Font size: ` ... `
+- Estilo de letra:
+ - Bold ` ... `
+ - Italic ` ... `
+ - Normal ` ... `
+ - Underline ` ... `
+ - Strikethrough `...`
+
+*Note: The "strikethrough" style is not supported under macOS, but this tag can still be managed by programming.*
+
+- Font colors: ` ... ` or `...`
+- Background colors: ` ... ` or `...`
+
+#### Color values
+
+For font color and background color attributes, the color value can be either the hexadecimal code for an RGB color, or the name of one of the 16 HTML colors defined for standard CSS by the W3C:
+
+
+
---
diff --git a/i18n/pt/docusaurus-plugin-content-docs/current/assets/en/FormObjects/colors1.png b/i18n/pt/docusaurus-plugin-content-docs/current/assets/en/FormObjects/colors1.png
new file mode 100644
index 00000000000000..fc0759ba0abc00
Binary files /dev/null and b/i18n/pt/docusaurus-plugin-content-docs/current/assets/en/FormObjects/colors1.png differ
diff --git a/i18n/pt/docusaurus-plugin-content-docs/current/assets/en/FormObjects/colors2.png b/i18n/pt/docusaurus-plugin-content-docs/current/assets/en/FormObjects/colors2.png
new file mode 100644
index 00000000000000..48d25eafd90071
Binary files /dev/null and b/i18n/pt/docusaurus-plugin-content-docs/current/assets/en/FormObjects/colors2.png differ
diff --git a/i18n/pt/docusaurus-plugin-content-docs/current/assets/en/FormObjects/multistyle-ex1.png b/i18n/pt/docusaurus-plugin-content-docs/current/assets/en/FormObjects/multistyle-ex1.png
new file mode 100644
index 00000000000000..715de8bdb44813
Binary files /dev/null and b/i18n/pt/docusaurus-plugin-content-docs/current/assets/en/FormObjects/multistyle-ex1.png differ
diff --git a/i18n/pt/docusaurus-plugin-content-docs/current/assets/en/FormObjects/multistyle-ex2.png b/i18n/pt/docusaurus-plugin-content-docs/current/assets/en/FormObjects/multistyle-ex2.png
new file mode 100644
index 00000000000000..2ea1e2de1b9d12
Binary files /dev/null and b/i18n/pt/docusaurus-plugin-content-docs/current/assets/en/FormObjects/multistyle-ex2.png differ
diff --git a/i18n/pt/docusaurus-plugin-content-docs/current/commands/theme/Styled_Text.md b/i18n/pt/docusaurus-plugin-content-docs/current/commands/theme/Styled_Text.md
index ca30090553b3ce..4d1449acbdcee2 100644
--- a/i18n/pt/docusaurus-plugin-content-docs/current/commands/theme/Styled_Text.md
+++ b/i18n/pt/docusaurus-plugin-content-docs/current/commands/theme/Styled_Text.md
@@ -22,3 +22,94 @@ slug: /commands/theme/Styled-Text
| [](../../commands/st-set-options)
|
| [](../../commands/st-set-plain-text)
|
| [](../../commands/st-set-text)
|
+
+## Working with text handling commands
+
+### Interface do usuário
+
+The commands that can be used to manipulate text objects by programming do not take any style tags integrated into the text into account. They act upon displayed text only. This concerns the following commands:
+
+- [User Interface](./User_Interface.md) theme commands
+- [`HIGHLIGHT TEXT`](../../commands/highlight-text)
+- [`GET HIGHLIGHT`](../../commands/get-highlight)
+
+When you use these commands with commands that manipulate character strings, it is necessary to filter the formatting characters using the [`ST Get plain text`](../../commands/st-get-plain-text) command:
+
+```4d
+ HIGHLIGHT TEXT([Products]Notes;1;Length(ST Get plain text([Products]Notes))+1)
+```
+
+### Objects (Forms)
+
+The commands that can be used to modify the style of objects (for example, [`OBJECT SET FONT`](../../commands/object-set-font)) apply to the whole object and not to the selection.
+
+If the object does not have the focus when the command is executed, the modification is applied simultaneously to the object (the text area) and to its associated variable. If the object does have the focus, the modification is carried out on the object but not on the associated variable. The modification is only applied to the variable when the object loses the focus. Keep this principle in mind when programming text areas.
+
+:::note
+
+If the [**Store with default style tags**](../../FormObjects/properties_Text.md#store-with-default-style-tags) option is checked for the object, the use of these commands will cause a modification of the tags saved with each object.
+
+:::
+
+Note also that only default properties are affected by these commands (as well as any properties saved by means of default tags). Custom style tags remain as they are. For example, given a multi-style area where default tags were saved:
+
+
+
+The plain text of the area is as follows:
+
+```html
+This is the word red
+```
+
+Se executar o seguinte código:
+
+```4d
+OBJECT SET COLOR(*;"myArea";-(Blue+(256*Yellow)))
+```
+
+The red color remains:
+
+
+
+and code is:
+
+```html
+This is the word red
+```
+
+The following commands are concerned:
+
+- [`OBJECT SET RGB COLORS`](../../commands/object-set-rgb-colors)
+- [`OBJECT SET FONT`](../../commands/object-set-font)
+- [`OBJECT SET FONT STYLE`](../../commands/object-set-font-style)
+- [`OBJECT SET FONT SIZE`](../../commands/object-set-font-size)
+
+In the context of multi-style areas, such commands should be used to set default styles only. To manage styles during database execution, we recommend using the commands of the "Styled Text" theme.
+
+### Get edited text
+
+When it is used with a rich text area, the [`Get edited text`](../../commands/get-edited-text) command returns the text of the current area including any style tags.
+
+To retrieve the "plain" text (text without tags) being edited, you must use the [`ST Get plain text`](../../commands/st-get-plain-text) command:
+
+```4d
+ST Get plain text(Get edited text)
+```
+
+### Query and order by commands
+
+Queries and sorts carried out among multi-style objects take into account any style tags saved in the object. If a style modification has been made within a word, searching for the word will not be successful.
+
+To be able to carry out valid searches and sorts, you must use the [`ST Get plain text`](../../commands/st-get-plain-text) command. Por exemplo:
+
+```4d
+QUERY BY FORMULA([MyTable];ST Get plain text([MyTable]MyFieldStyle)="very well")
+```
+
+## Automatic normalization of line endings
+
+In order to ensure multi-platform compatibility of texts handled in the database, 4D automatically normalizes line endings so that they occupy a single character: `\r` (carriage return). This normalization is carried out at the level of form objects (variables or fields) hosting plain or multi-style text. Line endings that are not native, or that use a mix of several characters (for example `\r\n`), are considered as a single `\r`.
+
+Note that in compliance with the XML standard (multi-style text format), the multi-style text commands also normalize line endings for text variables that are not associated with objects.
+
+This principle makes it easier to use multi-style text commands or commands such as [`HIGHLIGHT TEXT`](../../commands/highlight-text) in a multi-platform context. However, you must take this into account in your processing when you work with texts from heterogeneous sources.
\ No newline at end of file
diff --git a/i18n/pt/docusaurus-plugin-content-docs/current/commands/theme/System_Documents.md b/i18n/pt/docusaurus-plugin-content-docs/current/commands/theme/System_Documents.md
index 7eecfc4a014833..6cb46b5da3f0e3 100644
--- a/i18n/pt/docusaurus-plugin-content-docs/current/commands/theme/System_Documents.md
+++ b/i18n/pt/docusaurus-plugin-content-docs/current/commands/theme/System_Documents.md
@@ -63,46 +63,64 @@ When it is called from a [preemptive process](../../Develop/preemptive.md), a *D
## The Document system variable
-`Open document`, `Create document`, `Append document` and `Select document` enable you to access a document using the standard Open or Save file dialog boxes. When you access a document through a standard dialog, 4D returns the full pathname of the document in the [`Document` system variable](../../Concepts/variables.md#system-variables). This system variable has to be distinguished from the *document* parameter that appears in the parameter list of the commands.
+[`Open document`](../../commands/open-document), [`Create document`](../../commands/create-document), [`Append document`](../../commands/append-document`) and [`Select document`](../../commands/select-document) commands enable you to access a document using the standard Open or Save file dialog boxes. When you access a document through a standard dialog, 4D returns the full pathname of the document in the [`Document` system variable](../../Concepts/variables.md#system-variables). This system variable has to be distinguished from the *document* parameter that appears in the parameter list of the commands.
## Absolute or relative pathname
-Most of the routines of this section accept document names, relative pathnames or absolute pathnames:
+Most of the routines of this section accept **document names**, **relative pathnames** or **absolute pathnames**.
+
+- **Relative pathnames** define a location with respect to a folder located on disk. Passing only a document name is considered as using a relative pathname. In 4D, a relative pathname is usually expressed with respect to the [project folder](../../Project/architecture.md#project-folder), i.e. the folder containing the .project file. Relative pathnames are especially useful when deploying applications in heterogenous environments.
+- **Absolute pathnames** define a location with respect to the root of the volume and so they do not depend on the current location of the project folder.
-Relative pathnames define a location with respect to a folder located on disk. Passing only a document name is considered as using a relative pathname. In 4D, a relative pathname is usually expressed with respect to the database folder, i.e. the folder containing the structure file. Relative pathnames are especially useful when deploying applications in heterogenous environments.
-Absolute pathnames define a location with respect to the root of the volume and so they do not depend on the current location of the database folder.
To determine whether a pathname passed to a command must be interpreted as absolute or relative, 4D applies a specific algorithm on each platform.
-Windows
-If the parameter contains only two characters and if the second one is a ':',
-or if the text contains ':' and '\' as the second and third character,
-or if the text starts with "\\",
-then the pathname is absolute.
+### Windows
+
+- If the parameter contains only two characters and if the second one is a ':'
+- or if the text contains ':' and '\' as the second and third character,
+- or if the text starts with "\\",
+- then the pathname is absolute.
In all other cases, the pathname is relative.
-Examples with the CREATE FOLDER command:
+Examples with the [`CREATE FOLDER`](../../commands/create-folder) command:
+
+```4d
+ CREATE FOLDER("lundi") // relative path
+ CREATE FOLDER("\Monday") // relative path
+ CREATE FOLDER("\Monday\Tuesday") // relative path
+ CREATE FOLDER("c:") // absolute path
+ CREATE FOLDER("d:\Monday") // absolute path
+ CREATE FOLDER("\\srv-Internal\temp") // absolute path
+```
+
+:::note
+
+The code editor of 4D allows the use of [escape sequences](../../Concepts/quick-tour.md#escape-sequences). An escape sequence begins with a backslash `\`, followed by a character. For example, `\t` is the escape sequence for the Tab character.
-CREATE FOLDER("lundi") // relative path
-CREATE FOLDER("\Monday") // relative path
-CREATE FOLDER("\Monday\Tuesday") // relative path
-CREATE FOLDER("c:") // absolute path
-CREATE FOLDER("d:\Monday") // absolute path
-CREATE FOLDER("\\srv-Internal\temp") // absolute path
+The `\` character is also used as the separator in pathnames in Windows. In general, 4D will correctly interpret Windows pathnames that are entered in the method editor by replacing single backslashes `\` with double backslashes `\\`. For example, `C:\Folder` will become `C:\\Folder`.
-macOS
-If the text starts with a folder separator ':',
-or if does not contain any,
-then the path is relative.
+However, if you write `C:\MyDocuments\New`, 4D will display `C:\\MyDocuments\New`. In this case, the second `\` is incorrectly interpreted as `\N` (an existing escape sequence). Você deve então digitar um duplo `\\` quando quiser inserir uma barra invertida antes de um caractere usado em uma das sequências de escape reconhecidas por 4D.
+
+:::
+
+### macOS
+
+- If the text starts with a folder separator ':',
+- or if does not contain any,
+- then the path is relative.
In all other cases, it is absolute.
-Examples with the CREATE FOLDER command:
+Examples with the [`CREATE FOLDER`](../../commands/create-folder) command:
+
+```4d
-CREATE FOLDER("Monday") // relative path
-CREATE FOLDER("macintosh hd:") // absolute path
-CREATE FOLDER("Monday:Tuesday") // absolute path (a volume must be called Monday)
-CREATE FOLDER(":Monday:Tuesday") // relative path
+ CREATE FOLDER("Monday") // relative path
+ CREATE FOLDER("macintosh hd:") // absolute path
+ CREATE FOLDER("Monday:Tuesday") // absolute path (a volume must be called Monday)
+ CREATE FOLDER(":Monday:Tuesday") // relative path
+```
:::note
@@ -112,8 +130,8 @@ See also [**Absolute and relative pathnames** in the Concepts section](../../Con
## Extracting pathname contents
-You can handle pathname contents using the Path to object and Object to path commands. In particular, using these commands, you can extract from a pathname:
+You can handle pathname contents using the [`Path to object`](../../commands/path-to-object) and [`Object to path`](../../commands/object-to-path) commands. In particular, using these commands, you can extract from a pathname:
-a file name,
-the parent folder path,
-the file or folder extension.
\ No newline at end of file
+- a file name,
+- the parent folder path,
+- the file or folder extension.
\ No newline at end of file
diff --git a/i18n/pt/docusaurus-plugin-content-docs/current/commands/theme/Web_Services_Client.md b/i18n/pt/docusaurus-plugin-content-docs/current/commands/theme/Web_Services_Client.md
index 96b3dba914cc05..0489d9e5b0c38d 100644
--- a/i18n/pt/docusaurus-plugin-content-docs/current/commands/theme/Web_Services_Client.md
+++ b/i18n/pt/docusaurus-plugin-content-docs/current/commands/theme/Web_Services_Client.md
@@ -13,3 +13,9 @@ slug: /commands/theme/Web-Services-Client
| [](../../commands/web-service-get-result)
|
| [](../../commands/web-service-set-option)
|
| [](../../commands/web-service-set-parameter)
|
+
+A Web Service is a set of functions published on a network. These functions can be called and used by any application compatible with Web Services and connected to the network. Web Services can carry out all types of tasks, such as supervising the routing of packages at a transporter’s, e-commerce, monitoring market values, etc.
+
+Subscription to Web Services with 4D is easy to carry out using the [Web Services Wizard](https://doc.4d.com/4Dv21/4D/21/Subscribing-to-a-Web-Service-in-4D.300-7676804.en.html). In most cases, this Wizard will be sufficient for you to be able to use Web Services. However, if you want to customize certain mechanisms, you must use the client SOAP commands of 4D.
+
+Note: By convention, the terms “SOAP” and “Web Service” have been used to differentiate between command (and constant) names on the server and client side, respectively. These two concepts refer to the same technology.
\ No newline at end of file
diff --git a/i18n/pt/docusaurus-plugin-content-docs/current/commands/theme/Web_Services_Server.md b/i18n/pt/docusaurus-plugin-content-docs/current/commands/theme/Web_Services_Server.md
index e4afe12b6a3e51..d534f3550d62a2 100644
--- a/i18n/pt/docusaurus-plugin-content-docs/current/commands/theme/Web_Services_Server.md
+++ b/i18n/pt/docusaurus-plugin-content-docs/current/commands/theme/Web_Services_Server.md
@@ -12,3 +12,7 @@ slug: /commands/theme/Web-Services-Server
| [](../../commands/soap-reject-new-requests)
|
| [](../../commands/soap-request)
|
| [](../../commands/soap-send-fault)
|
+
+Publication of Web Services with 4D is carried out easily using [options in the method properties](../../Project/project-method-properties.md#web-services). In most cases, this operation will be sufficient to enable you to publish Web Services. However, if you want to customize certain mechanisms, use data arrays, etc., you must use the server SOAP commands of 4D.
+
+Note: By convention, the terms “SOAP” and “Web Service” have been used to differentiate between command (and constant) names on the server and client side, respectively. These two concepts refer to the same technology.
\ No newline at end of file
diff --git a/i18n/pt/docusaurus-plugin-content-docs/current/commands/theme/XML.md b/i18n/pt/docusaurus-plugin-content-docs/current/commands/theme/XML.md
index 67cef9e74fef7d..b511a8d72b891d 100644
--- a/i18n/pt/docusaurus-plugin-content-docs/current/commands/theme/XML.md
+++ b/i18n/pt/docusaurus-plugin-content-docs/current/commands/theme/XML.md
@@ -16,7 +16,7 @@ slug: /commands/theme/XML
:::note
-For XML support, 4D uses a library named Xerces.dll developed by the Apache Foundation company.
+For XML support, 4D uses the [Xerces.dll library](../../Notes/updates.md#library-table) developed by the Apache Foundation company.
:::
diff --git a/i18n/pt/docusaurus-plugin-content-docs/current/language-legacy/Formulas/execute-formula.md b/i18n/pt/docusaurus-plugin-content-docs/current/language-legacy/Formulas/execute-formula.md
index 6e9fe0ef8d757c..4fb8ce6b65e9c8 100644
--- a/i18n/pt/docusaurus-plugin-content-docs/current/language-legacy/Formulas/execute-formula.md
+++ b/i18n/pt/docusaurus-plugin-content-docs/current/language-legacy/Formulas/execute-formula.md
@@ -33,7 +33,7 @@ displayed_sidebar: docs
A string *instruçao* deve ser uma linha de código.\[#/descv\] Se *instruçao* for uma string vazia,EXECUTE FORMULA não faz nada. A regra geral é que se instrução puder ser executada como um método de uma-linha, então será executado propriamente. Use **EXECUTE FORMULA** apenas eventualmente, pois pode desacelerar a velocidade de execução. Em um banco de dados compilado, a linha de código não é compilada. Isso significa que instrução será compilada, mas não será verificada pelo compilador no momento da compilação.
-**Nota:** a execução de fórmulas em modo compilado pode ser otimizada utilizando uma memória caché (ver \[#cmd id="63" anchor="2882913"/\] abaixo).
+**Nota:** a execução de fórmulas em modo compilado pode ser otimizada utilizando uma memória caché (ver [Cache para formulas em modo compilado](#cache-para-formulas-em-modo-compilado) abaixo).
A instrução pode estar em:
@@ -47,7 +47,7 @@ A instrução pode estar em:
* Se l *instrução* for um método projeto, se recomenda utilizar [EXECUTE METHOD](../commands/execute-method) que lhe permite passar parâmetros.
* Não se recomenda chamar a nenhum comando de declaração de variável como *C\_DATE* em *instrução* já que pode gerar conflitos no código.
-A fórmula pode incluir variáveis de processo e variáveis entre processos. Entretanto, a declaração não pode conter o controle das instruções de fluxo (If, While, etc.), já que deve estar em uma linha de código.
+A fórmula pode incluir variáveis de processo e variáveis entre processos. Entretanto, a declaração não pode conter o controle das instruções de fluxo (If, While, Return, Break, etc.), já que deve estar em uma linha de código. Essas palavras-chave serão ignoradas.
Para garantir que a *instrução* seja avaliada corretamente, independentemente da linguagem 4D ou a versão utilizada, se recomenda utilizar a sintaxe de *token* para os elementos cujo nome possa variar entre diferentes versões (comandos, tabelas, campos, constantes). Por exemplo, para inserir o comando \[#cmd id="178"/\], introduza '**Current time:C178**'. Para saber mais, consulte *Usar tokens em fórmulas*.
diff --git a/i18n/pt/docusaurus-plugin-content-docs/current/language-legacy/Formulas/formula.md b/i18n/pt/docusaurus-plugin-content-docs/current/language-legacy/Formulas/formula.md
index 99bb4d2e90e7a0..ebdd52d8e6c6c9 100644
--- a/i18n/pt/docusaurus-plugin-content-docs/current/language-legacy/Formulas/formula.md
+++ b/i18n/pt/docusaurus-plugin-content-docs/current/language-legacy/Formulas/formula.md
@@ -32,7 +32,7 @@ displayed_sidebar: docs
## Descrição
-O comando `Formula` cria um objeto `4D Function` com base na expressão *formulaExp*. *formulaExp* pode ser tão simples quanto um único valor ou tão complexo quanto um método projeto com parâmetros.
+O comando `Formula` cria um objeto `4D Function` com base na expressão *formulaExp*. *formulaExp* pode ser tão simples quanto um único valor ou tão complexo quanto um método projeto com parâmetros. Para mais informações sobre o que *formulaExp* pode conter, consulte a descrição do comando [`EXECUTE FORMULA`](../commands/execute-formula).
Ter uma fórmula como se fosse um objeto permite que seja passada como um parâmetro (atributo calculado) para comandos ou métodos, ou para ser executado a partir de vários componentes, sem precisar declará-los como "partilhados por componentes e database host". Quando chamado, o objeto fórmula é avaliado sem o contexto do banco de dados ou componente que o criou.
diff --git a/i18n/pt/docusaurus-plugin-content-docs/current/language-legacy/Interruptions/defer.md b/i18n/pt/docusaurus-plugin-content-docs/current/language-legacy/Interruptions/defer.md
new file mode 100644
index 00000000000000..ba09a589f734b4
--- /dev/null
+++ b/i18n/pt/docusaurus-plugin-content-docs/current/language-legacy/Interruptions/defer.md
@@ -0,0 +1,121 @@
+---
+id: defer
+title: defer
+slug: /commands/defer
+displayed_sidebar: docs
+---
+
+**defer** ( *exitFormula* : Expression )
+
+
+
+| Parâmetro | Tipo | | Descrição |
+| --- | --- | --- | --- |
+| exitFormula | Expression | → | Expressão a ser executada na saída |
+
+
+
+
+Histórico
+
+|Versão|Alterações|
+|---|---|
+|21 R4|Criado|
+
+
+
+
+## Descrição
+
+O comando `defer` declara uma expressão *exitFormula* que sempre será executada quando o método ou a função terminar, mesmo que um erro tenha sido lançado ou que um `return` tenha sido executado. O uso de `defer` permite garantir que um método ou função termine corretamente executando código de finalização na saída. Além disso, esse comando evita duplicar o mesmo código de saída em cada bloco de retorno ou de tratamento de erro.
+
+:::tip Post de blog relacionado
+
+[Streamline Your Clean-Up Code with the “defer” Command](https://blog.4d.com/streamline-your-clean-up-code-with-the-defer-command)
+
+:::
+
+O comando `defer` pode ser chamado em qualquer lugar do código do método ou função, e você pode inserir quantas expressões `defer` quiser. Durante a execução, todas as expressões *exitFormula* encontradas são empilhadas. Quando a execução termina, seja qual for o motivo (fluxo normal, break, erro, interrupção do usuário, return...), todas as expressões da pilha diferida são desempilhadas e executadas em ordem LIFO (*Last In First Out*).
+
+Por exemplo:
+
+```4d
+defer(ALERT("1"))
+defer(ALERT("2"))
+// Na saída, os alertas exibirão "2" e depois "1"
+```
+
+Em *exitFormula*, você passa a expressão que deseja avaliar na saída do método ou função, independentemente da forma de término. Internamente, toda vez que `defer` é chamado, o 4D converte *exitFormula* em uma [formula](../../commands/formula) e a adiciona a uma pilha associada ao método ou função. Quando o método ou função termina, todas as formulas armazenadas na pilha são avaliadas na ordem em que aparecem na coleção.
+
+Como para todas as [formulas](../../commands/formula), se a expressão *exitFormula* usar variáveis locais, seus valores atuais são copiados e armazenados no objeto formula retornado **no momento em que ele é colocado na pilha diferida**. Quando executada, a formula usa esses valores copiados em vez dos valores atuais das variáveis locais.
+
+:::note Notas
+
+- Tenha em mente que variáveis locais armazenam **referências** para valores [object](../../Concepts/dt_object.md#assignment) e [collection](../../Concepts/dt_collection.md#assignment).
+- Se *exitFormula* contiver outra instrução `defer`, um erro será lançado.
+
+:::
+
+Se a expressão *exitFormula* lançar um erro, ele é automaticamente interceptado e ignorado, e o fluxo de execução continua sem interrupção.
+
+## Exemplo 1
+
+Estes exemplos ilustram as várias expressões *exitFormula* suportadas:
+
+```4d
+// Chamada de método
+defer(aMethod)
+
+// Chamada de função de objeto
+defer(myObject.aFunction(something))
+
+// Chamada de função singleton
+defer(cs.aClass.me.aFunction(something))
+```
+
+## Exemplo 2
+
+Você quer garantir que uma referência XML seja sempre liberada corretamente, para evitar possíveis vazamentos de memória:
+
+```4d
+var $xmlRef:=DOM Create XML ref("theRoot")
+defer(DOM CLOSE XML($xmlRef))
+...
+```
+
+## Exemplo 3
+
+Você quer garantir que o monitoramento de atividade seja interrompido no final do método:
+
+```4d
+START MONITORING ACTIVITY(0.001;Activity all)
+defer(STOP MONITORING ACTIVITY())
+...
+```
+
+## Exemplo 4
+
+Você quer controlar a geração de logs:
+
+```4d
+$logRecording:=Get database parameter(Diagnostic log recording)
+SET DATABASE PARAMETER(Diagnostic log recording; 1)
+defer(SET DATABASE PARAMETER(Diagnostic log recording; $logRecording))
+
+$logLevel:=Get database parameter(Diagnostic log level)
+SET DATABASE PARAMETER(Diagnostic log level; Log trace)
+defer(SET DATABASE PARAMETER(Diagnostic log level; $logLevel))
+```
+
+## Ver também
+
+[throw](../commands/throw)
+[Last errors](../commands/last-errors)
+[ON ERR CALL](../commands/on-err-call)
+
+## Propriedades
+
+| | |
+| --- | --- |
+| Número do comando | 1805 |
+| Thread-seguro | no |
diff --git a/i18n/pt/docusaurus-plugin-content-docs/current/language-legacy/Interruptions/throw.md b/i18n/pt/docusaurus-plugin-content-docs/current/language-legacy/Interruptions/throw.md
index 400d68949e1d5f..a07ac3fca714bb 100644
--- a/i18n/pt/docusaurus-plugin-content-docs/current/language-legacy/Interruptions/throw.md
+++ b/i18n/pt/docusaurus-plugin-content-docs/current/language-legacy/Interruptions/throw.md
@@ -38,7 +38,7 @@ Os erros lançados utilizando o comando **throw** são gestionados pelo runtime
O comando admite três sintaxes:
-### **throw(errorCode{; description})**
+### throw(errorCode{; description})
Especifica o código de erro e um texto de descrição opcional, o erro se lança imediatamente.
Se não indicar nenhuma descrição, se preenche com:
@@ -46,7 +46,7 @@ Se não indicar nenhuma descrição, se preenche com:
* Código de erro (errorCode): (host) na aplicação local
* Código de erro (errorCode): (C00x) em um componente
-### **throw(errorObj)**
+### throw(errorObj)
O objeto *errorObj* permite obter informação de erro mais detalhada e controlar a gestão de erros. Pode conter as seguintes propriedades, assim como toda propriedade personalizada à que possa fazer referência à propriedade **message**.
@@ -63,7 +63,7 @@ Quando se utilizar esta sintaxe, o objeto *errorObj* se devolve em Últimos erro
**Nota:** é possível chamar o comando várias vezes no mesmo projeto para gerar vários erros. Pode usar a opção diferida para enviar todos os erros de vez.
-### **throw**
+### throw
Lança todos os erros atuais em **modo diferido**, o que significa que se adicionarão a uma pilha e serão geridas quando voltar ao método que os chama. Isso se faz tipicamente desde dentro de uma retrochamada [ON ERR CALL](../commands/on-err-call).
@@ -113,6 +113,7 @@ throw({componentSignature: "xbox"; errCode: 600; name: "myFileName"; path: "myFi
## Ver também
[ASSERT](../commands/assert)
+[defer](../commands/defer)
[Last errors](../commands/last-errors)
[ON ERR CALL](../commands/on-err-call)
diff --git a/i18n/pt/docusaurus-plugin-content-docs/version-21-R2/API/DataClassClass.md b/i18n/pt/docusaurus-plugin-content-docs/version-21-R2/API/DataClassClass.md
index fce022fb33f097..420b31f7bedd4e 100644
--- a/i18n/pt/docusaurus-plugin-content-docs/version-21-R2/API/DataClassClass.md
+++ b/i18n/pt/docusaurus-plugin-content-docs/version-21-R2/API/DataClassClass.md
@@ -1242,14 +1242,14 @@ var $results := ds.MyClass.query("myVectorField <= :1"; $comparisonVector)
The **order by** statement is supported in the query string so that entities in the resulting entity selection are sorted by similarity. Por exemplo:
```4d
-var $results := ds.MyClass.query("myVectorField > :1 order by myVectorField"; $comparisonVector)
- //default order, the first entity is the most similar
+var $results := ds.MyClass.query("myVectorField > :1 order by myVectorField desc"; $comparisonVector)
+ //the first entity is the most similar
```
If the same vector appears multiple times in the query string, the order by will be applied to the results of the first one, for example:
```4d
-var $results := ds.MyClass.query("myVectorField > :1 and myVectorField > :2 order by myVectorField" desc; /
+var $results := ds.MyClass.query("myVectorField > :1 and myVectorField > :2 order by myVectorField desc"; /
{vector : $myVector1 };{vector : $myVector2 }) //myVectorField > :1 is used for the order by
```
diff --git a/i18n/pt/docusaurus-plugin-content-docs/version-21-R3/API/DataClassClass.md b/i18n/pt/docusaurus-plugin-content-docs/version-21-R3/API/DataClassClass.md
index 4e974a06016e61..1aee0b96165337 100644
--- a/i18n/pt/docusaurus-plugin-content-docs/version-21-R3/API/DataClassClass.md
+++ b/i18n/pt/docusaurus-plugin-content-docs/version-21-R3/API/DataClassClass.md
@@ -1244,14 +1244,14 @@ var $results := ds.MyClass.query("myVectorField <= :1"; $comparisonVector)
The **order by** statement is supported in the query string so that entities in the resulting entity selection are sorted by similarity. Por exemplo:
```4d
-var $results := ds.MyClass.query("myVectorField > :1 order by myVectorField"; $comparisonVector)
- //default order, the first entity is the most similar
+var $results := ds.MyClass.query("myVectorField > :1 order by myVectorField desc"; $comparisonVector)
+ //the first entity is the most similar
```
If the same vector appears multiple times in the query string, the order by will be applied to the results of the first one, for example:
```4d
-var $results := ds.MyClass.query("myVectorField > :1 and myVectorField > :2 order by myVectorField" desc; /
+var $results := ds.MyClass.query("myVectorField > :1 and myVectorField > :2 order by myVectorField desc"; /
{vector : $myVector1 };{vector : $myVector2 }) //myVectorField > :1 is used for the order by
```
diff --git a/versioned_docs/version-19/API/FunctionClass.md b/versioned_docs/version-19/API/FunctionClass.md
index f5864250d3a92a..b3005a8dfbf1e0 100644
--- a/versioned_docs/version-19/API/FunctionClass.md
+++ b/versioned_docs/version-19/API/FunctionClass.md
@@ -133,7 +133,7 @@ Parameters are received within the method, in the order they are specified in th
#### Description
-The `Formula` command creates a `4D Function` object based upon the *formulaExp* expression. *formulaExp* can be as simple as a single value or complex, such as a project method with parameters.
+The `Formula` command creates a `4D Function` object based upon the *formulaExp* expression. *formulaExp* can be as simple as a single value or complex, such as a project method with parameters. For more information on what *formulaExp* can contain, please refer to the [`EXECUTE FORMULA`](../commands/execute-formula) command description.
Having a formula as an object allows it to be passed as a parameter (calculated attribute) to commands or methods or to be executed from various components without needing to declare them as "shared by components and host database". When called, the formula object is evaluated within the context of the database or component that created it.
diff --git a/versioned_docs/version-21-R2/API/DataClassClass.md b/versioned_docs/version-21-R2/API/DataClassClass.md
index b0558e4dcc387e..f4d79ef96511a1 100644
--- a/versioned_docs/version-21-R2/API/DataClassClass.md
+++ b/versioned_docs/version-21-R2/API/DataClassClass.md
@@ -1241,14 +1241,21 @@ var $results := ds.MyClass.query("myVectorField <= :1"; $comparisonVector)
The **order by** statement is supported in the query string so that entities in the resulting entity selection are sorted by similarity. For example:
```4d
-var $results := ds.MyClass.query("myVectorField > :1 order by myVectorField"; $comparisonVector)
- //default order, the first entity is the most similar
+var $results := ds.MyClass.query("myVectorField > :1 order by myVectorField desc"; $comparisonVector)
+ //the first entity is the most similar
```
+:::note
+
+The default order is ascending, although a descending order is usually the most useful for vector similarity queries. Thus, you will usually have to add the `desc` keyword in your vector similarity query strings.
+
+:::
+
+
If the same vector appears multiple times in the query string, the order by will be applied to the results of the first one, for example:
```4d
-var $results := ds.MyClass.query("myVectorField > :1 and myVectorField > :2 order by myVectorField" desc; /
+var $results := ds.MyClass.query("myVectorField > :1 and myVectorField > :2 order by myVectorField desc"; /
{vector : $myVector1 };{vector : $myVector2 }) //myVectorField > :1 is used for the order by
```
diff --git a/versioned_docs/version-21-R2/commands-legacy/accumulate.md b/versioned_docs/version-21-R2/commands-legacy/accumulate.md
index ebb73a6c05bee6..9184298acb9e19 100644
--- a/versioned_docs/version-21-R2/commands-legacy/accumulate.md
+++ b/versioned_docs/version-21-R2/commands-legacy/accumulate.md
@@ -11,7 +11,8 @@ displayed_sidebar: docs
| Parameter | Type | | Description |
| --- | --- | --- | --- |
-| data | Field, Variable | → | Numeric field or variable on which to accumulate |
+| dataField | Field | → | Numeric field on which to accumulate |
+| dataVar | Variable | → | Numeric variable on which to accumulate |
diff --git a/versioned_docs/version-21-R3/API/DataClassClass.md b/versioned_docs/version-21-R3/API/DataClassClass.md
index 768871ed39465b..dff84253be03d2 100644
--- a/versioned_docs/version-21-R3/API/DataClassClass.md
+++ b/versioned_docs/version-21-R3/API/DataClassClass.md
@@ -1243,14 +1243,21 @@ var $results := ds.MyClass.query("myVectorField <= :1"; $comparisonVector)
The **order by** statement is supported in the query string so that entities in the resulting entity selection are sorted by similarity. For example:
```4d
-var $results := ds.MyClass.query("myVectorField > :1 order by myVectorField"; $comparisonVector)
- //default order, the first entity is the most similar
+var $results := ds.MyClass.query("myVectorField > :1 order by myVectorField desc"; $comparisonVector)
+ //the first entity is the most similar
```
+:::note
+
+The default order is ascending, although a descending order is usually the most useful for vector similarity queries. Thus, you will usually have to add the `desc` keyword in your vector similarity query strings.
+
+:::
+
+
If the same vector appears multiple times in the query string, the order by will be applied to the results of the first one, for example:
```4d
-var $results := ds.MyClass.query("myVectorField > :1 and myVectorField > :2 order by myVectorField" desc; /
+var $results := ds.MyClass.query("myVectorField > :1 and myVectorField > :2 order by myVectorField desc"; /
{vector : $myVector1 };{vector : $myVector2 }) //myVectorField > :1 is used for the order by
```
diff --git a/versioned_docs/version-21-R3/language-legacy/Formulas/execute-formula.md b/versioned_docs/version-21-R3/language-legacy/Formulas/execute-formula.md
index 94503e0742c6da..a687d70bc8aa35 100644
--- a/versioned_docs/version-21-R3/language-legacy/Formulas/execute-formula.md
+++ b/versioned_docs/version-21-R3/language-legacy/Formulas/execute-formula.md
@@ -33,7 +33,7 @@ displayed_sidebar: docs
The statement string must be one line. If *statement* is an empty string, **EXECUTE FORMULA** does nothing. The rule of thumb is that if the *statement* can be executed as a one-line method, then it will execute properly. Use **EXECUTE FORMULA** sparingly, as it can slow down execution speed. In a compiled database, the line of code is not compiled. This means that *statement* will be executed, but it will not have been checked by the compiler at compilation time.
-**Note:** Executing formulas in compiled mode can be optimized using a cache (see *Cache for formulas in compiled mode* below).
+**Note:** Executing formulas in compiled mode can be optimized using a cache (see [Cache for formulas in compiled mode](#cache-for-formulas-in-compiled-mode) below).
The *statement* can include the following elements:
@@ -46,7 +46,7 @@ The *statement* can include the following elements:
* If *statement* is a project method, it is recommended to use the [EXECUTE METHOD](../commands/execute-method) that allows you to pass parameters.
* It is not recommend to call any variable declaration in *statement* since it can generate conflicts in the code.
-The formula can include process variables and interprocess variables. However, the statement cannot contain control of flow statements (If, While, etc.), because it must be in one line of code.
+The formula can include process variables and interprocess variables. However, the statement cannot contain control of flow statements (If, While, Return, Break, etc.), because it must be in one line of code. These keywords will be ignored.
To ensure that the *statement* will be evaluated correctly regardless of the 4D language or version used, we recommend using the *token* syntax for elements whose name might vary between different versions (commands, tables, fields, constants). For example, to insert the [Current time](../commands/current-time) command, enter '**Current time:C178**'. For more information about this, refer to *Using tokens in formulas*.
diff --git a/versioned_docs/version-21-R3/language-legacy/Formulas/formula.md b/versioned_docs/version-21-R3/language-legacy/Formulas/formula.md
index c28488aa386901..b060f56d3d90b0 100644
--- a/versioned_docs/version-21-R3/language-legacy/Formulas/formula.md
+++ b/versioned_docs/version-21-R3/language-legacy/Formulas/formula.md
@@ -32,7 +32,7 @@ displayed_sidebar: docs
## Description
-The `Formula` command creates a `4D Function` object based upon the *formulaExp* expression. *formulaExp* can be as simple as a single value or complex, such as a project method with parameters.
+The `Formula` command creates a `4D Function` object based upon the *formulaExp* expression. *formulaExp* can be as simple as a single value or complex, such as a project method with parameters. For more information on what *formulaExp* can contain, please refer to the [`EXECUTE FORMULA`](../commands/execute-formula) command description.
Having a formula as an object allows it to be passed as a parameter (calculated attribute) to commands or methods or to be executed from various components without needing to declare them as "shared by components and host database". When called, the formula object is evaluated within the context of the database or component that created it.
diff --git a/versioned_docs/version-21-R3/language-legacy/Printing/accumulate.md b/versioned_docs/version-21-R3/language-legacy/Printing/accumulate.md
index 7386ab66773f1c..e39883fdc4a8db 100644
--- a/versioned_docs/version-21-R3/language-legacy/Printing/accumulate.md
+++ b/versioned_docs/version-21-R3/language-legacy/Printing/accumulate.md
@@ -5,13 +5,14 @@ slug: /commands/accumulate
displayed_sidebar: docs
---
-**ACCUMULATE** ( *...data* : Field, Variable)
+**ACCUMULATE** ( {*...dataField* : Field} {; *...dataVar* : Variable )
| Parameter | Type | | Description |
| --- | --- | --- | --- |
-| data | Field, Variable | → | Numeric field or variable on which to accumulate |
+| dataField | Field | → | Numeric field on which to accumulate |
+| dataVar | Variable | → | Numeric variable on which to accumulate |
diff --git a/versioned_docs/version-21/commands-legacy/accumulate.md b/versioned_docs/version-21/commands-legacy/accumulate.md
index c20152ef00ee43..19109a695b5da2 100644
--- a/versioned_docs/version-21/commands-legacy/accumulate.md
+++ b/versioned_docs/version-21/commands-legacy/accumulate.md
@@ -11,7 +11,8 @@ displayed_sidebar: docs
| Parameter | Type | | Description |
| --- | --- | --- | --- |
-| data | Field, Variable | → | Numeric field or variable on which to accumulate |
+| dataField | Field | → | Numeric field on which to accumulate |
+| dataVar | Variable | → | Numeric variable on which to accumulate |