You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/API/EntityClass.md
+14-2Lines changed: 14 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -928,7 +928,12 @@ A record locked by `.lock()` is unlocked:
928
928
* when the [`unlock()`](#unlock) function is called on a matching entity in the same process
929
929
* automatically, when it is no longer referenced by any entities in memory. For example, if the lock is put only on one local reference of an entity, the entity is unlocked when the function ends. As long as there are references to the entity in memory, the record remains locked.
930
930
931
-
> An entity can also be [locked by a REST session](../REST/$lock.md), in which case it can only be unlocked by the session.
931
+
:::note Notes
932
+
933
+
-[`unlock()`](#unlock) must be called as many times as `lock()` was called in the same process for the entity to be actually unlocked.
934
+
- An entity can also be [locked by a REST session](../REST/$lock.md), in which case it can only be unlocked by the session.
935
+
936
+
:::
932
937
933
938
By default, if the *mode* parameter is omitted, the function will return an error (see below) if the same entity was modified (i.e. the stamp has changed) by another process or user in the meantime.
934
939
@@ -1725,7 +1730,7 @@ The `.unlock()` function <!-- REF #EntityClass.unlock().Summary -->removes the p
1725
1730
1726
1731
A record is automatically unlocked when it is no longer referenced by any entities in the locking process (for example: if the lock is put only on one local reference of an entity, the entity and thus the record is unlocked when the process ends).
1727
1732
1728
-
>When a record is locked, it must be unlocked from the locking process and on the entity reference which put the lock. For example:
1733
+
When a record is locked, it must be unlocked from the locking process and on the entity reference which put the lock. For example:
1729
1734
1730
1735
```4d
1731
1736
$e1:=ds.Emp.all()[0]
@@ -1735,6 +1740,13 @@ A record is automatically unlocked when it is no longer referenced by any entiti
1735
1740
$res:=$e1.unlock() //$res.success=true
1736
1741
```
1737
1742
1743
+
:::note
1744
+
1745
+
`unlock()` must be called as many times as [`lock()`](#lock) was called in the same process for the entity to be actually unlocked.
1746
+
1747
+
:::
1748
+
1749
+
1738
1750
**Result**
1739
1751
1740
1752
The object returned by `.unlock()` contains the following property:
Copy file name to clipboardExpand all lines: docs/FormObjects/properties_Object.md
+4-21Lines changed: 4 additions & 21 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -101,32 +101,15 @@ You can use an [expression](Concepts/quick-tour.md#expressions) as data source f
101
101
You can leave it up to 4D to create variables associated with your form objects (buttons, enterable variables, check boxes, etc.) dynamically and according to your needs. To do this, simply leave the "Variable or Expression" property (or `dataSource` JSON field) blank.
102
102
103
103
When a variable is not named, when the form is loaded, 4D creates a new variable for the object, with a calculated name that is unique in the space of the process variables of the interpreter (which means that this mechanism can be used even in compiled mode). This temporary variable will be destroyed when the form is closed.
104
-
In order for this principle to work in compiled mode, it is imperative that dynamic variables are explicitly typed. There are two ways to do this:
105
104
106
-
- You can set the type using the [Expression type](#expression-type) property.
107
-
- You can use a specific initialization code when the form is loaded that uses, for example, the `VARIABLE TO VARIABLE` command:
105
+
To get or set the value of form objects that use dynamic variables, you just need to call [`OBJECT Get value`](../commands-legacy/object-get-value.md) and [`OBJECT SET VALUE`](../commands-legacy/object-set-value.md) commands. For example:
108
106
109
107
```4d
110
-
If(Form event code=On Load)
111
-
var $init : Text
112
-
$Ptr_object:=OBJECT Get pointer(Object named;"comments")
113
-
$init:=""
114
-
VARIABLE TO VARIABLE(Current process;$Ptr_object->;$init)
115
-
End if
108
+
var $value : Variant
109
+
$value:=OBJECT Get value("comments")
110
+
OBJECT SET VALUE("comments";$value+10)
116
111
```
117
112
118
-
In the 4D code, dynamic variables can be accessed using a pointer obtained with the `OBJECT Get pointer` command. For example:
119
-
120
-
```4d
121
-
// assign the time 12:00:00 to the variable for the "tstart" object
122
-
$p :=OBJECT Get pointer(Object named;"tstart")
123
-
$p->:=?12:00:00?
124
-
```
125
-
126
-
There are two advantages with this mechanism:
127
-
128
-
- On the one hand, it allows the development of "subform" type components that can be used several times in the same host form. Let us take as an example the case of a datepicker subform that is inserted twice in a host form to set a start date and an end date. This subform will use objects for choosing the date of the month and the year. It will be necessary for these objects to work with different variables for the start date and the end date. Letting 4D create their variable with a unique name is a way of resolving this difficulty.
129
-
- On the other hand, it can be used to limit memory usage. In fact, form objects only work with process or inter-process variables. However, in compiled mode, an instance of each process variable is created in all the processes, including the server processes. This instance takes up memory, even when the form is not used during the session. Therefore, letting 4D create variables dynamically when loading the forms can save memory.
Copy file name to clipboardExpand all lines: docs/Notes/updates.md
+4Lines changed: 4 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -15,6 +15,10 @@ Read [**What’s new in 4D 20 R10**](https://blog.4d.com/en-whats-new-in-4d-20-R
15
15
- 4D Language:
16
16
- For consistency, [`Create entity selection`](../commands/create-entity-selection.md) and [`USE ENTITY SELECTION`](../commands/use-entity-selection.md) commands have been moved from the ["4D Environment"](../commands/theme/4D_Environment.md) to the ["Selection"](../commands/theme/Selection.md) themes.
17
17
18
+
#### Behavior changes
19
+
20
+
- On Windows, current printer fonts intended only for printing (i.e. not usable on screen) are no longer loaded by 4D at startup.
Copy file name to clipboardExpand all lines: docs/commands-legacy/get-pasteboard-data-type.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -11,7 +11,7 @@ displayed_sidebar: docs
11
11
| --- | --- | --- | --- |
12
12
| 4Dsignatures | Text array |←| 4D signatures of data types |
13
13
| nativeTypes | Text array |←| Native data types |
14
-
| formatNames | Text array |←| Format names (Windows only), empty strings under Mac OS|
14
+
| formatNames | Text array |←| Format names or descriptions|
15
15
16
16
<!-- END REF-->
17
17
@@ -26,7 +26,7 @@ This command returns the data types in several different forms via two (or three
26
26
* Under Mac OS, native types are expressed as UTIs (Uniform Type Identifier).
27
27
* Under Windows, native types are expressed as numbers, with each number being associated with a format name. The *nativeTypes* array contains these numbers in the form of strings (“3”, “12”, and so on). If you want to use more explicit labels, it is recommended to use the optional *formatNames* array, which contains the format names of the native types under Windows.
28
28
The *nativeTypes* array lets any type of data found in the pasteboard to be supported, including data whose type is not referenced by 4D.
29
-
*Under Windows, you can also pass the *formatNames* array, which receives the names of the data types found in the pasteboard. The values returned in this array can be used, for example, to build a format selection pop-up menu. Under Mac OS, the *formatNames* array returns empty strings.
29
+
*You can also pass the *formatNames* array, which receives the names or descriptions of the data types found in the pasteboard. The values returned in this array can be used, for example, to build a format selection pop-up menu.
30
30
31
31
For more information about the data types supported, please refer to the *Managing Pasteboards* section.
Copy file name to clipboardExpand all lines: docs/commands-legacy/listbox-get-row-color-as-number.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -34,7 +34,7 @@ In *row*, pass the number of the row whose color you want to get.
34
34
35
35
**Note:** The command does not take any hidden/visible states of the list box rows into account.
36
36
37
-
In the *colorType* parameter, you can pass either the lk background coloror lk font color constant ("*List Box*" theme) in order to find out the background or font color for the row. If you omit this parameter, the font color is returned.
37
+
In the *colorType* parameter, you can pass either the `lk background color`or `lk font color` constant ("*List Box*" theme) in order to find out the background or font color for the row. If you omit this parameter, the font color is returned.
38
38
39
39
**Warning:** a color assigned to a row is not necessarily displayed in every cell of the row (see example). If conflicting color values are set using properties for list boxes or list box columns, an order of priority is applied. For more information, refer to the *Design Reference* manual.
Copy file name to clipboardExpand all lines: docs/commands-legacy/listbox-get-row-color.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -34,7 +34,7 @@ In *row*, pass the number of the row whose color you want to get.
34
34
35
35
**Note:** The command does not take any hidden/visible states of the list box rows into account.
36
36
37
-
In the *colorType* parameter, you can pass either the lk background coloror lk font color constant ("*List Box*" theme) in order to find out the background or font color for the row. If you omit this parameter, the font color is returned.
37
+
In the *colorType* parameter, you can pass either the `lk background color`or `lk font color` constant ("*List Box*" theme) in order to find out the background or font color for the row. If you omit this parameter, the font color is returned.
38
38
39
39
**Warning:** A color assigned to a row is not necessarily displayed in every cell of the row (see example). If conflicting color values are set using properties for list boxes or list box columns, an order of priority is applied. For more information, refer to the *Design Reference* manual.
Copy file name to clipboardExpand all lines: docs/commands-legacy/listbox-set-row-color.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -34,9 +34,9 @@ In *row*, pass the number of the row where you want to apply the new color.
34
34
35
35
**Note:** The command does not take any hidden/visible states of the list box rows into account.
36
36
37
-
In *color*, pass an RGB color value. For more information about RGB colors, refer to the description of the [OBJECT SET RGB COLORS](object-set-rgb-colors.md) command. If you want the row to inherit the color set for the higher level, you can pass thelk inherited constant in *color*.
37
+
In *color*, pass an RGB color value. For more information about RGB colors, refer to the description of the [OBJECT SET RGB COLORS](object-set-rgb-colors.md) command. If you want the row to inherit the color set for the higher level, you can pass the`lk inherited` constant in *color*.
38
38
39
-
In the *colorType* parameter, pass the lk background coloror lk font color constants to indicate whether you want to apply the color as the background or the font color of the row. If you omit this parameter, the color is applied as the font color.
39
+
In the *colorType* parameter, pass the `lk background color`or `lk font color` constants to indicate whether you want to apply the color as the background or the font color of the row. If you omit this parameter, the color is applied as the font color.
40
40
41
41
This command modifies values found in the array of colors that may have been defined for the column or list box. If these arrays are not already defined, the command dynamically creates arrays that you can access using the [LISTBOX Get array](listbox-get-array.md) command.
Copy file name to clipboardExpand all lines: docs/commands-legacy/web-send-blob.md
+1-44Lines changed: 1 addition & 44 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -26,50 +26,7 @@ The type of data contained in the BLOB is indicated by *type*. This parameter ca
26
26
27
27
**Note:** For more information about MIME types, refer to the page: <http://www.iana.org/assignments/media-types>.
28
28
29
-
Here is a list of the most common MIME types:
30
-
31
-
|**Extension**|**Mime/Type**|
32
-
| ------------- | ------------------------ |
33
-
| .htm | text/html |
34
-
| .html | text/html |
35
-
| .shtml | text/html |
36
-
| .shtm | text/html |
37
-
| .css | text/css |
38
-
| .pdf | application/pdf |
39
-
| .rtf | application/rtf |
40
-
| .ps | application/postscript |
41
-
| .eps | application/postscript |
42
-
| .hqx | application/mac-binhex40 |
43
-
| .js | application/javascript |
44
-
| .json | application/json |
45
-
| .txt | text/plain |
46
-
| .text | text/plain |
47
-
| .gif | image/gif |
48
-
| .jpg | image/jpeg |
49
-
| .jpeg | image/jpeg |
50
-
| .jpe | image/jpeg |
51
-
| .jfif | image/jpeg |
52
-
| .pic | image/pict |
53
-
| .pict | image/pict |
54
-
| .tif | image/tiff |
55
-
| .tiff | image/tiff |
56
-
| .mpeg | video/mpeg |
57
-
| .mpg | video/mpeg |
58
-
| .mov | video/quicktime |
59
-
| .moov | video/quicktime |
60
-
| .aif | audio/aiff |
61
-
| .aiff | audio/aiff |
62
-
| .wav | audio/wav |
63
-
| .ram | audio/x-pn-realaudio |
64
-
| .sit | application/x-stuffit |
65
-
| .bin | application/x-stuffit |
66
-
| .xml | application/xml |
67
-
| .z | application/x-zip |
68
-
| .zip | application/x-zip |
69
-
| .gz | application/x-gzip |
70
-
| .tar | application/x-tar |
71
-
72
-
**Note:** The list of MIME types supported by the 4D HTTP server is saved in the "MimeTypes.xml" file found in the following folder of the 4D application: *\[Contents\]\\Native components\\HTTPServer.bundle\\Contents\\Resources*.
29
+
The list of MIME types and their file extensions supported by the 4D HTTP server is saved in the "MimeTypes.xml" file found in the "Resources" folder of the 4D application.
73
30
74
31
The references to 4D variables and *4DSCRIPT* type tags in the page are always parsed.
0 commit comments