Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
64e1612
all xml done
arnaud4d Apr 9, 2026
75daef0
forms started
arnaud4d Apr 10, 2026
c25acff
Update forms.md
arnaud4d Apr 15, 2026
609d2e1
example with screenshots
arnaud4d Apr 16, 2026
407cf88
Update forms.md
arnaud4d Apr 16, 2026
289aa06
after proofreads
arnaud4d Apr 16, 2026
41231c4
Update forms.md
arnaud4d Apr 17, 2026
357576c
Merge branch 'main' into feature/fullfill-language-sections
arnaud4d May 11, 2026
7748660
Merge branch 'main' into feature/fullfill-language-sections
arnaud4d May 11, 2026
1c9be43
supported tags (en cours)
arnaud4d May 11, 2026
ae5aa3a
supported tags (finished)
arnaud4d May 28, 2026
f65ba4f
web services et system documents
arnaud4d May 28, 2026
a67567b
fixed Form FR
arnaud4d Jun 3, 2026
06cd4c9
fix OWC glitch
arnaud4d Jun 3, 2026
3b465fe
adde ref to && operator
arnaud4d Jun 3, 2026
81c1d40
fix glitch
arnaud4d Jun 3, 2026
dda325b
Merge branch 'main' into feature/fullfill-language-sections
arnaud4d Jun 8, 2026
087d3c7
sets
arnaud4d Jun 8, 2026
88b83c8
Merge branch 'main' into feature/fullfill-language-sections
arnaud4d Jun 22, 2026
e9243b7
records
arnaud4d Jun 22, 2026
8c8d4cc
Merge branch 'main' into feature/fullfill-language-sections
arnaud4d Jun 23, 2026
5869fe1
up to drag and drop
arnaud4d Jun 23, 2026
680bff5
drag and drop+pasteboard final
arnaud4d Jun 24, 2026
8f92d09
up to form object name
arnaud4d Jun 24, 2026
63b9a23
list box commands
arnaud4d Jun 24, 2026
92f51a1
added tokens
arnaud4d Jun 24, 2026
94254ac
Update general.md
arnaud4d Jun 24, 2026
dfbbabb
relations and LDAP
arnaud4d Jun 25, 2026
68cf975
Update sidebars.js
arnaud4d Jun 25, 2026
98317e6
Merge branch 'main' into feature/fullfill-language-sections
arnaud4d Jun 25, 2026
53b7db8
Merge branch 'main' into feature/fullfill-language-sections
arnaud4d Jul 2, 2026
602bf28
ajout cache management commands overview dans les settings + fix lien…
arnaud4d Jul 2, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 4 additions & 8 deletions docs/API/SignalClass.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,16 @@ title: Signal

Signals are tools provided by the 4D language to manage interactions and avoid conflicts between processes in a multiprocess application. Signals allow you to make sure one or more process(es) will wait for a specific task to be completed before continuing execution. Any process can wait and/or release a signal.

> Semaphores can also be used to manage interactions. Semaphores allow you to make sure that two or more processes do not modify the same resource (file, record...) at the same time. Only the process that sets the semaphore can remove it.
:::note

