Skip to content

Commit

Permalink
Merge pull request #387 from doc4d/main
Browse files Browse the repository at this point in the history
launch R8 beta
  • Loading branch information
arnaud4d authored Jan 16, 2025
2 parents e8f3395 + d375636 commit 2122590
Show file tree
Hide file tree
Showing 17,970 changed files with 753,277 additions and 283,917 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
10 changes: 6 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,12 @@ on:
- '!main'

jobs:
workflow-check:
check:
uses: ./.github/workflows/workflow-syntax-check.yml
workflow-build:
build:
uses: ./.github/workflows/workflow-build.yml
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}-build
cancel-in-progress: true
build-static:
uses: ./.github/workflows/workflow-build-static.yml
28 changes: 28 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ jobs:
uses: ./.github/workflows/workflow-syntax-check.yml
workflow-build:
uses: ./.github/workflows/workflow-build.yml
workflow-static:
uses: ./.github/workflows/workflow-build-static.yml

gh-release:
needs: [workflow-build]
Expand All @@ -22,3 +24,29 @@ jobs:
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./build/

publish-release:
needs: [workflow-static]
name: 'Publish Release'
runs-on: ubuntu-latest
steps:
- name: Download artifact
uses: actions/download-artifact@v4
with:
pattern: static-doc-*
path: ./release
- name: Zip
run: |
cd release
for dir in *; do
zip -r "$dir.zip" "$dir"
done
- name: Upload Release Asset
uses: softprops/action-gh-release@v2
with:
tag_name: "latest"
files: |
release/*.zip
token: ${{ secrets.GITHUB_TOKEN }}
prerelease: true

31 changes: 31 additions & 0 deletions .github/workflows/workflow-build-static.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Build static documentation

on:
workflow_call:

jobs:
build:
strategy:
matrix:
language: ["en", "fr", "es", "ja", "pt"]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '22.x'
- name: Build
run: |
if [ -e package-lock.json ]; then
npm ci
else
npm i
fi
npm run build -- --locale ${{ matrix.language }}
env:
DOCUSAURUS_LANGUAGE: ${{ matrix.language }}
DOCUSAURUS_ROUTER: 'hash'
- uses: actions/upload-artifact@v4
with:
path: ./build
name: static-doc-${{ matrix.language }}
2 changes: 1 addition & 1 deletion .github/workflows/workflow-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '20.x'
node-version: '22.x'
- name: Build
run: |
if [ -e package-lock.json ]; then
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/workflow-syntax-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '20.x'
node-version: '22.x'
- name: Diff images
env:
CLICOLOR_FORCE: 1
Expand Down
62 changes: 51 additions & 11 deletions docs/Concepts/dt_pointer.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,13 @@ $MyVar:="Hello"
$MyVar is now a variable containing the string “Hello.” We can now create a pointer to $MyVar:

```4d
C_POINTER($MyPointer)
var $MyPointer : Pointer
$MyPointer:=->$MyVar
```
The -> symbol means “get a pointer to.” This symbol is formed by a dash followed by a “greater than” sign. In this case, it gets the pointer that references or “points to” $MyVar. This pointer is assigned to MyPointer with the assignment operator.

$MyPointer is now a variable that contains a pointer to $MyVar. $MyPointer does not contain “Hello”, which is the value in $MyVar, but you can use $MyPointer to get this value. The following expression returns the value in $MyVar:

```4d
$MyPointer->
```
Expand Down Expand Up @@ -84,8 +85,35 @@ With:
|Inequality |Pointer # Pointer |Boolean |vPtrA # vPtrC |True|
||||vPtrA # vPtrB|False|


:::warning Null Pointers

Trying to assign or to read a null pointer (aka "nil") will produce an error at runtime. For example:

```4d
var $p : Pointer // non initialized pointer (Nil value)
$v:=$p-> // error
$p->:=$v // error
```

To prevent such errors, you can write:

```4d
If ($p#Null)
$p->:=$v
End if
```

:::




## Main usages


### Pointers to tables

Anywhere that the language expects to see a table, you can use a dereferenced pointer to the table. You create a pointer to a table by using a line like this:
```4d
$TablePtr:=->[anyTable]
Expand Down Expand Up @@ -118,19 +146,26 @@ OBJECT SET FONT($FieldPtr->;"Arial")

When you use pointers to process or local variables, you must be sure that the variable pointed to is already set when the pointer is used. Keep in mind that local variables are deleted when the method that created them has completed its execution and process variables are deleted at the end of the process that created them. When a pointer calls a variable that no longer exists, this causes a syntax error in interpreted mode (variable not defined) but it can generate a more serious error in compiled mode.

Pointers to local variables allow you to save process variables in many cases. Pointers to local variables can only be used within the same process. In the debugger, when you display a pointer to a local variable that has been declared in another method, the original method name is indicated in parentheses, after the pointer. For example, if you write in Method1:
Pointers to local variables allow you to save process variables in many cases. Pointers to local variables can only be used within the same process. In the debugger, when you display a pointer to a local variable that has been declared in another method, the original method name is indicated in parentheses, after the pointer. For example, if you write in *Method1*:

```4d
$MyVar:="Hello world"
Method2(->$MyVar)
```
In Method2, the debugger will display $1 as follows:
*Method2*:

|$1|->$MyVar (Method1)
|---|---
```4d
#DECLARE($param : Pointer)
...
```
The debugger will display $param as follows:

The value of $1 will be:
|$param|->$MyVar (Method1)|
|---|---|

You can expand $param and its value will be:

|$MyVar (Method1)|"Hello world"|
|$MyVar|"Hello world"|
|---|---|

### Pointers to array elements
Expand Down Expand Up @@ -162,12 +197,14 @@ If you need to refer to the fourth element in the array by using the pointer, yo

### Pointers as parameters to methods
You can pass a pointer as a parameter to a method. Inside the method, you can modify the object referenced by the pointer. For example, the following method, `takeTwo`, takes two parameters that are pointers. It changes the object referenced by the first parameter to uppercase characters, and the object referenced by the second parameter to lowercase characters. Here is the project method:

```4d
//takeTwo project method
//$1 – Pointer to a string field or variable. Change this to uppercase.
//$2 – Pointer to a string field or variable. Change this to lowercase.
$1->:=Uppercase($1->)
$2->:=Lowercase($2->)
//$changeUp – Pointer to a string field or variable. Change this to uppercase.
//$changeLow – Pointer to a string field or variable. Change this to lowercase.
#DECLARE($changeUp : Pointer ; $changeLow : Pointer)
$changeUp->:=Uppercase($changeUp->)
$changeLow->:=Lowercase($changeLow->)
```

The following line uses the `takeTwo` method to change a field to uppercase characters and to change a variable to lowercase characters:
Expand All @@ -180,6 +217,7 @@ If the field [myTable]myField contained the string "jones", it would be changed
In the takeTwo method, and in fact, whenever you use pointers, it is important that the data type of the object being referenced is correct. In the previous example, the pointers must point to something that contains a string or text.

### Pointers to pointers

If you really like to complicate things, you can use pointers to reference other pointers. Consider this example:
```4d
$MyVar:="Hello"
Expand Down Expand Up @@ -214,3 +252,5 @@ $NewVar:=($PointerTwo->)->
```

**Important:** Multiple dereferencing requires parentheses.


4 changes: 2 additions & 2 deletions docs/Debugging/debugLogFiles.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ id: debugLogFiles
title: Log files
---

4D applications can generate several log files that are useful for debugging or optimizing their execution. Logs are usually started or stopped using selectors of the [SET DATABASE PARAMETER](https://doc.4d.com/4dv20/help/command/en/page642.html), [WEB SET OPTION](https://doc.4d.com/4dv20/help/command/en/page1210.html), or [HTTP SET OPTION](https://doc.4d.com/4dv20/help/command/en/page1160.html) commands and are stored in the [Logs folder](Project/architecture.md#logs) of the project.
4D applications can generate several log files that are useful for debugging or optimizing their execution. Logs are usually started or stopped using selectors of the [SET DATABASE PARAMETER](../commands-legacy/set-database-parameter.md), [WEB SET OPTION](../commands-legacy/web-set-option.md), or [HTTP SET OPTION](../commands-legacy/http-set-option.md) commands and are stored in the [Logs folder](Project/architecture.md#logs) of the project.

Information logged needs to be analyzed to detect and fix issues. This section provides a comprehensive description of the following log files:

Expand Down Expand Up @@ -290,7 +290,7 @@ These log files record each exchange between the 4D application and the mail ser

* SMTP - [SMTP New transporter](../commands/smtp-new-transporter.md)
* POP3 - [POP3 New transporter](../commands/pop3-new-transporter.md)
* IMAP - [IMAP New transporter](../commands/imap-new-transporter.mdnsporter)
* IMAP - [IMAP New transporter](../commands/imap-new-transporter.md)

The log files can be produced in two versions:

Expand Down
2 changes: 1 addition & 1 deletion docs/Develop/preemptive.md
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ It is possible to [disable locally the thread-safety verification](#).

:::

The [symbol file](../Project/compiler.md/#complete-list-of-methods), if enabled, also contains the thread safety status for each method.
The [symbol file](../Project/compiler.md#complete-list-of-methods), if enabled, also contains the thread safety status for each method.

### User interface

Expand Down
4 changes: 2 additions & 2 deletions docs/FormEditor/forms.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ You can create multiple pages for an input form. If you have more fields or vari

- Place the most important information on the first page and less important information on other pages.
- Organize each topic on its own page.
- Reduce or eliminate scrolling during data entry by setting the [entry order](../FormEditor/formEditor.html#data-entry-order).
- Reduce or eliminate scrolling during data entry by setting the [entry order](formEditor.md#data-entry-order).
- Provide space around the form elements for an attractive screen design.

Multiple pages are a convenience used for input forms only. They are not for printed output. When a multi-page form is printed, only the first page is printed.
Expand All @@ -112,7 +112,7 @@ When a form is executed, the objects are loaded and combined in the following or
3. Page zero of the open form
4. Current page of the open form.

This order determines the default [entry order](../FormEditor/formEditor.html#data-entry-order) of objects in the form.
This order determines the default [entry order](formEditor.md#data-entry-order) of objects in the form.

> Only pages 0 and 1 of an inherited form can appear in other forms.
Expand Down
2 changes: 1 addition & 1 deletion docs/FormObjects/dropdownList_Overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ You can create different types of drop-down lists with different features. To de

> This feature is only available in 4D projects.
An [object](Concepts/dt_object.md) encapsulating a [collection](Concepts/dt_collection) can be used as the data source of a drop-down list. The object must contain the following properties:
An [object](Concepts/dt_object.md) encapsulating a [collection](Concepts/dt_collection.md) can be used as the data source of a drop-down list. The object must contain the following properties:

|Property|Type|Description|
|---|---|---|
Expand Down
8 changes: 4 additions & 4 deletions docs/FormObjects/properties_Entry.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ For a [multi-style](properties_Text.md#multi-style) text type [input](input_over
- commands for supported style modifications: font, size, style, color and background color.
When the user modifies a style attribute via this pop-up menu, 4D generates the `On After Edit` form event.

For a [Web Area](webArea_overview.md), the contents of the menu depend of the rendering engine of the platform. It is possible to control access to the context menu via the [`WA SET PREFERENCE`](https://doc.4d.com/4Dv17R6/4D/17-R6/WA-SET-PREFERENCE.301-4310780.en.html) command.
For a [Web Area](webArea_overview.md), the contents of the menu depend of the rendering engine of the platform. It is possible to control access to the context menu via the [`WA SET PREFERENCE`](../commands-legacy/wa-set-preference.md) command.

#### JSON Grammar

Expand Down Expand Up @@ -221,7 +221,7 @@ You can use an XLIFF reference in the ":xliff:resname" form as a placeholder, fo

You only pass the reference in the "Placeholder" field; it is not possible to combine a reference with static text.

>You can also set and get the placeholder text by programming using the [OBJECT SET PLACEHOLDER](https://doc.4d.com/4Dv17R5/4D/17-R5/OBJECT-SET-PLACEHOLDER.301-4128243.en.html) and [OBJECT Get placeholder](https://doc.4d.com/4Dv17R5/4D/17-R5/OBJECT-Get-placeholder.301-4128249.en.html) commands.
>You can also set and get the placeholder text by programming using the [`OBJECT SET PLACEHOLDER`](../commands-legacy/object-set-placeholder.md) and [`OBJECT Get placeholder`](../commands-legacy/object-get-placeholder.md) commands.
#### JSON Grammar

Expand Down Expand Up @@ -263,9 +263,9 @@ You can configure this option by clicking the [...] button in the Shortcuts prop

![](../assets/en/FormObjects/property_shortcut.png)

>You can also assign a shortcut to a custom menu command. If there is a conflict between two shortcuts, the active object has priority. For more information about associating shortcuts with menus, refer to [Setting menu properties](https://doc.4d.com/4Dv17R5/4D/17-R5/Setting-menu-properties.300-4163525.en.html).
>You can also assign a shortcut to a custom menu command. If there is a conflict between two shortcuts, the active object has priority. For more information about associating shortcuts with menus, refer to [Setting menu properties](../Menus/properties.md).
To view a list of all the shortcuts used in the 4D Design environment, see the [Shortcuts Page](https://doc.4d.com/4Dv17R5/4D/17-R5/Shortcuts-Page.300-4163701.en.html) in the Preferences dialog box.
To view a list of all the shortcuts used in the 4D Design environment, see the [Shortcuts Page](../Preferences/shortcuts.md) in the Preferences dialog box.

#### JSON Grammar

Expand Down
Loading

0 comments on commit 2122590

Please sign in to comment.