Skip to content

Commit

Permalink
Merge pull request #364 from doc4d/main
Browse files Browse the repository at this point in the history
Update 4D 20.5 release note
  • Loading branch information
arnaud4d authored Oct 14, 2024
2 parents b65530f + 6b75230 commit b089742
Show file tree
Hide file tree
Showing 10,940 changed files with 439,947 additions and 32,494 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
6 changes: 5 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,11 @@ name: deploy
on:
pull_request:
branches: [main]

push:
branches:
- '*/*'
- '!main'

jobs:
workflow-build:
uses: ./.github/workflows/workflow-build.yml
1,352 changes: 1,343 additions & 9 deletions commandList.json

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions crowdin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,16 @@ files:
- source: /docs/**/*
ignore:
- /docs/preprocessing.conf
- /docs/commands-legacy/*.*
- /docs/WritePro/commands-legacy/*.*
translation: /i18n/%two_letters_code%/docusaurus-plugin-content-docs/current/**/%original_file_name%
- source: /i18n/en/docusaurus-plugin-content-docs/*.json
translation: /i18n/%two_letters_code%/docusaurus-plugin-content-docs/%original_file_name%
- source: /versioned_docs/**/*
ignore:
- /versioned_docs/**/preprocessing.conf
- /versioned_docs/**/commands-legacy/*.*
- /versioned_docs/**/WritePro/commands-legacy/*.*
translation: /i18n/%two_letters_code%/docusaurus-plugin-content-docs/**/%original_file_name%
- source: /i18n/en/docusaurus-theme-classic/*.json
translation: /i18n/%two_letters_code%/docusaurus-theme-classic/%original_file_name%
Expand Down
24 changes: 24 additions & 0 deletions docs/API/ClassClass.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ When a user class is [defined](Concepts/classes.md#class-definition) in the proj

||
|---|
|[<!-- INCLUDE #ClassClass.isSessionSingleton.Syntax -->](#issessionsingleton)<br/><!-- INCLUDE #ClassClass.isSessionSingleton.Summary -->|
|[<!-- INCLUDE #ClassClass.isShared.Syntax -->](#isshared)<br/><!-- INCLUDE #ClassClass.isShared.Summary -->|
|[<!-- INCLUDE #ClassClass.isSingleton.Syntax -->](#issingleton)<br/><!-- INCLUDE #ClassClass.isSingleton.Summary -->|
|[<!-- INCLUDE #ClassClass.me.Syntax -->](#me)<br/><!-- INCLUDE #ClassClass.me.Summary -->|
Expand All @@ -22,6 +23,29 @@ When a user class is [defined](Concepts/classes.md#class-definition) in the proj



<!-- REF ClassClass.isSessionSingleton.Desc -->
## .isSessionSingleton

<details><summary>History</summary>

|Release|Changes|
|---|---|
|20 R7|Added|

</details>

<!-- REF #ClassClass.isSessionSingleton.Syntax -->**.isSessionSingleton** : Boolean<!-- END REF -->

#### Description

The `.isSessionSingleton` property <!-- REF #ClassClass.isSessionSingleton.Summary -->returns `true` if the user class has been defined as a [session singleton class](../Concepts/classes.md#singleton-classes)<!-- END REF -->, and `false` otherwise.

This property is **read-only**.

<!-- END REF -->



<!-- REF ClassClass.isShared.Desc -->
## .isShared

Expand Down
159 changes: 4 additions & 155 deletions docs/API/CollectionClass.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,8 @@ title: Collection

The Collection class manages [Collection](Concepts/dt_collection.md) type variables.

A collection is initialized with:
A collection is initialized with the [`New collection`](../commands/new-collection.md) or [`New shared collection`](../commands/new-shared-collection.md) commands.

||
|---|
|[<!-- INCLUDE #_command_.New collection.Syntax -->](#new-collection)<br/><!-- INCLUDE #_command_.New collection.Summary -->|
|[<!-- INCLUDE #_command_.New shared collection.Syntax -->](#new-shared-collection)<br/><!-- INCLUDE #_command_.New shared collection.Summary -->|


### Example
Expand Down Expand Up @@ -77,156 +73,6 @@ A collection is initialized with:



## `New collection`


<!-- REF #_command_.New collection.Syntax -->**New collection** {( *...value* : any )} : Collection<!-- END REF -->


<!-- REF #_command_.New collection.Params -->
|Parameter|Type||Description|
|---------|--- |:---:|------|
|value|Number, Text, Date, Time, Boolean, Object, Collection, Picture, Pointer|->|Collection's value(s)|
|Result|Collection|<-|The new collection|
<!-- END REF -->


#### Description

The `New collection` command <!-- REF #_command_.New collection.Summary --> creates a new empty or prefilled collection<!-- END REF --> and returns its reference.

If you do not pass any parameters, `New collection` creates an empty collection and returns its reference.

You must assign the returned reference to a 4D variable of the Collection type.

>Keep in mind that `var : Collection` or `C_COLLECTION` statements declare a variable of the `Collection` type but do not create any collection.
Optionally, you can prefill the new collection by passing one or several *value*(s) as parameter(s).

Otherwise, you can add or modify elements subsequently through assignment. For example:

```4d
myCol[10]:="My new element"
```

If the new element index is beyond the last existing element of the collection, the collection is automatically resized and all new intermediary elements are assigned a **null** value.

You can pass any number of values of any supported type (number, text, date, picture, pointer, object, collection...). Unlike arrays, collections can mix data of different types.

You must pay attention to the following conversion issues:

* If you pass a pointer, it is kept "as is"; it is evaluated using the `JSON Stringify` command
* Dates are stored as "yyyy-mm-dd" dates or strings with the "YYYY-MM-DDTHH:mm:ss.SSSZ" format, according to the current "dates inside objects" database setting. When converting 4D dates into text prior to storing them in the collection, by default the program takes the local time zone into account. You can modify this behavior using the `Dates inside objects` selector of the `SET DATABASE PARAMETER` command.
* If you pass a time, it is stored as a number of milliseconds (Real).

#### Example 1



You want to create a new empty collection and assign it to a 4D collection variable:

```4d
var $myCol : Collection
$myCol:=New collection
//$myCol=[]
```

#### Example 2

You want to create a prefilled collection:

```4d
var $filledColl : Collection
$filledColl:=New collection(33;"mike";"november";->myPtr;Current date)
//$filledColl=[33,"mike","november","->myPtr","2017-03-28T22:00:00.000Z"]
```

#### Example 3

You create a new collection and then add a new element:

```4d
var $coll : Collection
$coll:=New collection("a";"b";"c")
//$coll=["a","b","c"]
$coll[9]:="z" //add a 10th element with value "z"
$vcolSize:=$coll.length //10
//$coll=["a","b","c",null,null,null,null,null,null,"z"]
```




## `New shared collection`

<details><summary>History</summary>

|Release|Changes|
|---|---|
|v16 R6|Added|

</details>

<!-- REF #_command_.New shared collection.Syntax -->**New shared collection** {( *...value* : any )} : Collection<!-- END REF -->


<!-- REF #_command_.New shared collection.Params -->
|Parameter|Type||Description|
|---------|--- |:---:|------|
|value|Number, Text, Date, Time, Boolean, Shared object, Shared collection|->|Shared collection's value(s)|
|Result|Collection|<-|The new shared collection|
<!-- END REF -->


#### Description

The `New shared collection` command <!-- REF #_command_.New shared collection.Summary --> creates a new empty or prefilled shared collection<!-- END REF --> and returns its reference.

Adding an element to this collection using the assignment operator must be surrounded by the [`Use...End use`](Concepts/shared.md#useend-use) structure, otherwise an error is generated (this is not necessary when adding elements using functions such as [`push()`](#push) or [`map()`](#map) because they automatically trigger an internal *Use...End use*). Reading an element without a *Use...End use* structure is, however, possible.

:::info

For more information on shared collections, please refer to the [Shared objects and collections](Concepts/shared.md) page.

:::

If you do not pass any parameters, `New shared collection` creates an empty shared collection and returns its reference.

You must assign the returned reference to a 4D variable of the Collection type.

> Keep in mind that `var : Collection` or `C_COLLECTION` statements declare a variable of the `Collection` type but do not create any collection.
Optionally, you can prefill the new shared collection by passing one or several *value*(s) as parameter(s). Otherwise, you can add or modify elements subsequently through object notation assignment (see example).

If the new element index is beyond the last existing element of the shared collection, the collection is automatically resized and all new intermediary elements are assigned a **null** value.

You can pass any number of values of the following supported types:

* number (real, longint...). Number values are always stored as reals.
* text
* boolean
* date
* time (stored as number of milliseconds - real)
* null
* shared object
* shared collection

:::note

Unlike standard (not shared) collections, shared collections do not support pictures, pointers, and objects or collections that are not shared.

:::


#### Example

```4d
$mySharedCol:=New shared collection("alpha";"omega")
Use($mySharedCol)
$mySharedCol[1]:="beta"
End use
```




Expand Down Expand Up @@ -353,6 +199,7 @@ If the collection contains objects, pass the *propertyPath* parameter to indicat

</details>


<!-- REF #collection.clear().Syntax -->**.clear()** : Collection<!-- END REF -->


Expand Down Expand Up @@ -2357,6 +2204,7 @@ The `.orderBy()` function <!-- REF #collection.orderBy().Summary -->returns a ne
This function returns a *shallow copy*, which means that objects or collections in both collections share the same reference. If the original collection is a shared collection, the returned collection is also a shared collection.



>This function does not modify the original collection.
If you pass no parameter, the function orders scalar values in the collection in ascending order (other element types such as objects or collections are returned with an internal order). You can modify this automatic order by passing the `ck ascending` or `ck descending` constants in the *ascOrDesc* parameter (see below).
Expand Down Expand Up @@ -3069,6 +2917,7 @@ The callback sets the following parameter(s):
#### Example 1



```4d
var $c : Collection
$c:=New collection(5;3;5;1;3;4;4;6;2;2)
Expand Down
Loading

0 comments on commit b089742

Please sign in to comment.