[Semaphores](../Develop/processes.md#semaphores) can also be used to manage interactions. Semaphores allow you to make sure that two or more processes do not modify the same resource (file, record...) at the same time. Only the process that sets the semaphore can remove it.

:::

### Signal Object

A signal is a shared object that must be passed as a parameter to commands that call or create workers or processes.

A `4D.Signal` object contains the following built-in methods and properties:

- [`.wait()`](#wait)
- [`.trigger()`](#trigger)
- [`.signaled`](#signaled)
- [`.description`](#description).

Any worker/process calling the `.wait()` method will suspend its execution until the `.signaled` property is true. While waiting for a signal, the calling process does not use any CPU. This can be very interesting for performance in multiprocess applications. The `.signaled` property becomes true when any worker/process calls the `.trigger()` method.

Note that to avoid blocking situations, the `.wait()` can also return after a defined timeout has been reached.
Expand Down
9 changes: 9 additions & 0 deletions docs/Concepts/dt_string.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,15 @@ The following escape sequences can be used within strings:

**Note:** The \ (backslash) character is used as a separator in pathnames under Windows. You must therefore use a double backslash \\\ in paths when you want to have a backslash in front of a character used in one of the escape sequences recognized by 4D (e.g. "C:\\\MyDocuments\\\New.txt").


### 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](../commands/theme/Styled_Text.md) 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.



## String operators

|Operation |Syntax |Returns |Expression |Value|
Expand Down
54 changes: 54 additions & 0 deletions docs/Concepts/methods.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,57 @@ In the 4D Language, there are several categories of methods. The category depend
|**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). |


## Language tokens

4D's language includes a unique tokenization system for constants, commands, tables, fields and keywords names that are used in the code. Tokenizing these names means that as you type in the code editor they are stored internally as absolute references (numbers) and then restored as text during execution or display depending on the context. This allows you to guarantee that the code will always be interpreted correctly, even if you rename your tables or fields, or when 4D language commands are renamed over the course of different application versions.

**Note:** This also ensures automatic translation of the code when you have enabled the ["Use regional system settings" preference](../Preferences/methods.md#4d-programming-language-use-regional-system-settings) and open your databases with 4D versions in different languages.

Tokenisation is completely transparent for 4D developers when working in the [4D code editor](../code-editor/write-class-method.md), and you generally won't need to worry about it. However, there are two cases where you might need to take action regarding tokenization: if you want to disable it, and if you want to use tokenization in your formulas.

### Disabling tokenization

When your project is stored on a version control system (VCS) such as GitHub or GitLab, you may want to disable tokenization to make the code more readable on the external platform. To do this, you can deselect the [**Include tokens in project source files**](../Preferences/general.md#include-tokens-in-project-source-files) preference to prevent tokens from being stored in your **new projects**.

You can configure your **existing projects** to save code without tokens by inserting the following key in the `<applicationName>.4DProject` file using a text editor:

```json
"tokenizedText": false
```

This setting is only taken into account when methods are saved. Existing methods in your projects are left untouched, unless you resave them.

### Using tokens in formulas

A text-based 4D [formula](../commands/theme/Formulas.md) is a text that is interpreted at runtime, and not as it is typed. In fact, this is the case as soon as 4D code is expressed as raw text, more specifically when code is exported and then imported using the [`METHOD GET CODE`](../commands/method-get-code) and [`METHOD SET CODE`](../commands/method-set-code) commands, copied/pasted or [interpreted from 4D HTML tags](../Tags/transformation-tags.md).
To benefit from tokenization mechanisms in these contexts, you just need to use an explicit syntax which consists in preceding object names in the language by their token.

### Token syntax

For tokenizable named elements contained in expressions, 4D offers a special syntax you can use to reference the tokens directly: you just need to add a specific suffix after the element name to indicate its type (command, field, etc.), followed by its reference. The token syntax is detailed in this table:

|Element|Example (standard syntax)|Suffix|Example (token syntax)|Comments|
|--|---|---|---|----|
|4D Command|String(a)|:Cxx|String:C10(a)|xx is the command number|
|4D Constant|Pi|:Kxx:yy|Pi:K30:1|xx is the ID of the constant group and yy is its index (position) within this group|
|Table|[Employees]|:xx|[Employees:1]|xx is the table number|
|Field|[Employees]Name|:xx|[Employees:1]Name:2|xx is the field number|
|4D Plugin|PV PRINT(area)|:Pxx:yy|PV PRINT:P13000:229(area)|xx is the plug-in ID and yy is the index of the command|

**Note:** Uppercase letters (C, P) must be used in the suffixes; otherwise, they will not be interpreted correctly.

When you use this syntax, you guarantee that your formulas will be interpreted correctly even in the case of renaming or when the database is executed in a different language.

This syntax is accepted in all 4D formulas (or 4D expressions) regardless of the calling context:

- 4D formulas executed using the Formula editor or using commands such as [`EXECUTE FORMULA`](../commands/execute-formula), [`APPLY TO SELECTION`](../commands/apply-to-selection), [`QUERY BY FORMULA`](../commands/query-by-formula), [`LISTBOX INSERT COLUMN FORMULA`](../commands/listbox-insert-column-formula), etc.
- expressions inserted in [multi-style text areas](../FormObjects/properties_Text.md#supported-tags) (see [`ST INSERT EXPRESSION`]()),
- expressions calculated in [transformation tags](../Tags/transformation-tags.md),
- expressions inserted in external areas such as [4D Write Pro areas](../WritePro/managing-formulas.md).

#### Where to find the element numbers?

The token syntax requires the addition of the reference numbers of various elements. The location of these references depends on the type of element.

- **4D commands:** Command numbers can be found in the documentation ("Properties" area) as well as on the Commands page of the Explorer.
- **Tables and fields**: Table and field numbers can be obtained using the [`Table`](../commands/table) and [`Field`](../commands/field) commands. They are also displayed in the Inspector palette of the Structure editor.
Loading
Loading