diff --git a/docs/assets/de/FormEditor/listboxBuilderIcon.png b/docs/assets/de/FormEditor/listboxBuilderIcon.png index 4c11a5989f23eb..40daf8fccf2aa0 100644 Binary files a/docs/assets/de/FormEditor/listboxBuilderIcon.png and b/docs/assets/de/FormEditor/listboxBuilderIcon.png differ diff --git a/docs/assets/de/FormObjects/button_osxgradient.en.png b/docs/assets/de/FormObjects/button_osxgradient.en.png index c667b5992fbe9d..106bdd992461f0 100644 Binary files a/docs/assets/de/FormObjects/button_osxgradient.en.png and b/docs/assets/de/FormObjects/button_osxgradient.en.png differ diff --git a/docs/assets/de/MSC/MSC_RepairOK.png b/docs/assets/de/MSC/MSC_RepairOK.png index 13d0696f212fc8..3c4453f9d400be 100644 Binary files a/docs/assets/de/MSC/MSC_RepairOK.png and b/docs/assets/de/MSC/MSC_RepairOK.png differ diff --git a/docs/assets/de/MSC/MSC_encrypt1.png b/docs/assets/de/MSC/MSC_encrypt1.png index bcbd782ae83065..2181fe33d09f03 100644 Binary files a/docs/assets/de/MSC/MSC_encrypt1.png and b/docs/assets/de/MSC/MSC_encrypt1.png differ diff --git a/docs/assets/de/MSC/MSC_encrypt10.png b/docs/assets/de/MSC/MSC_encrypt10.png index 4aab2e1a54bf05..9ab73cab6f6bf7 100644 Binary files a/docs/assets/de/MSC/MSC_encrypt10.png and b/docs/assets/de/MSC/MSC_encrypt10.png differ diff --git a/docs/assets/de/MSC/MSC_encrypt2.png b/docs/assets/de/MSC/MSC_encrypt2.png index 1a1162cc78faa8..659086edf8cdc7 100644 Binary files a/docs/assets/de/MSC/MSC_encrypt2.png and b/docs/assets/de/MSC/MSC_encrypt2.png differ diff --git a/docs/assets/de/MSC/MSC_encrypt4.png b/docs/assets/de/MSC/MSC_encrypt4.png index 39d9afe1d10e62..a215c22162f4a8 100644 Binary files a/docs/assets/de/MSC/MSC_encrypt4.png and b/docs/assets/de/MSC/MSC_encrypt4.png differ diff --git a/docs/assets/de/MSC/MSC_encrypt5.png b/docs/assets/de/MSC/MSC_encrypt5.png index 55ead066ab7160..a2f1b974180020 100644 Binary files a/docs/assets/de/MSC/MSC_encrypt5.png and b/docs/assets/de/MSC/MSC_encrypt5.png differ diff --git a/docs/assets/de/MSC/MSC_encrypt6.png b/docs/assets/de/MSC/MSC_encrypt6.png index 47eebe0a570f18..2a83cdd65c7fba 100644 Binary files a/docs/assets/de/MSC/MSC_encrypt6.png and b/docs/assets/de/MSC/MSC_encrypt6.png differ diff --git a/docs/assets/de/MSC/MSC_encrypt7.png b/docs/assets/de/MSC/MSC_encrypt7.png index ee07b87cc8cb2f..3b30e573abd253 100644 Binary files a/docs/assets/de/MSC/MSC_encrypt7.png and b/docs/assets/de/MSC/MSC_encrypt7.png differ diff --git a/docs/assets/de/MSC/MSC_encrypt8.png b/docs/assets/de/MSC/MSC_encrypt8.png index a61e238eacd67a..bb665844fc0668 100644 Binary files a/docs/assets/de/MSC/MSC_encrypt8.png and b/docs/assets/de/MSC/MSC_encrypt8.png differ diff --git a/docs/assets/de/MSC/MSC_encrypt9.png b/docs/assets/de/MSC/MSC_encrypt9.png index 39d9afe1d10e62..a215c22162f4a8 100644 Binary files a/docs/assets/de/MSC/MSC_encrypt9.png and b/docs/assets/de/MSC/MSC_encrypt9.png differ diff --git a/docs/assets/de/MSC/msc_Backup.png b/docs/assets/de/MSC/msc_Backup.png index 01cea9df490a28..04ac3a99ed1879 100644 Binary files a/docs/assets/de/MSC/msc_Backup.png and b/docs/assets/de/MSC/msc_Backup.png differ diff --git a/docs/assets/fr/FormEditor/listboxBuilderIcon.png b/docs/assets/fr/FormEditor/listboxBuilderIcon.png index 4c11a5989f23eb..40daf8fccf2aa0 100644 Binary files a/docs/assets/fr/FormEditor/listboxBuilderIcon.png and b/docs/assets/fr/FormEditor/listboxBuilderIcon.png differ diff --git a/docs/assets/fr/FormEditor/shields.png b/docs/assets/fr/FormEditor/shields.png index 21c805438c888a..aaae4df4f580ed 100644 Binary files a/docs/assets/fr/FormEditor/shields.png and b/docs/assets/fr/FormEditor/shields.png differ diff --git a/docs/assets/fr/FormObjects/hierarch1.png b/docs/assets/fr/FormObjects/hierarch1.png index 5ac2887997d817..d6152bc100580d 100644 Binary files a/docs/assets/fr/FormObjects/hierarch1.png and b/docs/assets/fr/FormObjects/hierarch1.png differ diff --git a/docs/assets/fr/FormObjects/hierarch11.png b/docs/assets/fr/FormObjects/hierarch11.png index 37fa77455ed6e9..142b5083f9dd84 100644 Binary files a/docs/assets/fr/FormObjects/hierarch11.png and b/docs/assets/fr/FormObjects/hierarch11.png differ diff --git a/docs/assets/fr/FormObjects/hierarch12.png b/docs/assets/fr/FormObjects/hierarch12.png index 6a1a95bbba71f8..6b2d48d92cebf8 100644 Binary files a/docs/assets/fr/FormObjects/hierarch12.png and b/docs/assets/fr/FormObjects/hierarch12.png differ diff --git a/docs/assets/fr/FormObjects/hierarch13.png b/docs/assets/fr/FormObjects/hierarch13.png index 297a435ea97003..9b6e12a921d944 100644 Binary files a/docs/assets/fr/FormObjects/hierarch13.png and b/docs/assets/fr/FormObjects/hierarch13.png differ diff --git a/docs/assets/fr/FormObjects/hierarch14.png b/docs/assets/fr/FormObjects/hierarch14.png index f863b99d1dc965..5162868f9589bb 100644 Binary files a/docs/assets/fr/FormObjects/hierarch14.png and b/docs/assets/fr/FormObjects/hierarch14.png differ diff --git a/docs/assets/fr/FormObjects/hierarch15.png b/docs/assets/fr/FormObjects/hierarch15.png index 7da50e0fa1e493..7c96ce64727f97 100644 Binary files a/docs/assets/fr/FormObjects/hierarch15.png and b/docs/assets/fr/FormObjects/hierarch15.png differ diff --git a/docs/assets/fr/FormObjects/hierarch16.png b/docs/assets/fr/FormObjects/hierarch16.png index fe8150e1b233e4..fd58a2263ffbec 100644 Binary files a/docs/assets/fr/FormObjects/hierarch16.png and b/docs/assets/fr/FormObjects/hierarch16.png differ diff --git a/docs/assets/fr/FormObjects/hierarch2.png b/docs/assets/fr/FormObjects/hierarch2.png index a8840594684108..c86e3aea4f799f 100644 Binary files a/docs/assets/fr/FormObjects/hierarch2.png and b/docs/assets/fr/FormObjects/hierarch2.png differ diff --git a/docs/assets/fr/FormObjects/hierarch3.png b/docs/assets/fr/FormObjects/hierarch3.png index 1f8adcf60e4a0a..db80bf6ddcc623 100644 Binary files a/docs/assets/fr/FormObjects/hierarch3.png and b/docs/assets/fr/FormObjects/hierarch3.png differ diff --git a/docs/assets/fr/FormObjects/hierarch4.png b/docs/assets/fr/FormObjects/hierarch4.png index 7fee1c19ee0751..c197d38b5a1080 100644 Binary files a/docs/assets/fr/FormObjects/hierarch4.png and b/docs/assets/fr/FormObjects/hierarch4.png differ diff --git a/docs/assets/fr/FormObjects/hierarch5.png b/docs/assets/fr/FormObjects/hierarch5.png index 1c82ef869c8530..9bc1d0857ccd82 100644 Binary files a/docs/assets/fr/FormObjects/hierarch5.png and b/docs/assets/fr/FormObjects/hierarch5.png differ diff --git a/docs/assets/fr/FormObjects/hierarch6.png b/docs/assets/fr/FormObjects/hierarch6.png index b67742d4422225..2190a4d247406c 100644 Binary files a/docs/assets/fr/FormObjects/hierarch6.png and b/docs/assets/fr/FormObjects/hierarch6.png differ diff --git a/docs/assets/fr/FormObjects/hierarch7.png b/docs/assets/fr/FormObjects/hierarch7.png index 919cb6e5db57d7..1b98f44ae735ee 100644 Binary files a/docs/assets/fr/FormObjects/hierarch7.png and b/docs/assets/fr/FormObjects/hierarch7.png differ diff --git a/docs/assets/fr/FormObjects/hierarch8.png b/docs/assets/fr/FormObjects/hierarch8.png index 324ace96f36b0a..994dbc977fc398 100644 Binary files a/docs/assets/fr/FormObjects/hierarch8.png and b/docs/assets/fr/FormObjects/hierarch8.png differ diff --git a/docs/assets/fr/FormObjects/hierarch9.png b/docs/assets/fr/FormObjects/hierarch9.png index 3953368eaca295..088da8a61450bb 100644 Binary files a/docs/assets/fr/FormObjects/hierarch9.png and b/docs/assets/fr/FormObjects/hierarch9.png differ diff --git a/docs/assets/fr/MSC/MSC_compactwarn.png b/docs/assets/fr/MSC/MSC_compactwarn.png index 92437fd9d2f474..5c69747af43a56 100644 Binary files a/docs/assets/fr/MSC/MSC_compactwarn.png and b/docs/assets/fr/MSC/MSC_compactwarn.png differ diff --git a/docs/assets/fr/MSC/MSC_encrypt1.png b/docs/assets/fr/MSC/MSC_encrypt1.png index 74844ae23b9d26..2181fe33d09f03 100644 Binary files a/docs/assets/fr/MSC/MSC_encrypt1.png and b/docs/assets/fr/MSC/MSC_encrypt1.png differ diff --git a/docs/assets/fr/MSC/MSC_encrypt10.png b/docs/assets/fr/MSC/MSC_encrypt10.png index 5e92a8df51db38..9ab73cab6f6bf7 100644 Binary files a/docs/assets/fr/MSC/MSC_encrypt10.png and b/docs/assets/fr/MSC/MSC_encrypt10.png differ diff --git a/docs/assets/fr/MSC/MSC_encrypt2.png b/docs/assets/fr/MSC/MSC_encrypt2.png index 63a711cfdb7bd4..659086edf8cdc7 100644 Binary files a/docs/assets/fr/MSC/MSC_encrypt2.png and b/docs/assets/fr/MSC/MSC_encrypt2.png differ diff --git a/docs/assets/fr/MSC/MSC_encrypt4.png b/docs/assets/fr/MSC/MSC_encrypt4.png index d40afbffb8793c..a215c22162f4a8 100644 Binary files a/docs/assets/fr/MSC/MSC_encrypt4.png and b/docs/assets/fr/MSC/MSC_encrypt4.png differ diff --git a/docs/assets/fr/MSC/MSC_encrypt5.png b/docs/assets/fr/MSC/MSC_encrypt5.png index 367b443a311385..a2f1b974180020 100644 Binary files a/docs/assets/fr/MSC/MSC_encrypt5.png and b/docs/assets/fr/MSC/MSC_encrypt5.png differ diff --git a/docs/assets/fr/MSC/msc_Backup.png b/docs/assets/fr/MSC/msc_Backup.png index ebb0452c9193fc..04ac3a99ed1879 100644 Binary files a/docs/assets/fr/MSC/msc_Backup.png and b/docs/assets/fr/MSC/msc_Backup.png differ diff --git a/docs/assets/fr/MSC/mscrepair2.png b/docs/assets/fr/MSC/mscrepair2.png index c5daac47528ce2..40cf9df248a679 100644 Binary files a/docs/assets/fr/MSC/mscrepair2.png and b/docs/assets/fr/MSC/mscrepair2.png differ diff --git a/docs/assets/fr/Menus/splash1.png b/docs/assets/fr/Menus/splash1.png index 2fda9739222397..e1965b10502612 100644 Binary files a/docs/assets/fr/Menus/splash1.png and b/docs/assets/fr/Menus/splash1.png differ diff --git a/docs/assets/fr/Menus/splash3.png b/docs/assets/fr/Menus/splash3.png index aa786a67df6c8c..b5ed4e1d5786a5 100644 Binary files a/docs/assets/fr/Menus/splash3.png and b/docs/assets/fr/Menus/splash3.png differ diff --git a/docs/assets/ja/FormEditor/listboxBuilderIcon.png b/docs/assets/ja/FormEditor/listboxBuilderIcon.png index 4c11a5989f23eb..40daf8fccf2aa0 100644 Binary files a/docs/assets/ja/FormEditor/listboxBuilderIcon.png and b/docs/assets/ja/FormEditor/listboxBuilderIcon.png differ diff --git a/website/i18n/fr.json b/website/i18n/fr.json index e884afd4f04a33..760344733af165 100644 --- a/website/i18n/fr.json +++ b/website/i18n/fr.json @@ -30,7 +30,7 @@ "title": "DataStore" }, "API/directory": { - "title": "Classe Directory" + "title": "Directory Class" }, "API/document": { "title": "Document Class" @@ -57,7 +57,7 @@ "title": "IMAPTransporter" }, "API/overview": { - "title": "Aperçu - API des classes" + "title": "Class API Overview" }, "API/pop3TransporterClass": { "title": "POP3Transporter" @@ -69,7 +69,7 @@ "title": "SMTPTransporter" }, "API/transporter": { - "title": "Classe Transporter" + "title": "Transporter Class" }, "API/webServerClass": { "title": "WebServer" @@ -391,13 +391,13 @@ "title": "Action" }, "FormEditor/propertiesForm": { - "title": "Propriétés des formulaires" + "title": "Form Properties" }, "FormEditor/formSize": { "title": "Form Size" }, "FormEditor/jsonReference": { - "title": "Liste de propriétés JSON" + "title": "JSON property list" }, "FormEditor/markers": { "title": "Markers" @@ -406,52 +406,52 @@ "title": "Menu" }, "FormEditor/print": { - "title": "Imprimer" + "title": "Print" }, "FormEditor/windowSize": { "title": "Window Size" }, "FormObjects/buttonOverview": { - "title": "Bouton" + "title": "Button" }, "FormObjects/buttonGridOverview": { - "title": "Grille de boutons" + "title": "Button Grid" }, "FormObjects/checkboxOverview": { - "title": "Case à cocher" + "title": "Check Box" }, "FormObjects/comboBoxOverview": { "title": "Combo Box" }, "FormObjects/dropdownListOverview": { - "title": "Liste déroulante" + "title": "Drop-down List" }, "FormObjects/formObjectsOverview": { - "title": "A propos des objets formulaires 4D" + "title": "About 4D Form Objects" }, "FormObjects/groupBox": { - "title": "Zone de groupe" + "title": "Group Box" }, "FormObjects/inputOverview": { "title": "Input" }, "FormObjects/listOverview": { - "title": "Liste hiérarchique" + "title": "Hierarchical List" }, "FormObjects/listboxOverview": { "title": "List Box" }, "FormObjects/pictureButtonOverview": { - "title": "Bouton image" + "title": "Picture Button" }, "FormObjects/picturePopupMenuOverview": { - "title": "Pop-up menu image" + "title": "Picture Pop-up Menu" }, "FormObjects/pluginAreaOverview": { - "title": "Zone de plug-in" + "title": "Plug-in Area" }, "FormObjects/progressIndicator": { - "title": "Indicateurs de progression" + "title": "Progress Indicator" }, "FormObjects/propertiesAction": { "title": "Action" @@ -460,46 +460,46 @@ "title": "Animation" }, "FormObjects/propertiesAppearance": { - "title": "Apparence" + "title": "Appearance" }, "FormObjects/propertiesBackgroundAndBorder": { - "title": "Fond et bordure" + "title": "Background and Border" }, "FormObjects/propertiesCoordinatesAndSizing": { - "title": "Coordonnées et dimensions" + "title": "Coordinates & Sizing" }, "FormObjects/propertiesCrop": { - "title": "Découpage" + "title": "Crop" }, "FormObjects/propertiesDataSource": { - "title": "Source de données" + "title": "Data Source" }, "FormObjects/propertiesDisplay": { - "title": "Affichage" + "title": "Display" }, "FormObjects/propertiesEntry": { - "title": "Saisie" + "title": "Entry" }, "FormObjects/propertiesFooters": { - "title": "Pieds" + "title": "Footers" }, "FormObjects/propertiesGridlines": { - "title": "Quadrillage" + "title": "Gridlines" }, "FormObjects/propertiesHeaders": { - "title": "En-têtes" + "title": "Headers" }, "FormObjects/propertiesHelp": { - "title": "Aide" + "title": "Help" }, "FormObjects/propertiesHierarchy": { - "title": "Hiérarchie" + "title": "Hierarchy" }, "FormObjects/propertiesListBox": { "title": "List Box" }, "FormObjects/propertiesObject": { - "title": "Objets" + "title": "Objects" }, "FormObjects/propertiesPicture": { "title": "Image" @@ -508,161 +508,161 @@ "title": "Plug-ins" }, "FormObjects/propertiesPrint": { - "title": "Imprimer" + "title": "Print" }, "FormObjects/propertiesRangeOfValues": { - "title": "Plage de valeurs" + "title": "Range of Values" }, "FormObjects/propertiesReference": { - "title": "Liste de propriétés JSON" + "title": "JSON property list" }, "FormObjects/propertiesResizingOptions": { - "title": "Options de redimensionnement" + "title": "Resizing Options" }, "FormObjects/propertiesScale": { - "title": "Echelle" + "title": "Scale" }, "FormObjects/propertiesSubform": { - "title": "Sous-formulaire" + "title": "Subform" }, "FormObjects/propertiesText": { - "title": "Texte" + "title": "Text" }, "FormObjects/propertiesTextAndPicture": { - "title": "Texte et Image" + "title": "Text and Picture" }, "FormObjects/propertiesWebArea": { - "title": "Zone Web" + "title": "Web Area" }, "FormObjects/radiobuttonOverview": { - "title": "Bouton radio" + "title": "Radio Button" }, "FormObjects/ruler": { - "title": "Règle" + "title": "Ruler" }, "FormObjects/shapesOverview": { - "title": "Formes" + "title": "Shapes" }, "FormObjects/spinner": { "title": "Spinner" }, "FormObjects/splitters": { - "title": "Séparateur" + "title": "Splitter" }, "FormObjects/staticPicture": { - "title": "Image statique" + "title": "Static picture" }, "FormObjects/stepper": { "title": "Stepper" }, "FormObjects/subformOverview": { - "title": "Sous-formulaire" + "title": "Subform" }, "FormObjects/tabControl": { - "title": "Onglets" + "title": "Tab Controls" }, "FormObjects/text": { - "title": "Texte" + "title": "Text" }, "FormObjects/viewProAreaOverview": { - "title": "Zone 4D View Pro" + "title": "4D View Pro area" }, "FormObjects/webAreaOverview": { - "title": "Zone Web" + "title": "Web Area" }, "FormObjects/writeProAreaOverview": { - "title": "Zone 4D Write Pro" + "title": "4D Write Pro area" }, "GettingStarted/installation": { "title": "Installation" }, "Menus/bars": { - "title": "Barres de menus" + "title": "Menu bar features" }, "Menus/creating": { - "title": "Créer des menus et des barres de menus" + "title": "Creating menus and menu bars" }, "Menus/overview": { "title": "Aperçu" }, "Menus/properties": { - "title": "Propriétés des menus" + "title": "Menu item properties" }, "Menus/sdi": { - "title": "Mode SDI sous Windows" + "title": "SDI mode on Windows" }, "MSC/analysis": { - "title": "Page Analyse d'activités", - "sidebar_label": "Page Analyse d'activités" + "title": "Activity analysis Page", + "sidebar_label": "Activity analysis Page" }, "MSC/backup": { - "title": "Page Sauvegarde", - "sidebar_label": "Page Sauvegarde" + "title": "Backup Page", + "sidebar_label": "Backup Page" }, "MSC/compact": { - "title": "Page compactage", - "sidebar_label": "Page compactage" + "title": "Compact Page", + "sidebar_label": "Compact Page" }, "MSC/encrypt": { - "title": "Page chiffrement", - "sidebar_label": "Page chiffrement" + "title": "Encrypt Page", + "sidebar_label": "Encrypt Page" }, "MSC/information": { - "title": "Page informations", - "sidebar_label": "Page informations" + "title": "Information Page", + "sidebar_label": "Information Page" }, "MSC/overview": { "title": "Aperçu", "sidebar_label": "Aperçu" }, "MSC/repair": { - "title": "Page Réparation", - "sidebar_label": "Page Réparation" + "title": "Repair Page", + "sidebar_label": "Repair Page" }, "MSC/restore": { - "title": "Page restitution", - "sidebar_label": "Page restitution" + "title": "Restore Page", + "sidebar_label": "Restore Page" }, "MSC/rollback": { - "title": "Page Retour en arrière", - "sidebar_label": "Page Retour en arrière" + "title": "Rollback Page", + "sidebar_label": "Rollback Page" }, "MSC/verify": { - "title": "Page Vérification", - "sidebar_label": "Page Vérification" + "title": "Verify Page", + "sidebar_label": "Verify Page" }, "ORDA/dsmapping": { "title": "Data Model Objects" }, "ORDA/entities": { - "title": "Travailler avec des données" + "title": "Working with data" }, "ORDA/glossary": { - "title": "Glossaire" + "title": "Glossary" }, "ORDA/ordaClasses": { - "title": "Classes du modèle de données" + "title": "Data Model Classes" }, "ORDA/overview": { - "title": "Que signifie ORDA ?" + "title": "What is ORDA?" }, "ORDA/quickTour": { - "title": "Tour d'horizon d'ORDA" + "title": "A Quick Tour in ORDA" }, "ORDA/datastores": { - "title": "Utiliser un datastore distant" + "title": "Using a remote datastore" }, "Project/architecture": { "title": "Architecture of a project" }, "Project/creating": { - "title": "Créer ou ouvrir un projet" + "title": "Creating or opening a project" }, "Project/developing": { - "title": "Développer un projet" + "title": "Developing a project" }, "Project/documentation": { - "title": "Documenter un projet" + "title": "Documenting a project" }, "Project/overview": { "title": "Aperçu" @@ -743,34 +743,34 @@ "title": "$version" }, "REST/authUsers": { - "title": "Sessions et utilisateurs" + "title": "Users and sessions" }, "REST/classFunctions": { - "title": "Appeler des fonctions de classe ORDA" + "title": "Calling ORDA class functions" }, "REST/configuration": { - "title": "Configuration du serveur" + "title": "Server Configuration" }, "REST/genInfo": { - "title": "Obtenir des informations du serveur" + "title": "Getting Server Information" }, "REST/gettingStarted": { - "title": "Prise en main" + "title": "Getting Started" }, "REST/manData": { - "title": "Manipulation des données" + "title": "Manipulating Data" }, "REST/REST_requests": { - "title": "A propos des requêtes REST" + "title": "About REST Requests" }, "Users/editing": { - "title": "Gestion des groupes et utilisateurs 4D" + "title": "Managing 4D users and groups" }, "Users/overview": { "title": "Aperçu" }, "WebServer/webServerObject": { - "title": "Objet Serveur Web" + "title": "Web Server object" } }, "links": { @@ -779,54 +779,54 @@ "v18": "v18" }, "categories": { - "Getting Started": "Prise en main", - "Project Management": "Gestion de projet", - "4D Language Concepts": "Concepts du langage 4D", + "Getting Started": "Getting Started", + "Project Management": "Project Management", + "4D Language Concepts": "4D Language Concepts", "ORDA": "ORDA", - "Class API Reference": "Classes API", - "Access Rights": "Droits d'accès", + "Class API Reference": "Class API Reference", + "Access Rights": "Access Rights", "Administration": "Administration", - "MSC": "CSM", - "Backup and Restore": "Sauvegarde et restitution", - "Web Server": "Serveur Web", - "REST Server": "Serveur REST", - "Forms": "Formulaires", - "Form Properties": "Propriétés des formulaires", - "Form Objects": "Objets formulaires", - "Form Object Properties": "Propriétés des objets formulaire", - "Form Events": "Evénements formulaire", + "MSC": "MSC", + "Backup and Restore": "Backup and Restore", + "Web Server": "Web Server", + "REST Server": "REST Server", + "Forms": "Forms", + "Form Properties": "Form Properties", + "Form Objects": "Form Objects", + "Form Object Properties": "Form Object Properties", + "Form Events": "Form Events", "Menus": "Menus" } }, "pages-strings": { "Installation|in index page Getting started": "Installation", - "Starting 4D|in index page Getting started": "Démarrer 4D", - "Language Concepts|in index page Getting started": "Concepts du langage", - "Project Management|in index page Getting started": "Gestion de projet", + "Starting 4D|in index page Getting started": "Starting 4D", + "Language Concepts|in index page Getting started": "Language Concepts", + "Project Management|in index page Getting started": "Project Management", "Object Relational Data Access (ORDA)|in index page Getting started": "Object Relational Data Access (ORDA)", - "Class API Reference|no description given": "Classes API", - "Forms|no description given": "Formulaires", - "Form Properties|no description given": "Propriétés des formulaires", - "Form Events|no description given": "Evénements formulaire", - "Form Objects|no description given": "Objets formulaires", - "Form Object Properties|no description given": "Propriétés des objets formulaire", + "Class API Reference|no description given": "Class API Reference", + "Forms|no description given": "Forms", + "Form Properties|no description given": "Form Properties", + "Form Events|no description given": "Form Events", + "Form Objects|no description given": "Form Objects", + "Form Object Properties|no description given": "Form Object Properties", "Menus|no description given": "Menus", - "Web Server|no description given": "Serveur Web", - "REST Server|no description given": "Serveur REST", - "Maintenance and Security Center|no description given": "Centre de Sécurité et de Maintenance", - "Backup and Restore|no description given": "Sauvegarde et restitution", - "License Management|no description given": "Gestion des licences", - "Build Application|no description given": "Générateur d'application", - "Language Reference (4D Doc Center)|no description given": "Langage (4D Doc Center)", - "Access Rights|no description given": "Droits d'accès", - "Getting started|no description given": "Prise en main", - "Core Development|no description given": "Développement", + "Web Server|no description given": "Web Server", + "REST Server|no description given": "REST Server", + "Maintenance and Security Center|no description given": "Maintenance and Security Center", + "Backup and Restore|no description given": "Backup and Restore", + "License Management|no description given": "License Management", + "Build Application|no description given": "Build Application", + "Language Reference (4D Doc Center)|no description given": "Language Reference (4D Doc Center)", + "Access Rights|no description given": "Access Rights", + "Getting started|no description given": "Getting started", + "Core Development|no description given": "Core Development", "Administration|no description given": "Administration", - "Web applications|no description given": "Applications Web", - "Mobile applications|no description given": "Applications Mobile", - "Desktop applications|no description given": "Applications Desktop", - "Help Translate|recruit community translators for your project": "Aidez-nous à traduire", - "Edit this Doc|recruitment message asking to edit the doc source": "Modifier", - "Translate this Doc|recruitment message asking to translate the docs": "Traduire" + "Web applications|no description given": "Web applications", + "Mobile applications|no description given": "Mobile applications", + "Desktop applications|no description given": "Desktop applications", + "Help Translate|recruit community translators for your project": "Help Translate", + "Edit this Doc|recruitment message asking to edit the doc source": "Edit", + "Translate this Doc|recruitment message asking to translate the docs": "Translate" } } diff --git a/website/translated_docs/de/API/collectionClass.md b/website/translated_docs/de/API/collectionClass.md index f3946c60653cfe..a20ecf270956df 100644 --- a/website/translated_docs/de/API/collectionClass.md +++ b/website/translated_docs/de/API/collectionClass.md @@ -192,7 +192,7 @@ You can pass any number of values of the following supported types: * number (real, longint...). Number values are always stored as reals. * Text -* boolean +* Boolean * date * time (stored as number of milliseconds - real) * Null diff --git a/website/translated_docs/de/API/cryptoKeyClass.md b/website/translated_docs/de/API/cryptoKeyClass.md index b24f9dc7c70346..1bd683fb498621 100644 --- a/website/translated_docs/de/API/cryptoKeyClass.md +++ b/website/translated_docs/de/API/cryptoKeyClass.md @@ -29,7 +29,7 @@ ASSERT($status.success) ### Summary | | | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| [](#4dcryptokeynew)

    | +| [](#4dcryptokeynew)

    | | [](#curve)

     | | [](#decrypt)

    | | [](#encrypt)

    | @@ -46,6 +46,8 @@ ASSERT($status.success) + + ## 4D.CryptoKey.new()

History @@ -57,7 +59,7 @@ ASSERT($status.success) **4D.CryptoKey.new**( *settings* : Object ) : 4D.CryptoKey - + | Parameter | Typ | | Beschreibung | | --------- | ------------ | -- | ---------------------------------------------------------------------- | | settings | Objekt | -> | Settings to generate or load a key pair | @@ -82,7 +84,7 @@ The `4D.CryptoKey.new()` function create #### *cryptoKey* The returned `cryptoKey` object encapsulates an encryption key pair. It is a shared object and can therefore be used by multiple 4D processes simultaneously. - + @@ -144,7 +146,7 @@ The function returns a status object with `success` property set to `true` if th | Property | Typ | Beschreibung | | -------- | ---------- | ------------------------------------------------------------------- | -| success | boolean | True if the message has been successfully decrypted | +| success | Boolean | True if the message has been successfully decrypted | | result | Text | Message decrypted and decoded using the `options.encodingDecrypted` | | errors | collection | If `success` is `false`, may contain a collection of errors | @@ -295,7 +297,7 @@ The `cryptoKey` must contain a valid **private** key. | ----------------- | ------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | hash | Text | Digest algorithm to use. For example: "SHA256", "SHA384", or "SHA512". When used to produce a JWT, the hash size must match the PS@, ES@, RS@, or PS@ algorithm size | | encodingEncrypted | Text | Encoding used to convert the binary encrypted message into the result string. Can be "Base64", or "Base64URL". Default is "Base64". | -| pss | boolean | Use Probabilistic Signature Scheme (PSS). Ignored if the key is not an RSA key. Pass `true` when producing a JWT for PS@ algorithm | +| pss | Boolean | Use Probabilistic Signature Scheme (PSS). Ignored if the key is not an RSA key. Pass `true` when producing a JWT for PS@ algorithm | | encoding | Text | ERepresentation to be used for result signature. Possible values: "Base64" or "Base64URL". Default is "Base64". | @@ -368,7 +370,7 @@ The `cryptoKey` must contain a valid **public** key. | Property | Typ | Beschreibung | | -------- | ------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | hash | Text | Digest algorithm to use. For example: "SHA256", "SHA384", or "SHA512". When used to produce a JWT, the hash size must match the PS@, ES@, RS@, or PS@ algorithm size | -| pss | boolean | Use Probabilistic Signature Scheme (PSS). Ignored if the key is not an RSA key. Pass `true` when verifying a JWT for PS@ algorithm | +| pss | Boolean | Use Probabilistic Signature Scheme (PSS). Ignored if the key is not an RSA key. Pass `true` when verifying a JWT for PS@ algorithm | | encoding | Text | Representation of provided signature. Possible values are "Base64" or "Base64URL". Default is "Base64". | @@ -380,7 +382,7 @@ In case the signature couldn't be verified because it was not signed with the sa | Property | Typ | Beschreibung | | -------- | ---------- | ----------------------------------------------------------- | -| success | boolean | True if the signature matches the message | +| success | Boolean | True if the signature matches the message | | errors | collection | If `success` is `false`, may contain a collection of errors | diff --git a/website/translated_docs/de/API/datastoreClass.md b/website/translated_docs/de/API/datastoreClass.md index 3b8f435a7832e7..18b2293efb2a8c 100644 --- a/website/translated_docs/de/API/datastoreClass.md +++ b/website/translated_docs/de/API/datastoreClass.md @@ -10,13 +10,14 @@ A [Datastore](ORDA/dsMapping.md#datastore) is the interface object provided by O ### Summary -| | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | [](#canceltransaction)

    | | [](#dataclassname)

     | | [](#encryptionstatus)

     | | [](#getinfo)

     | | [](#getrequestlog)

     | +| [](#makeSelectionsAlterable)

     | | [](#providedatakey)

     | | [](#startrequestlog)

     | | [](#starttransaction)

     | @@ -75,7 +76,7 @@ Using the main datastore on the 4D database: #### Beispiel 2 -```4d +```4d var $connectTo; $firstFrench; $firstForeign : Object var $frenchStudents; $foreignStudents : cs.DataStore @@ -166,7 +167,7 @@ Pass in *connectionInfo* an object describing the remote datastore you want to c Connection to a remote datastore without user / password: ```4d - var $connectTo : Object + var $connectTo : Object var $remoteDS : cs.DataStore $connectTo:=New object("type";"4D Server";"hostname";"192.168.18.11:8044") $remoteDS:=Open datastore($connectTo;"students") @@ -178,7 +179,7 @@ Connection to a remote datastore without user / password: Connection to a remote datastore with user / password / timeout / tls: ```4d - var $connectTo : Object + var $connectTo : Object var $remoteDS : cs.DataStore $connectTo:=New object("type";"4D Server";"hostname";\"192.168.18.11:4443";\ "user";"marie";"password";$pwd;"idleTimeout";70;"tls";True) @@ -191,7 +192,7 @@ Connection to a remote datastore with user / password / timeout / tls: Working with several remote datastores: ```4d - var $connectTo : Object + var $connectTo : Object var $frenchStudents; $foreignStudents : cs.DataStore $connectTo:=New object("hostname";"192.168.18.11:8044") $frenchStudents:=Open datastore($connectTo;"french") @@ -203,7 +204,7 @@ Working with several remote datastores: #### Error management -In case of error, the command returns **Null**. If the remote datastore cannot be reached (wrong address, web server not started, http and https not enabled...), error 1610 "A remote request to host XXX has failed" is raised. You can intercept this error with a method installed by `ON ERR CALL`. +In case of error, the command returns **Null**. If the remote datastore cannot be reached (wrong address, web server not started, http and https not enabled...), error 1610 "A remote request to host XXX has failed" is raised. You can intercept this error with a method installed by `ON ERR CALL`. @@ -380,12 +381,12 @@ The `.getInfo()` function returns **Returned object** -| Property | Typ | Beschreibung | -| ---------- | ------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| type | string |

  • "4D": main datastore, available through ds
  • "4D Server": remote datastore, open with Open datastore
  • | -| networked | boolean |
  • True: the datastore is reached through a network connection.
  • False: the datastore is not reached through a network connection (local database)
  • | -| localID | Text | ID of the datastore on the machine. Corresponds to the localId string given with the `Open datastore` command. Empty string ("") for main datastore. | -| connection | object | Object describing the remote datastore connection (not returned for main datastore). Available properties:

    PropertyTypBeschreibung
    hostnameTextIP address or name of the remote datastore + ":" + port number
    tlsbooleanTrue if secured connection is used with the remote datastore
    idleTimeoutnumberSession inactivity timeout (in minutes)
    userTextUser authenticated on the remote datastore
    | +| Property | Typ | Beschreibung | +| ---------- | ------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| type | string |

  • "4D": main datastore, available through ds
  • "4D Server": remote datastore, open with Open datastore
  • | +| networked | Boolean |
  • True: the datastore is reached through a network connection.
  • False: the datastore is not reached through a network connection (local database)
  • | +| localID | Text | ID of the datastore on the machine. Corresponds to the localId string given with the `Open datastore` command. Empty string ("") for main datastore. | +| connection | object | Object describing the remote datastore connection (not returned for main datastore). Available properties:

    PropertyTypBeschreibung
    hostnameTextIP address or name of the remote datastore + ":" + port number
    tlsBooleanTrue if secured connection is used with the remote datastore
    idleTimeoutnumberSession inactivity timeout (in minutes)
    userTextUser authenticated on the remote datastore
    | * If the `.getInfo()` function is executed on a 4D Server or 4D single-user, `networked` is False. * If the `.getInfo()` function is executed on a remote 4D, `networked` is True @@ -419,8 +420,8 @@ On a remote datastore: //"localID":"students", //"networked":true, //"connection":{hostname:"111.222.33.44:8044","tls":false,"idleTimeout":2880,"user":"marie"}} -``` - +``` + @@ -465,6 +466,39 @@ See Example 2 of [`.startRequestLog()`](#startrequestlog). + +## .makeSelectionsAlterable() + +

    History +| Version | Changes | +| ------- | ------- | +| v18 R5 | Added | +
    + + +**.makeSelectionsAlterable()** + + +| Parameter | Typ | | Beschreibung | +| --------- | --- |::| ------------------------------- | +| | | | Does not require any parameters | + + + +#### Beschreibung + +The `.makeSelectionsAlterable()` function sets all entity selections as alterable by default in all the current application datastores (including [remote datastores](ORDA/remoteDatastores.md)). It is intended to be used once, for example in the `On Startup` database method. + +When this function is not called, new entity selections can be shareable, depending on the nature of their "parent", or [how they are created](ORDA/entities.md#shareable-or-non-shareable-entity-selections). + +> This function does not modify entity selections created by [`.copy()`](#copy) or `OB Copy` when the explicit `ck shared` option is used. + + +> **Compatibility**: This function must only be used in projects converted from 4D versions prior to 4D v18 R5 and containing [.add()](entitySelectionClass.md#add) calls. In this context, using `.makeSelectionsAlterable()` can save time by restoring instantaneously the previous 4D behavior in existing projects. On the other hand, using this method in new projects created in 4D v18 R5 and higher **is not recommended**, since it prevents entity selections to be shared, which provides greater performance and scalabitlity. + + + + ## .provideDataKey() @@ -525,7 +559,7 @@ If no *curPassphrase* or *curDataKey* is given, `.provideDataKey()` returns **nu #### Beispiel -```4d +```4d var $keyStatus : Object var $passphrase : Text @@ -539,7 +573,7 @@ If no *curPassphrase* or *curDataKey* is given, `.provideDataKey()` returns **nu End if End if ``` - + @@ -587,7 +621,7 @@ For a description of the ORDA request log format, please refer to the [**ORDA cl You want to log ORDA client requests in a file and use the log sequence number: -```4d +```4d var $file : 4D.File var $e : cs.PersonsEntity @@ -604,7 +638,7 @@ You want to log ORDA client requests in a file and use the log sequence number: You want to log ORDA client requests in memory: -```4d +```4d var $es : cs.PersonsSelection var $log : Collection @@ -617,7 +651,7 @@ You want to log ORDA client requests in memory: $log:=ds.getRequestLog() ALERT("The longest request lasted: "+String($log.max("duration"))+" ms") ``` - + @@ -653,7 +687,7 @@ You can nest several transactions (sub-transactions). Each transaction or sub-tr #### Beispiel -```4d +```4d var $connect; $status : Object var $person : cs.PersonsEntity var $ds : cs.DataStore @@ -683,13 +717,14 @@ You can nest several transactions (sub-transactions). Each transaction or sub-tr $ds.validateTransaction() End if ``` - + + ## .stopRequestLog() diff --git a/website/translated_docs/de/API/emailObjectClass.md b/website/translated_docs/de/API/emailObjectClass.md index 123a4e0f450c7e..94fad7cc45ea6c 100644 --- a/website/translated_docs/de/API/emailObjectClass.md +++ b/website/translated_docs/de/API/emailObjectClass.md @@ -175,7 +175,7 @@ The `.bodyValues` object contains the following properties: | Property | Typ | Wert | | -------------------------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------- | | *partID*.value | Text | Value of the body part | -| *partID*.isEncodingProblem | boolean | True if malformed sections are found while decoding the charset, or unknown charset, or unknown content transfer-encoding. False by default | +| *partID*.isEncodingProblem | Boolean | True if malformed sections are found while decoding the charset, or unknown charset, or unknown content transfer-encoding. False by default | @@ -341,7 +341,7 @@ This property is the "keywords" header (see [RFC#4021](https://tools.ietf.org/ht - boolean + Boolean diff --git a/website/translated_docs/de/API/entityClass.md b/website/translated_docs/de/API/entityClass.md index f8bd7692a2e65f..d10079d0f7377e 100644 --- a/website/translated_docs/de/API/entityClass.md +++ b/website/translated_docs/de/API/entityClass.md @@ -363,7 +363,7 @@ The object returned by `.drop( )` contains the following properties: | Property | | Typ | Beschreibung | | ------------- | ------------------- | --------------------- | --------------------------------------------------------------------------------------------------------------------- | -| success | | boolean | true if the drop action is successful, false otherwise. | +| success | | Boolean | true if the drop action is successful, false otherwise. | | | | | ***Available only in case of error:*** | | status(*) | | number | Error code, see below | | statusText(*) | | Text | Description of the error, see below | @@ -920,9 +920,9 @@ The object returned by `.lock( )` contains the following properties: | Property | | Typ | Beschreibung | | ---------------- | ------------------- | --------------------- | ------------------------------------------------------------------------------------------------------------------- | -| success | | boolean | true if the lock action is successful (or if the entity is already locked in the current process), false otherwise. | +| success | | Boolean | true if the lock action is successful (or if the entity is already locked in the current process), false otherwise. | | | | | ***Available only if `dk reload if stamp changed` option is used:*** | -| **wasReloaded** | | boolean | true if the entity was reloaded with success, false otherwise. | +| **wasReloaded** | | Boolean | true if the entity was reloaded with success, false otherwise. | | | | | ***Available only in case of error:*** | | status(\*) | | number | Error code, see below | | statusText(\*) | | Text | Description of the error, see below | @@ -1105,7 +1105,7 @@ The object returned by `.reload( )` contains the following properties: | Property | Typ | Beschreibung | | ---------------- | ------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- | -| success | boolean | True if the reload action is successful, False otherwise.

    ***Available only in case of error***: | +| success | Boolean | True if the reload action is successful, False otherwise.

    ***Available only in case of error***: | | status(\*) | number | Error code, see below | | statusText(\*) | Text | Description of the error, see below | @@ -1178,9 +1178,9 @@ The object returned by `.save()` contains the following properties: | Property | | Typ | Beschreibung | | ---------------- | | ------- | ------------------------------------------------------- | -| success | | boolean | True if the save action is successful, False otherwise. | +| success | | Boolean | True if the save action is successful, False otherwise. | | | | | ***Available only if `dk auto merge` option is used***: | -| autoMerged | | boolean | True if an auto merge was done, False otherwise. | +| autoMerged | | Boolean | True if an auto merge was done, False otherwise. | | | | | ***Available only in case of error***: | | status(\*) | | number | Error code, see below | | statusText(\*) | | Text | Description of the error, see below | diff --git a/website/translated_docs/de/API/entitySelectionClass.md b/website/translated_docs/de/API/entitySelectionClass.md index e7faa39ff600cd..1cf545d5fce8c8 100644 --- a/website/translated_docs/de/API/entitySelectionClass.md +++ b/website/translated_docs/de/API/entitySelectionClass.md @@ -23,6 +23,7 @@ An entity selection is an object containing one or more reference(s) to [entitie | [](#extract)

        | | [](#first)

        | | [](#getdataclass)

        | +| [](#isalterable)

        | | [](#isordered)

        | | [](#last)

        | | [](#length)

        | @@ -43,6 +44,46 @@ An entity selection is an object containing one or more reference(s) to [entitie + +**Create entity selection** ( *dsTable* : Table { ; *settings* : Object } ) : 4D.EntitySelection + + +| Parameter | Typ | | Beschreibung | +| --------- | ------------------ |:--:| ------------------------------------------------------------------------------------------- | +| dsTable | Tabelle | -> | Table in the 4D database whose current selection will be used to build the entity selection | +| settings | Objekt | -> | Build option: context | +| Ergebnis | 4D.EntitySelection | <- | Entity selection matching the dataclass related to the given table | + + + +#### Beschreibung + +The `Create entity selection` command builds and returns a new, [alterable](ORDA/entities.md#shareable-or-alterable-entity-selections) entity selection related to the dataclass matching the given *dsTable*, according to the current selection of this table. + +If the current selection is sorted, an [ordered](ORDA/dsMapping.md#ordered-or-unordered-entity-selection) entity selection is created (the order of the current selection is kept). If the current selection is unsorted, an unordered entity selection is created. + +If the *dsTable* is not exposed in [`ds`](API/datastoreClass.md#ds), an error is returned. This command cannot be used with a Remote datastore. + +In the optional *settings* parameter, you can pass an object containing the following property: + +| Property | Typ | Beschreibung | +| -------- | ---- | ----------------------------------------------------------------------------------------------------------------- | +| context | Text | Label for the [optimization context](ORDA/entities.md#clientserver-optimization) applied to the entity selection. | + + +#### Beispiel + +```4d +var $employees : cs.EmployeeSelection +ALL RECORDS([Employee]) +$employees:=Create entity selection([Employee]) +// The $employees entity selection now contains a set of reference +// on all entities related to the Employee dataclass +``` + +#### See also + +[`dataClass.newSelection()`](dataclassClass.md#newselection) ## [*index*] @@ -181,10 +222,10 @@ The resulting object is an entity selection of Employee with duplications remove ## .add()

    History -| Version | Changes | -| ------- | --------------------------------------------- | -| v18 R5 | Only supports non-shareable entity selections | -| v17 | Added | +| Version | Changes | +| ------- | ----------------------------------------- | +| v18 R5 | Only supports alterable entity selections | +| v17 | Added |
    @@ -204,7 +245,7 @@ The resulting object is an entity selection of Employee with duplications remove The `.add()` function adds the specified *entity* to the entity selection and returns the modified entity selection. > This function modifies the original entity selection. -**Warning:** The entity selection must be *non-shareable*, i.e. it has been created for example by [`.newSelection()`](dataclassClass.md#newselection) or `Create entity selection`, otherwise `.add()` will return an error. Shareable entity selections do not accept the addition of entities. For more information, please refer to the [Shareable vs Non-shareable entity selections](ORDA/entities.md#shareable-or-non-shareable-entity-selections) section. +**Warning:** The entity selection must be *alterable*, i.e. it has been created for example by [`.newSelection()`](dataclassClass.md#newselection) or `Create entity selection`, otherwise `.add()` will return an error. Shareable entity selections do not accept the addition of entities. For more information, please refer to the [Shareable or alterable entity selections](ORDA/entities.md#shareable-or-alterable-entity-selections) section. * If the entity selection is ordered, *entity* is added at the end of the selection. If a reference to the same entity already belongs to the entity selection, it is duplicated and a new reference is added. @@ -482,9 +523,9 @@ The `.copy()` function returns > This function does not modify the original entity selection. -By default, if the *option* parameter is omitted, the function returns a new, non-shareable entity selection (even if the function is applied to a shareable entity selection). Pass the `ck shared` constant in the *option* parameter if you want to create a shareable entity selection. +By default, if the *option* parameter is omitted, the function returns a new, alterable entity selection (even if the function is applied to a shareable entity selection). Pass the `ck shared` constant in the *option* parameter if you want to create a shareable entity selection. -> For information on the shareable property of entity selections, please refer to the [Shareable vs Non-shareable entity selections](ORDA/entities.md#shareable-or-non-shareable-entity-selections) section. +> For information on the shareable property of entity selections, please refer to the [Shareable or alterable entity selections](ORDA/entities.md#shareable-or-alterable-entity-selections) section. #### Beispiel @@ -806,6 +847,7 @@ There is, however, a difference between both statements when the selection is em **.getDataClass()** : 4D.DataClass + | Parameter | Typ | | Beschreibung | | --------- | ------------ |:--:| ------------------------------------------------------ | @@ -842,6 +884,47 @@ The following generic code duplicates all entities of the entity selection: + +## .isAlterable() + +
    History + +| Version | Changes | +| ------- | ------- | +| v18 R5 | Added | + +
    + + +**.isAlterable()** : Boolean + + +| Parameter | Typ | | Beschreibung | +| --------- | ------- |:--:| ---------------------------------------------------------- | +| Ergebnis | Boolean | <- | True if the entity selection is alterable, False otherwise | + + +#### Beschreibung + +The `.isAlterable()` function returns True if the entity selection is alterable, and False if the entity selection is not alterable. + +For more information, please refer to [Shareable or alterable entity selections](ORDA/entities.md#shareable-or-alterable-entity-selections). + +#### Beispiel + +You are about to display `Form.products` in a [list box](FormObjects/listbox_overview.md) to allow the user to add new products. You want to make sure it is alterable so that the user can add new products without error: + +```4d +If (Not(Form.products.isAlterable())) + Form.products:=Form.products.copy() +End if +... +Form.products.add(Form.product) +``` + + + + ## .isOrdered() @@ -988,6 +1071,7 @@ Entity selections always have a `.length` property. **.max**( *attributePath* : Text ) : any + | Parameter | Typ | | Beschreibung | | ------------- | ---- |:--:| ------------------------------------------------ | @@ -1898,6 +1982,7 @@ Returns: "lastName": "Durham" } ] + ``` #### Example 4 @@ -2090,6 +2175,7 @@ Returns: }, { "firstName": "Gary", + "lastName": "Reichert", "directReports": [ { diff --git a/website/translated_docs/de/API/imapTransporterClass.md b/website/translated_docs/de/API/imapTransporterClass.md index fb989abadd41f1..3196d18ea2b2ea 100644 --- a/website/translated_docs/de/API/imapTransporterClass.md +++ b/website/translated_docs/de/API/imapTransporterClass.md @@ -433,9 +433,9 @@ Each object of the returned collection contains the following properties: | Property | Typ | Beschreibung | | ---------------- | ------- | ------------------------------------------------------------------------------------------------------------------- | | \[].name | Text | Name of the mailbox | -| \[].selectable | boolean | Indicates whether or not the access rights allow the mailbox to be selected: | -| \[].inferior | boolean | Indicates whether or not the access rights allow creating a lower hierachy in the mailbox: | -| \[].interesting | boolean | Indicates if the mailbox has been marked "interesting" by the server: | +| \[].selectable | Boolean | Indicates whether or not the access rights allow the mailbox to be selected: | +| \[].inferior | Boolean | Indicates whether or not the access rights allow creating a lower hierachy in the mailbox: | +| \[].interesting | Boolean | Indicates if the mailbox has been marked "interesting" by the server: | If the account does not contain any mailboxes, an empty collection is returned. @@ -557,8 +557,8 @@ The optional *options* parameter allows you pass an object defining additional i | Property | Typ | Beschreibung | | ---------- | ------- | --------------------------------------------------------------------------------------------------------------------------- | -| updateSeen | boolean | If True, the message is marked as "seen" in the mailbox. If False, the message is not marked as "seen". Default value: True | -| withBody | boolean | Pass True to return the body of the message. If False, only the message header is returned. Default value: True | +| updateSeen | Boolean | If True, the message is marked as "seen" in the mailbox. If False, the message is not marked as "seen". Default value: True | +| withBody | Boolean | Pass True to return the body of the message. If False, only the message header is returned. Default value: True | > * The function generates an error and returns **Null** if *msgID* designates a non-existing message, > * If no mailbox is selected with the [`.selectBox()`](#selectbox) function, an error is generated, > * If there is no open connection, `.getMail()` will open a connection the last mailbox specified with [`.selectBox()`](#selectbox)`. diff --git a/website/translated_docs/de/API/transporter.md b/website/translated_docs/de/API/transporter.md index c924d0bb425ca2..bb9311b791177e 100644 --- a/website/translated_docs/de/API/transporter.md +++ b/website/translated_docs/de/API/transporter.md @@ -318,7 +318,7 @@ The function sends a request to the mail server and returns an object describing | Property | | Typ | Beschreibung | | ---------- | ------------------------ | ---------- | ------------------------------------------------------------------------------------------------------------ | -| success | | boolean | True if the check is successful, False otherwise | +| success | | Boolean | True if the check is successful, False otherwise | | status | | number | (SMTP only) Status code returned by the mail server (0 in case of an issue unrelated to the mail processing) | | statusText | | Text | Status message returned by the mail server, or last error returned in the 4D error stack | | errors | | collection | 4D error stack (not returned if a mail server response is received) | diff --git a/website/translated_docs/de/API/webServerClass.md b/website/translated_docs/de/API/webServerClass.md index f0d9c435369734..b86aa4a1d4776e 100644 --- a/website/translated_docs/de/API/webServerClass.md +++ b/website/translated_docs/de/API/webServerClass.md @@ -70,10 +70,10 @@ They provide the following properties and functions: -| Parameter | Typ | | Beschreibung | +| Parameter | Type | | Description | | --------- | ------------ | -- | -------------------------------------------------------------- | -| option | Ganzzahl | -> | Web server to get (default if omitted = `Web server database`) | -| Ergebnis | 4D.WebServer | <- | Web server object | +| option | Integer | -> | Web server to get (default if omitted = `Web server database`) | +| Result | 4D.WebServer | <- | Web server object | @@ -81,15 +81,15 @@ The `WEB Server` command returns the d By default, if the *option* parameter is omitted, the command returns a reference to the Web server of the database, i.e. the default Web server. To designate the Web server to return, you can pass one of the following constants in the *option* parameter: -| Constant | Wert | Kommentar | -| ------------------------------ | ---- | -------------------------------------------------------- | -| `Web server database` | 1 | Current database Web server (default if omitted) | -| `Web server host database` | 2 | Web server of the host database of a component | -| `Web server receiving request` | 3 | Web server that received the request (target Web server) | +| Constant | Value | Comment | +| ------------------------------ | ----- | -------------------------------------------------------- | +| `Web server database` | 1 | Current database Web server (default if omitted) | +| `Web server host database` | 2 | Web server of the host database of a component | +| `Web server receiving request` | 3 | Web server that received the request (target Web server) | The returned Web server object contains the current values of the Web server properties. -#### Beispiel +#### Example From your component, you want to know if the Web server of the host database is started: @@ -116,9 +116,9 @@ From your component, you want to know if the Web server of the host database is -| Parameter | Typ | | Beschreibung | +| Parameter | Type | | Description | | --------- | ---------- | -- | ---------------------------------------------- | -| Ergebnis | Collection | <- | Collection of the available Web server objects | +| Result | Collection | <- | Collection of the available Web server objects | @@ -136,7 +136,7 @@ All available Web servers are returned by the `WEB Server list` command, whether You can use the [.name](#name) property of the Web server object to identify the project or component to which each Web server object in the list is attached. -#### Beispiel +#### Example We want to know how many running web servers are available: @@ -723,10 +723,10 @@ The IP address va -| Parameter | Typ | | Beschreibung | +| Parameter | Type | | Description | | --------- | ------ | -- | ------------------------------------- | -| settings | Objekt | -> | Web server settings to set at startup | -| Ergebnis | Objekt | <- | Status of the web server startup | +| settings | Object | -> | Web server settings to set at startup | +| Result | Object | <- | Status of the web server startup | @@ -741,16 +741,16 @@ Customized session settings will be reset when the [`.stop()`](#stop) function i The function returns an object describing the Web server launch status. This object can contain the following properties: -| Property | | Typ | Beschreibung | +| Property | | Type | Description | | -------- | ----------------------- | ---------- | -------------------------------------------------------------------- | | success | | Boolean | True if the web server was correctly started, False otherwise | | errors | | Collection | 4D error stack (not returned if the web server started successfully) | -| | \[].errCode | Zahl | 4D error code | +| | \[].errCode | Number | 4D error code | | | \[].message | Text | Description of the 4D error | | | \[].componentSignature | Text | Signature of the internal component which returned the error | > If the Web server was already launched, an error is returned. -#### Beispiel +#### Example ```4d var $settings;$result : Object @@ -783,9 +783,9 @@ The function returns an object describing the Web server launch status. This obj -| Parameter | Typ | | Beschreibung | -| --------- | --- | | ------------------------------- | -| | | | Does not require any parameters | +| Parameter | Type | | Description | +| --------- | ---- | | ------------------------------- | +| | | | Does not require any parameters | @@ -795,7 +795,7 @@ If the web server was started, all web connections and web processes are closed, > This function resets the customized web settings defined for the session using the *settings* parameter of the [`.start()`](#start) function, if any. -#### Beispiel +#### Example To stop the database Web server: diff --git a/website/translated_docs/de/API/zipArchiveClass.md b/website/translated_docs/de/API/zipArchiveClass.md index 96403db23b263a..d31e4972f79caf 100644 --- a/website/translated_docs/de/API/zipArchiveClass.md +++ b/website/translated_docs/de/API/zipArchiveClass.md @@ -10,7 +10,7 @@ A 4D ZIP archive is a `File` or `Folder` object containing one or more files or - 4D [`ZIPFile`](zipFileClass.md) and [`ZIPFolder`](zipFolderClass.md) instances are available through the [`root`](#root) property (`ZIPFolder`) of the object returned by [ZIP Read archive](#zip-read-archive) command. -### Beispiel +### Example To retrieve and view the contents of a ZIP file object: @@ -50,18 +50,18 @@ End if **ZIP Create archive** ( *fileToZip* : 4D.File ; *destinationFile* : 4D.File ) : Object
    **ZIP Create archive** ( *folderToZip* : 4D.Folder ; *destinationFile* : 4D.File { ; *options* : Integer }) : Object
    **ZIP Create archive** ( *zipStructure* : Object ; *destinationFile* : 4D.File ) : Object -| Parameter | Typ | | Beschreibung | +| Parameter | Type | | Description | | --------------- | --------- |:--:| ---------------------------------------------------- | | fileToZip | 4D.File | -> | File or Folder object to compress | | folderToZip | 4D.Folder | -> | File or Folder object to compress | -| zipStructure | Objekt | -> | File or Folder object to compress | +| zipStructure | Object | -> | File or Folder object to compress | | destinationFile | 4D.File | -> | Destination file for the archive | -| options | Ganzzahl | -> | *folderToZip* option: `ZIP Without enclosing folder` | -| Ergebnis | Objekt | <- | Status object | +| options | Integer | -> | *folderToZip* option: `ZIP Without enclosing folder` | +| Result | Object | <- | Status object | -#### Beschreibung +#### Description The `ZIP Create archive` command creates a compressed ZIP archive object and returns the status of the operation. @@ -78,11 +78,11 @@ You can pass a 4D.File, a 4D.Folder, or a zip structure object as first paramete - Typ + Type - Beschreibung + Description @@ -151,17 +151,17 @@ Once an archive is created, you can use the [ZIP Read archive](#zip-read-archive The returned status object contains the following properties: -| Property | Typ | Beschreibung | -| ---------- | -------- | --------------------------------------------------------------------------------------------------------------------------------------- | -| statusText | Text | Error message (if any):
  • Cannot open ZIP archive
  • Cannot create ZIP archive
  • Password is required for encryption | -| status | Ganzzahl | Status code | -| success | Boolean | True if archive created successfully, else false | +| Property | Type | Description | +| ---------- | ------- | --------------------------------------------------------------------------------------------------------------------------------------- | +| statusText | Text | Error message (if any):
  • Cannot open ZIP archive
  • Cannot create ZIP archive
  • Password is required for encryption | +| status | Integer | Status code | +| success | Boolean | True if archive created successfully, else false | -#### Beispiel 1 +#### Example 1 To compress a `4D.File`: @@ -181,7 +181,7 @@ To compress a `4D.File`: -#### Beispiel 2 +#### Example 2 To compress a `4D.Folder` without the folder itself: @@ -275,15 +275,15 @@ You want to pass a collection of folders and files to compress to the *zipStruct **ZIP Read archive** ( *zipFile* : 4D.File { ; *password* : Text }) : 4D.ZipArchive -| Parameter | Typ | | Beschreibung | +| Parameter | Type | | Description | | --------- | ------------- |:--:| --------------------------- | | zipFile | 4D.File | -> | Zip archive file | | password | Text | -> | ZIP archive password if any | -| Ergebnis | 4D.ZipArchive | <- | Archive object | +| Result | 4D.ZipArchive | <- | Archive object | -#### Beschreibung +#### Description The `ZIP Read archive` command retrieves the contents of *zipFile* and returns it as a `4D.ZipArchive` object. @@ -303,7 +303,7 @@ The returned `4D.ZipArchive` object contains a single [`root`](#root) property w -#### Beispiel +#### Example To retrieve and view the contents of a ZIP file object: @@ -365,7 +365,7 @@ To extract from the root folder: **.root** : 4D.ZipFolder -#### Beschreibung +#### Description The `.root` property contains a virtual folder providing access to the contents of the ZIP archive. diff --git a/website/translated_docs/de/API/zipFileClass.md b/website/translated_docs/de/API/zipFileClass.md index c3977aa1abce4a..34c42602eea48e 100644 --- a/website/translated_docs/de/API/zipFileClass.md +++ b/website/translated_docs/de/API/zipFileClass.md @@ -5,7 +5,7 @@ title: ZIPFile The following properties and functions from the [File](fileClass.md) class are available to `ZIPFile` objects: -| Available [File](fileClass.md) APIs for ZIPFile | Kommentar | +| Available [File](fileClass.md) APIs for ZIPFile | Comment | | --------------------------------------------------------------------------------------------- | -------------------------------------- | | [](fileClass.md#copyto) | | | [](fileClass.md#creationdate) | | diff --git a/website/translated_docs/de/API/zipFolderClass.md b/website/translated_docs/de/API/zipFolderClass.md index fd81803650d211..aa377c9bfa20be 100644 --- a/website/translated_docs/de/API/zipFolderClass.md +++ b/website/translated_docs/de/API/zipFolderClass.md @@ -7,7 +7,7 @@ title: ZIPFolder The following properties and functions from the [Folder](folderClass.md) class are available to `ZIPFolder` objects: -| Available [Folder](folderClass.md) APIs for ZIPFolder | Kommentar | +| Available [Folder](folderClass.md) APIs for ZIPFolder | Comment | | ------------------------------------------------------------------------------------------------ | --------------------------------------------------------------------------------------------------------------------------------- | | [](folderClass.md#copyto) | | | [](folderClass.md#creationdate) | Date may be different for the `root` folder from a folder within the archive | diff --git a/website/translated_docs/de/Concepts/dt_boolean.md b/website/translated_docs/de/Concepts/dt_boolean.md index 1fc3baf05d1289..1230a8e151aaaa 100644 --- a/website/translated_docs/de/Concepts/dt_boolean.md +++ b/website/translated_docs/de/Concepts/dt_boolean.md @@ -1,5 +1,5 @@ --- -id: boolean +id: Boolean title: Boolean --- diff --git a/website/translated_docs/de/Concepts/dt_variant.md b/website/translated_docs/de/Concepts/dt_variant.md index 8208d7ba14d523..bf49f63c4ac3df 100644 --- a/website/translated_docs/de/Concepts/dt_variant.md +++ b/website/translated_docs/de/Concepts/dt_variant.md @@ -8,7 +8,7 @@ Variant ist ein Variablentyp, um Daten von beliebigem regulären Typ in eine Var Eine Variable vom Typ Variant kann einen Wert in folgenden Datentypen enthalten: - BLOB -- boolean +- Boolean - collection - date - Lange Ganzzahl @@ -23,7 +23,7 @@ Eine Variable vom Typ Variant kann einen Wert in folgenden Datentypen enthalten: > Arrays lassen sich nicht in Variablen vom Typ Variant speichern. -Im interpretierten und im kompilierten Modus kann derselben Variablen vom Typ Variant Inhalt mit unterschiedlichen Typen zugewiesen werden. Im Gegensatz zu festen Variablentypen ist der Inhaltstyp von Variant unterschiedlich von der Variable selbst. Beispiel: +Sowohl im interpretierten als auch im kompilierten Modus kann derselben Variablen vom Typ Variant Inhalt mit unterschiedlichen Typen zugewiesen werden. Im Gegensatz zu festen Variablentypen ist der Inhaltstyp von Variant unterschiedlich von der Variable selbst. Beispiel: ```4d C_VARIANT($variant) diff --git a/website/translated_docs/de/Events/onAfterEdit.md b/website/translated_docs/de/Events/onAfterEdit.md index 3cb655b025174d..1dc38d396cf1a0 100644 --- a/website/translated_docs/de/Events/onAfterEdit.md +++ b/website/translated_docs/de/Events/onAfterEdit.md @@ -57,8 +57,8 @@ Depending on the `action` property value, the [event object](overview.md#event-o | --------- | ------- | --------------------------------------------------- | | fromRange | object | Range of source cell range (being dragged) | | toRange | object | Range of the destination cell range (drop location) | -| copy | boolean | Specifies if the source range is copied or not | -| insert | boolean | Specifies if the source range is inserted or not | +| copy | Boolean | Specifies if the source range is copied or not | +| insert | Boolean | Specifies if the source range is inserted or not | #### action = DragFillBlock diff --git a/website/translated_docs/de/Events/onColumnResize.md b/website/translated_docs/de/Events/onColumnResize.md index 3bef6134bd5eb2..33b5e1092406b9 100644 --- a/website/translated_docs/de/Events/onColumnResize.md +++ b/website/translated_docs/de/Events/onColumnResize.md @@ -27,7 +27,7 @@ This event is generated when the width of a column is modified by a user. On thi | objectName | Text | 4D View Pro area name | | sheetName | Text | Name of the sheet of the event | | range | object | Cell range of the columns whose widths have changed | -| header | boolean | True if the row header column (first column) is resized, else false | +| header | Boolean | True if the row header column (first column) is resized, else false | #### Beispiel diff --git a/website/translated_docs/de/Events/onRowResize.md b/website/translated_docs/de/Events/onRowResize.md index e1736dbb61f2eb..c90beb5f85ecb9 100644 --- a/website/translated_docs/de/Events/onRowResize.md +++ b/website/translated_docs/de/Events/onRowResize.md @@ -19,7 +19,7 @@ This event is generated when the height of a row is modified by a user in a 4D V | objectName | Text | 4D View Pro area name | | sheetName | Text | Name of the sheet of the event | | range | object | Cell range of the rows whose heights have changed | -| header | boolean | True if the column header row (first row) is resized, else false | +| header | Boolean | True if the column header row (first row) is resized, else false | #### Beispiel diff --git a/website/translated_docs/de/FormEditor/properties_FormProperties.md b/website/translated_docs/de/FormEditor/properties_FormProperties.md index d45736c5d8449a..3fbf7d0f374c1b 100644 --- a/website/translated_docs/de/FormEditor/properties_FormProperties.md +++ b/website/translated_docs/de/FormEditor/properties_FormProperties.md @@ -112,7 +112,7 @@ Only project forms can be specified as published subforms. | Name | Datentyp | Possible Values | | ------ | -------- | --------------- | -| shared | boolean | true, false | +| shared | Boolean | true, false | --- @@ -131,7 +131,7 @@ When this option is selected, the [Save Value](FormObjects/properties_Object.md# | Name | Datentyp | Possible Values | | ---------------- | -------- | --------------- | -| memorizeGeometry | boolean | true, false | +| memorizeGeometry | Boolean | true, false | #### See also [**Save Value**](FormObjects/properties_Object.md#save-value) diff --git a/website/translated_docs/de/FormObjects/listbox_overview.md b/website/translated_docs/de/FormObjects/listbox_overview.md index 6b7f6e894787a3..c32d939eb7f9e8 100644 --- a/website/translated_docs/de/FormObjects/listbox_overview.md +++ b/website/translated_docs/de/FormObjects/listbox_overview.md @@ -251,7 +251,7 @@ Form events on list box or list box column objects may return the following addi | footerName | Text | Name of the footer | | headerName | Text | Name of the header | | horizontalScroll | Lange Ganzzahl | Positive if scroll is towards the right, negative if towards the left | -| isRowSelected | boolean | True if row is selected, else False | +| isRowSelected | Boolean | True if row is selected, else False | | newPosition | Lange Ganzzahl | New position of the column or row | | newSize | Lange Ganzzahl | New size (in pixels) of the column or row | | oldPosition | Lange Ganzzahl | Previous position of the column or row | @@ -868,7 +868,7 @@ When a list box column is associated with an object array, the way a cell is dis | Text | text input | drop-down menu (required list) or combo box (choice list) | | Zahl | controlled text input (numbers and separators) | drop-down menu (required list) or combo box (choice list) | | integer | controlled text input (numbers only) | drop-down menu (required list) or combo box (choice list) or three-states check box | -| boolean | check box | drop-down menu (required list) | +| Boolean | check box | drop-down menu (required list) | | color | background color | Text | | event | button with label | | | | | All widgets can have an additional unit toggle button or ellipsis button attached to the cell. | @@ -896,7 +896,7 @@ Each element of the object array is an object that can contain one or more attri The only mandatory attribute is "valueType" and its supported values are "text", "real", "integer", "boolean", "color", and "event". The following table lists all the attributes supported in list box object arrays, depending on the "valueType" value (any other attributes are ignored). Display formats are detailed and examples are provided below. -| | valueType | Text | Zahl | integer | boolean | color | event | +| | valueType | Text | Zahl | integer | Boolean | color | event | | --------------------- | --------------------------------------- | ---- | ---- | ------- | ------- | ----- | ----- | | *Attributes* | *Beschreibung* | | | | | | | | value | cell value (input or output) | x | x | x | | | | diff --git a/website/translated_docs/de/FormObjects/properties_Action.md b/website/translated_docs/de/FormObjects/properties_Action.md index 8a5e520a5a29c4..8bd91479357631 100644 --- a/website/translated_docs/de/FormObjects/properties_Action.md +++ b/website/translated_docs/de/FormObjects/properties_Action.md @@ -74,7 +74,7 @@ When this option is enabled, the object method is executed with the `On Data Cha | Name | Datentyp | Possible Values | | ------------------- | -------- | --------------- | -| continuousExecution | boolean | true, false | +| continuousExecution | Boolean | true, false | #### Objects Supported @@ -99,7 +99,7 @@ Several types of method references are supported: - a project method name: name of an existing project method without file extension, i.e.: `myMethod` In this case, 4D does not provide automatic support for object operations. - a custom method file path including the .4dm extension, e.g.: - `ObjectMethods/objectName.4dm` You can also use a filesystem: + `../../CustomMethods/myMethod.4dm` You can also use a filesystem: `/RESOURCES/Buttons/bOK.4dm` In this case, 4D does not provide automatic support for object operations. @@ -127,7 +127,7 @@ Authorizes the movement of rows during execution. This option is selected by def | Name | Datentyp | Possible Values | | ----------- | -------- | --------------- | -| movableRows | boolean | true, false | +| movableRows | Boolean | true, false | #### Objects Supported @@ -170,7 +170,7 @@ In other cases (list boxes based on named selections, columns associated with ex | Name | Datentyp | Possible Values | | -------- | -------- | --------------- | -| sortable | boolean | true, false | +| sortable | Boolean | true, false | #### Objects Supported [List Box](listbox_overview.md) diff --git a/website/translated_docs/de/FormObjects/properties_Animation.md b/website/translated_docs/de/FormObjects/properties_Animation.md index a33e2c846cf2b8..4b910a9231dfc7 100644 --- a/website/translated_docs/de/FormObjects/properties_Animation.md +++ b/website/translated_docs/de/FormObjects/properties_Animation.md @@ -13,7 +13,7 @@ Pictures are displayed in a continuous loop. When the user reaches the last pict | Name | Datentyp | Possible Values | | -------------------- | -------- | --------------- | -| loopBackToFirstFrame | boolean | true, false | +| loopBackToFirstFrame | Boolean | true, false | #### Objects Supported @@ -31,7 +31,7 @@ Displays the first picture all the time except when the user clicks the button. | Name | Datentyp | Possible Values | | ---------------------- | -------- | --------------- | -| switchBackWhenReleased | boolean | true, false | +| switchBackWhenReleased | Boolean | true, false | #### Objects Supported @@ -50,7 +50,7 @@ Allows the user to hold down the mouse button to display the pictures continuous | Name | Datentyp | Possible Values | | ------------------ | -------- | --------------- | -| switchContinuously | boolean | true, false | +| switchContinuously | Boolean | true, false | #### Objects Supported @@ -87,7 +87,7 @@ Modifies the contents of the picture button when the mouse cursor passes over it | Name | Datentyp | Possible Values | | ------------------ | -------- | --------------- | -| switchWhenRollover | boolean | true, false | +| switchWhenRollover | Boolean | true, false | #### Objects Supported @@ -108,7 +108,7 @@ Enables setting the last thumbnail as the one to display when the button is disa | Name | Datentyp | Possible Values | |:---------------------- | -------- | --------------- | -| useLastFrameAsDisabled | boolean | true, false | +| useLastFrameAsDisabled | Boolean | true, false | #### Objects Supported diff --git a/website/translated_docs/de/FormObjects/properties_Appearance.md b/website/translated_docs/de/FormObjects/properties_Appearance.md index d88f70c4bff28d..b7b6d168fa9cf6 100644 --- a/website/translated_docs/de/FormObjects/properties_Appearance.md +++ b/website/translated_docs/de/FormObjects/properties_Appearance.md @@ -44,7 +44,7 @@ During execution, a field or any enterable area is outlined by a selection recta | Name | Datentyp | Possible Values | | ------------- | -------- | --------------- | -| hideFocusRing | boolean | true, false | +| hideFocusRing | Boolean | true, false | #### Objects Supported @@ -67,7 +67,7 @@ By default, this option is not enabled. | Name | Datentyp | Possible Values | | ------------------- | -------- | --------------- | -| hideSystemHighlight | boolean | true, false | +| hideSystemHighlight | Boolean | true, false | #### Objects Supported diff --git a/website/translated_docs/de/FormObjects/properties_BackgroundAndBorder.md b/website/translated_docs/de/FormObjects/properties_BackgroundAndBorder.md index 188882b254edf0..24c3eba3f0c71c 100644 --- a/website/translated_docs/de/FormObjects/properties_BackgroundAndBorder.md +++ b/website/translated_docs/de/FormObjects/properties_BackgroundAndBorder.md @@ -115,7 +115,7 @@ You can remove these empty rows by selecting this option. The bottom of the list | Name | Datentyp | Possible Values | | ------------------ | -------- | --------------- | -| hideExtraBlankRows | boolean | true, false | +| hideExtraBlankRows | Boolean | true, false | #### Objects Supported diff --git a/website/translated_docs/de/FormObjects/properties_CoordinatesAndSizing.md b/website/translated_docs/de/FormObjects/properties_CoordinatesAndSizing.md index 67ea05707ff9e7..31f97d72514dfa 100644 --- a/website/translated_docs/de/FormObjects/properties_CoordinatesAndSizing.md +++ b/website/translated_docs/de/FormObjects/properties_CoordinatesAndSizing.md @@ -31,7 +31,7 @@ When this property is enabled, the height of every row is automatically calculat | Name | Datentyp | Possible Values | | ------------- | -------- | --------------- | -| rowHeightAuto | boolean | true, false | +| rowHeightAuto | Boolean | true, false | #### Objects Supported diff --git a/website/translated_docs/de/FormObjects/properties_DataSource.md b/website/translated_docs/de/FormObjects/properties_DataSource.md index 07f5237424cb6d..d1edc72fae1728 100644 --- a/website/translated_docs/de/FormObjects/properties_DataSource.md +++ b/website/translated_docs/de/FormObjects/properties_DataSource.md @@ -24,7 +24,7 @@ When the **automatic insertion** option is not selected (default), the value ent | Name | Datentyp | Possible Values | | ------------------ | -------- | --------------- | -| automaticInsertion | boolean | true, false | +| automaticInsertion | Boolean | true, false | #### Objects Supported diff --git a/website/translated_docs/de/FormObjects/properties_Display.md b/website/translated_docs/de/FormObjects/properties_Display.md index 3650204ac3ebe7..cfa9faa33b4beb 100644 --- a/website/translated_docs/de/FormObjects/properties_Display.md +++ b/website/translated_docs/de/FormObjects/properties_Display.md @@ -418,7 +418,7 @@ In particular, this property allows implementing "invisible" buttons. Non-rende | Name | Datentyp | Possible Values | | ------- | -------- | --------------- | -| display | boolean | true, false | +| display | Boolean | true, false | #### Objects Supported @@ -455,7 +455,7 @@ In this case as well, the [Title](#title) property is also available so that the | Name | Datentyp | Possible Values | | ---------- | -------- | --------------- | -| threeState | boolean | true, false | +| threeState | Boolean | true, false | #### Objects Supported diff --git a/website/translated_docs/de/FormObjects/properties_Entry.md b/website/translated_docs/de/FormObjects/properties_Entry.md index 5d0308e35336cb..06dcd401370410 100644 --- a/website/translated_docs/de/FormObjects/properties_Entry.md +++ b/website/translated_docs/de/FormObjects/properties_Entry.md @@ -15,7 +15,7 @@ The Auto Spellcheck property activates the spell-check for each object. When use | Name | Datentyp | Possible Values | | ---------- | -------- | --------------- | -| spellcheck | boolean | true, false | +| spellcheck | Boolean | true, false | #### Objects Supported @@ -67,7 +67,7 @@ When this property is disabled, any pop-up menus associated with a list box colu | Name | Datentyp | Possible Values | | --------- | -------- | --------------- | -| enterable | boolean | true, false | +| enterable | Boolean | true, false | #### Objects Supported @@ -157,7 +157,7 @@ When the **Focusable** property is selected for a non-enterable object, the user | Name | Datentyp | Possible Values | | --------- | -------- | --------------- | -| focusable | boolean | true, false | +| focusable | Boolean | true, false | #### Objects Supported @@ -271,7 +271,7 @@ This property keeps the selection visible within the object after it has lost th | Name | Datentyp | Possible Values | | ------------- | -------- | --------------- | -| showSelection | boolean | true, false | +| showSelection | Boolean | true, false | #### Objects Supported @@ -297,11 +297,11 @@ To view a list of all the shortcuts used in the 4D Design environment, see the [ | Name | Datentyp | Possible Values | | --------------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| shortcutAccel | boolean | true, false (Ctrl Windows/Command macOS) | -| shortcutAlt | boolean | true, false | -| shortcutCommand | boolean | true, false | -| shortcutControl | boolean | true, false (macOS Control) | -| shortcutShift | boolean | true, false | +| shortcutAccel | Boolean | true, false (Ctrl Windows/Command macOS) | +| shortcutAlt | Boolean | true, false | +| shortcutCommand | Boolean | true, false | +| shortcutControl | Boolean | true, false (macOS Control) | +| shortcutShift | Boolean | true, false | | | | | | shortcutKey | string |
  • any character key: "a", "b"...
  • [F1]" -> "[F15]", "[Return]", "[Enter]", "[Backspace]", "[Tab]", "[Esc]", "[Del]", "[Home]", "[End]", "[Help]", "[Page up]", "[Page down]", "[left arrow]", "[right arrow]", "[up arrow]", "[down arrow]" | @@ -327,7 +327,7 @@ When this option is not enabled, users must first select the cell row and then c | Name | Datentyp | Possible Values | | --------------- | -------- | --------------- | -| singleClickEdit | boolean | true, false | +| singleClickEdit | Boolean | true, false | #### Objects Supported diff --git a/website/translated_docs/de/FormObjects/properties_Footers.md b/website/translated_docs/de/FormObjects/properties_Footers.md index e7a92b80d44073..1ccf29434e163b 100644 --- a/website/translated_docs/de/FormObjects/properties_Footers.md +++ b/website/translated_docs/de/FormObjects/properties_Footers.md @@ -12,7 +12,7 @@ This property is used to display or hide [list box column footers](listbox_overv | Name | Datentyp | Possible Values | | ----------- | -------- | --------------- | -| showFooters | boolean | true, false | +| showFooters | Boolean | true, false | #### Objects Supported diff --git a/website/translated_docs/de/FormObjects/properties_Headers.md b/website/translated_docs/de/FormObjects/properties_Headers.md index 2249b48ef5777c..67cf374a0a12ac 100644 --- a/website/translated_docs/de/FormObjects/properties_Headers.md +++ b/website/translated_docs/de/FormObjects/properties_Headers.md @@ -12,7 +12,7 @@ This property is used to display or hide [list box column headers](listbox_overv | Name | Datentyp | Possible Values | | ----------- | -------- | --------------- | -| showHeaders | boolean | true, false | +| showHeaders | Boolean | true, false | #### Objects Supported diff --git a/website/translated_docs/de/FormObjects/properties_Object.md b/website/translated_docs/de/FormObjects/properties_Object.md index 274104dadc26e0..0d0f44e948ac6f 100644 --- a/website/translated_docs/de/FormObjects/properties_Object.md +++ b/website/translated_docs/de/FormObjects/properties_Object.md @@ -67,7 +67,7 @@ Here is the list of objects whose value can be saved: | Name | Datentyp | Possible Values | | ------------- | -------- | --------------- | -| memorizeValue | boolean | true, false | +| memorizeValue | Boolean | true, false | #### Objects Supported diff --git a/website/translated_docs/de/FormObjects/properties_RangeOfValues.md b/website/translated_docs/de/FormObjects/properties_RangeOfValues.md index 36a2a8b768c5bf..adbe4162823dca 100644 --- a/website/translated_docs/de/FormObjects/properties_RangeOfValues.md +++ b/website/translated_docs/de/FormObjects/properties_RangeOfValues.md @@ -13,7 +13,7 @@ The default value can only be used if the [data source type](properties_Object.m - number/integer - date - time -- boolean +- Boolean 4D provides stamps for generating default values for the date, time, and sequence number. The date and time are taken from the system date and time. 4D automatically generates any sequence numbers needed. The table below shows the stamp to use to generate default values automatically: diff --git a/website/translated_docs/de/FormObjects/properties_Reference.md b/website/translated_docs/de/FormObjects/properties_Reference.md index 3ba48fc0e83ffe..877b6bd4f289f3 100644 --- a/website/translated_docs/de/FormObjects/properties_Reference.md +++ b/website/translated_docs/de/FormObjects/properties_Reference.md @@ -125,7 +125,7 @@ You will find in this page a comprehensive list of all object properties sorted | [rowCount](properties_Crop.md#rows) | Sets the number of rows. | minimum: 1 | | [rowFillSource](properties_BackgroundAndBorder.md#row-background-color-array) (array list box)
    [rowFillSource](properties_BackgroundAndBorder.md#background-color-expression) (selection or collection list box) | The name of an array or expression to apply a custom background color to each row of a list box. | The name of an array or expression. | | [rowHeight](properties_CoordinatesAndSizing.md#row-height) | Sets the height of list box rows. | CSS value unit "em" or "px" (default) | -| [rowHeightAuto](properties_CoordinatesAndSizing.md#automatic-row-height) | boolean | "true", "false" | +| [rowHeightAuto](properties_CoordinatesAndSizing.md#automatic-row-height) | Boolean | "true", "false" | | [rowHeightAutoMax](properties_CoordinatesAndSizing.md#maximum-width) | Designates the largest height allowed for list box rows. | CSS value unit "em" or "px" (default). minimum: 0 | | [rowHeightAutoMin](properties_CoordinatesAndSizing.md#minimum-width) | Designates the smallest height allowed for list box rows. | CSS value unit "em" or "px" (default). minimum: 0 | | [rowHeightSource](properties_CoordinatesAndSizing.md#row-height-array) | An array defining different heights for the rows in a list box. | Name of a 4D array variable. | diff --git a/website/translated_docs/de/FormObjects/properties_ResizingOptions.md b/website/translated_docs/de/FormObjects/properties_ResizingOptions.md index fef720021f3d61..8fcc6c74ab4ce7 100644 --- a/website/translated_docs/de/FormObjects/properties_ResizingOptions.md +++ b/website/translated_docs/de/FormObjects/properties_ResizingOptions.md @@ -131,7 +131,7 @@ Designates if the size of the column can be modified by the user. | Name | Datentyp | Possible Values | |:--------- |:--------:|:---------------:| -| resizable | boolean | "true", "false" | +| resizable | Boolean | "true", "false" | #### Objects Supported diff --git a/website/translated_docs/de/FormObjects/properties_Scale.md b/website/translated_docs/de/FormObjects/properties_Scale.md index 16e4cb04cc409d..6eaa16d7f59ebe 100644 --- a/website/translated_docs/de/FormObjects/properties_Scale.md +++ b/website/translated_docs/de/FormObjects/properties_Scale.md @@ -29,7 +29,7 @@ Displays/Hides the graduations next to the labels. | Name | Datentyp | Possible Values | |:---------------:|:--------:| --------------- | -| showGraduations | boolean | "true", "false" | +| showGraduations | Boolean | "true", "false" | #### Objects Supported diff --git a/website/translated_docs/de/FormObjects/properties_Subform.md b/website/translated_docs/de/FormObjects/properties_Subform.md index 1124af19db9163..da8bf8fa5963a2 100644 --- a/website/translated_docs/de/FormObjects/properties_Subform.md +++ b/website/translated_docs/de/FormObjects/properties_Subform.md @@ -12,7 +12,7 @@ Specifies if the user can delete subrecords in a list subform. | Name | Datentyp | Possible Values | | --------------- | -------- | --------------------------- | -| deletableInList | boolean | true, false (default: true) | +| deletableInList | Boolean | true, false (default: true) | #### Objects Supported @@ -103,7 +103,7 @@ When a list subform has this property enabled, the user can modify record data d | Name | Datentyp | Possible Values | | --------------- | -------- | --------------- | -| enterableInList | boolean | true, false | +| enterableInList | Boolean | true, false | #### Objects Supported diff --git a/website/translated_docs/de/FormObjects/properties_Text.md b/website/translated_docs/de/FormObjects/properties_Text.md index 3809ab5a03cdc3..1bb658192044f6 100644 --- a/website/translated_docs/de/FormObjects/properties_Text.md +++ b/website/translated_docs/de/FormObjects/properties_Text.md @@ -13,7 +13,7 @@ When this property is enabled, the [OPEN FONT PICKER](https://doc.4d.com/4Dv18/4 | Property | Datentyp | Possible Values | | -------------------- | -------- | --------------------- | -| allowFontColorPicker | boolean | false (default), true | +| allowFontColorPicker | Boolean | false (default), true | #### Objects Supported @@ -310,8 +310,8 @@ Specifies an expression or a variable which will be evaluated for each row displ | fontStyle | string | "normal","italic" | | fontWeight | string | "normal","bold" | | textDecoration | string | "normal","underline" | -| unselectable | boolean | Designates the corresponding row as not being selectable (*i.e.*, highlighting is not possible). Enterable areas are no longer enterable if this option is enabled unless the "Single-Click Edit" option is also enabled. Controls such as checkboxes and lists remain functional. This setting is ignored if the list box selection mode is "None". Default value: False. | -| disabled | boolean | Disables the corresponding row. Enterable areas are no longer enterable if this option is enabled. Text and controls (checkboxes, lists, etc.) appear dimmed or grayed out. Default value: False. | +| unselectable | Boolean | Designates the corresponding row as not being selectable (*i.e.*, highlighting is not possible). Enterable areas are no longer enterable if this option is enabled unless the "Single-Click Edit" option is also enabled. Controls such as checkboxes and lists remain functional. This setting is ignored if the list box selection mode is "None". Default value: False. | +| disabled | Boolean | Disables the corresponding row. Enterable areas are no longer enterable if this option is enabled. Text and controls (checkboxes, lists, etc.) appear dimmed or grayed out. Default value: False. | | cell.\ | object | Allows applying the property to a single column. Pass in \ the object name of the list box column. **Note**: "unselectable" and "disabled" properties can only be defined at row level. They are ignored if passed in the "cell" object | > Style settings made with this property are ignored if other style settings are already defined through expressions (*i.e.*, [Style Expression](#style-expression), [Font Color Expression](#font-color-expression), [Background Color Expression](#background-color-expression)). @@ -412,7 +412,7 @@ This property enables the possibility of using specific styles in the selected a - boolean + Boolean @@ -731,7 +731,7 @@ This property enables the possibility of using specific styles in the selected a - boolean + Boolean diff --git a/website/translated_docs/de/FormObjects/properties_WebArea.md b/website/translated_docs/de/FormObjects/properties_WebArea.md index b1f440e0c2add9..a690347b17a8e4 100644 --- a/website/translated_docs/de/FormObjects/properties_WebArea.md +++ b/website/translated_docs/de/FormObjects/properties_WebArea.md @@ -16,9 +16,9 @@ When this property is on, a special JavaScript object named `$4d` is instantiate #### JSON Grammar -| Name | Datentyp | Possible Values | -| -------------------- | -------- | ----------------------- | -| methodsAccessibility | string | "none" (default), "all" | +| Name | Data Type | Possible Values | +| -------------------- | --------- | ----------------------- | +| methodsAccessibility | string | "none" (default), "all" | #### Objects Supported @@ -32,9 +32,9 @@ Name of a Longint type variable. This variable will receive a value between 0 an #### JSON Grammar -| Name | Datentyp | Possible Values | -| -------------- | -------- | -------------------------- | -| progressSource | string | Name of a Longint variable | +| Name | Data Type | Possible Values | +| -------------- | --------- | -------------------------- | +| progressSource | string | Name of a Longint variable | #### Objects Supported @@ -63,9 +63,9 @@ The URL variable produces the same effects as the [WA OPEN URL](https://doc.4d.c #### JSON Grammar -| Name | Datentyp | Possible Values | -| --------- | -------- | --------------- | -| urlSource | string | A URL. | +| Name | Data Type | Possible Values | +| --------- | --------- | --------------- | +| urlSource | string | A URL. | #### Objects Supported @@ -94,9 +94,9 @@ This option allows choosing between two rendering engines for the Web area, depe #### JSON Grammar -| Name | Datentyp | Possible Values | -| --------- | -------- | -------------------- | -| webEngine | string | "embedded", "system" | +| Name | Data Type | Possible Values | +| --------- | --------- | -------------------- | +| webEngine | string | "embedded", "system" | #### Objects Supported diff --git a/website/translated_docs/de/FormObjects/splitters.md b/website/translated_docs/de/FormObjects/splitters.md index c613b12eef9c37..38aeb2be788bd8 100644 --- a/website/translated_docs/de/FormObjects/splitters.md +++ b/website/translated_docs/de/FormObjects/splitters.md @@ -46,7 +46,7 @@ In a form, splitters interact with the objects that are around them according to | Resizing options for the object(s) | Object(s) above an horizontal splitter or to the left of a vertical splitter (1) | Object(s) below an horizontal *non-Pusher* splitter or to the right of a vertical *non-Pusher* splitter | Object(s) below an horizontal *Pusher* splitter or to the right of a vertical *Pusher* splitter | | ---------------------------------- | ----------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | | None | Remain as is | Are moved with the splitter (position relative to the splitter is not modified) until the next stop. The stop when moving to the bottom or right is either the window’s border, or another splitter. | Are moved with the splitter (position relative to the splitter is not modified) indefinitely. No stop is applied (see the next paragraph) | -| Zoomen | Keep original position(s), but are resized according to the splitter’s new position | | | +| Resize | Keep original position(s), but are resized according to the splitter’s new position | | | | Move | Are moved with the splitter | | | *(1) You cannot drag the splitter past the right (horizontal) or bottom (vertical) side of an object located in this position.* diff --git a/website/translated_docs/de/FormObjects/text.md b/website/translated_docs/de/FormObjects/text.md index 5e0db00aa57e3f..36b404343166c9 100644 --- a/website/translated_docs/de/FormObjects/text.md +++ b/website/translated_docs/de/FormObjects/text.md @@ -1,5 +1,5 @@ --- -id: Text +id: text title: Text --- diff --git a/website/translated_docs/de/FormObjects/webArea_overview.md b/website/translated_docs/de/FormObjects/webArea_overview.md index ac145b32b60472..ad90524db90d86 100644 --- a/website/translated_docs/de/FormObjects/webArea_overview.md +++ b/website/translated_docs/de/FormObjects/webArea_overview.md @@ -59,7 +59,7 @@ $4d.4DMethodName(param1,paramN,function(result){}) > By default, 4D works in UTF-8. When you return text containing extended characters, for example characters with accents, make sure the encoding of the page displayed in the Web area is declared as UTF-8, otherwise the characters may be rendered incorrectly. In this case, add the following line in the HTML page to declare the encoding: `` -#### Beispiel 1 +#### Example 1 Given a 4D project method named `today` that does not receive parameters and returns the current date as a string. 4D code of `today` method: @@ -96,7 +96,7 @@ $4d.today(function(dollarZero) ``` -#### Beispiel 2 +#### Example 2 The 4D project method `calcSum` receives parameters (`$1...$n`) and returns their sum in `$0`: diff --git a/website/translated_docs/de/MSC/analysis.md b/website/translated_docs/de/MSC/analysis.md index cbe8450b050324..dfe013a5039a16 100644 --- a/website/translated_docs/de/MSC/analysis.md +++ b/website/translated_docs/de/MSC/analysis.md @@ -1,36 +1,36 @@ --- -id: Analyse -title: Seite Aktivität Analyse -sidebar_label: Seite Aktivität Analyse +id: analysis +title: Activity analysis Page +sidebar_label: Activity analysis Page --- -Auf der Seite Aktivität Analyse des MSC können Sie den Inhalt des aktuellen Logbuchs betrachten. This function is useful for parsing the use of an application or detecting the operation(s) that caused errors or malfunctions. In the case of an application in client-server mode, it allows verifying operations performed by each client machine. -> Sie können die in den Daten der Anwendung ausgeführten Operationen auch zurückfahren (rollback). Weitere Informationen dazu finden Sie auf der [Seite Zurückfahren](rollback.md). +The Activity analysis page allows viewing the contents of the current log file. This function is useful for parsing the use of an application or detecting the operation(s) that caused errors or malfunctions. In the case of an application in client-server mode, it allows verifying operations performed by each client machine. +> It is also possible to rollback the operations carried out on the data of the database. For more information, refer to [Rollback page](rollback.md). ![](assets/en/MSC/MSC_analysis.png) -Jede im Logbuch gespeicherte Operation erscheint als eine Zeile. Die Spalten liefern verschiedene Informationen zur Operation. Durch Anklicken der Kopfteile können Sie die Spalten beliebig umstellen. +Every operation recorded in the log file appears as a row. The columns provide various information on the operation. You can reorganize the columns as desired by clicking on their headers. -Über diese Informationen können Sie die Quelle und den Kontext jeder Operation identifizieren: +This information allows you to identify the source and context of each operation: - **Operation**: Sequence number of operation in the log file. -- **Action**: Type of operation performed on the data. Diese Spalte kann eine der nachfolgenden Operationen anzeigen: - - Öffnen der Datendatei: Datendatei öffnen - - Schließen der Datendatei: Eine geöffnete Datendatei wird geschlossen - - Erstellen eines Kontexts: Einen Prozess erstellen, der einen Ausführungskontext angibt - - Schließen eines Kontexts: Prozess schließen - - Hinzufügen: Einen Datensatz erstellen und speichern - - BLOB hinzufügen: Ein BLOB in einem BLOB Feld speichern - - Löschen: Datensatz gelöscht - - Ändern: Datensatz geändert - - Starten der Transaktion: Transaktion gestartet - - Bestätigen der Transaktion: Transaktion bestätigt - - Abbrechen der Transaktion: Transaktion annulliert +- **Action**: Type of operation performed on the data. This column can contain one of the following operations: + - Opening of Data File: Opening of a data file. + - Closing of Data File: Closing of an open data file. + - Creation of a Context: Creation of a process that specifies an execution context. + - Closing of a Context: Closing of process. + - Addition: Creation and storage of a record. + - Adding a BLOB: Storage of a BLOB in a BLOB field. + - Deletion: Deletion of a record. + - Modification: Modification of a record. + - Start of Transaction: Transaction started. + - Validation of Transaction: Transaction validated. + - Cancellation of Transaction: Transaction cancelled. - Update context: Change in extra data (e.g. a call to `CHANGE CURRENT USER` or `SET USER ALIAS`). - **Table**: Table to which the added/deleted/modified record or BLOB belongs. - **Primary Key/BLOB**: contents of the primary key for each record (when the primary key consists of several fields, the values are separated by semi-colons) or sequence number of the BLOB involved in the operation. -- **Process**: Internal number of process in which the operation was carried out. Diese interne Nummer entspricht dem Kontext der Operation. +- **Process**: Internal number of process in which the operation was carried out. This internal number corresponds to the context of the operation. - **Size**: Size (in bytes) of data processed by the operation. - **Date and Hour**: Date and hour when the operation was performed. - **System User**: System name of the user that performed the operation. In client-server mode, the name of the client-side machine is displayed; in single-user mode, the session name of the user is displayed. diff --git a/website/translated_docs/de/MSC/backup.md b/website/translated_docs/de/MSC/backup.md index 2dc75e880c847b..07667b30a86882 100644 --- a/website/translated_docs/de/MSC/backup.md +++ b/website/translated_docs/de/MSC/backup.md @@ -1,19 +1,19 @@ --- id: backup -title: Seite Backup -sidebar_label: Seite Backup +title: Backup Page +sidebar_label: Backup Page --- -Die Seite Backup des MSC zeigt die Backup-Einstellungen für die Datenbank. Hier können Sie auch ein manuelles Backup starten: +You can use the Backup page to view some backup parameters of the database and to launch a manual backup: ![](assets/en/MSC/msc_Backup.png) -Diese Seite ist in drei Bereiche unterteilt: +This page consists of the following three areas: -- **Backup File Destination**: displays information about the location of the application backup file. sowie den freien bzw. verwendeten Platz auf der Backup-Festplatte. +- **Backup File Destination**: displays information about the location of the application backup file. It also indicates the free/used space on the backup disk. - **Last Backup Information**: provides the date and time of the last backup (automatic or manual) carried out on the application. - **Contents of the backup file**: lists the files and folders included in the backup file. The **Backup** button is used to launch a manual backup. -Auf dieser Seite können Sie keine Backup-Parameter verändern. To do this, you must click on the **Database properties...** button. \ No newline at end of file +This page cannot be used to modify the backup parameters. To do this, you must click on the **Database properties...** button. \ No newline at end of file diff --git a/website/translated_docs/de/MSC/compact.md b/website/translated_docs/de/MSC/compact.md index 0fafbc8496a211..6b5abb40ca8ab4 100644 --- a/website/translated_docs/de/MSC/compact.md +++ b/website/translated_docs/de/MSC/compact.md @@ -1,37 +1,37 @@ --- id: compact -title: Seite Kompakt -sidebar_label: Seite Kompakt +title: Compact Page +sidebar_label: Compact Page --- -Auf dieser Seite können Sie die Funktionen zum Komprimieren der Datendatei verwenden. +You use this page to access the data file compacting functions. -## Warum Dateien komprimieren? +## Why compact your files? -Komprimieren der Dateien erfüllt zwei Anforderungen: +Compacting files meets two types of needs: -- **Reducing size and optimization of files**: Files may contain unused spaces (“holes”). Beim Löschen von Datensätzen wird der zuvor belegte Platz in der Datei zum Leerraum. In der Regel verwendet 4D diese Leerräume soweit wie möglich erneut. Da jedoch die Datengröße unterschiedlich ist, entstehen durch sukzessives Löschen oder Ändern unweigerlich nicht-verwendbare Leerräume. Dasselbe passiert, wenn eine große Menge Daten gerade gelöscht wurde: die leeren Stellen bleiben in der Datei ohne Zuweisung. Das Verhältnis zwischen Größe der Datendatei und derzeit für die Daten genutztem Platz ist die Auslastungsrate der Daten. Eine zu geringe Rate ist zunächst Platzverschwendung, kann aber auch die Performance der Datenbank beeinträchtigen. Hier schafft Komprimieren Abhilfe, denn dadurch wird das Speichern der Daten neu organisiert und optimiert, d. h. die Löcher werden entfernt. Der Bereich “Information” fasst die Daten im Hinblick auf Fragmentierung zusammen und schlägt die auszuführenden Operationen vor. Die Registerkarte [Daten](information.md#data) auf der Seite “Information” des MSC gibt die Fragmentierung der aktuellen Datendatei an. +- **Reducing size and optimization of files**: Files may contain unused spaces (“holes”). In fact, when you delete records, the space that they occupied previously in the file becomes empty. 4D reuses these empty spaces whenever possible, but since data size is variable, successive deletions or modifications will inevitably generate unusable space for the program. The same goes when a large quantity of data has just been deleted: the empty spaces remain unassigned in the file. The ratio between the size of the data file and the space actually used for the data is the occupation rate of the data. A rate that is too low can lead, in addition to a waste of space, to the deterioration of database performance. Compacting can be used to reorganize and optimize storage of the data in order to remove the “holes”. The “Information” area summarizes the data concerning the fragmentation of the file and suggests operations to be carried out. The [Data](information.md#data) tab on the “Information” page of the MSC indicates the fragmentation of the current data file. -- **Complete updating of data** by applying the current formatting set in the structure file. Das ist hilfreich, wenn Daten aus der gleichen Tabelle in unterschiedlichen Formaten gespeichert wurden, z. B. nach einer Änderung in der Struktur der Anwendung. -> Komprimieren ist nur im Wartungsmodus verfügbar. If you attempt to carry out this operation in standard mode, a warning dialog box will inform you that the application will be closed and restarted in maintenance mode. You can compact a data file that is not opened by the application (see [Compact records and indexes](#compact-records-and-indexes) below). +- **Complete updating of data** by applying the current formatting set in the structure file. This is useful when data from the same table were stored in different formats, for example after a change in the database structure. +> Compacting is only available in maintenance mode. If you attempt to carry out this operation in standard mode, a warning dialog box will inform you that the application will be closed and restarted in maintenance mode. You can compact a data file that is not opened by the application (see [Compact records and indexes](#compact-records-and-indexes) below). -## Standard Komprimierung +## Standard compacting -Um das Komprimieren direkt zu starten, klicken Sie im MSC-Fenster auf die Schaltfläche zum Komprimieren. +To directly begin the compacting of the data file, click on the compacting button in the MSC window. ![](assets/en/MSC/MSC_compact.png) -> Da beim Komprimieren die Originaldatei dupliziert wird, ist die Schaltfläche inaktiv, wenn auf der Festplatte mit dieser Datei nicht genügend Speicherplatz vorhanden ist. +> Since compacting involves the duplication of the original file, the button is disabled when there is not adequate space available on the disk containing the file. -Dieser Vorgang komprimiert die Hauptdatei sowie alle Index-Dateien. 4D copies the original files and puts them in a folder named **Replaced Files (Compacting)**, which is created next to the original file. Haben Sie mehrere Komprimierungen durchgeführt, wird jedes Mal ein neuer Ordner angelegt. Er lautet “Replaced Files (Compacting)_1”, “Replaced Files (Compacting)_2”, usw. Im erweiterten Modus können Sie den Ordner zum Abspeichern der Originaldateien verändern. +This operation compacts the main file as well as any index files. 4D copies the original files and puts them in a folder named **Replaced Files (Compacting)**, which is created next to the original file. If you have carried out several compacting operations, a new folder is created each time. It will be named “Replaced Files (Compacting)_1”, “Replaced Files (Compacting)_2”, and so on. You can modify the folder where the original files are saved using the advanced mode. -Ist die Operation abgeschlossen, ersetzen die komprimierten Dateien automatisch die Originaldateien. The application is immediately operational without any further manipulation. -> Bei einer verschlüsselten Anwendung enthält die Komprimierung auch die Schritte Entschlüsselung und Verschlüsselung. Dazu ist auch der aktuelle Verschlüsselungscode erforderlich. Ist noch kein gültiger Datenschlüssel angegeben, erscheint ein Dialogfenster, dass die Passphrase oder den Datenschlüssel anfordert. +When the operation is completed, the compacted files automatically replace the original files. The application is immediately operational without any further manipulation. +> When the database is encrypted, compacting includes decryption and encryption steps and thus, requires the current data encryption key. If no valid data key has already been provided, a dialog box requesting the passphrase or the data key is displayed. -**Warning:** Each compacting operation involves the duplication of the original file which increases the size of the application folder. Sie sollten darauf achten (besonders auf macOS, wo 4D Anwendungen als Package erscheinen), dass die Größe der Anwendung nicht exzessiv ansteigt. In diesem Fall ist es hilfreich, die Kopien der Originaldatei im Package manuell zu entfernen, damit die Größe des Package im Rahmen bleibt. +**Warning:** Each compacting operation involves the duplication of the original file which increases the size of the application folder. It is important to take this into account (especially under macOS where 4D applications appear as packages) so that the size of the application does not increase excessively. Manually removing the copies of the original file inside the package can be useful in order to keep the package size down. -## Logbuch öffnen +## Open log file -After compacting is completed, 4D generates a log file in the Logs folder of the project. Hier können Sie alle ausgeführten Operationen ansehen. It is created in XML format and named: *ApplicationName**_Compact_Log_yyyy-mm-dd hh-mm-ss.xml*" where: +After compacting is completed, 4D generates a log file in the Logs folder of the project. This file allows you to view all the operations carried out. It is created in XML format and named: *ApplicationName**_Compact_Log_yyyy-mm-dd hh-mm-ss.xml*" where: - *ApplicationName* is the name of the project file without any extension, for example "Invoices", - *yyyy-mm-dd hh-mm-ss* is the timestamp of the file, based upon the local system time when the maintenance operation was started, for example "2019-02-11 15-20-45". @@ -39,33 +39,33 @@ After compacting is completed, 4D generates a log file in the Logs folder of the When you click on the **Open log file** button, 4D displays the most recent log file in the default browser of the machine. -## Erweiterter Modus +## Advanced mode The Compact page contains an **Advanced>** button, which can be used to access an options page for compacting data file. -### Komprimiere Datensätze und Indizes +### Compact records and indexes -The **Compact records and indexes** area displays the pathname of the current data file as well as a **[...]** button that can be used to specify another data file. Klicken Sie auf diese Schaltfläche, erscheint ein Standard-Öffnen Dialog, um die gewünschte Datendatei zum Komprimieren auszuwählen. Sie müssen eine Datendatei auswählen, die zur geöffneten Strukturdatei passt. Bestätigen Sie dieses Dialogfenster, erscheint der Pfadname der zu komprimierenden Datei im Fenster. +The **Compact records and indexes** area displays the pathname of the current data file as well as a **[...]** button that can be used to specify another data file. When you click on this button, a standard Open document dialog box is displayed so that you can designate the data file to be compacted. You must select a data file that is compatible with the open structure file. Once this dialog box has been validated, the pathname of the file to be compacted is indicated in the window. -The second **[...]** button can be used to specify another location for the original files to be saved before the compacting operation. Diese Option ist insbesondere beim Komprimieren umfangreicher Dateien auf verschiedenen Festplatten hilfreich. +The second **[...]** button can be used to specify another location for the original files to be saved before the compacting operation. This option can be used more particularly when compacting voluminous files while using different disks. -### Erzwinge Aktualisierung aller Datensätze +### Force updating of the records -Ist diese Option markiert, schreibt 4D während der Komprimierung jeden Datensatz für jede Tabelle gemäß seiner Beschreibung in der Struktur erneut. Ist diese Option nicht markiert, organisiert 4D lediglich das Speichern der Daten auf der Festplatte neu. Diese Option ist in folgenden Fällen von Nutzen: +When this option is checked, 4D rewrites every record for each table during the compacting operation, according to its description in the structure. If this option is not checked, 4D just reorganizes the data storage on disk. This option is useful in the following cases: -- Wenn Feldtypen in der Struktur der Anwendung nach der Dateneingabe geändert wurden. Sie haben z. B. ein Feld vom Typ Lange Ganzzahl in den Typ Zahl geändert. 4D erlaubt sogar Änderungen zwischen unterschiedlichen Typen (mit dem Risiko von Datenverlust), z. B. lässt sich ein Feld vom Typ Zahl in den Typ Text ändern und umgekehrt. In diesem Fall konvertiert 4D bereits eingegebene Daten nicht rückwirkend; Daten werden nur beim Laden und Sichern von Datensätzen konvertiert. Diese Option erzwingt die Konvertierung aller Daten. +- When field types are changed in the application structure after data were entered. For example, you may have changed a Longint field to a Real type. 4D even allows changes between two very different types (with risks of data loss), for instance a Real field can be changed to Text and vice versa. In this case, 4D does not convert data already entered retroactively; data is converted only when records are loaded and then saved. This option forces all data to be converted. -- Wenn die Option externes Speichern für Daten vom Typ Text, Bild oder BLOB nach der Dateneingabe geändert wurde. Das kann insbesondere beim Konvertieren der Datenbanken aus einer Version älter als v13 passieren. Auch hier konvertiert 4D bereits eingegebene Daten nicht rückwirkend. Mit dieser Option können Sie erzwingen, dass alle Datensätze aktualisiert werden, damit der neue Speicherungsmodus auch auf bereits eingegebene Datensätze angewandt wird. +- When an external storage option for Text, Picture or BLOB data has been changed after data were entered. This can happen when databases are converted from a version prior to v13. As is the case with the retyping described above, 4D does not convert data already entered retroactively. To do this, you can force records to be updated in order to apply the new storage mode to records that have already been entered. -- Wenn Tabellen oder Felder gelöscht wurden. In diesem Fall wird der Platz der entfernten Daten beim Komprimieren mit Aktualisieren aller Datensätze wieder verwendet und so die Dateigröße verringert. -> Ist diese Option gewählt, werden alle Indizes aktualisiert. +- When tables or fields were deleted. In this case, compacting with updating of records recovers the space of these removed data and thus reduces file size. +> All the indexes are updated when this option is selected. -### Komprimiere Adresstabelle -(Option nur aktiv, wenn die vorige Option markiert ist) +### Compact address table +(option only active when preceding option is checked) -Diese Option baut beim Komprimieren die Adresstabelle für die Datensätze komplett neu auf. Das optimiert die Größe der Adresstabelle und ist nur sinnvoll für Datenbanken, wo umfangreiches Datenvolumen erstellt und dann wieder gelöscht wurde. In anderen Fällen ist die Optimierung nicht signifikant. +This option completely rebuilds the address table for the records during compacting. This optimizes the size of the address table and is mainly used for databases where large volumes of data were created and then deleted. In other cases, optimization is not a decisive factor. -Beachten Sie, dass diese Option die Komprimierung beträchtlich verlangsamt und alle Mengen, die über den Befehl `SAVE SET` gesichert wurden, ungültig werden. Wir empfehlen außerdem dringend, in diesem Fall gesicherte Mengen zu löschen, da ihre Verwendung zur Auswahl nicht-korrekter Daten führen kann. -> - Beim Komprimieren werden auch die Datensätze von Tabellen berücksichtigt, die im Papierkorb liegen. Gibt es dort eine große Anzahl Datensätze, kann das ein weiterer Faktor sein, der die Operation verlangsamt. -> - Diese Option macht die Adresstabelle und folglich auch die Anwendung inkompatibel zum aktuellen Logbuch (sofern vorhanden). It will be saved automatically and a new journal file will have to be created the next time the application is launched. -> - Um zu sehen, ob die Adresstabelle komprimiert werden muss, gehen Sie auf die Seite [Information](information.md) des MSC und vergleichen die Gesamtanzahl der Datensätze mit der Größe der Adresstabelle. +Note that this option substantially slows compacting and invalidates any sets saved using the `SAVE SET` command. Moreover, we strongly recommend deleting saved sets in this case because their use can lead to selections of incorrect data. +> - Compacting takes records of tables that have been put into the Trash into account. If there are a large number of records in the Trash, this can be an additional factor that may slow down the operation. +> - Using this option makes the address table, and thus the database, incompatible with the current journal file (if there is one). It will be saved automatically and a new journal file will have to be created the next time the application is launched. +> - You can decide if the address table needs to be compacted by comparing the total number of records and the address table size in the [Information](information.md) page of the MSC. diff --git a/website/translated_docs/de/MSC/encrypt.md b/website/translated_docs/de/MSC/encrypt.md index de2c3cb7f494aa..0dc76b76e7259c 100644 --- a/website/translated_docs/de/MSC/encrypt.md +++ b/website/translated_docs/de/MSC/encrypt.md @@ -1,94 +1,94 @@ --- id: encrypt -title: Seite Verschlüsseln -sidebar_label: Seite Verschlüsseln +title: Encrypt Page +sidebar_label: Encrypt Page --- You can use this page to encrypt or *decrypt* (i.e. remove encryption from) the data file, according to the **Encryptable** attribute status defined for each table in the database. For detailed information about data encryption in 4D, please refer to the "Encrypting data" section in the *Design Reference* manual. -Bei jeder Operation Verschlüsselung/Entschlüsselung wird ein neuer Ordner angelegt. It is named "Replaced Files (Encrypting) *yyyy-mm-dd hh-mm-ss*> or "Replaced Files (Decrypting) *yyyy-mm-dd hh-mm-ss*". -> Verschlüsselung ist nur im [Wartungsmodus](overview.md#display-in-maintenance-mode) verfügbar. If you attempt to carry out this operation in standard mode, a warning dialog will inform you that the application will be closed and restarted in maintenance mode +A new folder is created each time you perform an encryption/decryption operation. It is named "Replaced Files (Encrypting) *yyyy-mm-dd hh-mm-ss*> or "Replaced Files (Decrypting) *yyyy-mm-dd hh-mm-ss*". +> Encryption is only available in [maintenance mode](overview.md#display-in-maintenance-mode). If you attempt to carry out this operation in standard mode, a warning dialog will inform you that the application will be closed and restarted in maintenance mode -**Warnung:** -- Encrypting a data file is a lengthy operation. Währenddessen erscheint ein Ablaufbalken (den der Benutzer unterbrechen kann). Note also that an application encryption operation always includes a compacting step. -- Jeder Verschlüsselungsvorgang produziert eine Kopie der Datendatei, was den Anwendungsordner vergrößert. Sie sollten darauf achten (besonders auf macOS, wo 4D Anwendungen als Package erscheinen), dass die Größe der Anwendung nicht exzessiv ansteigt. In diesem Fall ist es hilfreich, die Kopien der Originaldatei im Package manuell zu entfernen, damit die Größe des Package im Rahmen bleibt. +**Warning:** +- Encrypting a data file is a lengthy operation. It displays a progress indicator (which could be interrupted by the user). Note also that an application encryption operation always includes a compacting step. +- Each encryption operation produces a copy of the data file, which increases the size of the application folder. It is important to take this into account (especially in macOS where 4D applications appear as packages) so that the size of the application does not increase excessively. Manually moving or removing the copies of the original file inside the package can be useful in order to minimize the package size. -## Daten zum ersten Mal verschlüsseln -Beim ersten Verschlüsseln Ihrer Daten über das MSC sind folgende Schritte erforderlich: +## Encrypting data for the first time +Encrypting your data for the first time using the MSC requires the following steps: -1. In the Structure editor, check the **Encryptable** attribute for each table whose data you want to encrypt. Weitere Informationen dazu finden Sie im Abschnitt "Tabelleneigenschaften". -2. Öffnen Sie die Seite Verschlüsseln des MSC. If you open the page without setting any tables as **Encryptable**, the following message is displayed in the page: ![](assets/en/MSC/MSC_encrypt1.png) Otherwise, the following message is displayed: ![](assets/en/MSC/MSC_encrypt2.png)

    This means that the **Encryptable** status for at least one table has been modified and the data file still has not been encrypted. **Note: **The same message is displayed when the **Encryptable** status has been modified in an already encrypted data file or after the data file has been decrypted (see below). +1. In the Structure editor, check the **Encryptable** attribute for each table whose data you want to encrypt. See the "Table properties" section. +2. Open the Encrypt page of the MSC. If you open the page without setting any tables as **Encryptable**, the following message is displayed in the page: ![](assets/en/MSC/MSC_encrypt1.png) Otherwise, the following message is displayed: ![](assets/en/MSC/MSC_encrypt2.png)

    This means that the **Encryptable** status for at least one table has been modified and the data file still has not been encrypted. **Note: **The same message is displayed when the **Encryptable** status has been modified in an already encrypted data file or after the data file has been decrypted (see below). 3. Click on the Encrypt picture button. ![](assets/en/MSC/MSC_encrypt3.png) - You will be prompted to enter a passphrase for your data file: ![](assets/en/MSC/MSC_encrypt4.png) The passphrase is used to generate the data encryption key. Eine Passphrase ist eine sicherere Version als ein Kennwort, da sie eine größere Anzahl Zeichen enthalten kann. For example, you could enter a passphrases such as "We all came out to Montreux" or "My 1st Great Passphrase!!" The security level indicator can help you evaluate the strength of your passphrase: ![](assets/en/MSC/MSC_encrypt5.png) (deep green is the highest level) -4. Geben Sie zum Bestätigen Ihre gesicherte Passphrase ein. + You will be prompted to enter a passphrase for your data file: ![](assets/en/MSC/MSC_encrypt4.png) The passphrase is used to generate the data encryption key. A passphrase is a more secure version of a password and can contain a large number of characters. For example, you could enter a passphrases such as "We all came out to Montreux" or "My 1st Great Passphrase!!" The security level indicator can help you evaluate the strength of your passphrase: ![](assets/en/MSC/MSC_encrypt5.png) (deep green is the highest level) +4. Enter to confirm your secured passphrase. -Dann wird der Prozess zum Verschlüsseln gestartet. If the MSC was opened in standard mode, the application is reopened in maintenance mode. +The encrypting process is then launched. If the MSC was opened in standard mode, the application is reopened in maintenance mode. -4D bietet an, den Verschlüsselungscode zu sichern (siehe unten im Absatz [Verschlüsselungscode sichern](#verschlusselungscode-sichern)). Sie können das gleich oder später machen. Sie können auch das Logbuch zur Verschlüsselung öffnen. +4D offers to save the encryption key (see [Saving the encryption key](#saving-the-encryption-key) below). You can do it at this moment or later. You can also open the encryption log file. -War der Prozess zum Verschlüsseln erfolgreich, zeigt die Seite Verschlüsseln Schaltflächen für Wartungsoperationen beim Verschlüsseln. +If the encryption process is successful, the Encrypt page displays Encryption maintenance operations buttons. -**Warning:** During the encryption operation, 4D creates a new, empty data file and fills it with data from the original data file. Datensätze aus "verschlüsselbaren" Tabellen werden verschlüsselt und dann kopiert, andere Datensätze werden nur kopiert. (Außerdem wird eine Komprimierung durchgeführt). War die Operation erfolgreich, wird die ursprüngliche Datendatei in den Ordner "Replaced Files (Encrypting)" geschoben. If you intend to deliver an encrypted data file, make sure to move/remove any unencrypted data file from the application folder beforehand. +**Warning:** During the encryption operation, 4D creates a new, empty data file and fills it with data from the original data file. Records belonging to "encryptable" tables are encrypted then copied, other records are only copied (a compacting operation is also executed). If the operation is successful, the original data file is moved to a "Replaced Files (Encrypting)" folder. If you intend to deliver an encrypted data file, make sure to move/remove any unencrypted data file from the application folder beforehand. -## Wartungsoperationen beim Verschlüsseln +## Encryption maintenance operations When an application is encrypted (see above), the Encrypt page provides several encryption maintenance operations, corresponding to standard scenarios. ![](assets/en/MSC/MSC_encrypt6.png) -### Den aktuellen Verschlüsselungscode für Daten liefern -Aus Sicherheitsgründen wird bei allen Wartungsoperationen für Verschlüsselung der aktuelle Verschlüsselungscode der Daten angefordert. +### Providing the current data encryption key +For security reasons, all encryption maintenance operations require that the current data encryption key be provided. -- Wurde der Verschlüsselungscode für Daten bereits in den 4D Schlüsselbund (1) geladen, verwendet 4D ihn automatisch wieder. -- Wird kein Verschlüsselungscode für Daten gefunden, müssen Sie ihn liefern. Es erscheint folgendes Dialogfenster: ![](assets/en/MSC/MSC_encrypt7.png) +- If the data encryption key is already loaded in the 4D keychain(1), it is automatically reused by 4D. +- If the data encryption key is not found, you must provide it. The following dialog is displayed: ![](assets/en/MSC/MSC_encrypt7.png) -An dieser Stelle haben Sie zwei Möglichkeiten: -- enter the current passphrase(2) and click **OK**. ODER +At this step, you have two options: +- enter the current passphrase(2) and click **OK**. OR - connect a device such as a USB key and click the **Scan devices** button. (1) The 4D keychain stores all valid data encrpytion keys entered during the application session. (2) The current passphrase is the passphrase used to generate the current encryption key. -Ist die Eingabe korrekt, startet 4D in allen Fällen erneut im Wartungsmodus (falls das noch nicht der Fall ist) und führt die Operation aus. +In all cases, if valid information is provided, 4D restarts in maintenance mode (if not already the case) and executes the operation. -### Daten mit dem aktuellen Verschlüsselungscode erneut verschlüsseln +### Re-encrypt data with the current encryption key -This operation is useful when the **Encryptable** attribute has been modified for one or more tables containing data. Zur Vermeidung von Inkonsistenzen in der Datendatei erlaubt 4D in solchen Fällen keinen Schreibzugriff auf die Datensätze dieser Tabellen in der Anwendung. Die Daten müssen dann erneut verschlüsselt werden, um wieder einen gültigen Verschlüsselungsstatus herzustellen. +This operation is useful when the **Encryptable** attribute has been modified for one or more tables containing data. In this case, to prevent inconsistencies in the data file, 4D disallows any write access to the records of the tables in the application. Re-encrypting data is then necessary to restore a valid encryption status. 1. Click on **Re-encrypt data with the current encryption key**. -2. Geben Sie den aktuellen Verschlüsselungscode für Daten ein. +2. Enter the current data encryption key. -Die Datendatei wird erneut ordnungsgemäß mit dem aktuellen Schlüssel verschlüsselt und es erscheint eine Meldung als Bestätigung: ![](assets/en/MSC/MSC_encrypt8.png) +The data file is properly re-encrypted with the current key and a confirmation message is displayed: ![](assets/en/MSC/MSC_encrypt8.png) -### Passphrase verändern und Daten erneut verschlüsseln -Diese Operation bietet sich an, wenn Sie Ihren aktuellen Verschlüsselungscode für Daten verändern müssen, um bestimmte Sicherheitsregeln einzuhalten (z. B. wenn ein Admin das Unternehmen verlassen hat). +### Change your passphrase and re-encrypt data +This operation is useful when you need to change the current encryption data key. For example, you may need to do so to comply with security rules (such as requiring changing the passphrase every three months). 1. Click on **Change your passphrase and re-encrypt data**. -2. Geben Sie den aktuellen Verschlüsselungscode für Daten ein. -3. Geben Sie die neue Passphrase ein. Für zusätzliche Sicherheit werden Sie aufgefordert, diese ein zweites Mal einzugeben: ![](assets/en/MSC/MSC_encrypt9.png) Die Datendatei wird mit dem neuen Schlüssel verschlüsselt und es erscheint eine Meldung als Bestätigung. ![](assets/en/MSC/MSC_encrypt8.png) +2. Enter the current data encryption key. +3. Enter the new passphrase (for added security, you are prompted to enter it twice): ![](assets/en/MSC/MSC_encrypt9.png) The data file is encrypted with the new key and the confirmation message is displayed. ![](assets/en/MSC/MSC_encrypt8.png) -### Alle Daten entschlüsseln -Diese Operation entfernt jede Verschlüsselung aus der Datendatei. Sollen Ihre Daten nicht länger verschlüsselt sein: +### Decrypt all data +This operation removes all encryption from the data file. If you no longer want to have your data encrypted: 1. Click on **Decrypt all data**. -2. Geben Sie den aktuellen Verschlüsselungscode für Daten ein (siehe unter Den aktuellen Verschlüsselungscode für Daten liefern). +2. Enter the current data encryption key (see Providing the current data encryption key). -Die Datendatei wird komplett entschlüsselt und es erscheint eine Meldung als Bestätigung: ![](assets/en/MSC/MSC_encrypt10.png) -> Ist die Datendatei entschlüsselt, passt der Verschlüsselungsstatus der Tabellen nicht mehr zur Eigenschaft Verschlüsselbar. To restore a matching status, you must deselect all **Encryptable** attributes at the database structure level. +The data file is fully decrypted and a confirmation message is displayed: ![](assets/en/MSC/MSC_encrypt10.png) +> Once the data file is decrypted, the encryption status of tables do not match their Encryptable attributes. To restore a matching status, you must deselect all **Encryptable** attributes at the database structure level. -## Verschlüsselungscode sichern +## Saving the encryption key -In 4D können Sie den Verschlüsselungscode für Daten in einer spezifischen Datei speichern. Storing this file on an external device such a USB key will facilitate the use of an encrypted application, since the user would only need to connect the device to provide the key before opening the application in order to access encrypted data. +4D allows you to save the data encryption key in a dedicated file. Storing this file on an external device such a USB key will facilitate the use of an encrypted application, since the user would only need to connect the device to provide the key before opening the application in order to access encrypted data. -Sie können den Verschlüsselungscode jedes Mal sichern, wenn eine neue Passphrase angelegt wird: +You can save the encryption key each time a new passphrase has been provided: - when the application is encrypted for the first time, - when the application is re-encrypted with a new passphrase. -Aufeinanderfolgende Verschlüsselungscodes lassen sich auf dem gleichen Gerät speichern. +Successive encryption keys can be stored on the same device. -## Logbuch +## Log file After an encryption operation has been completed, 4D generates a file in the Logs folder of the application. It is created in XML format and named "*ApplicationName_Encrypt_Log_yyyy-mm-dd hh-mm-ss.xml*" or "*ApplicationName_Decrypt_Log_yyyy-mm-dd hh-mm-ss.xml*". -Immer wenn ein neues Logbuch angelegt wurde, erscheint auf der Seite Verschlüsselt unten die Schaltfläche Logbuch anzeigen. +An Open log file button is displayed on the MSC page each time a new log file has been generated. -Das Logbuch listet alle internen Operationen, die während dem Prozess Verschlüsseln/Entschlüsseln ausgeführt werden, sowie evtl. aufgetretene Fehler. +The log file lists all internal operations executed pertaining to the encryption/decryption process, as well as errors (if any). diff --git a/website/translated_docs/de/MSC/information.md b/website/translated_docs/de/MSC/information.md index 779dd42158b99d..ade0d827d2ee49 100644 --- a/website/translated_docs/de/MSC/information.md +++ b/website/translated_docs/de/MSC/information.md @@ -1,12 +1,12 @@ --- id: information -title: Seite Information -sidebar_label: Seite Information +title: Information Page +sidebar_label: Information Page --- -Die Seite “Information” liefert Informationen über die 4D Umgebung und die Systemumgebung, die Dateien der Datenbank und der Anwendung. Über die Registerkarten am oberen Rand können Sie die einzelnen Seiten aufrufen. +The Information page provides information about the 4D and system environments, as well as the database and application files. Each page can be displayed using tab controls at the top of the window. -## Programm +## Program This page indicates the name, version and location of the application as well as the active 4D folder (for more information about the active 4D folder, refer to the description of the `Get 4D folder` command in the *4D Language Reference* manual). @@ -15,38 +15,38 @@ The central part of the window indicates the name and location of the project an - **Display and selection of pathnames**: On the **Program** tab, pathnames are displayed in pop-up menus containing the folder sequence as found on the disk: ![](assets/en/MSC/MSC_popup.png) If you select a menu item (disk or folder), it is displayed in a new system window. The **Copy the path** command copies the complete pathname as text to the clipboard, using the separators of the current platform. -- **"Licenses" Folder** The **"Licenses" Folder** button displays the contents of the active Licenses folder in a new system window. Alle Lizenzdateien, die in Ihrer 4D Umgebung installiert sind, sind in diesem Ordner auf Ihrer Festplatte zusammengefasst. Beim Öffnen über einen Web Browser erscheinen die Informationen über die enthaltenen Lizenzen und ihre Merkmale. Der Speicherort des Ordners Licenses kann je nach Version Ihres Betriebssystems variieren. For more information about the location of this folder, refer to the `Get 4D folder` command. ***Note:** You can also access this folder from the “Update License” dialog box (available in the Help menu).* +- **"Licenses" Folder** The **"Licenses" Folder** button displays the contents of the active Licenses folder in a new system window. All the license files installed in your 4D environment are grouped together in this folder, on your hard disk. When they are opened with a Web browser, these files display information concerning the licenses they contain and their characteristics. The location of the "Licenses" folder can vary depending on the version of your operating system. For more information about the location of this folder, refer to the `Get 4D folder` command. ***Note:** You can also access this folder from the “Update License” dialog box (available in the Help menu).* -## Tabellen +## Tables -Diese Seite gibt einen Überblick über die Tabellen in Ihrer Anwendung: +This page provides an overview of the tables in your database: ![](assets/en/MSC/MSC_Tables.png) -> Information auf dieser Seite ist im Standardmodus und im Wartungsmodus verfügbar. +> Information on this page is available in both standard and maintenance modes. -Die Seite listet alle Tabellen der Datenbank - auch die ausgeblendeten - mit den dazugehörigen Merkmalen: +The page lists all the tables of the database (including invisible tables) as well as their characteristics: - **ID**: Internal number of the table. -- **Tables**: Name of the table. Namen von gelöschten Tabellen erscheinen in Klammern (wenn sie noch im Papierkorb sind). -- **Records**: Total number of records in the table. If a record is damaged or cannot be read, *Error* is displayed instead of the number. Dann können Sie abwägen, ob Sie die Tools zum Prüfen und Reparieren einsetzen. -- **Fields**: Number of fields in the table. Ausgeblendete Felder werden mitgezählt, gelöschte Felder dagegen nicht. +- **Tables**: Name of the table. Names of deleted tables are displayed with parenthesis (if they are still in the trash). +- **Records**: Total number of records in the table. If a record is damaged or cannot be read, *Error* is displayed instead of the number. In this case, you can consider using the verify and repair tools. +- **Fields**: Number of fields in the table. Invisible fields are counted, however, deleted fields are not counted. - **Indexes**: Number of indexes of any kind in the table - **Encryptable**: If checked, the **Encryptable** attribute is selected for the table at the structure level (see "Encryptable" paragraph in the Design Reference Manual). - **Encrypted**: If checked, the records of the table are encrypted in the data file. ***Note**: Any inconstency between Encryptable and Encrypted options requires that you check the encryption status of the data file in the Encrypt page of the MSC.* -- **Address Table Size**: Size of the address table for each table. In der Adresstabelle wird pro angelegtem Datensatz in der Tabelle intern ein Element gespeichert. Es verbindet Datensätze mit ihrer physikalischen Adresse. Aus Performance Gründen wird sie beim Löschen von Datensätzen nicht angepasst, so dass ihre Größe von der aktuellen Anzahl der Datensätze in der Tabelle abweichen kann. Bei einem deutlichen Unterschied können Sie die Größe der Adresstabelle über die Option "Komprimiere Adresstabelle" optimieren (siehe Seite [Kompakt](compact.md)). ***Note:** Differences between address table size and record number can also result from an incident during the cache flush.* +- **Address Table Size**: Size of the address table for each table. The address table is an internal table which stores one element per record created in the table. It actually links records to their physical address. For performance reasons, it is not resized when records are deleted, thus its size can be different from the current number of records in the table. If this difference is significant, a data compacting operation with the "Compact address table" option checked can be executed to optimize the address table size (see [Compact](compact.md) page). ***Note:** Differences between address table size and record number can also result from an incident during the cache flush.* -## Daten +## Data The **Data** page provides information about the available and used storage space in the data file. -> Diese Seite ist im Wartungsmodus nicht verfügbar +> This page cannot be accessed in maintenance mode -Diese Angaben werden grafisch dargestellt: +The information is provided in graph form: ![](assets/en/MSC/MSC_Data.png) -> Diese Seite berücksichtigt keine Daten, die außerhalb der Datendatei gespeichert sind (siehe "Daten extern speichern"). +> This page does not take into account any data that may be stored outside of the data file (see "External storage"). -Zu stark fragmentierte Dateien senken die Performance der Festplatte und somit der Datenbank. Bei zu niedriger Auslastungsrate zeigt 4D ein Icon als gelbes Warndreieck und meldet, dass Komprimieren notwendig ist. Das Icon erscheint in der Schaltfläche Information und in der Registerkarte der entsprechenden Datei:![](assets/en/MSC/MSC_infowarn.png) +Files that are too fragmented reduce disk, and thus, database performance. If the occupation rate is too low, 4D will indicate this by a warning icon (which is displayed on the Information button and on the tab of the corresponding file type) and specify that compacting is necessary:![](assets/en/MSC/MSC_infowarn.png) -Das Warndreieck erscheint auch in der Schaltfläche Komprimieren auf der Seite [Kompakt](compact.md): ![](assets/en/MSC/MSC_compactwarn.png) +A warning icon is also displayed on the button of the [Compact](compact.md) page: ![](assets/en/MSC/MSC_compactwarn.png) diff --git a/website/translated_docs/de/MSC/overview.md b/website/translated_docs/de/MSC/overview.md index cc9bed43ffa5f5..f4e2d24dd7a370 100644 --- a/website/translated_docs/de/MSC/overview.md +++ b/website/translated_docs/de/MSC/overview.md @@ -1,40 +1,40 @@ --- id: overview -title: Überblick -sidebar_label: Überblick +title: Overview +sidebar_label: Overview --- -Das Fenster Maintenance und Security Center (MSC) enthält alle Tools zum Prüfen, Analysieren, Warten, Sichern, Komprimieren und Verschlüsseln von Datendateien. Das MSC ist in allen 4D Programmen verfügbar, also 4D Developer, 4D Server oder 4D Desktop. +The Maintenance and Security Center (MSC) window contains all the tools needed for verification, analysis, maintenance, backup, compacting, and encrypting of data files. The MSC window is available in all 4D applications: 4D single user, 4D Server or 4D Desktop. **Note:** The MSC window is not available from a 4D remote connection. -Es gibt verschiedene Wege, das MSC-Fenster zu öffnen. The way it is accessed also determines the way the application project is opened: in “maintenance” mode or “standard” mode. In maintenance mode, the project is not opened by 4D, only its reference is provided to the MSC. In standard mode, the project is opened by 4D. +There are several ways to open the MSC window. The way it is accessed also determines the way the application project is opened: in “maintenance” mode or “standard” mode. In maintenance mode, the project is not opened by 4D, only its reference is provided to the MSC. In standard mode, the project is opened by 4D. -## Anzeige im Wartungsmodus +## Display in maintenance mode In maintenance mode, only the MSC window is displayed (the project is not opened by the 4D application). This means that projects that are too damaged to be opened in standard mode by 4D can nevertheless be accessed. Moreover, certain operations (compacting, repair, and so on) require the project to be opened in maintenance mode (see [Feature availability](#feature-availability)). -Es gibt zwei Stellen, das MSC im Wartungsmodus zu öffnen: +You can open the MSC in maintenance mode from two locations: - **From the standard project opening dialog box** The standard Open dialog includes the **Maintenance Security Center** option from the menu associated with the **Open** button: ![](assets/en/MSC/MSC_standardOpen.png) - **Help/Maintenance Security Center** menu or **MSC** button in the tool bar (project not open) ![](assets/en/MSC/mscicon.png) When you call this function, a standard Open file dialog appears so that you can select the *.4DProject* or *.4dz* file of the to be examined. The project will not be opened by 4D. -## Anzeige im Standardmodus +## Display in standard mode -In standard mode, a project is open. Hier sind nicht alle Wartungsfunktionen verfügbar. Es gibt mehrere Möglichkeiten, das MSC Fenster zu öffnen: +In standard mode, a project is open. In this mode, certain maintenance functions are not available. You have several possibilities for accessing the MSC window: - Use the **Help/Maintenance Security Center** menu or the **MSC** button in the 4D toolbar: ![](assets/en/MSC/mscicon.png) - Use the “msc” standard action that it is possible to associate with a menu command or a form object. - Use the `OPEN SECURITY CENTER` language command. -## Verfügbarkeit der Funktionen +## Feature availability -Je nach dem Öffnen-Modus in MSC sind bestimmte MSC Funktionen nicht verfügbar: +Certain MSC functions are not available depending on the MSC opening mode: - Backup function is only available when the project is open (the MSC must have been opened in standard mode). -- Datenkomprimierung, Zurückfahren, Wiederherstellen, Reparieren und Verschlüsselung sind nur bei nicht-geöffneten Datendateien verwendbar, d. h. MSC muss im Wartungsmodus geöffnet sein. If these functions are tried while the project is open in standard mode, a dialog warns you that it implies that the application be closed and restarted in maintenance mode. -- In verschlüsselten Datenbanken ist für den Zugriff auf verschlüsselte Daten oder die Datei .journal ein gültiger Schlüssel zum Entschlüsseln erforderlich (siehe unter [Seite Verschlüsseln](encrypt.md)). Andernfalls sind verschlüsselte Daten nicht sichtbar. +- Data compacting, rollback, restore, repair, and encryption functions can only be used with data files that are not open (the MSC must have been opened in maintenance mode). If these functions are tried while the project is open in standard mode, a dialog warns you that it implies that the application be closed and restarted in maintenance mode. +- In encrypted databases, access to encrypted data or to the .journal file requires that a valid encryption data key be provided (see [Encrypt page](encrypt.md)). Otherwise, encrypted data is not visible. diff --git a/website/translated_docs/de/MSC/repair.md b/website/translated_docs/de/MSC/repair.md index e15eca5ce0db0e..55bc4e7794c9b0 100644 --- a/website/translated_docs/de/MSC/repair.md +++ b/website/translated_docs/de/MSC/repair.md @@ -1,69 +1,69 @@ --- id: repair -title: Seite Reparieren -sidebar_label: Seite Reparieren +title: Repair Page +sidebar_label: Repair Page --- -Auf dieser Seite wählen Sie Optionen zum Reparieren der Datendatei bei Beschädigung. Generally, you will only use these functions at the request of 4D, when anomalies have been detected while opening the application or following a [verification](verify.md). +This page is used to repair the data file when it has been damaged. Generally, you will only use these functions at the request of 4D, when anomalies have been detected while opening the application or following a [verification](verify.md). -**Warning:** Each repair operation involves the duplication of the original file, which increases the size of the application folder. Sie sollten darauf achten (besonders auf macOS, wo 4D Anwendungen als Package erscheinen), dass die Größe der Anwendung nicht exzessiv ansteigt. In diesem Fall ist es hilfreich, die Kopien der Originaldatei im Package manuell zu entfernen, damit die Größe des Package im Rahmen bleibt. -> Reparieren ist nur im Wartungsmodus verfügbar. If you attempt to carry out this operation in standard mode, a warning dialog will inform you that the application will be closed and restarted in maintenance mode. -> Bei einer verschlüsselten Anwendung enthält das Reparieren auch die Schritte Entschlüsselung und Verschlüsselung. Dazu ist auch der aktuelle Verschlüsselungscode erforderlich. Ist noch kein gültiger Verschlüsselungscode angegeben, erscheint ein Dialogfenster, das die Passphrase oder den Verschlüsselungscode anfordert (siehe Seite Verschlüsseln). +**Warning:** Each repair operation involves the duplication of the original file, which increases the size of the application folder. It is important to take this into account (especially in macOS where 4D applications appear as packages) so that the size of the application does not increase excessively. Manually removing the copies of the original file inside the package can be useful to minimize the package size. +> Repairing is only available in maintenance mode. If you attempt to carry out this operation in standard mode, a warning dialog will inform you that the application will be closed and restarted in maintenance mode. +> When the database is encrypted, repairing data includes decryption and encryption steps and thus, requires the current data encryption key. If no valid encryption key has already been provided, a dialog requesting the passphrase or the encryption key is displayed (see Encrypt page). -## Datei Überblick +## File overview -### Datendatei reparieren -Pfadname der aktuellen Datendatei. The **[...]** button can be used to specify another data file. Klicken Sie auf diese Schaltfläche, erscheint ein Standard-Öffnen Dialog, um die gewünschte Datendatei zum Reparieren auszuwählen. Bei der [Standard Reparatur](#standard_repair) müssen Sie eine Datendatei wählen, die mit der geöffneten Projektdatei kompatibel ist. Bei [Reparieren nach Datensatzheader](#recover-by-record-headers) können Sie jede Datendatei wählen. Bestätigen Sie dieses Dialogfenster, erscheint der Pfadname der Datei zum Reparieren im Fenster. +### Data file to be repaired +Pathname of the current data file. The **[...]** button can be used to specify another data file. When you click on this button, a standard Open document dialog is displayed so that you can designate the data file to be repaired. If you perform a [standard repair](#standard_repair), you must select a data file that is compatible with the open project file. If you perform a [recover by record headers](#recover-by-record-headers) repair, you can select any data file. Once this dialog has been validated, the pathname of the file to be repaired is indicated in the window. -### Ordner Backup der Originaldateien -Standardmäßig wird die Originaldatei vor dem Reparieren dupliziert It will be placed in a subfolder named “Replaced files (repairing)” in the application folder. The second **[...]** button can be used to specify another location for the original files to be saved before repairing begins. Diese Möglichkeit ist insbesondere beim Reparieren umfangreicher Dateien auf verschiedenen Festplatten hilfreich. +### Original files backup folder +By default, the original data file will be duplicated before the repair operation. It will be placed in a subfolder named “Replaced files (repairing)” in the application folder. The second **[...]** button can be used to specify another location for the original files to be saved before repairing begins. This option can be used more particularly when repairing voluminous files while using different disks. -### Reparierte Dateien -4D erstellt eine neue leere Datendatei an der Stelle der Originaldatei. The original file is moved into the folder named "\Replaced Files (Repairing) date time" whose location is set in the "Original files backup folder" area (application folder by default). Die leere Datei wird mit den wiederhergestellten Daten gefüllt. +### Repaired files +4D creates a new blank data file at the location of the original file. The original file is moved into the folder named "\Replaced Files (Repairing) date time" whose location is set in the "Original files backup folder" area (application folder by default). The blank file is filled with the recovered data. -## Standard Reparatur +## Standard repair -Wählen Sie diese Option, wenn nur wenige Datensätze oder Indizes beschädigt sind (Adresstabellen sind intakt). Die Daten werden komprimiert und repariert. Diese Art der Reparatur lässt sich nur ausführen, wenn Datendatei und Strukturdatei zueinander passen. +Standard repair should be chosen when only a few records or indexes are damaged (address tables are intact). The data is compacted and repaired. This type of repair can only be performed when the data and structure file match. -Ist die Reparatur abgeschlossen, erscheint die Seite "Reparieren" des MSC. Eine Meldung gibt an, ob die Reparatur erfolgreich war. If so, you can open the application immediately. ![](assets/en/MSC/MSC_RepairOK.png) +When the repair procedure is finished, the "Repair" page of the MSC is displayed. A message indicates if the repair was successful. If so, you can open the application immediately. ![](assets/en/MSC/MSC_RepairOK.png) -## Wiederherstellen nach Datensatzheader -Verwenden Sie diese Reparatur auf niederer Ebene nur, wenn die Datendatei ernsthaft beschädigt ist und alle anderen Lösungen, wie Wiederherstellen über ein Backup, Standard Reparatur wirkungslos geblieben sind. +## Recover by record headers +Use this low-level repair option only when the data file is severely damaged and after all other solutions (restoring from a backup, standard repair) have proven to be ineffective. -4D Datensätze sind unterschiedlich groß. Deshalb muss die Stelle, wo sie auf der Festplatte in einer spezifischen Tabelle, genannt Adresstabelle, gespeichert sind, beibehalten werden, um sie wieder zu finden. Das Programm greift deshalb auf die Adresse des Datensatzes über einen Index und eine Adresstabelle zu. Sind nur Datensätze oder Indizes beschädigt, reicht die Standardreparatur in der Regel aus, um das Problem zu lösen. Ist dagegen die Adresstabelle selbst betroffen, ist ein komplexeres Wiederherstellen erforderlich, da diese Tabelle wiederhergestellt werden muss. Dazu verwendet das MSC die Marker, die im Kopfteil jedes Datensatzes angelegt sind. Sie sind vergleichbar mit einem Inhaltsverzeichnis des Datensatzes, inkl. aller wichtigen Informationen, über die sich die Adresstabelle rekonstruieren lässt. +4D records vary in size, so it is necessary to keep the location where they are stored on disk in a specific table, named address table, in order to find them again. The program therefore accesses the address of the record via an index and the address table. If only records or indexes are damaged, the standard repair option is usually sufficient to resolve the problem. However, when the address table itself is affected, it requires a more sophisticated recovery since it will be necessary to reconstitute it. To do this, the MSC uses the marker located in the header of each record. The markers are compared to a summary of the record, including the bulk of their information, and from which it is possible to reconstruct the address table. > If you have deselected the **Records definitively deleted** option in the properties of a table in the structure, performing a recovery by header markers may cause records that were previously deleted to reappear. > -> Wiederherstellen nach Kopfteil berücksichtigt keine Einschränkungen zur Datenintegrität. More specifically, after this operation you may get duplicated values with unique fields or NULL values with fields declared **Never Null**. +> Recovery by headers does not take integrity constraints into account. More specifically, after this operation you may get duplicated values with unique fields or NULL values with fields declared **Never Null**. -When you click on **Scan and repair...**, 4D performs a complete scan of the data file. Ist die Operation abgeschlossen, erscheint folgendes Fenster: +When you click on **Scan and repair...**, 4D performs a complete scan of the data file. When the scan is complete, the results appear in the following window: ![](assets/en/MSC/mscrepair2.png) -> Ließen sich alle Datensätze und alle Tabellen zuordnen, erscheint nur der Hauptbereich. +> If all the records and all the tables have been assigned, only the main area is displayed. -Der Bereich "Datensätze in Datendatei gefunden" besteht aus zwei Tabellen mit den Informationen aus dem Scan-Vorgang. +The "Records found in the data file" area includes two tables summarizing the information from the scan of the data file. -- Die erste Tabelle zeigt die Information aus dem Scannen der Datendatei. Jede Zeile enthält eine Gruppe der wiederherstellbaren Datensätze in der Datendatei: +- The first table lists the information from the data file scan. Each row shows a group of recoverable records in the data file: - The **Order** column indicates the recovery order for the group of records. - The **Count** column indicates the number of the records in the table. - - The **Destination table** column indicates the names of tables that were automatically assigned to the groups of identified records. Die Namen der dazugehörigen Tabellen erscheinen automatisch in grün. Nicht zugewiesene Gruppen, z.B. Tabellen, die keinen Datensätzen zugeordnet werden konnten, erscheinen in rot. - - The **Recover** column lets you indicate, for each group, whether you want to recover the records. Diese Option ist standardmäßig für jede Gruppe mit Datensätzen markiert, die einer Tabelle zugeordnet werden können. + - The **Destination table** column indicates the names of tables that were automatically assigned to the groups of identified records. The names of tables assigned automatically appear in green. Groups that were not assigned, i.e. tables that could not be associated with any records appear in red. + - The **Recover** column lets you indicate, for each group, whether you want to recover the records. By default, this option is checked for every group with records that can be associated with a table. -- Die zweite Tabelle zeigt die Tabellen der Projekt-Datei. +- The second table lists the tables of the project file. -### Manuell zuweisen -Ließen sich einige Datensatzgruppen aufgrund einer beschädigten Adresstabelle keinen Tabellen zuweisen, können Sie diese manuell zuweisen. Dazu wählen Sie zuerst im ersten Bereich eine nicht zugewiesene Gruppe aus. Zur leichteren Zuordnung zeigt der untere Bereich "Inhalt der Datensätze" eine Vorschau vom Inhalt der ersten Datensätze: +### Manual assigning +If several groups of records could not be assigned to tables due to a damaged address table, you can assign them manually. To do this, first select an unassigned group of records in the first table. The "Content of the records" area then displays a preview of the contents of the first records of the group to make it easier to assign them: ![](assets/en/MSC/mscrepair3.png) -Next select the table you want to assign to the group in the "Unassigned tables" table and click on the **Identify table** button. Sie können eine Tabelle auch per Drag-and-Drop zuweisen. Die Datensatzgruppe wird dann der Tabelle zugewiesen und in dieser Tabelle wiederhergestellt. Die per Hand zugewiesenen Tabellennamen erscheinen in schwarz. Use the **Ignore records** button to remove the association made manually between the table and the group of records. +Next select the table you want to assign to the group in the "Unassigned tables" table and click on the **Identify table** button. You can also assign a table using drag and drop. The group of records is then associated with the table and it will be recovered in this table. The names of tables that are assigned manually appear in black. Use the **Ignore records** button to remove the association made manually between the table and the group of records. -## Logbuch öffnen +## Open log file -After repair is completed, 4D generates a log file in the Logs folder of the project. Hier können Sie alle ausgeführten Operationen ansehen. It is created in XML format and named: *ApplicationName**_Repair_Log_yyyy-mm-dd hh-mm-ss.xml*" where: +After repair is completed, 4D generates a log file in the Logs folder of the project. This file allows you to view all the operations carried out. It is created in XML format and named: *ApplicationName**_Repair_Log_yyyy-mm-dd hh-mm-ss.xml*" where: - *ApplicationName* is the name of the project file without any extension, for example "Invoices", - *yyyy-mm-dd hh-mm-ss* is the timestamp of the file, based upon the local system time when the maintenance operation was started, for example "2019-02-11 15-20-45". diff --git a/website/translated_docs/de/MSC/restore.md b/website/translated_docs/de/MSC/restore.md index 9c760f468b80ee..8b4fe9867ff873 100644 --- a/website/translated_docs/de/MSC/restore.md +++ b/website/translated_docs/de/MSC/restore.md @@ -1,7 +1,7 @@ --- id: restore -title: Seite Wiederherstellen -sidebar_label: Seite Wiederherstellen +title: Restore Page +sidebar_label: Restore Page --- You can manually restore an archive of the current application using the **Restore** page. This page provides several options that can be used to control the restoration: @@ -10,54 +10,54 @@ You can manually restore an archive of the current application using the **Resto > 4D automatic recovery systems restore applications and include data log file when necessary. -The list found in the left part of the window displays any existing backups of the application. You can also click on the **Browse...** button found just under the area in order to open any other archive file from a different location. Es wird dann zur Liste der Archive hinzugefügt. +The list found in the left part of the window displays any existing backups of the application. You can also click on the **Browse...** button found just under the area in order to open any other archive file from a different location. It is then added to the list of archives. -Wählen Sie hier ein Backup aus, erscheinen im rechten Teil des Fensters Informationen über dieses Backup: +When you select a backup in this list, the right part of the window displays the information concerning this particular backup: -- **Path**: Complete pathname of the selected backup file. Mit der Schaltfläche Anzeigen öffnen Sie die Backup-Datei in einem Systemfenster. +- **Path**: Complete pathname of the selected backup file. Clicking the Show button opens the backup file in a system window. - **Date and Time**: Date and time of backup. -- **Content**: Contents of the backup file. Neben jedem Eintrag in der Liste gibt es ein Ankreuzfeld, über das Sie angeben, ob er wiederhergestellt werden soll. You can also use the **Check All** or **Uncheck All** buttons to set the list of items to be restored. +- **Content**: Contents of the backup file. Each item in the list has a check box next to it which can be used to indicate whether or not you want to restore it. You can also use the **Check All** or **Uncheck All** buttons to set the list of items to be restored. - **Destination folder of the restored files**: Folder where the restored files will be placed. By default, 4D restores the files in a folder named “Archivename” (no extension) that is placed next to the Project folder. To change this location, click on **[...]** and specify the folder where you want the restored files to be placed. The **Restore** button launches the manual restoration of the selected element(s). -## Mehrere Logbücher der Daten nacheinander integrieren +## Successive integration of several data log files -The **Integrate one or more log file(s) after restore** option allows you to integrate several data log files successively into an application. If, for example, you have 4 journal file archives (.4BL) corresponding to 4 backups, you can restore the first backup then integrate the journal (data log) archives one by one. Auf diese Weise können Sie z. B. eine Datei wiederherstellen, auch wenn die letzten Backup-Dateien fehlen. +The **Integrate one or more log file(s) after restore** option allows you to integrate several data log files successively into an application. If, for example, you have 4 journal file archives (.4BL) corresponding to 4 backups, you can restore the first backup then integrate the journal (data log) archives one by one. This means that you can, for example, recover a data file even when the last backup files are missing. -Ist diese Option markiert, zeigt 4D nach dem Wiederherstellen den Standard Öffnen-Dialog. Hier können Sie das entsprechende Logbuch auswählen. Der Öffnen-Dialog erscheint erneut nach jeder Integration, bis er abgebrochen wird. +When this option is checked, 4D displays the standard Open file dialog box after the restore, which can be used to select journal file to be integrated. The Open file dialog box is displayed again after each integration until it is cancelled. -## Eine verschlüsselte Anwendung wiederherstellen +## Restoring an encrypted database -Keep in mind that the data encryption key (passphrase) may have been changed through several versions of backup files (.4BK), .journal files (.4BL) and the current application. Es müssen immer passende Verschlüsselungscodes angegeben werden. +Keep in mind that the data encryption key (passphrase) may have been changed through several versions of backup files (.4BK), .journal files (.4BL) and the current application. Matching encryption keys must always be provided. -Beim Wiederherstellen eines Backup und Integration des aktuellen Logbuchs in eine verschlüsselte Anwendung gilt folgendes: +When restoring a backup and integrating the current log file in a encrypted database: -- Stellen Sie ein Backup mit einer alten Passphrase her, ist diese Passphrase beim nächsten Starten der Anwendung erforderlich. -- Nach dem Verschlüsseln läuft beim Öffnen einer verschlüsselten Datendatei ein Backup und es wird ein neues Logbuch erstellt. Deshalb ist es nicht möglich, eine Datei .4BK, die einen Verschlüsselungscode hat, wiederherzustellen und .4BL Dateien, die einen anderen Verschlüsselungscode haben, zu integrieren. +- If you restore a backup using an old passphrase, this passphrase will be required at the next database startup. +- After an encryption, when opening the encrypted data file, a backup is run and a new journal file is created. Thus, it is not possible to restore a .4BK file encrypted with one key and integrate .4BL files encrypted with another key. -Nachfolgende Übersicht zeigt die Vorgehensweise bei einer Operation Backup/Wiederherstellen mit mehreren Schlüsseln: +The following sequence illustrates the principles of a multi-key backup/restore operation: -| Operation | Generierte Dateien | Kommentar | -| --------------------------------- | ------------------------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| New data file | | | -| Daten hinzufügen (Datensatz # 1) | | | -| Backup Anwendung | 0000.4BL und 0001.4BK | | -| Daten hinzufügen (Datensatz # 2) | | | -| Backup Anwendung | 0001.4BL und 0002.4BK | | -| Daten hinzufügen (Datensatz # 3) | | | -| Datendatei mit key1 verschlüsseln | Datei 0003.4BK (verschlüsselt mit key1) | Verschlüsselung sichert Originaldateien (inkl. Journal) im Ordner "Replaced files (Encrypting) YYY-DD-MM HH-MM-SS". Beim Öffnen der verschlüsselten Datendatei wird ein neues Journal erstellt und ein Backup zum Aktivieren dieses Journals gemacht | -| Daten hinzufügen (Datensatz #4) | | | -| Backup Anwendung | Dateien 0003.4BL und 0004.4BK (verschlüsselt mit key1) | Wir können 0003.4BK wiederherstellen und 0003.4BL integrieren | -| Daten hinzufügen (Datensatz # 5) | | | -| Backup Anwendung | Dateien 0004.4BL und 0005.4BK (verschlüsselt mit key1) | Wir können 0003.4BK wiederherstellen und 0003.4BL + 0004.4BL integrieren. Wir können 0004.4BK wiederherstellen und 0004.4BL integrieren | -| Daten hinzufügen (Datensatz # 6) | | | -| Datendatei mit key2 verschlüsseln | Datei 0006.4BK (verschlüsselt mit key2) | Verschlüsselung sichert Originaldateien (inkl. Journal) im Ordner "Replaced files (Encrypting) YYY-DD-MM HH-MM-SS". Beim Öffnen der verschlüsselten Datendatei wird ein neues Journal erstellt und ein Backup zum Aktivieren dieses Journals gemacht | -| Daten hinzufügen (Datensatz # 7) | | | -| Backup Anwendung | Dateien 0006.4BL und 0007.4BK (verschlüsselt mit key2) | Wir können 0006.4BK wiederherstellen und 0006.4BL integrieren | -| Daten hinzufügen (Datensatz # 8) | | | -| Backup Anwendung | Dateien 0007.4BL und 0008.4BK (verschlüsselt mit key2) | Wir können 0006.4BK wiederherstellen und 0006.4BL + 0007.4BL integrieren. Wir können 0007.4BK wiederherstellen und 0007.4BL integrieren | -> Beim Wiederherstellen eines Backup .4BK und Integrieren eines oder mehrerer Logbücher .4BL müssen diese Dateien denselben Verschlüsselungscode haben. Wird während dem Integrieren der .4BL Datei im 4D Schlüsselbund kein gültiger Verschlüsselungscode gefunden, wird ein Fehler generiert. +| Operation | Generated files | Comment | +| --------------------------- | ------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| New data file | | | +| Add data (record # 1) | | | +| Backup database | 0000.4BL and 0001.4BK | | +| Add data (record # 2) | | | +| Backup database | 0001.4BL and 0002.4BK | | +| Add data (record # 3) | | | +| Encrypt data file with key1 | 0003.4BK file (encrypted with key1) | Encryption saves original files (including journal) in folder "Replaced files (Encrypting) YYY-DD-MM HH-MM-SS". When opening the encrypted data file, a new journal is created and a backup is made to activate this journal | +| Add data (record #4) | | | +| Backup database | 0003.4BL and 0004.4BK files (encrypted with key1) | We can restore 0003.4BK and integrate 0003.4BL | +| Add data (record # 5) | | | +| Backup database | 0004.4BL and 0005.4BK files (encrypted with key1) | We can restore 0003.4BK and integrate 0003.4BL + 0004.4BL. We can restore 0004.4BK and integrate 0004.4BL | +| Add data (record # 6) | | | +| Encrypt data file with key2 | 0006.4BK file (encrypted with key2) | Encryption saves original files (including journal) in folder "Replaced files (Encrypting) YYY-DD-MM HH-MM-SS". When opening the encrypted data file, a new journal is created and a backup is made to activate this journal | +| Add data (record # 7) | | | +| Backup database | 0006.4BL and 0007.4BK files (encrypted with key2) | We can restore 0006.4BK and integrate 0006.4BL | +| Add data (record # 8) | | | +| Backup database | 0007.4BL and 0008.4BK files (encrypted with key2) | We can restore 0006.4BK and integrate 0006.4BL + 0007.4BL. We can restore 0007.4BK and integrate 0007.4BL | +> When restoring a backup and integrating one or several .4BL files, the restored .4BK and .4BL files must have the same encryption key. During the integration process, if no valid encryption key is found in the 4D keychain when the .4BL file is integrated, an error is generated. > -> Haben Sie aufeinanderfolgende Datenschlüssel auf einem externen Gerät gespeichert und wird es angeschlossen, wird beim Wiederherstellen des Backup und Integrieren der Logbücher automatisch der jeweils passende Schlüssel gefunden. +> If you have stored successive data keys on the same external device, restoring a backup and integrating log files will automatically find the matching key if the device is connected. diff --git a/website/translated_docs/de/MSC/rollback.md b/website/translated_docs/de/MSC/rollback.md index 8176192e658a15..ded1eb72f1edfa 100644 --- a/website/translated_docs/de/MSC/rollback.md +++ b/website/translated_docs/de/MSC/rollback.md @@ -1,10 +1,10 @@ --- id: rollback -title: Seite Zurückfahren -sidebar_label: Seite Zurückfahren +title: Rollback Page +sidebar_label: Rollback Page --- -Auf dieser Seite können Sie auf die Funktion Rollback für die im Logbuch ausgeführten Operationen zugreifen. Sie arbeitet ähnlich wie die Operation Rückgängig auf mehreren Ebenen. Das ist besonders hilfreich, wenn ein Datensatz versehentlich in der Datenbank gelöscht wurde. +You use the Rollback page to access the rollback function among the operations carried out on the data file. It resembles an undo function applied over several levels. It is particularly useful when a record has been deleted by mistake in a database. This function is only available when the application functions with a data log file. @@ -12,14 +12,14 @@ This function is only available when the application functions with a data log f > If the database is encrypted and no valid data key corresponding to the open log file has been provided, encrypted values are not displayed in the **Values** column and a dialog requesting the passphrase or the data key is displayed if you click the **Rollback** button. -Die Liste ist genauso aufgebaut und funktioniert wie auf der Seite [Aktivitätsanalyse](analysis.md). +The contents and functioning of the list of operations are the same as for the [Activity analysis](analysis.md) window. -Um ein Rollback in den Operationen auszuführen, wählen Sie die Zeile, nach der alle Operationen annulliert werden sollen. Die Operation der gewählten Zeile bleibt als letzte erhalten. Wollen Sie z. B. einen Löschvorgang aufheben, wählen Sie die direkt davor liegende Operation. Diese bleibt dann erhalten, alle nachfolgenden Operationen werden annulliert. +To perform a rollback among the operations, select the row after which all operations must be cancelled. The operation of the selected row will be the last kept. If, for example, you wish to cancel a deletion, select the operation located just before it. The deletion operation, as well as all subsequent operations, will be cancelled. ![](assets/en/MSC/MSC_rollback2.png) -Next click on the **Rollback** button. Auf dem Bildschirm erscheint ein Dialogfenster zum Bestätigen. If you click **OK**, the data is then restored to the exact state it was in at the moment of the selected action. +Next click on the **Rollback** button. 4D asks you to confirm the operation. If you click **OK**, the data is then restored to the exact state it was in at the moment of the selected action. -Über das PopUp-Menü am unteren Rand wählen Sie das passende Logbuch zum Ausführen der Rollback-Funktion in einer wiederhergestellten Datenbank. In diesem Fall müssen Sie das passende Logbuch der Datei im Archiv angeben. +You use the menu found at the bottom of the window to select a data log file to be used when you apply the rollback function to a database restored from an archive file. In this case, you must specify the data log file corresponding to the archive. -Here is how the rollback function works: when the user clicks the **Rollback** button, 4D shuts the current database and restores the last backup of the database data. Die wiederhergestellte Datenbank wird dann geöffnet. 4D integriert die Operationen des Logbuchs bis zur gewählten Operation. Wurde die Datenbank noch nicht gesichert, startet 4D mit einer leeren Datendatei. \ No newline at end of file +Here is how the rollback function works: when the user clicks the **Rollback** button, 4D shuts the current database and restores the last backup of the database data. The restored database is then opened and 4D integrates the operations of the data log file up through to the selected operation. If the database has not yet been saved, 4D starts with a blank data file. \ No newline at end of file diff --git a/website/translated_docs/de/MSC/verify.md b/website/translated_docs/de/MSC/verify.md index 908a43ea4ae32c..5cd0434a37019e 100644 --- a/website/translated_docs/de/MSC/verify.md +++ b/website/translated_docs/de/MSC/verify.md @@ -1,27 +1,27 @@ --- id: verify -title: Seite Prüfen -sidebar_label: Seite Prüfen +title: Verify Page +sidebar_label: Verify Page --- -Auf dieser Seite können Sie die Datenintegrität überprüfen. Die Überprüfung lässt sich in Datensätzen und/oder Indizes durchführen. Diese Funktionalität prüft nur die Datenintegrität. Bei Fehlern oder notwendigen Reparaturen erhalten Sie eine Meldung, die [Seite Reparieren](repair.md) zu verwenden. +You use this page to verify data integrity. The verification can be carried out on records and/or indexes. This page only checks the data integrity. If errors are found and repairs are needed, you will be advised to use the [Repair page](repair.md). -## Aktionen +## Actions -Die Seite enthält die Schaltflächen für Aktionen, über die Sie direkt auf die Funktionen zum Überprüfen zugreifen können. -> Ist die Datenbank verschlüsselt, wird auch die Gültigkeit der verschlüsselten Datenkonsistenz überprüft. Ist noch kein gültiger Datenschlüssel angegeben, erscheint ein Dialogfenster, dass die Passphrase oder den Datenschlüssel anfordert. +The page contains action buttons that provide direct access to the verification functions. +> When the database is encrypted, verification includes validation of encrypted data consistency. If no valid data key has already been provided, a dialog requesting the passphrase or the data key is displayed. - **Verify the records and the indexes:** Starts the total data verification procedure. - **Verify the records only**: Starts the verification procedure for records only (indexes are not verified). - **Verify the indexes only**: Starts the verification procedure for indexes only (records are not verified). -> Sie können Datensätze und Indizes auch im Detail Tabelle für Tabelle überprüfen. Weitere Informationen dazu finden Sie im unteren Abschnitt. +> Verification of records and indexes can also be carried out in detail mode, table by table (see the Details section below). -## Logbuch öffnen +## Open log file -Regardless of the verification requested, 4D generates a log file in the `Logs` folder of the application. Hier erscheinen alle durchgeführten Überprüfungen und evtl. gefundene Fehler. Gibt es keine Fehler, wird das durch [OK] angezeigt. It is created in XML format and is named: *ApplicationName*_Verify_Log_*yyyy-mm-dd hh-mm-ss*.xml where: +Regardless of the verification requested, 4D generates a log file in the `Logs` folder of the application. This file lists all the verifications carried out and indicates any errors encountered, when applicable ([OK] is displayed when the verification is correct). It is created in XML format and is named: *ApplicationName*_Verify_Log_*yyyy-mm-dd hh-mm-ss*.xml where: - *ApplicationName* is the name of the project file without any extension, for example "Invoices", - *yyyy-mm-dd hh-mm-ss* is the timestamp of the file, based upon the local system time when the maintenance operation was started, for example "2019-02-11 15-20-45". @@ -36,21 +36,21 @@ The **Table list** button displays a detailed page that can be used to view and ![](assets/en/MSC/MSC_Verify.png) -Sie können bestimmte Einträge zum Überprüfen angeben, um so Zeit bei der Überprüfung zu sparen. +Specifying the items to be verified lets you save time during the verification procedure. -Die Hauptliste zeigt alle Tabellen der Datenbank. Sie können für jede Tabelle die Überprüfung auf Datensätze bzw. Indizes eingrenzen. Klicken Sie auf den Pfeil vor der Tabelle, um die Tabelle oder indizierte Datenfelder aufzuklappen und markieren Sie die Ankreuzfelder je nach gewünschter Aktion. Standardmäßig ist alles ausgewählt. You can also use the **Select all**, **Deselect all**, **All records** and **All indexes** shortcut buttons. +The main list displays all the tables of the database. For each table, you can limit the verification to the records and/or indexes. Expand the contents of a table or the indexed fields and select/deselect the checkboxes as desired. By default, everything is selected. You can also use the **Select all**, **Deselect all**, **All records** and **All indexes** shortcut buttons. -Die Spalte “Aktion” gibt für jede Zeile die auszuführenden Operationen an. Bei aufgeklappter Tabelle zeigen die Zeilen “Datensätze” und “Indizierte Felder” die Anzahl der betroffenen Einträge an. +For each row of the table, the "Action" column indicates the operations to be carried out. When the table is expanded, the "Records" and "Indexed fields" rows indicate the number of items concerned. -Die Spalte „Status“ zeigt den Überprüfungsstatus für jeden Eintrag mit dem entsprechenden Symbol an: +The "Status" column displays the verification status of each item using symbols: -| ![](assets/en/MSC/MSC_OK.png) | Überprüfung ausgeführt, keine Probleme | -| ------------------------------ | ----------------------------------------- | -| ![](assets/en/MSC/MSC_KO2.png) | Überprüfung ausgeführt, Probleme gefunden | -| ![](assets/en/MSC/MSC_KO3.png) | Überprüfung zum Teil ausgeführt | -| ![](assets/en/MSC/MSC_KO.png) | Überprüfung nicht ausgeführt | +| ![](assets/en/MSC/MSC_OK.png) | Verification carried out with no problem | +| ------------------------------ | ---------------------------------------------- | +| ![](assets/en/MSC/MSC_KO2.png) | Verification carried out, problems encountered | +| ![](assets/en/MSC/MSC_KO3.png) | Verification partially carried out | +| ![](assets/en/MSC/MSC_KO.png) | Verification not carried out | Click on **Verify** to begin the verification or on **Standard** to go back to the standard page. The **Open log file** button can be used to display the log file in the default browser of the machine (see [Open log file](#open-log-file) above). -> Die Standardseite berücksichtigt keine Änderungen, die auf der Detailseite gemacht wurden: Klicken Sie auf der Standardseite auf eine Schaltfläche zum Überprüfen, werden alle Einträge überprüft. Die auf der Detailseite definierten Einstellungen bleiben jedoch von einer Sitzung zur nächsten erhalten. +> The standard page will not take any modifications made on the detailed page into account: when you click on a verification button on the standard page, all the items are verified. On the other hand, the settings made on the detailed page are kept from one session to another. diff --git a/website/translated_docs/de/Menus/overview.md b/website/translated_docs/de/Menus/overview.md index 71a5084a7944dc..2110e37862bed6 100644 --- a/website/translated_docs/de/Menus/overview.md +++ b/website/translated_docs/de/Menus/overview.md @@ -1,6 +1,6 @@ --- id: overview -title: Überblick +title: Overview --- You can create menu bars and menus for your 4D applications. Because pull-down menus are a standard feature of any desktop application, their addition will make your applications easier to use and will make them feel familiar to users. diff --git a/website/translated_docs/de/Menus/properties.md b/website/translated_docs/de/Menus/properties.md index 902a48b6ebe133..f80aec70d202f0 100644 --- a/website/translated_docs/de/Menus/properties.md +++ b/website/translated_docs/de/Menus/properties.md @@ -23,7 +23,7 @@ You can set some properties of the menu commands by using control characters (me Control characters do not appear in the menu command labels. You should therefore avoid using them so as not to have any undesirable effects. The control characters are the following: -| Character | Beschreibung | Usage | +| Character | Description | Usage | | ----------- | --------------------------- | ------------------------------------------------------------- | | ( | open parenthese | Disable item | | In ORDA, the Automatic or Manual property of relations has no effect. -To assign a value directly to the "employer" attribute, you must pass an existing entity from the "Company" dataclass. Beispiel: +To assign a value directly to the "employer" attribute, you must pass an existing entity from the "Company" dataclass. For example: ```4d $emp:=ds.Employee.new() // create an employee @@ -147,7 +147,7 @@ To assign a value directly to the "employer" attribute, you must pass an existin $emp.save() ``` -4D provides an additional facility for entering a relation attribute for an N entity related to a "1" entity: you pass the primary key of the "1" entity directly when assigning a value to the relation attribute. For this to work, you pass data of type Number or Text (the primary key value) to the relation attribute. 4D then automatically takes care of searching for the corresponding entity in the dataclass. Beispiel: +4D provides an additional facility for entering a relation attribute for an N entity related to a "1" entity: you pass the primary key of the "1" entity directly when assigning a value to the relation attribute. For this to work, you pass data of type Number or Text (the primary key value) to the relation attribute. 4D then automatically takes care of searching for the corresponding entity in the dataclass. For example: ```4d $emp:=ds.Employee.new() @@ -184,71 +184,109 @@ You can create an object of type [entity selection](dsMapping.md#entity-selectio You can simultaneously create and use as many different entity selections as you want for a dataclass. Keep in mind that an entity selection only contains references to entities. Different entity selections can contain references to the same entities. -### Shareable or non-shareable entity selections +### Shareable or alterable entity selections -An entity selection can be **shareable** (readable by multiple processes, but not modifiable after creation) or **non-shareable** (only usable by the current process, but modifiable afterwards): +An entity selection can be **shareable** (readable by multiple processes, but not alterable after creation) or **alterable** (supports the [`.add()`](API/entitySelectionClass.md#add) function, but only usable by the current process). -- a **shareable** entity selection has the following characteristics: - - it can be stored in a shared object or shared collection, and can be shared between several processes or workers; - - it can be stored in several shared objects or collections, or in a shared object or collection which already belongs to a group (it does not have a *locking identifier*); - - it does not allow the addition of new entities. Trying to add an entity to a shareable entity selection will trigger an error (1637 - This entity selection cannot be altered). To add an entity to a shareable entity selection, you must first transform it into a non-shareable entity selection using the [`.copy()`](API/entitySelectionClass.md#copy) function, before calling [`.add()`](API/entitySelectionClass.md#add). +#### Properties -- a **non-shareable** entity selection has the following characteristics: - + it cannot be shared between processes, nor be stored in a shared object or collection. Trying to store a non-shareable entity selection in a shared object or collection will trigger an error (-10721 - Not supported value type in a shared object or shared collection); - + it accepts the addition of new entities. +A **shareable** entity selection has the following characteristics: -In most cases, new entity selections are **shareable**, including: +- it can be stored in a shared object or shared collection, and can be passed as parameter between several processes or workers; +- it can be stored in several shared objects or collections, or in a shared object or collection which already belongs to a group (it does not have a *locking identifier*); +- it does not allow the addition of new entities. Trying to add an entity to a shareable entity selection will trigger an error (1637 - This entity selection cannot be altered). To add an entity to a shareable entity selection, you must first transform it into a non-shareable entity selection using the [`.copy()`](API/entitySelectionClass.md#copy) function, before calling [`.add()`](API/entitySelectionClass.md#add). -- entity selections resulting from various ORDA class functions ([`.query()`](API/entitySelectionClass.md#query), [`.query()`](API/dataclassClass.md#query), etc.), -- entity selections based upon relations (e.g. `company.employee`), -- entity selections resulting from projections of values (e.g. `ds.Employee.all().employer`), -- entity selections explicitely copied as shareable with [`.copy()`](API/entitySelectionClass.md#copy) or `OB Copy`. +> Most entity selection functions (such as [`.slice()`](API/entitySelectionClass.md#slice), [`.and()`](API/entitySelectionClass.md#and)...) support shareable entity selections since they do not need to alter the original entity selection (they return a new one). -New entity selections are **non-shareable** in the following cases: +An **alterable** entity selection has the following characteristics: -- blank entity selections created using the [`.newSelection()`](API/dataclassClass.md#newselection) function or `Create entity selection` command, -- entity selections explicitely copied as non-shareable with [`.copy()`](API/entitySelectionClass.md#copy) or `OB Copy`. +- it cannot be shared between processes, nor be stored in a shared object or collection. Trying to store a non-shareable entity selection in a shared object or collection will trigger an error (-10721 - Not supported value type in a shared object or shared collection); +- it accepts the addition of new entities, i.e. it is supports the [`.add()`](API/entitySelectionClass.md#add) function. -#### Beispiel + +#### How are they defined? + +The **shareable** or **alterable** nature of an entity selection is defined when the entity selection is created (it cannot be modified afterwards). You can know the nature of an entity selection using the [.isAlterable()](API/entitySelectionClass.md#isalterable) function or the `OB Is shared` command. + + +A new entity selection is **shareable** in the following cases: + +- the new entity selection results from an ORDA class function applied to a dataClass: [dataClass.all()](API/dataclassClass.md#all), [dataClass.fromCollection()](API/dataclassClass.md#fromcollection), [dataClass.query()](API/dataclassClass.md#query), +- the new entity selection is based upon a relation [entity.*attributeName*](API/entityClass.md#attributename) (e.g. "company.employees") when *attributeName* is a one-to-many related attribute but the entity does not belong to an entity selection. +- the new entity selection is explicitely copied as shareable with [entitySelection.copy()](API/entitySelectionClass.md#copy) or `OB Copy` (i.e. with the `ck shared` option). + +Example: +```4d +$myComp:=ds.Company.get(2) //$myComp does not belong to an entity selection +$employees:=$myComp.employees //$employees is shareable +``` + +A new entity selection is **alterable** in the following cases: + +- the new entity selection created blank using the [dataClass.newSelection()](API/dataclassClass.md#newselection) function or `Create entity selection` command, +- the new entity selection is explicitely copied as alterable with [entitySelection.copy()](API/entitySelectionClass.md#copy) or `OB Copy` (i.e. without the `ck shared` option). + +Example: +```4d +$toModify:=ds.Company.all().copy() //$toModify is alterable +``` + + +A new entity selection **inherits** from the original entity selection nature in the following cases: + +- the new entity selection results from one of the various ORDA class functions applied to an existing entity selection ([.query()](API/entitySelectionClass.md#query), [.slice()](API/entitySelectionClass.md#slice), etc.) . +- the new entity selection is based upon a relation: + - [entity.*attributeName*](API/entityClass.md#attributename) (e.g. "company.employees") when *attributeName* is a one-to-many related attribute and the entity belongs to an entity selection (same nature as [.getSelection()](API/entityClass.md#getselection) entity selection), + - [entitySelection.*attributeName*](API/entitySelectionClass.md#attributename) (e.g. "employees.employer") when *attributeName* is a related attribute (same nature as the entity selection), + - [.extract()](API/entitySelectionClass.md#extract) when the resulting collection contains entity selections (same nature as the entity selection). + +Examples: + +```4d +$highSal:=ds.Employee.query("salary >= :1"; 1000000) + //$highSal is shareable because of the query on dataClass +$comp:=$highSal.employer //$comp is shareable because $highSal is shareable + +$lowSal:=ds.Employee.query("salary <= :1"; 10000).copy() + //$lowSal is alterable because of the copy() +$comp2:=$lowSal.employer //$comp2 is alterable because $lowSal is alterable +``` + + +#### Sharing an entity selection between processes (example) You work with two entity selections that you want to pass to a worker process so that it can send mails to appropriate persons: ```4d - If(Storage.info=Null) - Use(Storage) - Storage.info:=New shared object() - End use - End if - Use(Storage.info) - //Put entity selections in a shared object - Storage.info.paid:=ds.Invoices.query("status=:1";"Paid") - Storage.info.unpaid:=ds.Invoices.query("status=:1";"Unpaid") - End use +var $paid; $unpaid : cs.InvoicesSelection +//We get entity selections for paid and unpaid invoices +$paid:=ds.Invoices.query("status=:1"; "Paid") +$unpaid:=ds.Invoices.query("status=:1"; "Unpaid") + +//We pass entity selection references as parameters to the worker +CALL WORKER("mailing"; "sendMails"; $paid; $unpaid) + +``` - CALL WORKER("mailing";"sendMails";Storage.info) -The sendMails method: +The `sendMails` method: - var $info: ;$1Object - var $paid;$unpaid : cs.InvoicesSelection +```4d + + #DECLARE ($paid : cs.InvoicesSelection; $unpaid : cs.InvoicesSelection) var $invoice : cs.InvoicesEntity - var $server;$transporter;$email;$status : Object + var $server; $transporter; $email; $status : Object //Prepare emails - $server:=New object + $server:=New object() $server.host:="exchange.company.com" $server.user:="myName@company.com" $server.password:="my!!password" $transporter:=SMTP New transporter($server) - $email:=New object + $email:=New object() $email.from:="myName@company.com" - //Get entity selections - $info:=$1 - $paid:=$info.paid - $unpaid:=$info.unpaid - //Loops on entity selections For each($invoice;$paid) $email.to:=$invoice.customer.address // email address of the customer @@ -266,7 +304,7 @@ The sendMails method: ### Entity selections and Storage attributes -All storage attributes (text, number, boolean, date) are available as properties of entity selections as well as entities. When used in conjunction with an entity selection, a scalar attribute returns a collection of scalar values. Beispiel: +All storage attributes (text, number, boolean, date) are available as properties of entity selections as well as entities. When used in conjunction with an entity selection, a scalar attribute returns a collection of scalar values. For example: ```4d $locals:=ds.Person.query("city = :1";"San Jose") //entity selection of people @@ -385,7 +423,8 @@ The following methods automatically associate the optimization context of the so * `entitySelection.drop()` -**Beispiel** + +**Example** Given the following code: diff --git a/website/translated_docs/de/ORDA/glossary.md b/website/translated_docs/de/ORDA/glossary.md index a52d5d8d8eec45..7bcc5626295f59 100644 --- a/website/translated_docs/de/ORDA/glossary.md +++ b/website/translated_docs/de/ORDA/glossary.md @@ -87,7 +87,7 @@ An entity can be seen as an instance of the dataclass, like a record of the tabl For more information, see Entities. -## Entity-Selection +## Entity selection An entity selection is an object. When querying the datastore, an entity selection is returned. An entity selection is a set of references to entities related to the same dataclass. @@ -125,16 +125,16 @@ $myClass.query("name = smith") ## Mixed data type -In this documentation, "Mixed" data type is used to designate the various type of values that can be stored within dataclass attributes. Das gilt für: +In this documentation, "Mixed" data type is used to designate the various type of values that can be stored within dataclass attributes. It includes: * number -* Text -* Null +* text +* null * boolean * date * object * collection -* Bild (\*) +* picture(\*) *(\*) picture type is not supported by statistical methods such as* `entitySelection.max( )`. diff --git a/website/translated_docs/de/ORDA/ordaClasses.md b/website/translated_docs/de/ORDA/ordaClasses.md index 9bb327b05114b0..63e321b9b974e4 100644 --- a/website/translated_docs/de/ORDA/ordaClasses.md +++ b/website/translated_docs/de/ORDA/ordaClasses.md @@ -80,7 +80,7 @@ A 4D database exposes its own DataStore class in the `cs` class store. You can create functions in the DataStore class that will be available through the `ds` object. -#### Beispiel +#### Example ```4d // cs.DataStore class @@ -110,7 +110,7 @@ Each table exposed with ORDA offers a DataClass class in the `cs` class store. -#### Beispiel +#### Example ```4D // cs.Company class @@ -184,7 +184,7 @@ Each table exposed with ORDA offers an EntitySelection class in the `cs` class s - **Example name**: cs.EmployeeSelection -#### Beispiel +#### Example ```4d // cs.EmployeeSelection class @@ -214,7 +214,7 @@ Each table exposed with ORDA offers an Entity class in the `cs` class store. - **Class name**: *DataClassName*Entity (where *DataClassName* is the table name) - **Example name**: cs.CityEntity -#### Beispiel +#### Example ```4d // cs.CityEntity class @@ -248,7 +248,7 @@ End if When creating or editing data model classes, you must pay attention to the following rules: -- Since they are used to define automatic DataClass class names in the **cs** [class store](Concepts/classes.md#class-stores), 4D tables must be named in order to avoid any conflict in the **cs** namespace. Das bedeutet im einzelnen: +- Since they are used to define automatic DataClass class names in the **cs** [class store](Concepts/classes.md#class-stores), 4D tables must be named in order to avoid any conflict in the **cs** namespace. In particular: - Do not give the same name to a 4D table and to a [user class name](Concepts/classes.md#class-names). If such a case occurs, the constructor of the user class becomes unusable (a warning is returned by the compiler). - Do not use a reserved name for a 4D table (e.g., "DataClass"). @@ -282,7 +282,7 @@ exposed Function > The `exposed` keyword can only be used with Data model class functions. If used with a [regular user class](Concepts/classes.md) function, it is ignored and an error is returned by the compiler. -### Beispiel +### Example You want an exposed function to use a private function in a dataclass class: @@ -349,7 +349,7 @@ local Function getYoungest - **with** the `local` keyword, 4 requests are necessary: one to get the Schools entity students, one for the `query()`, one for the `orderBy()`, and one for the `slice()`. In this example, using the `local` keyword is inappropriate. -### Beispiele +### Examples #### Calculating age @@ -409,7 +409,7 @@ End if ## Support in 4D projects -### Datei Klasse +### Class files An ORDA data model user class is defined by adding, at the [same location as regular class files](Concepts/classes.md#class-files) (*i.e.* in the `/Sources/Classes` folder of the project folder), a .4dm file with the name of the class. For example, an entity class for the `Utilities` dataclass will be defined through a `UtilitiesEntity.4dm` file. diff --git a/website/translated_docs/de/Project/architecture.md b/website/translated_docs/de/Project/architecture.md index 14ccb5dcf6a7d5..542a7aa746eee3 100644 --- a/website/translated_docs/de/Project/architecture.md +++ b/website/translated_docs/de/Project/architecture.md @@ -3,11 +3,11 @@ id: architecture title: Architecture of a project --- -A 4D project is made of several folders and files, stored within a single parent application folder (package folder). Beispiel: +A 4D project is made of several folders and files, stored within a single parent application folder (package folder). For example: - MyProject - - Komponenten - - Daten + - Components + - Data - Logs - Settings - Documentation @@ -32,12 +32,12 @@ The Project folder typically contains the following hierarchy: - Sources + Classes + DatabaseMethods - + Methoden - + Formulare + + Methods + + Forms + TableForms - + Trigger + + Triggers - DerivedData -- Trash (falls vorhanden) +- Trash (if any) ### *applicationName*.4DProject file @@ -52,7 +52,7 @@ Project development file, used to designate and launch the project. This file ca ### Sources folder -| Inhalt | Beschreibung | Format | +| Contents | Description | Format | | ----------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------ | | catalog.4DCatalog | Table and field definitions | XML | | folders.json | Explorer folder definitions | JSON | @@ -68,50 +68,50 @@ Project development file, used to designate and launch the project. This file ca #### DatabaseMethods folder -| Inhalt | Beschreibung | Format | +| Contents | Description | Format | | ------------------------ | --------------------------------------------------------------------- | ------ | -| *databaseMethodName*.4dm | Database methods defined in the project. One file per database method | Text | +| *databaseMethodName*.4dm | Database methods defined in the project. One file per database method | text | #### Methods folder -| Inhalt | Beschreibung | Format | +| Contents | Description | Format | | ---------------- | ----------------------------------------------------------- | ------ | -| *methodName*.4dm | Project methods defined in the project. One file per method | Text | +| *methodName*.4dm | Project methods defined in the project. One file per method | text | #### Classes folder -| Inhalt | Beschreibung | Format | +| Contents | Description | Format | | --------------- | ---------------------------------------------------------------------------------------------------------------------------------- | ------ | -| *className*.4dm | User class definition method, allowing to instantiate specific objects. One file per class, the name of the file is the class name | Text | +| *className*.4dm | User class definition method, allowing to instantiate specific objects. One file per class, the name of the file is the class name | text | #### Forms folder -| Inhalt | Beschreibung | Format | +| Contents | Description | Format | | ----------------------------------------- | ------------------------------------------ | ------- | | *formName*/form.4DForm | Project form description | json | -| *formName*/method.4dm | Project form method | Text | +| *formName*/method.4dm | Project form method | text | | *formName*/Images/*pictureName* | Project form static picture | picture | -| *formName*/ObjectMethods/*objectName*.4dm | Object methods. One file per object method | Text | +| *formName*/ObjectMethods/*objectName*.4dm | Object methods. One file per object method | text | #### TableForms folder -| Inhalt | Beschreibung | Format | +| Contents | Description | Format | | ---------------------------------------------------- | ------------------------------------------------------ | ------- | | *n*/Input/*formName*/form.4DForm | Input table form description (n is the table number) | json | | *n*/Input/*formName*/Images/*pictureName* | Input table form static pictures | picture | -| *n*/Input/*formName*/method.4dm | Input table form method | Text | -| *n*/Input/*formName*/ObjectMethods/*objectName*.4dm | Input form object methods. One file per object method | Text | +| *n*/Input/*formName*/method.4dm | Input table form method | text | +| *n*/Input/*formName*/ObjectMethods/*objectName*.4dm | Input form object methods. One file per object method | text | | *n*/Output/*formName*/form.4DForm | Output table form description (n is the table number) | json | | *n*/Output/*formName*/Images/*pictureName* | Output table form static pictures | picture | -| *n*/Output/*formName*/method.4dm | Output table form method | Text | -| *n*/Output/*formName*/ObjectMethods/*objectName*.4dm | Output form object methods. One file per object method | Text | +| *n*/Output/*formName*/method.4dm | Output table form method | text | +| *n*/Output/*formName*/ObjectMethods/*objectName*.4dm | Output form object methods. One file per object method | text | #### Triggers folder -| Inhalt | Beschreibung | Format | +| Contents | Description | Format | | ------------- | ------------------------------------------------------------------------------------------ | ------ | -| table_*n*.4dm | Trigger methods defined in the project. One trigger file per table (n is the table number) | Text | +| table_*n*.4dm | Trigger methods defined in the project. One trigger file per table (n is the table number) | text | **Note:** The .4dm file extension is a text-based file format, containing the code of a 4D method. It is compliant with source control tools. @@ -120,8 +120,8 @@ Project development file, used to designate and launch the project. This file ca The Trash folder contains methods and forms that were deleted from the project (if any). It can contain the following folders: -- Methoden -- Formulare +- Methods +- Forms - TableForms Within these folders, deleted element names are in parentheses, e.g. "(myMethod).4dm". The folder organization is identical to the [Sources](#sources) folder. @@ -136,7 +136,7 @@ The DerivedData folder contains cached data used internally by 4D to optimize pr The Resources folder contains any custom project resource files and folders. In this folder, you can place all the files needed for the translation or customization of the application interface (picture files, text files, XLIFF files, etc.). 4D uses automatic mechanisms to work with the contents of this folder, in particular for the handling of XLIFF files and static pictures. For using in remote mode, the Resources folder lets you share files between the server machine and all the client machines. See the *4D Server Reference Manual*. -| Inhalt | Beschreibung | Format | +| Contents | Description | Format | | --------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- | ------- | | *item* | Project resource files and folders | various | | Images/Library/*item* | Pictures from the Picture Library as separate files(*). Names of these items become file names. If a duplicate exists, a number is added to the name. | picture | @@ -148,7 +148,7 @@ The Resources folder contains any custom project resource files and folders. In The data folder contains the data file and all files and folders relating to the data. -| Inhalt | Beschreibung | Format | +| Contents | Description | Format | | ------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------ | | data.4dd(*) | Data file containing data entered in the records and all the data belonging to the records. When you open a 4D project, the application opens the current data file by default. If you change the name or location of this file, the *Open data file* dialog box will then appear so that you can select the data file to use or create a new one | binary | | data.journal | Created only when the database uses a log file. The log file is used to ensure the security of the data between backups. All operations carried out on the data are recorded sequentially in this file. Therefore, each operation on the data causes two simultaneous actions: the first on the data (the statement is executed normally) and the second in the log file (a description of the operation is recorded). The log file is constructed independently, without disturbing or slowing down the user’s work. A database can only work with a single log file at a time. The log file records operations such as additions, modifications or deletions of records, transactions, etc. It is generated by default when a database is created. | binary | @@ -162,7 +162,7 @@ This folder contains **user settings files for data** used for application admin > These settings take priority over **[user settings files](#settings-folder-1)** and **[structure settings](#sources-folder)** files. -| Inhalt | Beschreibung | Format | +| Contents | Description | Format | | ------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------ | | directory.json | Description of 4D groups, users, and their access rights when the application is run with this data file. | JSON | | Backup.4DSettings | Database backup settings, used to set the [backup options](Backup/settings.md) when the database is run with this data file. Keys concerning backup configuration are described in the *4D XML Keys Backup* manual. | XML | @@ -187,7 +187,7 @@ This folder contains **user settings files** used for application administration > These settings take priority over **[structure settings](#sources-folder)** files. However, if a **[user settings file for data](#settings-folder)** exists, it takes priority over user settings file. -| Inhalt | Beschreibung | Format | +| Contents | Description | Format | | ------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------ | | directory.json | Description of 4D groups and users for the application, as well as their access rights | JSON | | Backup.4DSettings | Database backup settings, used to set the [backup options](Backup/settings.md)) when each backup is launched. This file can also be used to read or set additional options, such as the amount of information stored in the *backup journal*. Keys concerning backup configuration are described in the *4D XML Keys Backup* manual. | XML | @@ -198,7 +198,7 @@ This folder contains **user settings files** used for application administration This folder contains files that memorize user configurations, e.g. break point positions. You can just ignore this folder. It contains for example: -| Inhalt | Beschreibung | Format | +| Contents | Description | Format | | ---------------------------- | ------------------------------------------------------ | ------ | | methodPreferences.json | Current user method editor preferences | JSON | | methodWindowPositions.json | Current user window positions for methods | JSON | diff --git a/website/translated_docs/de/Project/creating.md b/website/translated_docs/de/Project/creating.md index 970e8cbbe7d2b0..e36701060fb2a1 100644 --- a/website/translated_docs/de/Project/creating.md +++ b/website/translated_docs/de/Project/creating.md @@ -12,7 +12,7 @@ New 4D application projects can be created from **4D** or **4D Server** (see [De To create a new project: 1. Launch 4D or 4D Server. -2. Select **New > Project...** from the **File** menu:

    ![](assets/en/getStart/projectCreate1.png)

    ODER

    (4D only) Select **Project...** from the **New** toolbar button:

    ![](assets/en/getStart/projectCreate2.png)

    A standard **Save** dialog appears so you can choose the name and location of the 4D project's main folder. +2. Select **New > Project...** from the **File** menu:

    ![](assets/en/getStart/projectCreate1.png)

    OR

    (4D only) Select **Project...** from the **New** toolbar button:

    ![](assets/en/getStart/projectCreate2.png)

    A standard **Save** dialog appears so you can choose the name and location of the 4D project's main folder. 3. Enter the name of your project folder and click **Save**.

    This name will be used: - as the name of the entire project folder, @@ -29,7 +29,7 @@ You can then start developing your project. To open an existing project locally from 4D: -1. Select **Open a local application project** in the Welcome Wizard dialog,

    ODER

    Select **Open/Local Project...** from the **File** menu or the **Open** toolbar button.

    The standard Open dialog appears. +1. Select **Open a local application project** in the Welcome Wizard dialog,

    OR

    Select **Open/Local Project...** from the **File** menu or the **Open** toolbar button.

    The standard Open dialog appears. 2. Select the project's `.4dproject` file and click **Open**.

    By default, the project is opened with its current data file. Other file types are suggested: @@ -54,7 +54,7 @@ The first time you connect to a 4D Server project via a remote 4D, you will usua To connect remotely to a 4D Server project: -1. Select **Connect to 4D Server** in the Welcome Wizard dialog,

    ODER

    Select **Open/Remote Project...** from the **File** menu or the **Open** toolbar button. +1. Select **Connect to 4D Server** in the Welcome Wizard dialog,

    OR

    Select **Open/Remote Project...** from the **File** menu or the **Open** toolbar button. The 4D Server connection dialog appears. This dialog has three tabs: **Recent**, **Available**, and **Custom**. diff --git a/website/translated_docs/de/Project/documentation.md b/website/translated_docs/de/Project/documentation.md index 1494d42acc3a70..8e80db2b54a9d0 100644 --- a/website/translated_docs/de/Project/documentation.md +++ b/website/translated_docs/de/Project/documentation.md @@ -10,7 +10,7 @@ In application projects, you can document your methods as well as your forms, ta The following project elements accept documentation: - Methods (database methods, component methods, project methods, form methods, 4D Mobile methods, triggers, and classes) -- Formulare +- Forms - Tables and Fields Your documentation files are written in Markdown syntax (.md files) using any editor that supports Markdown. They are stored as independant files within your project folder. @@ -43,10 +43,10 @@ The `Documentation` folder architecture is the following: + **DatabaseMethods** * onStartup.md * ... - + **Formulare** + + **Forms** * loginDial.md * ... - + **Methoden** + + **Methods** * myMethod.md * ... + **TableForms** @@ -54,7 +54,7 @@ The `Documentation` folder architecture is the following: - input.md - ... * ... - + **Trigger** + + **Triggers** * table1.md * ... @@ -124,7 +124,7 @@ New documentation files are created with the following default contents: ![](assets/en/Project/comments-explo4.png) -| Line | Beschreibung | +| Line | Description | | -------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------- | | "\" | HTML comment. Used in priority as the method description in the [code editor tips](#viewing-documentation-in-the-code-editor) | | ## Description | Heading level 2 in Markdown. The first sentence after this tag is used as the method description in the code editor tips if HTML comment is not used | @@ -196,7 +196,7 @@ The [documentation](https://doc.4d.com) of the command .... -## Beispiel +## Example In the `WP SwitchToolbar.md` file, you can write: diff --git a/website/translated_docs/de/Project/overview.md b/website/translated_docs/de/Project/overview.md index 396dd88bda16a3..ccab0c44a89315 100644 --- a/website/translated_docs/de/Project/overview.md +++ b/website/translated_docs/de/Project/overview.md @@ -1,6 +1,6 @@ --- id: overview -title: Überblick +title: Overview --- A 4D project contains all of the source code of a 4D application, whatever its deployement type (web, mobile, or desktop), from the database structure to the user interface, including code, forms, menus, user settings, or any required resources. A 4D project is primarily made of text-based files. diff --git a/website/translated_docs/de/REST/$asArray.md b/website/translated_docs/de/REST/$asArray.md index 1d046cf4ec15ae..a0b7b75b361e1e 100644 --- a/website/translated_docs/de/REST/$asArray.md +++ b/website/translated_docs/de/REST/$asArray.md @@ -7,11 +7,11 @@ title: '$asArray' Returns the result of a query in an array (i.e. a collection) instead of a JSON object. -## Beschreibung +## Description If you want to receive the response in an array, you just have to add `$asArray` to your REST request (*e.g.*, `$asArray=true`). -## Beispiel +## Example Here is an example or how to receive the response in an array. `GET /rest/Company/?$filter="name begin a"&$top=3&$asArray=true` diff --git a/website/translated_docs/de/REST/$atomic_$atonce.md b/website/translated_docs/de/REST/$atomic_$atonce.md index 22ad31ce26ee45..493f5fbd752900 100644 --- a/website/translated_docs/de/REST/$atomic_$atonce.md +++ b/website/translated_docs/de/REST/$atomic_$atonce.md @@ -7,11 +7,11 @@ title: '$atomic/$atonce' Allows the actions in the REST request to be in a transaction. If there are no errors, the transaction is validated. Otherwise, the transaction is cancelled. -## Beschreibung +## Description When you have multiple actions together, you can use `$atomic/$atonce` to make sure that none of the actions are completed if one of them fails. You can use either `$atomic` or `$atonce`. -## Beispiel +## Example We call the following REST request in a transaction. `POST /rest/Employee?$method=update&$atomic=true` diff --git a/website/translated_docs/de/REST/$attributes.md b/website/translated_docs/de/REST/$attributes.md index fbefc32147e3cc..bc8b65d3152804 100644 --- a/website/translated_docs/de/REST/$attributes.md +++ b/website/translated_docs/de/REST/$attributes.md @@ -6,7 +6,7 @@ title: '$attributes' Allows selecting the related attribute(s) to get from the dataclass (*e.g.*, `Company(1)?$attributes=employees.lastname` or `Employee?$attributes=employer.name`). -## Beschreibung +## Description When you have relation attributes in a dataclass, use `$attributes` to define the path of attributes whose values you want to get for the related entity or entities. diff --git a/website/translated_docs/de/REST/$binary.md b/website/translated_docs/de/REST/$binary.md index 68745668f8b984..c07c9699a761c6 100644 --- a/website/translated_docs/de/REST/$binary.md +++ b/website/translated_docs/de/REST/$binary.md @@ -5,7 +5,7 @@ title: '$binary' Pass "true" to save the BLOB as a document (must also pass `$expand={blobAttributeName}`) -## Beschreibung +## Description `$binary` allows you to save the BLOB as a document. You must also use the [`$expand`]($expand.md) command in conjunction with it. diff --git a/website/translated_docs/de/REST/$catalog.md b/website/translated_docs/de/REST/$catalog.md index 70353686c58343..d17daaeca941cb 100644 --- a/website/translated_docs/de/REST/$catalog.md +++ b/website/translated_docs/de/REST/$catalog.md @@ -9,7 +9,7 @@ The catalog describes all the dataclasses and attributes available in the datast ## Available syntaxes -| Syntax | Beispiel | Beschreibung | +| Syntax | Example | Description | | --------------------------------------------- | -------------------- | -------------------------------------------------------------------------------- | | [**$catalog**](#catalog) | `/$catalog` | Returns a list of the dataclasses in your project along with two URIs | | [**$catalog/$all**](#catalogall) | `/$catalog/$all` | Returns information about all of your project's dataclasses and their attributes | @@ -20,7 +20,7 @@ The catalog describes all the dataclasses and attributes available in the datast Returns a list of the dataclasses in your project along with two URIs: one to access the information about its structure and one to retrieve the data in the dataclass -### Beschreibung +### Description When you call `$catalog`, a list of the dataclasses is returned along with two URIs for each dataclass in your project's datastore. @@ -29,14 +29,14 @@ Only the exposed dataclasses are shown in this list for your project's datastore Here is a description of the properties returned for each dataclass in your project's datastore: -| Property | Typ | Beschreibung | +| Property | Type | Description | | -------- | ------ | --------------------------------------------------------------------------------- | | name | String | Name of the dataclass. | | uri | String | A URI allowing you to obtain information about the |dataclass and its attributes. | | dataURI | String | A URI that allows you to view the data in the dataclass. | -### Beispiel +### Example `GET /rest/$catalog` @@ -64,14 +64,14 @@ Here is a description of the properties returned for each dataclass in your proj Returns information about all of your project's dataclasses and their attributes -### Beschreibung +### Description Calling `$catalog/$all` allows you to receive detailed information about the attributes in each of the datastore classes in your project's active model. For more information about what is returned for each datastore class and its attributes, use [`$catalog/{dataClass}`](#catalogdataClass). -### Beispiel +### Example `GET /rest/$catalog/$all` @@ -185,7 +185,7 @@ For more information about what is returned for each datastore class and its att Returns information about a dataclass and its attributes -### Beschreibung +### Description Calling `$catalog/{dataClass}` for a specific dataclass will return the following information about the dataclass and the attributes it contains. If you want to retrieve this information for all the datastore classes in your project's datastore, use [`$catalog/$all`](#catalogall). @@ -201,11 +201,11 @@ The information you retrieve concerns the following: The following properties are returned for an exposed dataclass: -| Property | Typ | Beschreibung | +| Property | Type | Description | | -------------- | ------ | -------------------------------------------------------------------------------------------------- | | name | String | Name of the dataclass | | collectionName | String | Name of an entity selection on the dataclass | -| tableNumber | Zahl | Table number in the 4D database | +| tableNumber | Number | Table number in the 4D database | | scope | String | Scope for the dataclass (note that only datastore classes whose **Scope** is public are displayed) | | dataURI | String | A URI to the data in the dataclass | @@ -214,11 +214,11 @@ The following properties are returned for an exposed dataclass: Here are the properties for each exposed attribute that are returned: -| Property | Typ | Beschreibung | +| Property | Type | Description | | ----------- | ------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------- | | name | String | Attribute name. | | kind | String | Attribute type (storage or relatedEntity). | -| fieldPos | Zahl | Position of the field in the database table). | +| fieldPos | Number | Position of the field in the database table). | | scope | String | Scope of the attribute (only those attributes whose scope is Public will appear). | | indexed | String | If any **Index Kind** was selected, this property will return true. Otherwise, this property does not appear. | | type | String | Attribute type (bool, blob, byte, date, duration, image, long, long64, number, string, uuid, or word) or the datastore class for a N->1 relation attribute. | @@ -233,7 +233,7 @@ Here are the properties for each exposed attribute that are returned: The key object returns the **name** of the attribute defined as the **Primary Key** for the datastore class. -### Beispiel +### Example You can retrieve the information regarding a specific datastore class. `GET /rest/$catalog/Employee` diff --git a/website/translated_docs/de/REST/$compute.md b/website/translated_docs/de/REST/$compute.md index 6d73649885d711..d60c8fcfaf6a9a 100644 --- a/website/translated_docs/de/REST/$compute.md +++ b/website/translated_docs/de/REST/$compute.md @@ -6,7 +6,7 @@ title: '$compute' Calculate on specific attributes (*e.g.*, `Employee/salary/?$compute=sum)` or in the case of an Object attribute (*e.g.*, Employee/objectAtt.property1/?$compute=sum) -## Beschreibung +## Description This parameter allows you to do calculations on your data. @@ -14,14 +14,14 @@ If you want to perform a calculation on an attribute, you write the following: `GET /rest/Employee/salary/?$compute=$all` -If you want to pass an Object attribute, you must pass one of its property. Beispiel: +If you want to pass an Object attribute, you must pass one of its property. For example: `GET /rest/Employee/objectAtt.property1/?$compute=$all` You can use any of the following keywords: -| Keyword | Beschreibung | +| Keyword | Description | | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | $all | A JSON object that defines all the functions for the attribute (average, count, min, max, and sum for attributes of type Number and count, min, and max for attributes of type String | | average | Get the average on a numerical attribute | @@ -31,7 +31,7 @@ You can use any of the following keywords: | sum | Get the sum on a numerical attribute | -## Beispiel +## Example If you want to get all the computations for an attribute of type Number, you can write: diff --git a/website/translated_docs/de/REST/$directory.md b/website/translated_docs/de/REST/$directory.md index 965b46301b7931..f0ac78e4aea2cf 100644 --- a/website/translated_docs/de/REST/$directory.md +++ b/website/translated_docs/de/REST/$directory.md @@ -10,7 +10,7 @@ The directory handles user access through REST requests. Opens a REST session on your 4D application and logs in the user. -### Beschreibung +### Description Use `$directory/login` to open a session in your 4D application through REST and login a user. You can also modify the default 4D session timeout. All parameters must be passed in **headers** of a POST method: @@ -23,7 +23,7 @@ All parameters must be passed in **headers** of a POST method: | session-4D-length | Session inactivity timeout (minutes). Cannot be less than 60 - Not mandatory | -### Beispiel +### Example ```4d C_TEXT($response;$body_t) diff --git a/website/translated_docs/de/REST/$distinct.md b/website/translated_docs/de/REST/$distinct.md index 859e005472e93a..6c6c98ab886a47 100644 --- a/website/translated_docs/de/REST/$distinct.md +++ b/website/translated_docs/de/REST/$distinct.md @@ -7,13 +7,13 @@ title: '$distinct' Returns the distinct values for a specific attribute in a collection (*e.g.*, `Company/name?$filter="name=a*"&$distinct=true`) -## Beschreibung +## Description `$distinct` allows you to return a collection containing the distinct values for a query on a specific attribute. Only one attribute in the dataclass can be specified. Generally, the String type is best; however, you can also use it on any attribute type that could contain multiple values. You can also use `$skip` and `$top/$limit` as well, if you'd like to navigate the selection before it's placed in an array. -## Beispiel +## Example In our example below, we want to retrieve the distinct values for a company name starting with the letter "a": `GET /rest/Company/name?$filter="name=a*"&$distinct=true` diff --git a/website/translated_docs/de/REST/$entityset.md b/website/translated_docs/de/REST/$entityset.md index 3011bdb27d6cb1..b35886a0ba2e95 100644 --- a/website/translated_docs/de/REST/$entityset.md +++ b/website/translated_docs/de/REST/$entityset.md @@ -8,7 +8,7 @@ After [creating an entity set]($method.md#methodentityset) by using `$method=ent ## Available syntaxes -| Syntax | Beispiel | Beschreibung | +| Syntax | Example | Description | | ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ------------------------------------------------------------ | | [**$entityset/{entitySetID}**](#entitysetentitySetID) | `/People/$entityset/0ANUMBER` | Retrieves an existing entity set | | [**$entityset/{entitySetID}?$operator...&$otherCollection**](#entitysetentitysetidoperatorothercollection) | `/Employee/$entityset/0ANUMBER?$logicOperator=AND &$otherCollection=C0ANUMBER` | Creates a new entity set from comparing existing entity sets | @@ -21,7 +21,7 @@ After [creating an entity set]($method.md#methodentityset) by using `$method=ent Retrieves an existing entity set (*e.g.*, `People/$entityset/0AF4679A5C394746BFEB68D2162A19FF`) -### Beschreibung +### Description This syntax allows you to execute any operation on a defined entity set. @@ -29,7 +29,7 @@ Because entity sets have a time limit on them (either by default or after callin When you retrieve an existing entity set stored in 4D Server's cache, you can also apply any of the following to the entity set: [`$expand`]($expand.md), [`$filter`]($filter), [`$orderby`]($orderby), [`$skip`]($skip.md), and [`$top/$limit`]($top_$limit.md). -### Beispiel +### Example After you create an entity set, the entity set ID is returned along with the data. You call this ID in the following manner: @@ -40,14 +40,14 @@ After you create an entity set, the entity set ID is returned along with the dat Create another entity set based on previously created entity sets -| Parameter | Typ | Beschreibung | +| Parameter | Type | Description | | ---------------- | ------ | -------------------------------------------------------------- | | $operator | String | One of the logical operators to test with the other entity set | | $otherCollection | String | Entity set ID | -### Beschreibung +### Description After creating an entity set (entity set #1) by using `$method=entityset`, you can then create another entity set by using the `$entityset/{entitySetID}?$operator... &$otherCollection` syntax, the `$operator` property (whose values are shown below), and another entity set (entity set #2) defined by the `$otherCollection` property. The two entity sets must be in the same datastore class. @@ -55,21 +55,21 @@ You can then create another entity set containing the results from this call by Here are the logical operators: -| Operator | Beschreibung | +| Operator | Description | | --------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------- | -| UND | Returns the entities in common to both entity sets | -| ODER | Returns the entities in both entity sets | +| AND | Returns the entities in common to both entity sets | +| OR | Returns the entities in both entity sets | | EXCEPT | Returns the entities in entity set #1 minus those in entity set #2 | | INTERSECT | Returns either true or false if there is an intersection of the entities in both entity sets (meaning that least one entity is common in both entity sets) | > The logical operators are not case-sensitive, so you can write "AND" or "and". Below is a representation of the logical operators based on two entity sets. The red section is what is returned. -**UND** +**AND** ![](assets/en/REST/and.png) -**ODER** +**OR** ![](assets/en/REST/or.png) @@ -82,7 +82,7 @@ The syntax is as follows: `GET /rest/dataClass/$entityset/entitySetID?$logicOperator=AND&$otherCollection=entitySetID` -### Beispiel +### Example In the example below, we return the entities that are in both entity sets since we are using the AND logical operator: `GET /rest/Employee/$entityset/9718A30BF61343C796345F3BE5B01CE7?$logicOperator=AND&$otherCollection=C05A0D887C664D4DA1B38366DD21629B` diff --git a/website/translated_docs/de/REST/$filter.md b/website/translated_docs/de/REST/$filter.md index 5371c178bd7bcb..e0b8421cabd9a4 100644 --- a/website/translated_docs/de/REST/$filter.md +++ b/website/translated_docs/de/REST/$filter.md @@ -8,7 +8,7 @@ title: '$filter' Allows to query the data in a dataclass or method *(e.g.*, `$filter="firstName!='' AND salary>30000"`) -## Beschreibung +## Description This parameter allows you to define the filter for your dataclass or method. @@ -69,7 +69,7 @@ You can search in the object by writing the following: The comparator must be one of the following values: -| Comparator | Beschreibung | +| Comparator | Description | | ---------- | ------------------------ | | = | equals to | | != | not equal to | @@ -79,7 +79,7 @@ The comparator must be one of the following values: | <= | less than or equal to | | begin | begins with | -## Beispiele +## Examples In the following example, we look for all employees whose last name begins with a "j": diff --git a/website/translated_docs/de/REST/$imageformat.md b/website/translated_docs/de/REST/$imageformat.md index 35276f4678dc8e..ef61f166a921f0 100644 --- a/website/translated_docs/de/REST/$imageformat.md +++ b/website/translated_docs/de/REST/$imageformat.md @@ -5,11 +5,11 @@ title: '$imageformat' Defines which image format to use for retrieving images (*e.g.*, `$imageformat=png`) -## Beschreibung +## Description Define which format to use to display images. By default, the best format for the image will be chosen. You can, however, select one of the following formats: -| Typ | Beschreibung | +| Type | Description | | ---- | ------------------------------ | | GIF | GIF format | | PNG | PNG format | @@ -21,7 +21,7 @@ Once you have defined the format, you must pass the image attribute to [`$expand If there is no image to be loaded or the format doesn't allow the image to be loaded, the response will be empty. -## Beispiel +## Example The following example defines the image format to JPEG regardless of the actual type of the photo and passes the actual version number sent by the server: diff --git a/website/translated_docs/de/REST/$info.md b/website/translated_docs/de/REST/$info.md index 33a3442bd26ca9..751f3baabde2ca 100644 --- a/website/translated_docs/de/REST/$info.md +++ b/website/translated_docs/de/REST/$info.md @@ -5,14 +5,14 @@ title: '$info' Returns information about the entity sets currently stored in 4D Server's cache as well as user sessions -## Beschreibung +## Description When you call this request for your project, you retrieve information in the following properties: -| Property | Typ | Beschreibung | +| Property | Type | Description | | -------------- | ---------- | ----------------------------------------------------------------------------------- | -| cacheSize | Zahl | 4D Server's cache size. | -| usedCache | Zahl | How much of 4D Server's cache has been used. | -| entitySetCount | Zahl | Number of entity selections. | +| cacheSize | Number | 4D Server's cache size. | +| usedCache | Number | How much of 4D Server's cache has been used. | +| entitySetCount | Number | Number of entity selections. | | entitySet | Collection | A collection in which each object contains information about each entity selection. | | ProgressInfo | Collection | A collection containing information about progress indicator information. | | sessionInfo | Collection | A collection in which each object contains information about each user session. | @@ -21,14 +21,14 @@ When you call this request for your project, you retrieve information in the fol For each entity selection currently stored in 4D Server's cache, the following information is returned: -| Property | Typ | Beschreibung | +| Property | Type | Description | | ------------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | id | String | A UUID that references the entity set. | | dataClass | String | Name of the datastore class. | -| selectionSize | Zahl | Number of entities in the entity selection. | +| selectionSize | Number | Number of entities in the entity selection. | | sorted | Boolean | Returns true if the set was sorted (using `$orderby`) or false if it's not sorted. | -| refreshed | Datum | When the entity set was created or the last time it was used. | -| expires | Datum | When the entity set will expire (this date/time changes each time when the entity set is refreshed). The difference between refreshed and expires is the timeout for an entity set. This value is either two hours by default or what you defined using `$timeout`. | +| refreshed | Date | When the entity set was created or the last time it was used. | +| expires | Date | When the entity set will expire (this date/time changes each time when the entity set is refreshed). The difference between refreshed and expires is the timeout for an entity set. This value is either two hours by default or what you defined using `$timeout`. | For information about how to create an entity selection, refer to `$method=entityset`. If you want to remove the entity selection from 4D Server's cache, use `$method=release`. > 4D also creates its own entity selections for optimization purposes, so the ones you create with `$method=entityset` are not the only ones returned. @@ -38,14 +38,14 @@ For information about how to create an entity selection, refer to `$method=entit For each user session, the following information is returned in the *sessionInfo* collection: -| Property | Typ | Beschreibung | +| Property | Type | Description | | ---------- | ------ | ------------------------------------------------------------ | | sessionID | String | A UUID that references the session. | | userName | String | The name of the user who runs the session. | -| lifeTime | Zahl | The lifetime of a user session in seconds (3600 by default). | -| expiration | Datum | The current expiration date and time of the user session. | +| lifeTime | Number | The lifetime of a user session in seconds (3600 by default). | +| expiration | Date | The current expiration date and time of the user session. | -## Beispiel +## Example Retrieve information about the entity sets currently stored in 4D Server's cache as well as user sessions: diff --git a/website/translated_docs/de/REST/$method.md b/website/translated_docs/de/REST/$method.md index 20daaa13cf96c3..c9e72360ff205f 100644 --- a/website/translated_docs/de/REST/$method.md +++ b/website/translated_docs/de/REST/$method.md @@ -7,7 +7,7 @@ This parameter allows you to define the operation to execute with the returned e ## Available syntaxes -| Syntax | Beispiel | Beschreibung | +| Syntax | Example | Description | | ----------------------------------------------- | ----------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | | [**$method=delete**](#methoddelete) | `POST /Employee?$filter="ID=11"& $method=delete` | Deletes the current entity, entity collection, or entity selection | | [**$method=entityset**](#methodentityset) | `GET /People/?$filter="ID>320"& $method=entityset& $timeout=600` | Creates an entity set in 4D Server's cache based on the collection of entities defined in the REST request | @@ -24,13 +24,13 @@ This parameter allows you to define the operation to execute with the returned e Deletes the current entity, entity collection, or entity selection (created through REST) -### Beschreibung +### Description With `$method=delete`, you can delete an entity or an entire entity collection. You can define the collection of entities by using, for example, [`$filter`]($filter.md) or specifying one directly using [`{dataClass}({key})`](%7BdataClass%7D.html#dataclasskey) *(e.g.*, /Employee(22)). You can also delete the entities in an entity set, by calling [`$entityset/{entitySetID}`]($entityset.md#entitysetentitysetid). -## Beispiel +## Example You can then write the following REST request to delete the entity whose key is 22: `POST /rest/Employee(22)/?$method=delete` @@ -57,13 +57,13 @@ Response: Creates an entity set in 4D Server's cache based on the collection of entities defined in the REST request -### Beschreibung +### Description When you create a collection of entities in REST, you can also create an entity set that will be saved in 4D Server's cache. The entity set will have a reference number that you can pass to `$entityset/{entitySetID}` to access it. By default, it is valid for two hours; however, you can modify that amount of time by passing a value (in seconds) to $timeout. If you have used `$savedfilter` and/or `$savedorderby` (in conjunction with `$filter` and/or `$orderby`) when you created your entity set, you can recreate it with the same reference ID even if it has been removed from 4D Server's cache. -### Beispiel +### Example To create an entity set, which will be saved in 4D Server's cache for two hours, add `$method=entityset` at the end of your REST request: @@ -87,11 +87,11 @@ After you create an entity set, the first element, `__ENTITYSET`, is added to th Releases an existing entity set stored in 4D Server's cache. -### Beschreibung +### Description You can release an entity set, which you created using [`$method=entityset`](#methodentityset), from 4D Server's cache. -### Beispiel +### Example Release an existing entity set: @@ -124,7 +124,7 @@ If the entity set wasn't found, an error is returned: Creates an entity set in 4D Server's cache based on the collection of related entities defined in the REST request -### Beschreibung +### Description `$method=subentityset` allows you to sort the data returned by the relation attribute defined in the REST request. @@ -132,7 +132,7 @@ To sort the data, you use the `$subOrderby` property. For each attribute, you sp If you want to specify multiple attributes, you can delimit them with a comma, µ, `$subOrderby="lastName desc, firstName asc"`. -### Beispiel +### Example If you want to retrieve only the related entities for a specific entity, you can make the following REST request where staff is the relation attribute in the Company dataclass linked to the Employee dataclass: @@ -188,7 +188,7 @@ If you want to retrieve only the related entities for a specific entity, you can Updates and/or creates one or more entities -### Beschreibung +### Description `$method=update` allows you to update and/or create one or more entities in a single **POST**. If you update and/or create one entity, it is done in an object with each property an attribute with its value, *e.g.*, `{ lastName: "Smith" }`. If you update and/or create multiple entities, you must create a collection of objects. @@ -207,7 +207,7 @@ If a problem arises while adding or modifying an entity, an error will be return > * **Booleans** are either true or false. > * Uploaded files using `$upload` can be applied to an attribute of type Image or BLOB by passing the object returned in the following format { "ID": "D507BC03E613487E9B4C2F6A0512FE50"} -### Beispiel +### Example To update a specific entity, you use the following URL: diff --git a/website/translated_docs/de/REST/$orderby.md b/website/translated_docs/de/REST/$orderby.md index 888edb84ef7e5e..17481423abd973 100644 --- a/website/translated_docs/de/REST/$orderby.md +++ b/website/translated_docs/de/REST/$orderby.md @@ -6,12 +6,12 @@ title: '$orderby' Sorts the data returned by the attribute and sorting order defined (*e.g.*, `$orderby="lastName desc, salary asc"`) -## Beschreibung +## Description `$orderby` orders the entities returned by the REST request. For each attribute, you specify the order as `ASC` (or `asc`) for ascending order and `DESC` (`desc`) for descending order. By default, the data is sorted in ascending order. If you want to specify multiple attributes, you can delimit them with a comma, *e.g.*, `$orderby="lastName desc, firstName asc"`. -## Beispiel +## Example In this example, we retrieve entities and sort them at the same time: diff --git a/website/translated_docs/de/REST/$querypath.md b/website/translated_docs/de/REST/$querypath.md index 55808295456424..666c5dc9513b1c 100644 --- a/website/translated_docs/de/REST/$querypath.md +++ b/website/translated_docs/de/REST/$querypath.md @@ -5,7 +5,7 @@ title: '$querypath' Returns the query as it was executed by 4D Server (*e.g.*, `$querypath=true`) -## Beschreibung +## Description `$querypath` returns the query as it was executed by 4D Server. If, for example, a part of the query passed returns no entities, the rest of the query is not executed. The query requested is optimized as you can see in this `$querypath`. @@ -13,14 +13,14 @@ For more information about query paths, refer to [queryPlan and queryPath](genIn In the steps collection, there is an object with the following properties defining the query executed: -| Property | Typ | Beschreibung | +| Property | Type | Description | | ------------- | ---------- | --------------------------------------------------------------------------- | | description | String | Actual query executed or "AND" when there are multiple steps | -| time | Zahl | Number of milliseconds needed to execute the query | -| recordsfounds | Zahl | Number of records found | +| time | Number | Number of milliseconds needed to execute the query | +| recordsfounds | Number | Number of records found | | steps | Collection | An collection with an object defining the subsequent step of the query path | -## Beispiel +## Example If you passed the following query: diff --git a/website/translated_docs/de/REST/$queryplan.md b/website/translated_docs/de/REST/$queryplan.md index 1aca8adf9710ee..6032a4a3aa2093 100644 --- a/website/translated_docs/de/REST/$queryplan.md +++ b/website/translated_docs/de/REST/$queryplan.md @@ -6,17 +6,17 @@ title: '$queryplan' Returns the query as it was passed to 4D Server (*e.g.*, `$queryplan=true`) -## Beschreibung +## Description $queryplan returns the query plan as it was passed to 4D Server. -| Property | Typ | Beschreibung | +| Property | Type | Description | | -------- | ------ | ------------------------------------------------------------------------------------------- | | item | String | Actual query executed | | subquery | Array | If there is a subquery, an additional object containing an item property (as the one above) | For more information about query plans, refer to [queryPlan and queryPath](genInfo.md#querypath-and-queryplan). -## Beispiel +## Example If you pass the following query: `GET /rest/People/$filter="employer.name=acme AND lastName=Jones"&$queryplan=true` diff --git a/website/translated_docs/de/REST/$savedfilter.md b/website/translated_docs/de/REST/$savedfilter.md index 5e748568850121..0c144247101d85 100644 --- a/website/translated_docs/de/REST/$savedfilter.md +++ b/website/translated_docs/de/REST/$savedfilter.md @@ -5,7 +5,7 @@ title: '$savedfilter' Saves the filter defined by $filter when creating an entity set (*e.g.*, `$savedfilter="{filter}"`) -## Beschreibung +## Description When you create an entity set, you can save the filter that you used to create it as a measure of security. If the entity set that you created is removed from 4D Server's cache (due to the timeout, the server's need for space, or your removing it by calling [`$method=release`]($method.md#methodrelease)). @@ -15,7 +15,7 @@ If the entity set is no longer in 4D Server's cache, it will be recreated with a If you have used both `$savedfilter` and [`$savedorderby`]($savedorderby.md) in your call when creating an entity set and then you omit one of them, the new entity set, which will have the same reference number, will reflect that. -## Beispiel +## Example In our example, we first call ``$savedfilter` with the initial call to create an entity set as shown below: diff --git a/website/translated_docs/de/REST/$savedorderby.md b/website/translated_docs/de/REST/$savedorderby.md index 582514b4ff6460..180b3ff16b7bce 100644 --- a/website/translated_docs/de/REST/$savedorderby.md +++ b/website/translated_docs/de/REST/$savedorderby.md @@ -5,7 +5,7 @@ title: '$savedorderby' Saves the order by defined by `$orderby` when creating an entity set (*e.g.*, `$savedorderby="{orderby}"`) -## Beschreibung +## Description When you create an entity set, you can save the sort order along with the filter that you used to create it as a measure of security. If the entity set that you created is removed from 4D Server's cache (due to the timeout, the server's need for space, or your removing it by calling [`$method=release`]($method.md#methodrelease)). @@ -13,7 +13,7 @@ You use `$savedorderby` to save the order you defined when creating your entity If the entity set is no longer in 4D Server's cache, it will be recreated with a new default timeout of 10 minutes. If you have used both [`$savedfilter`]($savedfilter.md) and `$savedorderby` in your call when creating an entity set and then you omit one of them, the new entity set, having the same reference number, will reflect that. -## Beispiel +## Example You first call `$savedorderby` with the initial call to create an entity set: `GET /rest/People/?$filter="lastName!=''"&$savedfilter="lastName!=''"&$orderby="salary"&$savedorderby="salary"&$method=entityset` diff --git a/website/translated_docs/de/REST/$skip.md b/website/translated_docs/de/REST/$skip.md index 43756ffc9b5d44..1feb4d28be386e 100644 --- a/website/translated_docs/de/REST/$skip.md +++ b/website/translated_docs/de/REST/$skip.md @@ -6,13 +6,13 @@ title: '$skip' Starts the entity defined by this number in the collection (*e.g.*, `$skip=10`) -## Beschreibung +## Description `$skip` defines which entity in the collection to start with. By default, the collection sent starts with the first entity. To start with the 10th entity in the collection, pass 10. `$skip` is generally used in conjunction with [`$top/$limit`]($top_$limit.md) to navigate through an entity collection. -## Beispiel +## Example In the following example, we go to the 20th entity in our entity set: diff --git a/website/translated_docs/de/REST/$timeout.md b/website/translated_docs/de/REST/$timeout.md index 32480ef7a88401..2eac9ac71f3f27 100644 --- a/website/translated_docs/de/REST/$timeout.md +++ b/website/translated_docs/de/REST/$timeout.md @@ -6,7 +6,7 @@ title: '$timeout' Defines the number of seconds to save an entity set in 4D Server's cache (*e.g.*, `$timeout=1800`) -## Beschreibung +## Description To define a timeout for an entity set that you create using [`$method=entityset`]($method.md#methodentityset), pass the number of seconds to `$timeout`. For example, if you want to set the timeout to 20 minutes, pass 1200. By default, the timeout is two (2) hours. @@ -14,7 +14,7 @@ Once the timeout has been defined, each time an entity set is called upon (by us If an entity set is removed and then recreated using `$method=entityset` along with [`$savedfilter`]($savedfilter.md), the new default timeout is 10 minutes regardless of the timeout you defined when calling `$timeout`. -## Beispiel +## Example In our entity set that we're creating, we define the timeout to 20 minutes: diff --git a/website/translated_docs/de/REST/$top_$limit.md b/website/translated_docs/de/REST/$top_$limit.md index 9f2825f96624ac..8539277f771f3e 100644 --- a/website/translated_docs/de/REST/$top_$limit.md +++ b/website/translated_docs/de/REST/$top_$limit.md @@ -5,13 +5,13 @@ title: '$top/$limit' Limits the number of entities to return (e.g., `$top=50`) -## Beschreibung +## Description `$top/$limit` defines the limit of entities to return. By default, the number is limited to 100. You can use either keyword: `$top` or `$limit`. When used in conjunction with [`$skip`]($skip.md), you can navigate through the entity selection returned by the REST request. -## Beispiel +## Example In the following example, we request the next ten entities after the 20th entity: diff --git a/website/translated_docs/de/REST/$upload.md b/website/translated_docs/de/REST/$upload.md index 430097a6cb48fd..9b8159b841e27e 100644 --- a/website/translated_docs/de/REST/$upload.md +++ b/website/translated_docs/de/REST/$upload.md @@ -6,7 +6,7 @@ title: '$upload' Returns an ID of the file uploaded to the server -## Beschreibung +## Description Post this request when you have a file that you want to upload to the Server. If you have an image, you pass `$rawPict=true`. For all other files, you pass `$binary=true`. You can modify the timeout, which by default is 120 seconds, by passing a value to the `$timeout parameter`. diff --git a/website/translated_docs/de/REST/$version.md b/website/translated_docs/de/REST/$version.md index edd4bae5bb2b77..e80c60a3b08c92 100644 --- a/website/translated_docs/de/REST/$version.md +++ b/website/translated_docs/de/REST/$version.md @@ -5,13 +5,13 @@ title: '$version' Image version number -## Beschreibung +## Description `$version` is the image's version number returned by the server. The version number, which is sent by the server, works around the browser's cache so that you are sure to retrieve the correct image. The value of the image's version parameter is modified by the server. -## Beispiel +## Example The following example defines the image format to JPEG regardless of the actual type of the photo and passes the actual version number sent by the server: diff --git a/website/translated_docs/de/REST/ClassFunctions.md b/website/translated_docs/de/REST/ClassFunctions.md index 89647258bd59f1..9651353e316923 100644 --- a/website/translated_docs/de/REST/ClassFunctions.md +++ b/website/translated_docs/de/REST/ClassFunctions.md @@ -42,13 +42,13 @@ Functions are called on the corresponding object on the server datastore. > The function is searched in the entity selection class first. If not found, it is searched in the dataclass. In other words, if a function with the same name is defined in both the DataClass class and the EntitySelection class, the dataclass class function will never be executed. -## Parameter +## Parameters You can send parameters to functions defined in ORDA user classes. On the server side, they will be received in the class functions in regular $1, $2, etc. parameters. -Es gelten folgende Regeln: +The following rules apply: - Parameters must be passed in the **body of the POST request** - Parameters must be enclosed within a collection (JSON format) @@ -74,7 +74,7 @@ Entities passed in parameters are referenced on the server through their key (*i > If the request sends modified attribute values for an existing entity on the server, the called ORDA data model function will be automatically executed on the server with modified values. This feature allows you, for example, to check the result of an operation on an entity, after applying all business rules, from the client application. You can then decide to save or not the entity on the server. -| Properties | Typ | Beschreibung | +| Properties | Type | Description | | ------------------------ | ------------------------------------ | -------------------------------------------------------------------------- | | Attributes of the entity | mixed | Optional - Values to modify | | __DATACLASS | String | Mandatory - Indicates the Dataclass of the entity | @@ -100,7 +100,7 @@ The entity selection must have been defined beforehand using [$method=entityset] > If the request sends a modified entity selection to the server, the called ORDA data model function will be automatically executed on the server with the modified entity selection. -| Properties | Typ | Beschreibung | +| Properties | Type | Description | | ------------------------ | ------- | ------------------------------------------------------------------------------------ | | Attributes of the entity | mixed | Optional - Values to modify | | __DATASET | String | Mandatory - entitySetID (UUID) of the entity selection | @@ -132,7 +132,7 @@ You can then run this request: **POST** `127.0.0.1:8111/rest/$catalog/getName` -#### Ergebnis +#### Result ``` { @@ -162,7 +162,7 @@ You can then run this request: Body of the request: ["Aguada"] -#### Ergebnis +#### Result The result is an entity: ``` @@ -206,7 +206,7 @@ You can then run this request: **POST** `127.0.0.1:8111/rest/City(2)/getPopulation` -#### Ergebnis +#### Result ``` { @@ -232,7 +232,7 @@ You can then run this request: **POST** `127.0.0.1:8111/rest/City/getPopulation/?$filter="ID<3"` -#### Ergebnis +#### Result ``` { @@ -264,7 +264,7 @@ Once you have created an entityset, you can run this request: **POST** `127.0.0.1:8044/rest/Students/getAgeAverage/$entityset/17E83633FFB54ECDBF947E5C620BB532` -#### Ergebnis +#### Result ``` { @@ -295,7 +295,7 @@ You can then run this request: **POST** `127.0.0.1:8044/rest/Students/getLastSummary/$entityset/?$filter="lastname=b@"&$orderby="lastname"` -#### Ergebnis +#### Result ``` { @@ -350,7 +350,7 @@ Body of the request: Since no `__KEY` is given, a new Students entity is loaded on the server **with the attributes received from the client**. Because the `pushData()` function runs a `save()` action, the new entity is created. -#### Ergebnis +#### Result ``` { @@ -387,7 +387,7 @@ Body of the request: Since `__KEY` is given, the Students entity with primary key 55 is loaded **with the lastname value received from the client**. Because the function runs a `save()` action, the entity is updated. -#### Ergebnis +#### Result ``` { @@ -423,7 +423,7 @@ Body of the request: }] ``` -#### Ergebnis +#### Result ``` { @@ -477,7 +477,7 @@ You run this request, called on a Students entity : **POST** `http://127.0.0.1:8 }] ``` -#### Ergebnis +#### Result ``` { @@ -544,7 +544,7 @@ Body of the request: ``` -#### Ergebnis +#### Result The entities with primary keys 1 and 2 have been updated. diff --git a/website/translated_docs/de/REST/REST_requests.md b/website/translated_docs/de/REST/REST_requests.md index 9a1f517a147239..cf2ab3ccad554e 100644 --- a/website/translated_docs/de/REST/REST_requests.md +++ b/website/translated_docs/de/REST/REST_requests.md @@ -15,7 +15,7 @@ The following structures are supported for REST requests: While all REST requests must contain the URI and Resource parameters, the Output (which filters the data returned) is optional. -As with all URIs, the first parameter is delimited by a “?” and all subsequent parameters by a “&”. Beispiel: +As with all URIs, the first parameter is delimited by a “?” and all subsequent parameters by a “&”. For example: `GET /rest/Person/?$filter="lastName!=Jones"&$method=entityset&$timeout=600` > You can place all values in quotes in case of ambiguity. For example, in our above example, we could have put the value for the last name in single quotes: "lastName!='Jones'". @@ -31,7 +31,7 @@ With each REST request, the server returns the status and a response (with or wi ### Request Status With each REST request, you get the status along with the response. Below are a few of the statuses that can arise: -| Status | Beschreibung | +| Status | Description | | ------------------------- | -------------------------------------------------------------------------- | | 0 | Request not processed (server might not be started). | | 200 OK | Request processed without error. | diff --git a/website/translated_docs/de/REST/authUsers.md b/website/translated_docs/de/REST/authUsers.md index 23500f03553080..7bbb98da7fa022 100644 --- a/website/translated_docs/de/REST/authUsers.md +++ b/website/translated_docs/de/REST/authUsers.md @@ -26,7 +26,7 @@ WASID4D=EA0400C4D58FF04F94C0A4XXXXXX3 In the subsequent REST requests, make sure this cookie is included in the **"Cookie" request header** so that you will reuse the same session. Otherwise, a new session will be opened, and another license used. -### Beispiel +### Example The way to handle session cookies actually depends on your HTTP client. This example shows how to extract and resend the session cookie in the context of requests handled through the 4D `HTTP Request` command. diff --git a/website/translated_docs/de/REST/genInfo.md b/website/translated_docs/de/REST/genInfo.md index 0590f96de40d19..f0733a46c9c7c2 100644 --- a/website/translated_docs/de/REST/genInfo.md +++ b/website/translated_docs/de/REST/genInfo.md @@ -25,7 +25,7 @@ Use the [`$info`]($info.md) parameter to get information about the entity select Entity selections that are generated through queries can have the following two properties: `queryPlan` and `queryPath`. To calculate and return these properties, you just need to add [`$queryPlan`]($queryplan.md) and/or [`$queryPath`]($querypath.md) in the REST request. -Beispiel: +For example: `GET /rest/People/$filter="employer.name=acme AND lastName=Jones"&$queryplan=true&$querypath=true` diff --git a/website/translated_docs/de/REST/manData.md b/website/translated_docs/de/REST/manData.md index bdc4c1f319daeb..175b3de414697e 100644 --- a/website/translated_docs/de/REST/manData.md +++ b/website/translated_docs/de/REST/manData.md @@ -18,7 +18,7 @@ To query data directly, you can do so using the [`$filter`]($filter.md) function With the REST API, you can perform all the manipulations to data as you can in 4D. -To add and modify entities, you can call [`$method=update`]($method.md#methodupdate). Before saving data, you can also validate it beforehand by calling [`$method=validate`]($method.md#methodvalidate). If you want to delete one or more entities, you can use [`$method=delete`]($method.md#methoddelete). +To add and modify entities, you can call [`$method=update`]($method.md#methodupdate). If you want to delete one or more entities, you can use [`$method=delete`]($method.md#methoddelete). Besides retrieving a single entity in a dataclass using [{dataClass}({key})](%7BdataClass%7D_%7Bkey%7D.html), you can also write a [class function](classFunctions.md#function-calls) that returns an entity selection (or a collection). @@ -87,18 +87,18 @@ You can always define which attributes to return in the REST response after an i You can apply this filter in the following ways: -| Objekt | Syntax | Beispiel | +| Object | Syntax | Example | | ---------------------- | --------------------------------------------------- | ------------------------------------------------------------- | | Dataclass | {dataClass}/{att1,att2...} | /People/firstName,lastName | | Collection of entities | {dataClass}/{att1,att2...}/?$filter="{filter}" | /People/firstName,lastName/?$filter="lastName='a@'" | | Specific entity | {dataClass}({ID})/{att1,att2...} | /People(1)/firstName,lastName | | | {dataClass}:{attribute}(value)/{att1,att2...}/ | /People:firstName(Larry)/firstName,lastName/ | -| Entity-Selection | {dataClass}/{att1,att2...}/$entityset/{entitySetID} | /People/firstName/$entityset/528BF90F10894915A4290158B4281E61 | +| Entity selection | {dataClass}/{att1,att2...}/$entityset/{entitySetID} | /People/firstName/$entityset/528BF90F10894915A4290158B4281E61 | The attributes must be delimited by a comma, *i.e.*, `/Employee/firstName,lastName,salary`. Storage or relation attributes can be passed. -### Beispiele +### Examples Here are a few examples, showing you how to specify which attributes to return depending on the technique used to retrieve entities. You can apply this technique to: @@ -242,7 +242,7 @@ If you want to save a BLOB stored in your dataclass, you can write the following ## Retrieving only one entity -You can use the [`{dataClass}:{attribute}(value)`](%7BdataClass%7D.html#dataclassattributevalue) syntax when you want to retrieve only one entity. It's especially useful when you want to do a related search that isn't created on the dataclass's primary key. Sie schreiben zum Beispiel: +You can use the [`{dataClass}:{attribute}(value)`](%7BdataClass%7D.html#dataclassattributevalue) syntax when you want to retrieve only one entity. It's especially useful when you want to do a related search that isn't created on the dataclass's primary key. For example, you can write: `GET /rest/Company:companyCode("Acme001")` diff --git a/website/translated_docs/de/REST/{dataClass}.md b/website/translated_docs/de/REST/{dataClass}.md index ceb79767a5c245..e73c1a08895887 100644 --- a/website/translated_docs/de/REST/{dataClass}.md +++ b/website/translated_docs/de/REST/{dataClass}.md @@ -11,7 +11,7 @@ Dataclass names can be used directly in the REST requests to work with entities ## Available syntaxes -| Syntax | Beispiel | Beschreibung | +| Syntax | Example | Description | | ---------------------------------------------------------------------------------- | ---------------------------------------- | ------------------------------------------------------------------------------- | | [**{dataClass}**](#dataClass) | `/Employee` | Returns all the data (by default the first 100 entities) for the dataclass | | [**{dataClass}({key})**](#dataclasskey) | `/Employee(22)` | Returns the data for the specific entity defined by the dataclass's primary key | @@ -28,35 +28,35 @@ Dataclass names can be used directly in the REST requests to work with entities Returns all the data (by default the first 100 entities) for a specific dataclass (*e.g.*, `Company`) -### Beschreibung +### Description When you call this parameter in your REST request, the first 100 entities are returned unless you have specified a value using [`$top/$limit`]($top_$limit.md). Here is a description of the data returned: -| Property | Typ | Beschreibung | +| Property | Type | Description | | ------------- | ---------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | __entityModel | String | Name of the datastore class. | -| __COUNT | Zahl | Number of entities in the datastore class. | -| __SENT | Zahl | Number of entities sent by the REST request. This number can be the total number of entities if it is less than the value defined by `$top/$limit`. | -| __FIRST | Zahl | Entity number that the selection starts at. Either 0 by default or the value defined by `$skip`. | +| __COUNT | Number | Number of entities in the datastore class. | +| __SENT | Number | Number of entities sent by the REST request. This number can be the total number of entities if it is less than the value defined by `$top/$limit`. | +| __FIRST | Number | Entity number that the selection starts at. Either 0 by default or the value defined by `$skip`. | | __ENTITIES | Collection | This collection of objects contains an object for each entity with all its attributes. All relational attributes are returned as objects with a URI to obtain information regarding the parent. | Each entity contains the following properties: -| Property | Typ | Beschreibung | +| Property | Type | Description | | ----------- | ------ | ---------------------------------------------------------------------------------------------------------- | | __KEY | String | Value of the primary key defined for the datastore class. | -| __TIMESTAMP | Datum | Timestamp of the last modification of the entity | -| __STAMP | Zahl | Internal stamp that is needed when you modify any of the values in the entity when using `$method=update`. | +| __TIMESTAMP | Date | Timestamp of the last modification of the entity | +| __STAMP | Number | Internal stamp that is needed when you modify any of the values in the entity when using `$method=update`. | -If you want to specify which attributes you want to return, define them using the following syntax [{attribute1, attribute2, ...}](manData.md##selecting-attributes-to-get). Beispiel: +If you want to specify which attributes you want to return, define them using the following syntax [{attribute1, attribute2, ...}](manData.md##selecting-attributes-to-get). For example: `GET /rest/Company/name,address` -### Beispiel +### Example Return all the data for a specific datastore class. @@ -146,13 +146,13 @@ Return all the data for a specific datastore class. Returns the data for the specific entity defined by the dataclass's primary key, *e.g.*, `Company(22) or Company("IT0911AB2200")` -### Beschreibung +### Description By passing the dataclass and a key, you can retrieve all the public information for that entity. The key is the value in the attribute defined as the Primary Key for your datastore class. For more information about defining a primary key, refer to the **Modifying the Primary Key** section in the **Data Model Editor**. For more information about the data returned, refer to [{datastoreClass}](#datastoreclass). -If you want to specify which attributes you want to return, define them using the following syntax [{attribute1, attribute2, ...}](manData.md##selecting-attributes-to-get). Beispiel: +If you want to specify which attributes you want to return, define them using the following syntax [{attribute1, attribute2, ...}](manData.md##selecting-attributes-to-get). For example: `GET /rest/Company(1)/name,address` @@ -160,7 +160,7 @@ If you want to expand a relation attribute using `$expand`, you do so by specify `GET /rest/Company(1)/name,address,staff?$expand=staff` -### Beispiel +### Example The following request returns all the public data in the Company datastore class whose key is 1. @@ -195,13 +195,13 @@ The following request returns all the public data in the Company datastore class Returns the data for one entity in which the attribute's value is defined -### Beschreibung +### Description By passing the *dataClass* and an *attribute* along with a value, you can retrieve all the public information for that entity. The value is a unique value for attribute, but is not the primary key. `GET /rest/Company:companyCode(Acme001)` -If you want to specify which attributes you want to return, define them using the following syntax [{attribute1, attribute2, ...}](manData.md##selecting-attributes-to-get). Beispiel: +If you want to specify which attributes you want to return, define them using the following syntax [{attribute1, attribute2, ...}](manData.md##selecting-attributes-to-get). For example: `GET /rest/Company:companyCode(Acme001)/name,address` @@ -209,7 +209,7 @@ If you want to use a relation attribute using [$attributes]($attributes.md), you `GET /rest/Company:companyCode(Acme001)?$attributes=name,address,staff.name` -### Beispiel +### Example The following request returns all the public data of the employee named "Jones". diff --git a/website/translated_docs/de/Users/overview.md b/website/translated_docs/de/Users/overview.md index f2114c2c425804..0c3fc7163d22ce 100644 --- a/website/translated_docs/de/Users/overview.md +++ b/website/translated_docs/de/Users/overview.md @@ -1,6 +1,6 @@ --- id: overview -title: Überblick +title: Overview --- If more than one person uses an application, which is usually the case in client-server architecture or Web interfaces, you need to control access or provide different features according to the connected users. It is also essential to provide security for sensitive data. You can provide this security by assigning passwords to users and creating access groups that have different levels of access to information in the application or to application operations. diff --git a/website/translated_docs/de/WebServer/webServerObject.md b/website/translated_docs/de/WebServer/webServerObject.md index e083c3a9d20cc9..e6a8cb25dbddf7 100644 --- a/website/translated_docs/de/WebServer/webServerObject.md +++ b/website/translated_docs/de/WebServer/webServerObject.md @@ -66,7 +66,7 @@ webServer:=WEB Server(Web server receiving request) A [web server class object](API/webServerClass.md#web-server-object) contains the following functions: -| Funktionen | Parameter | Return value | Beschreibung | +| Functions | Parameter | Return value | Description | | ---------------------------------------- | ----------------- | --------------- | --------------------- | | [`start()`](API/webServerClass.md#start) | settings (object) | status (object) | Starts the web server | | [`stop()`](API/webServerClass.md#start) | - | - | Stops the web server | diff --git a/website/translated_docs/es/API/cryptoKeyClass.md b/website/translated_docs/es/API/cryptoKeyClass.md index 15fd95f73b59f4..e787391963ac3c 100644 --- a/website/translated_docs/es/API/cryptoKeyClass.md +++ b/website/translated_docs/es/API/cryptoKeyClass.md @@ -29,7 +29,7 @@ ASSERT($status.success) ### Summary | | | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| [](#4dcryptokeynew)

        | +| [](#4dcryptokeynew)

        | | [](#curve)

         | | [](#decrypt)

        | | [](#encrypt)

        | @@ -46,6 +46,8 @@ ASSERT($status.success) + + ## 4D.CryptoKey.new()

    History @@ -57,7 +59,7 @@ ASSERT($status.success) **4D.CryptoKey.new**( *settings* : Object ) : 4D.CryptoKey - + | Parameter | Type | | Description | | --------- | ------------ | -- | ---------------------------------------------------------------------- | | settings | Object | -> | Settings to generate or load a key pair | @@ -82,7 +84,7 @@ The `4D.CryptoKey.new()` function create #### *cryptoKey* The returned `cryptoKey` object encapsulates an encryption key pair. It is a shared object and can therefore be used by multiple 4D processes simultaneously. - + @@ -131,11 +133,11 @@ The key must be a RSA key, the algorithm is RSA-OAEP (see [RFC 3447](https://too #### *options* -| Property | Type | Description | -| ----------------- | ---- | -------------------------------------------------------------------------------------------------------------------------------------------- | -| hash | text | Digest algorithm to use. For example: "SHA256", "SHA384", or "SHA512". | -| encodingEncrypted | text | Encoding used to convert the binary decrypted message into the result string. Can be "UTF-8", "Base64", or "Base64URL". Default is "Base64". | -| encodingDecrypted | text | Encoding used to convert the binary decrypted message into the result string. Can be "UTF-8", "Base64", or "Base64URL". Default is "UTF-8". | +| Property | Type | Description | +| ----------------- | ---- | ------------------------------------------------------------------------------------------------------------------------------------------------ | +| hash | text | Digest algorithm to use. For example: "SHA256", "SHA384", or "SHA512". | +| encodingEncrypted | text | Encoding used to convert the `message` parameter into the binary representation to decrypt. Can be "Base64" or "Base64URL". Default is "Base64". | +| encodingDecrypted | text | Encoding used to convert the binary decrypted message into the result string. Can be "UTF-8", "Base64", or "Base64URL". Default is "UTF-8". | #### *Result* @@ -291,12 +293,12 @@ The `cryptoKey` must contain a valid **private** key. #### *options* -| Property | Type | Description | -| ----------------- | ------- | ----------------------------------------------------------------------------------------------------------------------------------- | -| hash | text | Digest algorithm to use. For example: "SHA256", "SHA384", or "SHA512". "HASH256", "HASH384", or "HASH512". | -| encodingEncrypted | text | Encoding used to convert the binary encrypted message into the result string. Can be "Base64", or "Base64URL". Default is "Base64". | -| pss | boolean | Use Probabilistic Signature Scheme (PSS). Ignored if the key is not an RSA key. Pass `true` when producing a JWT for PS@ algorithm | -| encoding | text | ERepresentation to be used for result signature. Possible values are "Base64" or "Base64URL". Default is "Base64". | +| Property | Type | Description | +| ----------------- | ------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| hash | text | Digest algorithm to use. For example: "SHA256", "SHA384", or "SHA512". When used to produce a JWT, the hash size must match the PS@, ES@, RS@, or PS@ algorithm size | +| encodingEncrypted | text | Encoding used to convert the binary encrypted message into the result string. Can be "Base64", or "Base64URL". Default is "Base64". | +| pss | boolean | Use Probabilistic Signature Scheme (PSS). Ignored if the key is not an RSA key. Pass `true` when producing a JWT for PS@ algorithm | +| encoding | text | ERepresentation to be used for result signature. Possible values: "Base64" or "Base64URL". Default is "Base64". | #### *Result* @@ -365,11 +367,11 @@ The `cryptoKey` must contain a valid **public** key. #### *options* -| Property | Type | Description | -| -------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------ | -| hash | text | Digest algorithm to use. For example: "SHA256", "SHA384", or "SHA512". "HASH256", "HASH384", or "HASH512". | -| pss | boolean | Use Probabilistic Signature Scheme (PSS). Ignored if the key is not an RSA key. Pass `true` when verifying a JWT for PS@ algorithm | -| encoding | text | Encoding used to convert the `message` parameter into the binary representation to decrypt. Can be "Base64" or "Base64URL". Default is "Base64". | +| Property | Type | Description | +| -------- | ------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| hash | text | Digest algorithm to use. For example: "SHA256", "SHA384", or "SHA512". When used to produce a JWT, the hash size must match the PS@, ES@, RS@, or PS@ algorithm size | +| pss | boolean | Use Probabilistic Signature Scheme (PSS). Ignored if the key is not an RSA key. Pass `true` when verifying a JWT for PS@ algorithm | +| encoding | text | Representation of provided signature. Possible values are "Base64" or "Base64URL". Default is "Base64". | #### *Result* diff --git a/website/translated_docs/es/API/datastoreClass.md b/website/translated_docs/es/API/datastoreClass.md index f842895cae2237..ff0364517b30f1 100644 --- a/website/translated_docs/es/API/datastoreClass.md +++ b/website/translated_docs/es/API/datastoreClass.md @@ -10,13 +10,14 @@ A [Datastore](ORDA/dsMapping.md#datastore) is the interface object provided by O ### Summary -| | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | [](#canceltransaction)

        | | [](#dataclassname)

         | | [](#encryptionstatus)

         | | [](#getinfo)

         | | [](#getrequestlog)

         | +| [](#makeSelectionsAlterable)

         | | [](#providedatakey)

         | | [](#startrequestlog)

         | | [](#starttransaction)

         | @@ -75,7 +76,7 @@ Using the main datastore on the 4D database: #### Example 2 -```4d +```4d var $connectTo; $firstFrench; $firstForeign : Object var $frenchStudents; $foreignStudents : cs.DataStore @@ -166,7 +167,7 @@ Pass in *connectionInfo* an object describing the remote datastore you want to c Connection to a remote datastore without user / password: ```4d - var $connectTo : Object + var $connectTo : Object var $remoteDS : cs.DataStore $connectTo:=New object("type";"4D Server";"hostname";"192.168.18.11:8044") $remoteDS:=Open datastore($connectTo;"students") @@ -178,7 +179,7 @@ Connection to a remote datastore without user / password: Connection to a remote datastore with user / password / timeout / tls: ```4d - var $connectTo : Object + var $connectTo : Object var $remoteDS : cs.DataStore $connectTo:=New object("type";"4D Server";"hostname";\"192.168.18.11:4443";\ "user";"marie";"password";$pwd;"idleTimeout";70;"tls";True) @@ -191,7 +192,7 @@ Connection to a remote datastore with user / password / timeout / tls: Working with several remote datastores: ```4d - var $connectTo : Object + var $connectTo : Object var $frenchStudents; $foreignStudents : cs.DataStore $connectTo:=New object("hostname";"192.168.18.11:8044") $frenchStudents:=Open datastore($connectTo;"french") @@ -203,7 +204,7 @@ Working with several remote datastores: #### Error management -In case of error, the command returns **Null**. If the remote datastore cannot be reached (wrong address, web server not started, http and https not enabled...), error 1610 "A remote request to host XXX has failed" is raised. You can intercept this error with a method installed by `ON ERR CALL`. +In case of error, the command returns **Null**. If the remote datastore cannot be reached (wrong address, web server not started, http and https not enabled...), error 1610 "A remote request to host XXX has failed" is raised. You can intercept this error with a method installed by `ON ERR CALL`. @@ -380,11 +381,11 @@ The `.getInfo()` function returns **Returned object** -| Property | Type | Description | -| ---------- | ------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| type | string |

  • "4D": main datastore, available through ds
  • "4D Server": remote datastore, open with Open datastore
  • | -| networked | boolean |
  • True: the datastore is reached through a network connection.
  • False: the datastore is not reached through a network connection (local database)
  • | -| localID | text | ID of the datastore on the machine. Corresponds to the localId string given with the `Open datastore` command. Empty string ("") for main datastore. | +| Property | Type | Description | +| ---------- | ------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| type | string |
  • "4D": main datastore, available through ds
  • "4D Server": remote datastore, open with Open datastore
  • | +| networked | boolean |
  • True: the datastore is reached through a network connection.
  • False: the datastore is not reached through a network connection (local database)
  • | +| localID | text | ID of the datastore on the machine. Corresponds to the localId string given with the `Open datastore` command. Empty string ("") for main datastore. | | connection | object | Object describing the remote datastore connection (not returned for main datastore). Available properties:

    PropertyTypeDescription
    hostnametextIP address or name of the remote datastore + ":" + port number
    tlsbooleanTrue if secured connection is used with the remote datastore
    idleTimeoutnumberSession inactivity timeout (in minutes)
    usertextUser authenticated on the remote datastore
    | * If the `.getInfo()` function is executed on a 4D Server or 4D single-user, `networked` is False. @@ -419,8 +420,8 @@ On a remote datastore: //"localID":"students", //"networked":true, //"connection":{hostname:"111.222.33.44:8044","tls":false,"idleTimeout":2880,"user":"marie"}} -``` - +``` + @@ -465,6 +466,39 @@ See Example 2 of [`.startRequestLog()`](#startrequestlog). + +## .makeSelectionsAlterable() + +

    History +| Version | Changes | +| ------- | ------- | +| v18 R5 | Added | +
    + + +**.makeSelectionsAlterable()** + + +| Parameter | Type | | Description | +| --------- | ---- |::| ------------------------------- | +| | | | Does not require any parameters | + + + +#### Description + +The `.makeSelectionsAlterable()` function sets all entity selections as alterable by default in all the current application datastores (including [remote datastores](ORDA/remoteDatastores.md)). It is intended to be used once, for example in the `On Startup` database method. + +When this function is not called, new entity selections can be shareable, depending on the nature of their "parent", or [how they are created](ORDA/entities.md#shareable-or-non-shareable-entity-selections). + +> This function does not modify entity selections created by [`.copy()`](#copy) or `OB Copy` when the explicit `ck shared` option is used. + + +> **Compatibility**: This function must only be used in projects converted from 4D versions prior to 4D v18 R5 and containing [.add()](entitySelectionClass.md#add) calls. In this context, using `.makeSelectionsAlterable()` can save time by restoring instantaneously the previous 4D behavior in existing projects. On the other hand, using this method in new projects created in 4D v18 R5 and higher **is not recommended**, since it prevents entity selections to be shared, which provides greater performance and scalabitlity. + + + + ## .provideDataKey() @@ -525,7 +559,7 @@ If no *curPassphrase* or *curDataKey* is given, `.provideDataKey()` returns **nu #### Example -```4d +```4d var $keyStatus : Object var $passphrase : Text @@ -539,7 +573,7 @@ If no *curPassphrase* or *curDataKey* is given, `.provideDataKey()` returns **nu End if End if ``` - + @@ -587,7 +621,7 @@ For a description of the ORDA request log format, please refer to the [**ORDA cl You want to log ORDA client requests in a file and use the log sequence number: -```4d +```4d var $file : 4D.File var $e : cs.PersonsEntity @@ -604,7 +638,7 @@ You want to log ORDA client requests in a file and use the log sequence number: You want to log ORDA client requests in memory: -```4d +```4d var $es : cs.PersonsSelection var $log : Collection @@ -617,7 +651,7 @@ You want to log ORDA client requests in memory: $log:=ds.getRequestLog() ALERT("The longest request lasted: "+String($log.max("duration"))+" ms") ``` - + @@ -653,7 +687,7 @@ You can nest several transactions (sub-transactions). Each transaction or sub-tr #### Example -```4d +```4d var $connect; $status : Object var $person : cs.PersonsEntity var $ds : cs.DataStore @@ -683,13 +717,14 @@ You can nest several transactions (sub-transactions). Each transaction or sub-tr $ds.validateTransaction() End if ``` - + + ## .stopRequestLog() diff --git a/website/translated_docs/es/API/entitySelectionClass.md b/website/translated_docs/es/API/entitySelectionClass.md index 4f580a0d48ee07..64b9afa2f892f6 100644 --- a/website/translated_docs/es/API/entitySelectionClass.md +++ b/website/translated_docs/es/API/entitySelectionClass.md @@ -23,6 +23,7 @@ An entity selection is an object containing one or more reference(s) to [entitie | [](#extract)

        | | [](#first)

        | | [](#getdataclass)

        | +| [](#isalterable)

        | | [](#isordered)

        | | [](#last)

        | | [](#length)

        | @@ -43,6 +44,46 @@ An entity selection is an object containing one or more reference(s) to [entitie + +**Create entity selection** ( *dsTable* : Table { ; *settings* : Object } ) : 4D.EntitySelection + + +| Parameter | Type | | Description | +| --------- | ------------------ |:--:| ------------------------------------------------------------------------------------------- | +| dsTable | Table | -> | Table in the 4D database whose current selection will be used to build the entity selection | +| settings | Object | -> | Build option: context | +| Result | 4D.EntitySelection | <- | Entity selection matching the dataclass related to the given table | + + + +#### Description + +The `Create entity selection` command builds and returns a new, [alterable](ORDA/entities.md#shareable-or-alterable-entity-selections) entity selection related to the dataclass matching the given *dsTable*, according to the current selection of this table. + +If the current selection is sorted, an [ordered](ORDA/dsMapping.md#ordered-or-unordered-entity-selection) entity selection is created (the order of the current selection is kept). If the current selection is unsorted, an unordered entity selection is created. + +If the *dsTable* is not exposed in [`ds`](API/datastoreClass.md#ds), an error is returned. This command cannot be used with a Remote datastore. + +In the optional *settings* parameter, you can pass an object containing the following property: + +| Property | Type | Description | +| -------- | ---- | ----------------------------------------------------------------------------------------------------------------- | +| context | Text | Label for the [optimization context](ORDA/entities.md#clientserver-optimization) applied to the entity selection. | + + +#### Example + +```4d +var $employees : cs.EmployeeSelection +ALL RECORDS([Employee]) +$employees:=Create entity selection([Employee]) +// The $employees entity selection now contains a set of reference +// on all entities related to the Employee dataclass +``` + +#### See also + +[`dataClass.newSelection()`](dataclassClass.md#newselection) ## [*index*] @@ -181,10 +222,10 @@ The resulting object is an entity selection of Employee with duplications remove ## .add()

    History -| Version | Changes | -| ------- | --------------------------------------------- | -| v18 R5 | Only supports non-shareable entity selections | -| v17 | Added | +| Version | Changes | +| ------- | ----------------------------------------- | +| v18 R5 | Only supports alterable entity selections | +| v17 | Added |
    @@ -204,7 +245,7 @@ The resulting object is an entity selection of Employee with duplications remove The `.add()` function adds the specified *entity* to the entity selection and returns the modified entity selection. > This function modifies the original entity selection. -**Warning:** The entity selection must be *non-shareable*, i.e. it has been created for example by [`.newSelection()`](dataclassClass.md#newselection) or `Create entity selection`, otherwise `.add()` will return an error. Shareable entity selections do not accept the addition of entities. For more information, please refer to the [Shareable vs Non-shareable entity selections](ORDA/entities.md#shareable-or-non-shareable-entity-selections) section. +**Warning:** The entity selection must be *alterable*, i.e. it has been created for example by [`.newSelection()`](dataclassClass.md#newselection) or `Create entity selection`, otherwise `.add()` will return an error. Shareable entity selections do not accept the addition of entities. For more information, please refer to the [Shareable or alterable entity selections](ORDA/entities.md#shareable-or-alterable-entity-selections) section. * If the entity selection is ordered, *entity* is added at the end of the selection. If a reference to the same entity already belongs to the entity selection, it is duplicated and a new reference is added. @@ -482,9 +523,9 @@ The `.copy()` function returns > This function does not modify the original entity selection. -By default, if the *option* parameter is omitted, the function returns a new, non-shareable entity selection (even if the function is applied to a shareable entity selection). Pass the `ck shared` constant in the *option* parameter if you want to create a shareable entity selection. +By default, if the *option* parameter is omitted, the function returns a new, alterable entity selection (even if the function is applied to a shareable entity selection). Pass the `ck shared` constant in the *option* parameter if you want to create a shareable entity selection. -> For information on the shareable property of entity selections, please refer to the [Shareable vs Non-shareable entity selections](ORDA/entities.md#shareable-or-non-shareable-entity-selections) section. +> For information on the shareable property of entity selections, please refer to the [Shareable or alterable entity selections](ORDA/entities.md#shareable-or-alterable-entity-selections) section. #### Example @@ -806,6 +847,7 @@ There is, however, a difference between both statements when the selection is em **.getDataClass()** : 4D.DataClass + | Parameter | Type | | Description | | --------- | ------------ |:--:| ------------------------------------------------------ | @@ -842,6 +884,47 @@ The following generic code duplicates all entities of the entity selection: + +## .isAlterable() + +
    History + +| Version | Changes | +| ------- | ------- | +| v18 R5 | Added | + +
    + + +**.isAlterable()** : Boolean + + +| Parameter | Type | | Description | +| --------- | ------- |:--:| ---------------------------------------------------------- | +| Result | Boolean | <- | True if the entity selection is alterable, False otherwise | + + +#### Description + +The `.isAlterable()` function returns True if the entity selection is alterable, and False if the entity selection is not alterable. + +For more information, please refer to [Shareable or alterable entity selections](ORDA/entities.md#shareable-or-alterable-entity-selections). + +#### Example + +You are about to display `Form.products` in a [list box](FormObjects/listbox_overview.md) to allow the user to add new products. You want to make sure it is alterable so that the user can add new products without error: + +```4d +If (Not(Form.products.isAlterable())) + Form.products:=Form.products.copy() +End if +... +Form.products.add(Form.product) +``` + + + + ## .isOrdered() @@ -988,6 +1071,7 @@ Entity selections always have a `.length` property. **.max**( *attributePath* : Text ) : any + | Parameter | Type | | Description | | ------------- | ---- |:--:| ------------------------------------------------ | @@ -1898,6 +1982,7 @@ Returns: "lastName": "Durham" } ] + ``` #### Example 4 @@ -2090,6 +2175,7 @@ Returns: }, { "firstName": "Gary", + "lastName": "Reichert", "directReports": [ { diff --git a/website/translated_docs/es/API/webServerClass.md b/website/translated_docs/es/API/webServerClass.md index b86aa4a1d4776e..f3c251474b9fb5 100644 --- a/website/translated_docs/es/API/webServerClass.md +++ b/website/translated_docs/es/API/webServerClass.md @@ -77,7 +77,7 @@ They provide the following properties and functions: -The `WEB Server` command returns the default Web server object, or the Web server object defined through the option parameter. +The `WEB Server` commandreturns the default Web server object, or the Web server object defined through the option parameter. By default, if the *option* parameter is omitted, the command returns a reference to the Web server of the database, i.e. the default Web server. To designate the Web server to return, you can pass one of the following constants in the *option* parameter: @@ -122,7 +122,7 @@ From your component, you want to know if the Web server of the host database is -The `WEB Server list` command returns a collection of all Web server objects available in the 4D application. +The `WEB Server list` commandreturns a collection of all Web server objects available in the 4D application. A 4D application can contain anywhere from one to several Web servers: @@ -561,7 +561,7 @@ Possible values: 500000 - 2147483648 **.maxSessions** : Number -The maximum number of simultaneous sessions. When you reach the limit, the oldest session is closed (and `On Web Close Process` database method is called) if the web server needs to create a new one. The number of simultaneous sessions cannot exceed the total number of web processes (maxConcurrentProcesses property, 100 by default) +The maximum number of simultaneous sessions. When you reach the limit, the oldest session is closed (and `On Web Close Process` database method is called) if the web server needs to create a new one. When you reach the limit, the oldest session is closed (and `On Web Close Process` database method is called) if the web server needs to create a new one. diff --git a/website/translated_docs/es/API/zipArchiveClass.md b/website/translated_docs/es/API/zipArchiveClass.md index d31e4972f79caf..cccf42b7959584 100644 --- a/website/translated_docs/es/API/zipArchiveClass.md +++ b/website/translated_docs/es/API/zipArchiveClass.md @@ -63,7 +63,7 @@ End if #### Description -The `ZIP Create archive` command creates a compressed ZIP archive object and returns the status of the operation. +The `ZIP Create archive` commandcreates a compressed ZIP archive object and returns the status of the operation. You can pass a 4D.File, a 4D.Folder, or a zip structure object as first parameter: @@ -285,7 +285,7 @@ You want to pass a collection of folders and files to compress to the *zipStruct #### Description -The `ZIP Read archive` command retrieves the contents of *zipFile* and returns it as a `4D.ZipArchive` object. +The `ZIP Read archive` commandretrieves the contents of *zipFile* and returns it as a `4D.ZipArchive` object. diff --git a/website/translated_docs/es/Admin/building.md b/website/translated_docs/es/Admin/building.md index 97978617c5bf74..44219b522320e6 100644 --- a/website/translated_docs/es/Admin/building.md +++ b/website/translated_docs/es/Admin/building.md @@ -238,10 +238,6 @@ Used to indicate the current version number for the application generated. You m #### Data linking mode -This option lets you choose the linking mode between the merged application and the local data file. - -#### Data linking mode - This option lets you choose the linking mode between the merged application and the local data file. Two data linking modes are available: * **By application name** (default) - The 4D application automatically opens the most recently opened data file corresponding to the structure file. This allows you to move the application package freely on the disk. This option should generally be used for merged applications, unless you specifically need to duplicate your application. @@ -295,8 +291,6 @@ In some cases, you may want to prevent client applications from being able to ca To force the update, simply exclude the current version number of client applications (X-1 and earlier) in the version number range compatible with the server application. In this case, the update mechanism will not allow non-updated client applications to connect. For example, if the new version of the client-server application is 6, you can stipulate that any client application with a version number lower than 6 will not be allowed to connect. -The [current version number](build-server-application) is set on the Client/Server page of the Build Application dialog box. - The [current version number](#current_version) is set on the Client/Server page of the Build Application dialog box. The intervals of authorized numbers are set in the application project using specific [XML keys](#build-application-settings). @@ -324,8 +318,6 @@ The contents of these folders vary depending on the current platform: > The macOS packages built contain the same items as the Windows subfolders. You can display their contents (**Control+click** on the icon) in order to be able to modify them. -If you checked the “Allow automatic update of client application” option, an additional subfolder called *Upgrade4DClient* is added in the *\Server* folder/package.
  • - If you checked the “Allow automatic update of client application” option, an additional subfolder called *Upgrade4DClient* is added in the *\Server* folder/package. This subfolder contains the client application in macOS and/or Windows format as a compressed file. This file is used during the automatic client application update. diff --git a/website/translated_docs/es/Concepts/classes.md b/website/translated_docs/es/Concepts/classes.md index cbb21b6b1c8c0d..2bba6eff1a6482 100644 --- a/website/translated_docs/es/Concepts/classes.md +++ b/website/translated_docs/es/Concepts/classes.md @@ -495,7 +495,7 @@ $message:=$square.description() //I have 4 sides which are all equal The `This` keyword returns a reference to the currently processed object. In 4D, it can be used in [different contexts](https://doc.4d.com/4Dv18/4D/18/This.301-4504875.en.html). -In most cases, the value of `This` is determined by how a function is called. It can't be set by assignment during execution, and it may be different each time the function is called. It can't be set by assignment during execution, and it may be different each time the function is called. +In most cases, the value of `This` is determined by how a function is called. It can't be set by assignment during execution, and it may be different each time the function is called. When a formula is called as a member method of an object, its `This` is set to the object the method is called on. For example: @@ -557,13 +557,6 @@ Several commands of the 4D language allows you to handle class features. `OB Class` returns the class of the object passed in parameter. -### OB Instance of - -#### OB Instance of ( object ; class ) -> Boolean - -`OB Instance of` returns `true` if `object` belongs to `class` or to one of its inherited classes, and `false` otherwise.

    - - ### OB Instance of #### OB Instance of ( object ; class ) -> Boolean diff --git a/website/translated_docs/es/Concepts/parameters.md b/website/translated_docs/es/Concepts/parameters.md index c85bf2f4891c87..529341f7ae0e66 100644 --- a/website/translated_docs/es/Concepts/parameters.md +++ b/website/translated_docs/es/Concepts/parameters.md @@ -53,9 +53,10 @@ Input and output values are [evaluated](#values-or-references) at the moment of > Both [named](#named-parameters) and [sequential](#sequential-parameters) variables syntaxes can be mixed with no restriction to declare parameters. For example: > > ```4d -Function add($x : Integer) - var $0;$2 : Integer - $0:=$x+$2 +```4d + Function add($x : Integer) + var $0;$2 : Integer + $0:=$x+$2 ``` @@ -63,7 +64,7 @@ Function add($x : Integer) ## Named parameters -Inside called methods or class functions, parameter values are assigned to local variables. You can declare parameters using a **parameter name** along with a **parameter type**, separated by colon. +Input and output values are [evaluated](#values-or-references) at the moment of the call and copied into local variables within the called class function or method. Two syntaxes are proposed to declare variable parameters in the called code: - For class functions, parameters are declared along with the `Function` keyword. - For methods (project methods, form object methods, database methods, and triggers), parameters are declared using the `#DECLARE` keyword at the beginning of the method code. @@ -465,7 +466,7 @@ APPEND TEXT(vtSomeText;"";$wpArea) //Displays text message and writes it to $wpA ## Values or references -When you pass a parameter, 4D always evaluates the parameter expression in the context of the calling method and sets the **resulting value** to the local variables in the class function or subroutine. The local variables/parameters are not the actual fields, variables, or expressions passed by the calling method; they only contain the values that have been passed. Since its scope is local, if the value of a parameter is modified in the class function/subroutine, it does not change the value in the calling method. For example: +When you pass a parameter, 4D always evaluates the parameter expression in the context of the calling method and sets the **resulting value** to the local variables in the class function or subroutine. The local variables/parameters are not the actual fields, variables, or expressions passed by the calling method; they only contain the values that have been passed. The local variables/parameters are not the actual fields, variables, or expressions passed by the calling method; they only contain the values that have been passed. For example: ```4d //Here is some code from the method MY_METHOD diff --git a/website/translated_docs/es/Events/onAfterEdit.md b/website/translated_docs/es/Events/onAfterEdit.md index 4e95b7529dc1f0..4c9580463ea7e5 100644 --- a/website/translated_docs/es/Events/onAfterEdit.md +++ b/website/translated_docs/es/Events/onAfterEdit.md @@ -96,8 +96,6 @@ Here is an example handling an `On After Edit` event: from "+String(FORM Event.oldValue)+\ " to "+String(FORM Event.newValue)+"!") End if - End if - End if End if ``` diff --git a/website/translated_docs/es/Events/onCloseBox.md b/website/translated_docs/es/Events/onCloseBox.md index 36f0caaee610d5..5c0bff081375fc 100644 --- a/website/translated_docs/es/Events/onCloseBox.md +++ b/website/translated_docs/es/Events/onCloseBox.md @@ -24,7 +24,6 @@ This example shows how to respond to a close window event with a form used for r :(Form event code=On Close Box) If(Modified record($vpFormTable->)) CONFIRM("This record has been modified. Save Changes?") - Save Changes?") If(OK=1) ACCEPT Else diff --git a/website/translated_docs/es/FormObjects/properties_Action.md b/website/translated_docs/es/FormObjects/properties_Action.md index 448504cefcdca2..7779fa5bb6e0a5 100644 --- a/website/translated_docs/es/FormObjects/properties_Action.md +++ b/website/translated_docs/es/FormObjects/properties_Action.md @@ -99,7 +99,7 @@ Several types of method references are supported: - a project method name: name of an existing project method without file extension, i.e.: `myMethod` In this case, 4D does not provide automatic support for object operations. - a custom method file path including the .4dm extension, e.g.: - `ObjectMethods/objectName.4dm` You can also use a filesystem: + `../../CustomMethods/myMethod.4dm` You can also use a filesystem: `/RESOURCES/Buttons/bOK.4dm` In this case, 4D does not provide automatic support for object operations. diff --git a/website/translated_docs/es/ORDA/entities.md b/website/translated_docs/es/ORDA/entities.md index afa3396ee84d0d..392c0c4065b6ef 100644 --- a/website/translated_docs/es/ORDA/entities.md +++ b/website/translated_docs/es/ORDA/entities.md @@ -184,71 +184,109 @@ You can create an object of type [entity selection](dsMapping.md#entity-selectio You can simultaneously create and use as many different entity selections as you want for a dataclass. Keep in mind that an entity selection only contains references to entities. Different entity selections can contain references to the same entities. -### Shareable or non-shareable entity selections +### Shareable or alterable entity selections -An entity selection can be **shareable** (readable by multiple processes, but not modifiable after creation) or **non-shareable** (only usable by the current process, but modifiable afterwards): +An entity selection can be **shareable** (readable by multiple processes, but not alterable after creation) or **alterable** (supports the [`.add()`](API/entitySelectionClass.md#add) function, but only usable by the current process). -- a **shareable** entity selection has the following characteristics: - - it can be stored in a shared object or shared collection, and can be shared between several processes or workers; - - it can be stored in several shared objects or collections, or in a shared object or collection which already belongs to a group (it does not have a *locking identifier*); - - it does not allow the addition of new entities. Trying to add an entity to a shareable entity selection will trigger an error (1637 - This entity selection cannot be altered). To add an entity to a shareable entity selection, you must first transform it into a non-shareable entity selection using the [`.copy()`](API/entitySelectionClass.md#copy) function, before calling [`.add()`](API/entitySelectionClass.md#add). +#### Properties -- a **non-shareable** entity selection has the following characteristics: - + it cannot be shared between processes, nor be stored in a shared object or collection. Trying to store a non-shareable entity selection in a shared object or collection will trigger an error (-10721 - Not supported value type in a shared object or shared collection); - + it accepts the addition of new entities. +A **shareable** entity selection has the following characteristics: -In most cases, new entity selections are **shareable**, including: +- it can be stored in a shared object or shared collection, and can be passed as parameter between several processes or workers; +- it can be stored in several shared objects or collections, or in a shared object or collection which already belongs to a group (it does not have a *locking identifier*); +- it does not allow the addition of new entities. Trying to add an entity to a shareable entity selection will trigger an error (1637 - This entity selection cannot be altered). To add an entity to a shareable entity selection, you must first transform it into a non-shareable entity selection using the [`.copy()`](API/entitySelectionClass.md#copy) function, before calling [`.add()`](API/entitySelectionClass.md#add). -- entity selections resulting from various ORDA class functions ([`.query()`](API/entitySelectionClass.md#query), [`.query()`](API/dataclassClass.md#query), etc.), -- entity selections based upon relations (e.g. `company.employee`), -- entity selections resulting from projections of values (e.g. `ds.Employee.all().employer`), -- entity selections explicitely copied as shareable with [`.copy()`](API/entitySelectionClass.md#copy) or `OB Copy`. +> Most entity selection functions (such as [`.slice()`](API/entitySelectionClass.md#slice), [`.and()`](API/entitySelectionClass.md#and)...) support shareable entity selections since they do not need to alter the original entity selection (they return a new one). -New entity selections are **non-shareable** in the following cases: +An **alterable** entity selection has the following characteristics: -- blank entity selections created using the [`.newSelection()`](API/dataclassClass.md#newselection) function or `Create entity selection` command, -- entity selections explicitely copied as non-shareable with [`.copy()`](API/entitySelectionClass.md#copy) or `OB Copy`. +- it cannot be shared between processes, nor be stored in a shared object or collection. Trying to store a non-shareable entity selection in a shared object or collection will trigger an error (-10721 - Not supported value type in a shared object or shared collection); +- it accepts the addition of new entities, i.e. it is supports the [`.add()`](API/entitySelectionClass.md#add) function. -#### Example + +#### How are they defined? + +The **shareable** or **alterable** nature of an entity selection is defined when the entity selection is created (it cannot be modified afterwards). You can know the nature of an entity selection using the [.isAlterable()](API/entitySelectionClass.md#isalterable) function or the `OB Is shared` command. + + +A new entity selection is **shareable** in the following cases: + +- the new entity selection results from an ORDA class function applied to a dataClass: [dataClass.all()](API/dataclassClass.md#all), [dataClass.fromCollection()](API/dataclassClass.md#fromcollection), [dataClass.query()](API/dataclassClass.md#query), +- the new entity selection is based upon a relation [entity.*attributeName*](API/entityClass.md#attributename) (e.g. "company.employees") when *attributeName* is a one-to-many related attribute but the entity does not belong to an entity selection. +- the new entity selection is explicitely copied as shareable with [entitySelection.copy()](API/entitySelectionClass.md#copy) or `OB Copy` (i.e. with the `ck shared` option). + +Example: +```4d +$myComp:=ds.Company.get(2) //$myComp does not belong to an entity selection +$employees:=$myComp.employees //$employees is shareable +``` + +A new entity selection is **alterable** in the following cases: + +- the new entity selection created blank using the [dataClass.newSelection()](API/dataclassClass.md#newselection) function or `Create entity selection` command, +- the new entity selection is explicitely copied as alterable with [entitySelection.copy()](API/entitySelectionClass.md#copy) or `OB Copy` (i.e. without the `ck shared` option). + +Example: +```4d +$toModify:=ds.Company.all().copy() //$toModify is alterable +``` + + +A new entity selection **inherits** from the original entity selection nature in the following cases: + +- the new entity selection results from one of the various ORDA class functions applied to an existing entity selection ([.query()](API/entitySelectionClass.md#query), [.slice()](API/entitySelectionClass.md#slice), etc.) . +- the new entity selection is based upon a relation: + - [entity.*attributeName*](API/entityClass.md#attributename) (e.g. "company.employees") when *attributeName* is a one-to-many related attribute and the entity belongs to an entity selection (same nature as [.getSelection()](API/entityClass.md#getselection) entity selection), + - [entitySelection.*attributeName*](API/entitySelectionClass.md#attributename) (e.g. "employees.employer") when *attributeName* is a related attribute (same nature as the entity selection), + - [.extract()](API/entitySelectionClass.md#extract) when the resulting collection contains entity selections (same nature as the entity selection). + +Examples: + +```4d +$highSal:=ds.Employee.query("salary >= :1"; 1000000) + //$highSal is shareable because of the query on dataClass +$comp:=$highSal.employer //$comp is shareable because $highSal is shareable + +$lowSal:=ds.Employee.query("salary <= :1"; 10000).copy() + //$lowSal is alterable because of the copy() +$comp2:=$lowSal.employer //$comp2 is alterable because $lowSal is alterable +``` + + +#### Sharing an entity selection between processes (example) You work with two entity selections that you want to pass to a worker process so that it can send mails to appropriate persons: ```4d - If(Storage.info=Null) - Use(Storage) - Storage.info:=New shared object() - End use - End if - Use(Storage.info) - //Put entity selections in a shared object - Storage.info.paid:=ds.Invoices.query("status=:1";"Paid") - Storage.info.unpaid:=ds.Invoices.query("status=:1";"Unpaid") - End use +var $paid; $unpaid : cs.InvoicesSelection +//We get entity selections for paid and unpaid invoices +$paid:=ds.Invoices.query("status=:1"; "Paid") +$unpaid:=ds.Invoices.query("status=:1"; "Unpaid") + +//We pass entity selection references as parameters to the worker +CALL WORKER("mailing"; "sendMails"; $paid; $unpaid) + +``` - CALL WORKER("mailing";"sendMails";Storage.info) -The sendMails method: +The `sendMails` method: - var $info: ;$1Object - var $paid;$unpaid : cs.InvoicesSelection +```4d + + #DECLARE ($paid : cs.InvoicesSelection; $unpaid : cs.InvoicesSelection) var $invoice : cs.InvoicesEntity - var $server;$transporter;$email;$status : Object + var $server; $transporter; $email; $status : Object //Prepare emails - $server:=New object + $server:=New object() $server.host:="exchange.company.com" $server.user:="myName@company.com" $server.password:="my!!password" $transporter:=SMTP New transporter($server) - $email:=New object + $email:=New object() $email.from:="myName@company.com" - //Get entity selections - $info:=$1 - $paid:=$info.paid - $unpaid:=$info.unpaid - //Loops on entity selections For each($invoice;$paid) $email.to:=$invoice.customer.address // email address of the customer @@ -385,6 +423,7 @@ The following methods automatically associate the optimization context of the so * `entitySelection.drop()` + **Example** Given the following code: diff --git a/website/translated_docs/es/REST/manData.md b/website/translated_docs/es/REST/manData.md index 6aa983fc269635..175b3de414697e 100644 --- a/website/translated_docs/es/REST/manData.md +++ b/website/translated_docs/es/REST/manData.md @@ -18,7 +18,7 @@ To query data directly, you can do so using the [`$filter`]($filter.md) function With the REST API, you can perform all the manipulations to data as you can in 4D. -To add and modify entities, you can call [`$method=update`]($method.md#methodupdate). Before saving data, you can also validate it beforehand by calling [`$method=validate`]($method.md#methodvalidate). If you want to delete one or more entities, you can use [`$method=delete`]($method.md#methoddelete). +To add and modify entities, you can call [`$method=update`]($method.md#methodupdate). If you want to delete one or more entities, you can use [`$method=delete`]($method.md#methoddelete). Besides retrieving a single entity in a dataclass using [{dataClass}({key})](%7BdataClass%7D_%7Bkey%7D.html), you can also write a [class function](classFunctions.md#function-calls) that returns an entity selection (or a collection). diff --git a/website/translated_docs/fr/API/classClass.md b/website/translated_docs/fr/API/classClass.md index 73d873ae3736e8..1af48114579a7c 100644 --- a/website/translated_docs/fr/API/classClass.md +++ b/website/translated_docs/fr/API/classClass.md @@ -4,11 +4,11 @@ title: Class --- -Lorsqu'une classe utilisateur est [définie](Concepts/classes.md#class-definition) dans le projet, elle est chargée dans l'environnement de langage 4D. Une classe est un objet lui-même, de la classe "Class", qui a des propriétés et une fonction. +When a user class is [defined](Concepts/classes.md#class-definition) in the project, it is loaded in the 4D language environment. A class is an object itself, of "Class" class, which has properties and a function. -### Sommaire +### Summary | | @@ -22,10 +22,10 @@ Lorsqu'une classe utilisateur est [définie](Concepts/classes.md#class-definitio ## .name -
    Historique -| Version | Modifications | -| ------- | ------------- | -| v18 R3 | Ajoutées | +
    History +| Version | Changes | +| ------- | ------- | +| v18 R3 | Added |
    @@ -34,9 +34,9 @@ Lorsqu'une classe utilisateur est [définie](Concepts/classes.md#class-definitio #### Description -La propriété `.name` contient le nom de l'objet `4D.Class`. Les noms de classe sont sensibles à la casse. +The `.name` property contains the name of the `4D.Class` object. Class names are case sensitive. -Cette propriété est en **lecture seule**. +This property is **read-only**. @@ -45,65 +45,80 @@ Cette propriété est en **lecture seule**. ## .new() -
    Historique -| Version | Modifications | -| ------- | ------------- | -| v18 R3 | Ajoutées | +
    History +| Version | Changes | +| ------- | ------- | +| v18 R3 | Added |
    **.new()** : 4D.Class -| Paramètres | Type | | Description | -| ---------- | -------- |:--:| ------------------------- | -| Résultat | 4D.Class | <- | Nouvel objet de la classe | +| Parameter | Type | | Description | +| --------- | -------- |:--:| ----------------------- | +| Result | 4D.Class | <- | New object of the class | #### Description -La `.new()` function crée et returne un objet `cs.className` qui est une nouvelle instance de la classe sur laquelle il est appelé. Cette fonction est automatiquement disponible sur toutes les classes à partir du class store [`cs`](Concepts/classes.md#cs). +The `.new()` function creates and returns a `cs.className` object which is a new instance of the class on which it is called. This function is automatically available on all classes from the [`cs` class store](Concepts/classes.md#cs). -S'il est appelé sur une classe inexistante, une erreur est retournée. +If it is called on a non-existing class, an error is returned. -#### Exemple +#### Example -Pour créer une nouvelle instance de la classe Person : +To create a new instance of the Person class: ```4d var $person : cs.Person -$person:=cs.Person.new() //créer la nouvelle instance -//$Person contient les fonctions de la classe -```## .superclass +$person:=cs.Person.new() //create the new instance +//$Person contains functions of the class +``` + + + + + + +## .superclass -
    Historique -| Version | Modifications | -| ------- | ------------- | -| v18 R3 | Ajoutées | +
    History +| Version | Changes | +| ------- | ------- | +| v18 R3 | Added | -
    **.superclass** : 4D.Class#### Description +
    + + +**.superclass** : 4D.Class + +#### Description -La propriété `.superclass`retourne la classe parente de la classe. Une superclasse peut être un objet `4D.Class`, ou un objet `cs.className`. Si la classe n'a pas de classe parente, la propriété renvoie **null**. +The `.superclass` property returns the parent class of the class. A superclass can be a `4D.Class` object, or a `cs.className` object. If the class does not have a parent class, the property returns **null**. -Une superclasse de classe utilisateur est déclarée dans une classe à l'aide du mot-clé [`Class extend`](Concepts/classes.md#class-extends-classname). +A superclass of a user class is declared in a class by using the [`Class extends `](Concepts/classes.md#class-extends-classname) keyword. -Cette propriété est en **lecture seule**. +This property is **read-only**. -#### Exemples +#### Examples ```4d $sup:=4D.File.superclass //Document $sup:=4D.Document.superclass //Object $sup:=4D.Object.superclass //null -// Si vous avez créé une classe MyFile -// avec `Class extends File` +// If you created a MyFile class +// with `Class extends File` $sup:=cs.MyFile.superclass //File ``` -**Voir également :** [Super](Concepts/classes.md#super) +**See also:** [Super](Concepts/classes.md#super) + + + diff --git a/website/translated_docs/fr/API/collectionClass.md b/website/translated_docs/fr/API/collectionClass.md index 75989fdf10162c..43c56f3ee7915b 100644 --- a/website/translated_docs/fr/API/collectionClass.md +++ b/website/translated_docs/fr/API/collectionClass.md @@ -4,9 +4,9 @@ title: Collection --- -La classe Collection gère les variables de type [Collection](Concepts/dt_collection.md). +The Collection class manages [Collection](Concepts/dt_collection.md) type variables. -Une collection est initialisée avec : +A collection is initialized with: | | | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | @@ -14,14 +14,15 @@ Une collection est initialisée avec : | [](#new-shared-collection)

        | -### Exemple +### Example ```4d - var $colVar : Collection //création d'une variable 4D de type collection. $colVar:=New $colVar:=New collection //initialisation de la collection et assignation à la variable 4D + var $colVar : Collection //creation of collection type 4D variable + $colVar:=New collection //initialization of the collection and assignment to the 4D variable ``` -### Sommaire +### Summary | | @@ -68,53 +69,53 @@ Une collection est initialisée avec : -## Nouvelle collection +## New collection -

    Historique -| Version | Modifications | -| ------- | ------------- | -| v16 R4 | Ajoutées | +
    History +| Version | Changes | +| ------- | ------- | +| v16 R4 | Added |
    **New collection** {( *...value* : any )} : Collection -| Paramètres | Type | | Description | -| ---------- | -------------------------------------------------------------------------- |:--:| ----------------------- | -| value | Numérique, Texte, Date, Heure, Booléen, Objet, Collection, Image, Pointeur | -> | Valeur(s) de collection | -| Résultat | Collection | <- | Nouvelle collection | +| Parameter | Type | | Description | +| --------- | ----------------------------------------------------------------------- |:--:| --------------------- | +| value | Number, Text, Date, Time, Boolean, Object, Collection, Picture, Pointer | -> | Collection's value(s) | +| Result | Collection | <- | New collection | #### Description -La commande `New collection` crée une nouvelle collection vide ou préremplie et retourne sa référence. +The `New collection` command creates a new empty or prefilled collection and returns its reference. -Si vous ne passez aucun paramètre, `New collection` crée une collection vide et retourne sa référence. +If you do not pass any parameters, `New collection` creates an empty collection and returns its reference. -Vous devez affecter la référence retournée à une variable 4D de type Collection. -> Gardez à l'esprit que les instructions `var : Collection` ou `C_COLLECTION` déclarent une variable de type `Collection` mais ne créent aucune collection. +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 does not create any collection. -En option, vous pouvez préremplir la nouvelle collection en utilisant une ou plusieurs valeur(s) (*value*(s)) en tant que paramètre(s). +Optionally, you can prefill the new collection by passing one or several *value*(s) as parameter(s). -Sinon, vous pouvez ajouter ou modifier des éléments ultérieurement par affectation. Par exemple: +Otherwise, you can add or modify elements subsequently through assignment. For example: ```4d myCol[10]:="My new element" ``` -Si le nouvel indice de l'élément est au-delà du dernier élément existant de la collection, la collection est automatiquement redimensionnée et tous les nouveaux éléments intermédiaires sont attribués une valeur **null**. +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. -Vous pouvez passer n'importe quel nombre de valeurs de n'importe quel type pris en charge (number, text, date, picture, pointer, object, collection...). Contrairement aux tableaux, les collections peuvent mélanger des données de différents types. +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. -Vous devez prêter attention aux problèmes de conversion suivants : +You must pay attention to the following conversion issues: -* Si vous passez un pointeur, il est conservé "tel quel"; il est évalué à l'aide de la commande `JSON Stringify` -* Les dates sont stockées sous la forme de date « aaaa-mm-jj » ou des chaînes au format « AAAA-MM-JJTHH: ss.SSSZ: mm » , selon la configuration actuelle « dates à l'intérieur des objets » de la base de données. Lors de la conversion de dates 4D en texte avant de les stocker dans la collection, par défaut le programme prend en compte le fuseau horaire local. Vous pouvez modifier ce comportement à l'aide du sélecteur `Dates inside objects` de la commande `SET DATABASE PARAMETER`. -* Si vous passez une heure, elle est stockée sous la forme d'un nombre de millisecondes (Réel). +* 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). -#### Exemple 1 +#### Example 1 @@ -126,7 +127,7 @@ You want to create a new empty collection and assign it to a 4D collection varia //$myCol=[] ``` -#### Exemple 2 +#### Example 2 You want to create a prefilled collection: @@ -144,7 +145,7 @@ You create a new collection and then add a new element: var $coll : Collection $coll:=New collection("a";"b";"c") //$coll=["a","b","c"] - $coll[9]:="z" //ajouter un 10e élément avec la valeur "z" + $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"] ``` @@ -152,22 +153,22 @@ You create a new collection and then add a new element: -## Nouvelle collection partagée +## New shared collection -
    Historique -| Version | Modifications | -| ------- | ------------- | -| v16 R6 | Ajoutées | +
    History +| Version | Changes | +| ------- | ------- | +| v16 R6 | Added |
    **New shared collection** {( *...value* : any )} : Collection -| Paramètres | Type | | Description | -| ---------- | ------------------------------------------------------------------- |:--:| ----------------------------------- | -| value | Number, Text, Date, Time, Boolean, Shared object, Shared collection | -> | Valeur(s) de la collection partagée | -| Résultat | Collection | <- | Nouvelle collection partagée | +| Parameter | Type | | Description | +| --------- | ------------------------------------------------------------------- |:--:| ---------------------------- | +| value | Number, Text, Date, Time, Boolean, Shared object, Shared collection | -> | Shared collection's value(s) | +| Result | Collection | <- | New shared collection | @@ -180,8 +181,8 @@ Adding an element to this collection must be surrounded by the [`Use...End`](Con If you do not pass any parameters, `New shared collection` creates an empty shared collection and returns its reference. -Vous devez affecter la référence retournée à une variable 4D de type Collection. -> Gardez à l'esprit que les instructions `var : Collection` ou `C_COLLECTION` déclarent une variable de type `Collection` mais ne créent aucune collection. +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 does 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). @@ -190,7 +191,7 @@ If the new element index is beyond the last existing element of the shared colle You can pass any number of values of the following supported types: * number (real, longint...). Number values are always stored as reals. -* Texte +* text * boolean * date * time (stored as number of milliseconds - real) @@ -201,7 +202,7 @@ You can pass any number of values of the following supported types: (*)When a shared object or collection is added to a shared collection, they share the same *locking identifier*. For more information on this point, refer to the **4D Developer**'s guide. -#### Exemple +#### Example ```4d $mySharedCol:=New shared collection("alpha";"omega") @@ -215,10 +216,10 @@ You can pass any number of values of the following supported types: ## .average() -
    Historique -| Version | Modifications | -| ------- | ------------- | -| v16 R6 | Ajoutées | +
    History +| Version | Changes | +| ------- | ------- | +| v16 R6 | Added |
    @@ -226,10 +227,10 @@ You can pass any number of values of the following supported types: -| Paramètres | Type | | Description | +| Parameter | Type | | Description | | ------------ | --------------- |:--:| ----------------------------------------------- | -| propertyPath | Texte | -> | Object property path to be used for calculation | -| Résultat | Real, Undefined | <- | Arithmetic mean (average) of collection values | +| propertyPath | Text | -> | Object property path to be used for calculation | +| Result | Real, Undefined | <- | Arithmetic mean (average) of collection values | @@ -251,7 +252,7 @@ If the collection contains objects, pass the *propertyPath* parameter to indicat * *propertyPath* is not found in the collection. -#### Exemple 1 +#### Example 1 ```4d var $col : Collection @@ -259,7 +260,7 @@ If the collection contains objects, pass the *propertyPath* parameter to indicat $vAvg:=$col.average() //12 ``` -#### Exemple 2 +#### Example 2 ```4d var $col : Collection @@ -277,19 +278,19 @@ If the collection contains objects, pass the *propertyPath* parameter to indicat ## .clear() -
    Historique -| Version | Modifications | -| ------- | ------------- | -| v16 R6 | Ajoutées | +
    History +| Version | Changes | +| ------- | ------- | +| v16 R6 | Added |
    **.clear()** : Collection -| Paramètres | Type | | Description | -| ---------- | ---------- |:--:| --------------------------------------------- | -| Résultat | Collection | <- | Original collection with all elements removed | +| Parameter | Type | | Description | +| --------- | ---------- |:--:| --------------------------------------------- | +| Result | Collection | <- | Original collection with all elements removed | @@ -298,7 +299,7 @@ If the collection contains objects, pass the *propertyPath* parameter to indicat The `.clear()` function removes all elements from the collection instance and returns an empty collection. > This function modifies the original collection. -#### Exemple +#### Example ```4d var $col : Collection @@ -316,10 +317,10 @@ $vSize:=$col.length //$vSize=0 ## .combine() -
    Historique -| Version | Modifications | -| ------- | ------------- | -| v16 R6 | Ajoutées | +
    History +| Version | Changes | +| ------- | ------- | +| v16 R6 | Added |
    @@ -327,11 +328,11 @@ $vSize:=$col.length //$vSize=0 -| Paramètres | Type | | Description | -| ---------- | ----------- |:--:| ----------------------------------------------------------------------------- | -| col2 | Collection | -> | Collection to combine | -| index | Entier long | -> | Position to which insert elements to combine in collection (default=length+1) | -| Résultat | Collection | <- | Original collection containing combined element(s) | +| Parameter | Type | | Description | +| --------- | ---------- |:--:| ----------------------------------------------------------------------------- | +| col2 | Collection | -> | Collection to combine | +| index | Integer | -> | Position to which insert elements to combine in collection (default=length+1) | +| Result | Collection | <- | Original collection containing combined element(s) | @@ -348,7 +349,7 @@ By default, *col2* elements are added at the end of the orginal collection. You * If the calculated value is negative, *index* is set to 0. -#### Exemple +#### Example ```4d var $c; $fruits : Collection @@ -366,20 +367,20 @@ $c.combine($fruits;3) //[1,2,3,"Orange","Banana","Apple","Grape",4,5,6] ## .concat() -
    Historique -| Version | Modifications | -| ------- | ------------- | -| v16 R6 | Ajoutées | +
    History +| Version | Changes | +| ------- | ------- | +| v16 R6 | Added |
    **.concat**( *value* : any { *;...valueN* } ) : Collection -| Paramètres | Type | | Description | -| ---------- | -------------------------------------------------------------- |:--:| ----------------------------------------------------------------------------------------------------------------- | -| value | Number, Text, Object, Collection, Date, Time, Boolean, Picture | -> | Value(s) to concatenate. If *value* is a collection, all collection elements are added to the original collection | -| Résultat | Collection | <- | New collection with value(s) added to the original collection | +| Parameter | Type | | Description | +| --------- | -------------------------------------------------------------- |:--:| ----------------------------------------------------------------------------------------------------------------- | +| value | Number, Text, Object, Collection, Date, Time, Boolean, Picture | -> | Value(s) to concatenate. If *value* is a collection, all collection elements are added to the original collection | +| Result | Collection | <- | New collection with value(s) added to the original collection | @@ -391,7 +392,7 @@ The `.concat()` function returns a new If *value* is a collection, all its elements are added as new elements at the end of the original collection. If *value* is not a collection, it is added itself as a new element. -#### Exemple +#### Example ```4d var $c : Collection @@ -410,11 +411,11 @@ $c2:=$c.concat(6;7;8) //[1,2,3,4,5,6,7,8] ## .copy() -
    Historique -| Version | Modifications | +
    History +| Version | Changes | | ------- | -------------------------------------------------- | | v18 R3 | New *ck shared* option. New *groupWith* parameters | -| v16 R6 | Ajoutées | +| v16 R6 | Added |
    @@ -422,12 +423,12 @@ $c2:=$c.concat(6;7;8) //[1,2,3,4,5,6,7,8] -| Paramètres | Type | | Description | -| ------------ | ----------- |:--:| -------------------------------------------------------------------------------------------------------- | -| option | Entier long | -> | `ck resolve pointers`: resolve pointers before copying,
    `ck shared`: return a shared collection | -| groupWithCol | Collection | -> | Shared collection to be grouped with the resulting collection | -| groupWithObj | Objet | -> | Shared object to be grouped with the resulting collection | -| Résultat | Collection | <- | Deep copy of the original collection | +| Parameter | Type | | Description | +| ------------ | ---------- |:--:| -------------------------------------------------------------------------------------------------------- | +| option | Integer | -> | `ck resolve pointers`: resolve pointers before copying,
    `ck shared`: return a shared collection | +| groupWithCol | Collection | -> | Shared collection to be grouped with the resulting collection | +| groupWithObj | Objet | -> | Shared object to be grouped with the resulting collection | +| Result | Collection | <- | Deep copy of the original collection | @@ -446,7 +447,7 @@ If passed, the *option* parameter can contain one of the following constants (or The *groupWithCol* or *groupWithObj* parameters allow you to designate a collection or an object with which the resulting collection should be associated. -#### Exemple 1 +#### Example 1 We want to copy the *$lastnames* regular (non shared) collection into the *$sharedObject* shared object. To do this, we must create a shared copy of the collection (*$sharedLastnames*). @@ -458,18 +459,18 @@ var $text : Text $sharedObject:=New shared object $text:=Document to text(Get 4D folder(Current resources folder)+"lastnames.txt") -$lastnames:=JSON Parse($text) //$lastnames est un collection standard +$lastnames:=JSON Parse($text) //$lastnames is a regular collection -$sharedLastnames:=$lastnames.copy(ck shared) //$sharedLastnames est une collection partagée +$sharedLastnames:=$lastnames.copy(ck shared) //$sharedLastnames is a shared collection -//Nous pouvons désormais placer $sharedLastnames dans $sharedObject +//Now we can put $sharedLastnames into $sharedObject Use($sharedObject) $sharedObject.lastnames:=$sharedLastnames End use ``` -#### Exemple 2 +#### Example 2 We want to combine *$sharedColl1* and *$sharedColl2*. Since they belong to different shared groups, a direct combination would result in an error. Therefore, we must make a shared copy of *$sharedColl1* and designate *$sharedColl2* as a shared group for the copy. @@ -536,10 +537,10 @@ This example illustrates the use of the `ck resolve pointers` option: ## .count() -
    Historique -| Version | Modifications | -| ------- | ------------- | -| v16 R6 | Ajoutées | +
    History +| Version | Changes | +| ------- | ------- | +| v16 R6 | Added |
    @@ -547,10 +548,10 @@ This example illustrates the use of the `ck resolve pointers` option: -| Paramètres | Type | | Description | -| ------------ | ----- |:--:| ----------------------------------------------- | -| propertyPath | Texte | -> | Object property path to be used for calculation | -| Résultat | Réel | <- | Number of elements in the collection | +| Parameter | Type | | Description | +| ------------ | ---- |:--:| ----------------------------------------------- | +| propertyPath | Text | -> | Object property path to be used for calculation | +| Result | Real | <- | Number of elements in the collection | @@ -560,7 +561,7 @@ The `.count()` function returns the numb If the collection contains objects, you can pass the *propertyPath* parameter. In this case, only elements that contain the *propertyPath* are taken into account. -#### Exemple +#### Example ```4d var $col : Collection @@ -584,10 +585,10 @@ If the collection contains objects, you can pass the *propertyPath* parameter. I ## .countValues() -
    Historique -| Version | Modifications | -| ------- | ------------- | -| v16 R6 | Ajoutées | +
    History +| Version | Changes | +| ------- | ------- | +| v16 R6 | Added |
    @@ -595,11 +596,11 @@ If the collection contains objects, you can pass the *propertyPath* parameter. I -| Paramètres | Type | | Description | +| Parameter | Type | | Description | | ------------ | ----------------------------------------------- |:--:| ----------------------------------------------- | | value | Text, Number, Boolean, Date, Object, Collection | -> | Value to count | -| propertyPath | Texte | -> | Object property path to be used for calculation | -| Résultat | Réel | <- | Number of occurrences of the value | +| propertyPath | Text | -> | Object property path to be used for calculation | +| Result | Real | <- | Number of occurrences of the value | @@ -618,7 +619,7 @@ For an element to be found, the type of *value* must be equivalent to the type o The optional *propertyPath* parameter allows you to count values inside a collection of objects: pass in *propertyPath* the path of the property whose values you want to count. > This function does not modify the original collection. -#### Exemple 1 +#### Example 1 ```4d var $col : Collection @@ -628,7 +629,7 @@ The optional *propertyPath* parameter allows you to count values inside a collec ``` -#### Exemple 2 +#### Example 2 ```4d var $col : Collection @@ -665,10 +666,10 @@ The optional *propertyPath* parameter allows you to count values inside a collec ## .distinct() -
    Historique -| Version | Modifications | -| ------- | ------------- | -| v16 R6 | Ajoutées | +
    History +| Version | Changes | +| ------- | ------- | +| v16 R6 | Added |
    @@ -676,11 +677,11 @@ The optional *propertyPath* parameter allows you to count values inside a collec -| Paramètres | Type | | Description | -| ------------ | ----------- |:--:| ---------------------------------------------------------------- | -| option | Entier long | -> | `ck diacritical`: diacritical evaluation ("A" # "a" for example) | -| propertyPath | Texte | -> | Path of attribute whose distinct values you want to get | -| Résultat | Collection | <- | New collection with only distinct values | +| Parameter | Type | | Description | +| ------------ | ---------- |:--:| ---------------------------------------------------------------- | +| option | Integer | -> | `ck diacritical`: diacritical evaluation ("A" # "a" for example) | +| propertyPath | Text | -> | Path of attribute whose distinct values you want to get | +| Result | Collection | <- | New collection with only distinct values | @@ -697,7 +698,7 @@ If the collection contains objects, you can pass the *propertyPath* parameter to -#### Exemple +#### Example ```4d var $c; $c2 : Collection @@ -720,21 +721,21 @@ If the collection contains objects, you can pass the *propertyPath* parameter to ## .equal() -
    Historique -| Version | Modifications | -| ------- | ------------- | -| v16 R6 | Ajoutées | +
    History +| Version | Changes | +| ------- | ------- | +| v16 R6 | Added |
    **.equal**( *collection2* : Collection {; *option* : Integer } ) : Boolean -| Paramètres | Type | | Description | -| ----------- | ----------- |:--:| ---------------------------------------------------------------- | -| collection2 | Collection | -> | Collection to compare | -| option | Entier long | -> | `ck diacritical`: diacritical evaluation ("A" # "a" for example) | -| Résultat | Booléen | <- | True if collections are identical, false otherwise | +| Parameter | Type | | Description | +| ----------- | ---------- |:--:| ---------------------------------------------------------------- | +| collection2 | Collection | -> | Collection to compare | +| option | Integer | -> | `ck diacritical`: diacritical evaluation ("A" # "a" for example) | +| Result | Booléen | <- | True if collections are identical, false otherwise | @@ -745,7 +746,7 @@ The `.equal()` function compares the col By default, a non-diacritical evaluation is performed. If you want the evaluation to be case sensitive or to differentiate accented characters, pass the `ck diacritical` constant in the option parameter. > Elements with **Null** values are not equal to Undefined elements. -#### Exemple +#### Example ```4d var $c; $c2 : Collection @@ -776,22 +777,22 @@ By default, a non-diacritical evaluation is performed. If you want the evaluatio ## .every() -
    Historique -| Version | Modifications | -| ------- | ------------- | -| v16 R6 | Ajoutées | +
    History +| Version | Changes | +| ------- | ------- | +| v16 R6 | Added |
    **.every**( *methodName* : Text { ;*...param* : any } ) : Boolean
    **.every**( *startFrom* : Integer ; *methodName* : Text { ;*...param* : any } ) : Boolean -| Paramètres | Type | | Description | -| ---------- | ----------- |:--:| ------------------------------------------------- | -| startFrom | Entier long | -> | Index to start the test at | -| methodName | Texte | -> | Name of the method to call for the test | -| param | Mixed | -> | Parameter(s) to pass to methodName | -| Résultat | Booléen | <- | True if all elements successfully passed the test | +| Parameter | Type | | Description | +| ---------- | ------- |:--:| ------------------------------------------------- | +| startFrom | Integer | -> | Index to start the test at | +| methodName | Text | -> | Name of the method to call for the test | +| param | Mixed | -> | Parameter(s) to pass to methodName | +| Result | Booléen | <- | True if all elements successfully passed the test | @@ -822,16 +823,16 @@ By default, `.every()` tests the whole collection. Optionally, you can pass in * * If *startFrom* = 0, the whole collection is searched (default). -#### Exemple 1 +#### Example 1 ```4d var $c : Collection var $b : Boolean $c:=New collection $c.push(5;3;1;4;6;2) -$b:=$c.every("NumberGreaterThan0") //retourne true +$b:=$c.every("NumberGreaterThan0") //returns true $c.push(-1) -$b:=$c.every("NumberGreaterThan0") //retourne false +$b:=$c.every("NumberGreaterThan0") //returns false ``` With the following ***NumberGreaterThan0*** method: @@ -840,7 +841,7 @@ With the following ***NumberGreaterThan0*** method: $1.result:=$1.value>0 ``` -#### Exemple 2 +#### Example 2 This example tests that all elements of a collection are of the real type: @@ -872,10 +873,10 @@ End if ## .extract() -
    Historique -| Version | Modifications | -| ------- | ------------- | -| v16 R6 | Ajoutées | +
    History +| Version | Changes | +| ------- | ------- | +| v16 R6 | Added |
    @@ -883,12 +884,12 @@ End if -| Paramètres | Type | | Description | -| ------------ | ----------- |:--:| ---------------------------------------------------------------------------------------------------------------------------------- | -| propertyPath | Texte | -> | Object property path whose values must be extracted to the new collection | -| targetpath | Texte | -> | Target property path or property name | -| option | Entier long | -> | `ck keep null`: include null properties in the returned collection (ignored by default). Parameter ignored if *targetPath* passed. | -| Résultat | Collection | <- | New collection containing extracted values | +| Parameter | Type | | Description | +| ------------ | ---------- |:--:| ---------------------------------------------------------------------------------------------------------------------------------- | +| propertyPath | Text | -> | Object property path whose values must be extracted to the new collection | +| targetpath | Text | -> | Target property path or property name | +| option | Integer | -> | `ck keep null`: include null properties in the returned collection (ignored by default). Parameter ignored if *targetPath* passed. | +| Result | Collection | <- | New collection containing extracted values | @@ -907,7 +908,7 @@ The contents of the returned collection depends on the *targetPath* parameter: * If one or more *targetPath* parameter(s) are passed, `.extract()` populates the new collection with the *propertyPath* properties and each element of the new collection is an object with *targetPath* properties filled with the corresponding *propertyPath* properties. Null values are kept (*option* parameter is ignored with this syntax). -#### Exemple 1 +#### Example 1 ```4d var $c : Collection @@ -921,7 +922,7 @@ $c2:=$c.extract("name";ck keep null) //$c2=[Cleveland,null,Blountsville,null] ``` -#### Exemple 2 +#### Example 2 ```4d @@ -947,10 +948,10 @@ $c2:=$c.extract("name";"City";"zc";"Zip") //$c2=[{Zip:35060},{City:null,Zip:3504 ## .fill() -
    Historique -| Version | Modifications | -| ------- | ------------- | -| v16 R6 | Ajoutées | +
    History +| Version | Changes | +| ------- | ------- | +| v16 R6 | Added |
    @@ -959,12 +960,12 @@ $c2:=$c.extract("name";"City";"zc";"Zip") //$c2=[{Zip:35060},{City:null,Zip:3504 -| Paramètres | Type | | Description | -| ---------- | ----------------------------------------------- |:--:| -------------------------------------- | -| value | number, Text, Collection, Object, Date, Boolean | -> | Filling value | -| startFrom | Entier long | -> | Start index (included) | -| end | Entier long | -> | End index (not included) | -| Résultat | collection | <- | Original collection with filled values | +| Parameter | Type | | Description | +| --------- | ----------------------------------------------- |:--:| -------------------------------------- | +| value | number, Text, Collection, Object, Date, Boolean | -> | Filling value | +| startFrom | Integer | -> | Start index (included) | +| end | Integer | -> | End index (not included) | +| Result | collection | <- | Original collection with filled values | @@ -984,7 +985,7 @@ In case of inconsistency, the following rules apply: * If *end* < *startFrom* (passed or calculated values), the method does nothing. -#### Exemple +#### Example ```4d var $c : Collection @@ -1004,10 +1005,10 @@ In case of inconsistency, the following rules apply: ## .filter() -
    Historique -| Version | Modifications | -| ------- | ------------- | -| v16 R6 | Ajoutées | +
    History +| Version | Changes | +| ------- | ------- | +| v16 R6 | Added |
    @@ -1015,11 +1016,11 @@ In case of inconsistency, the following rules apply: -| Paramètres | Type | | Description | +| Parameter | Type | | Description | | ---------- | ---------- |:--:| ---------------------------------------------------------- | -| methodName | Texte | -> | Name of the function to call to filter the collection | +| methodName | Text | -> | Name of the function to call to filter the collection | | param | Mixed | -> | Parameter(s) to pass to *methodName* | -| Résultat | Collection | <- | New collection containing filtered elements (shallow copy) | +| Result | Collection | <- | New collection containing filtered elements (shallow copy) | @@ -1042,7 +1043,7 @@ In *methodName*, pass the name of the method to use to evaluate collection eleme * *$1.stop* (boolean, optional): **true** to stop the method callback. The returned value is the last calculated. -#### Exemple 1 +#### Example 1 You want to get the collection of text elements whose length is smaller than 6: @@ -1063,7 +1064,7 @@ The code for ***LengthLessThan*** method is: End if ``` -#### Exemple 2 +#### Example 2 You want to filter elements according to their value type: @@ -1097,10 +1098,10 @@ The code for ***TypeLookUp*** is: ## .find() -
    Historique -| Version | Modifications | -| ------- | ------------- | -| v16 R6 | Ajoutées | +
    History +| Version | Changes | +| ------- | ------- | +| v16 R6 | Added |
    @@ -1108,12 +1109,12 @@ The code for ***TypeLookUp*** is: -| Paramètres | Type | | Description | -| ---------- | ----------- |:--:| -------------------------------------------- | -| startFrom | Entier long | -> | Index to start the search at | -| methodName | Texte | -> | Name of the function to call for the find | -| param | any | -> | Parameter(s) to pass to *methodName* | -| Résultat | any | <- | First value found, or Undefined if not found | +| Parameter | Type | | Description | +| ---------- | ------- |:--:| -------------------------------------------- | +| startFrom | Integer | -> | Index to start the search at | +| methodName | Text | -> | Name of the function to call for the find | +| param | any | -> | Parameter(s) to pass to *methodName* | +| Result | any | <- | First value found, or Undefined if not found | @@ -1142,7 +1143,7 @@ By default, `.find()` searches in the whole collection. Optionally, you can pass * If *startFrom* = 0, the whole collection is searched (default). -#### Exemple 1 +#### Example 1 You want to get the first element with a length smaller than 5: @@ -1162,7 +1163,7 @@ The code for ***LengthLessThan*** method is: End if ``` -#### Exemple 2 +#### Example 2 You want to find a city name within a collection: @@ -1194,10 +1195,10 @@ The code for ***FindCity*** is: ## .findIndex() -
    Historique -| Version | Modifications | -| ------- | ------------- | -| v16 R6 | Ajoutées | +
    History +| Version | Changes | +| ------- | ------- | +| v16 R6 | Added |
    @@ -1207,12 +1208,12 @@ The code for ***FindCity*** is: -| Paramètres | Type | | Description | -| ---------- | ----------- |:--:| ---------------------------------------------- | -| startFrom | Entier long | -> | Index to start the search at | -| methodName | Texte | -> | Name of the function to call for the find | -| param | any | -> | Parameter(s) to pass to *methodName* | -| Résultat | Entier long | <- | Index of first value found, or -1 if not found | +| Parameter | Type | | Description | +| ---------- | ------- |:--:| ---------------------------------------------- | +| startFrom | Integer | -> | Index to start the search at | +| methodName | Text | -> | Name of the function to call for the find | +| param | any | -> | Parameter(s) to pass to *methodName* | +| Result | Integer | <- | Index of first value found, or -1 if not found | @@ -1240,7 +1241,7 @@ By default, `.findIndex()` searches in the whole collection. Optionally, you can * If *startFrom* < 0, it is considered as the offset from the end of the collection (*startFrom:=startFrom+length*). **Note**: Even if *startFrom* is negative, the collection is still searched from left to right. * If *startFrom* = 0, the whole collection is searched (default). -#### Exemple +#### Example You want to find the position of the first city name within a collection: @@ -1275,21 +1276,21 @@ The code for ***FindCity*** method is: ## .indexOf() -
    Historique -| Version | Modifications | -| ------- | ------------- | -| v16 R6 | Ajoutées | +
    History +| Version | Changes | +| ------- | ------- | +| v16 R6 | Added |
    **.indexOf**( *toSearch* : expression { ; *startFrom* : Integer } ) : Integer -| Paramètres | Type | | Description | -| ---------- | ----------- |:--:| ---------------------------------------------------------------------------- | -| toSearch | expression | -> | Expression to search in the collection | -| startFrom | Entier long | -> | Index to start the search at | -| Résultat | Entier long | <- | Index of the first occurrence of toSearch in the collection, -1 if not found | +| Parameter | Type | | Description | +| --------- | ---------- |:--:| ---------------------------------------------------------------------------- | +| toSearch | expression | -> | Expression to search in the collection | +| startFrom | Integer | -> | Index to start the search at | +| Result | Integer | <- | Index of the first occurrence of toSearch in the collection, -1 if not found | @@ -1312,7 +1313,7 @@ Optionally, you can pass the index of collection from which to start the search * If *startFrom* < 0, it is considered as the offset from the end of the collection (*startFrom:=startFrom+length*). **Note**: Even if *startFrom* is negative, the collection is still searched from left to right. * If *startFrom* = 0, the whole collection is searched (default). -#### Exemple +#### Example ```4d @@ -1334,10 +1335,10 @@ Optionally, you can pass the index of collection from which to start the search ## .indices() -
    Historique -| Version | Modifications | -| ------- | ------------- | -| v16 R6 | Ajoutées | +
    History +| Version | Changes | +| ------- | ------- | +| v16 R6 | Added |
    @@ -1345,11 +1346,11 @@ Optionally, you can pass the index of collection from which to start the search -| Paramètres | Type | | Description | +| Parameter | Type | | Description | | ----------- | ---------- |:--:| -------------------------------------------------------- | -| queryString | Texte | -> | Search criteria | +| queryString | Text | -> | Search criteria | | value | any | -> | Value(s) to compare when using placeholder(s) | -| Résultat | Collection | <- | Element index(es) matching queryString in the collection | +| Result | Collection | <- | Element index(es) matching queryString in the collection | @@ -1366,7 +1367,7 @@ propertyPath comparator value {logicalOperator propertyPath comparator value} For a detailed description of the *queryString* and *value* parameters, please refer to the `dataClass.query()` function. -#### Exemple +#### Example ```4d @@ -1390,21 +1391,21 @@ For a detailed description of the *queryString* and *value* parameters, please r ## .insert() -
    Historique -| Version | Modifications | -| ------- | ------------- | -| v16 R6 | Ajoutées | +
    History +| Version | Changes | +| ------- | ------- | +| v16 R6 | Added |
    **.insert**( *index* : Integer ; *element* : any ) : Collection -| Paramètres | Type | | Description | -| ---------- | ----------- |:--:| ----------------------------------------------- | -| index | Entier long | -> | Where to insert the element | -| element | any | -> | Element to insert in the collection | -| Résultat | Collection | <- | Original collection containing inserted element | +| Parameter | Type | | Description | +| --------- | ---------- |:--:| ----------------------------------------------- | +| index | Integer | -> | Where to insert the element | +| element | any | -> | Element to insert in the collection | +| Result | Collection | <- | Original collection containing inserted element | @@ -1422,7 +1423,7 @@ In *index*, pass the position where you want the element to be inserted in the c Any type of element accepted by a collection can be inserted, even another collection. -#### Exemple +#### Example ```4d var $col : Collection @@ -1441,21 +1442,21 @@ Any type of element accepted by a collection can be inserted, even another colle ## .join() -
    Historique -| Version | Modifications | -| ------- | ------------- | -| v16 R6 | Ajoutées | +
    History +| Version | Changes | +| ------- | ------- | +| v16 R6 | Added |
    **.join**( *delimiter* : Text { ; *option* : Integer } ) : Text -| Paramètres | Type | | Description | -| ---------- | ----------- |:--:| ------------------------------------------------------------------------ | -| delimiter | Texte | -> | Separator to use between elements | -| option | Entier long | -> | `ck ignore null or empty`: ignore null and empty strings in the result | -| Résultat | Texte | <- | String containing all elements of the collection, separated by delimiter | +| Parameter | Type | | Description | +| --------- | ------- |:--:| ------------------------------------------------------------------------ | +| delimiter | Text | -> | Separator to use between elements | +| option | Integer | -> | `ck ignore null or empty`: ignore null and empty strings in the result | +| Result | Text | <- | String containing all elements of the collection, separated by delimiter | @@ -1466,7 +1467,7 @@ The `.join()` function converts all eleme By default, null or empty elements of the collection are returned in the resulting string. Pass the `ck ignore null or empty` constant in the *option* parameter if you want to remove them from the resulting string. -#### Exemple +#### Example ```4d @@ -1485,21 +1486,21 @@ By default, null or empty elements of the collection are returned in the resulti ## .lastIndexOf() -
    Historique -| Version | Modifications | -| ------- | ------------- | -| v16 R6 | Ajoutées | +
    History +| Version | Changes | +| ------- | ------- | +| v16 R6 | Added |
    **.lastIndexOf**( *toSearch* : expression { ; *startFrom* : Integer } ) : Integer -| Paramètres | Type | | Description | -| ---------- | ----------- |:--:| ----------------------------------------------------------------------- | -| toSearch | expression | -> | The element that is to be searched for within the collection | -| startFrom | Entier long | -> | Index to start the search at | -| Résultat | Entier long | <- | Index of last occurrence of toSearch in the collection, -1 if not found | +| Parameter | Type | | Description | +| --------- | ---------- |:--:| ----------------------------------------------------------------------- | +| toSearch | expression | -> | The element that is to be searched for within the collection | +| startFrom | Integer | -> | Index to start the search at | +| Result | Integer | <- | Index of last occurrence of toSearch in the collection, -1 if not found | @@ -1522,18 +1523,18 @@ Optionally, you can pass the index of collection from which to start a reverse s * If *startFrom* < 0, it is recalculated as *startFrom:=startFrom+length* (it is considered as the offset from the end of the collection). If the calculated value is negative, -1 is returned (the collection is not searched). **Note:** Even if *startFrom* is negative, the collection is still searched from right to left. * If *startFrom* = 0, -1 is returned, which means the collection is not searched. -#### Exemple +#### Example ```4d var $col : Collection var $pos1;$pos2;$pos3;$pos4;$pos5 : Integer $col:=Split string("a,b,c,d,e,f,g,h,i,j,e,k,e";",") //$col.length=13 - $pos1:=$col.lastIndexOf("e") //retourne 12 - $pos2:=$col.lastIndexOf("e";6) //retourne 4 - $pos3:=$col.lastIndexOf("e";15) //retourne 12 - $pos4:=$col.lastIndexOf("e";-2) //retourne 10 - $pos5:=$col.lastIndexOf("x") //retourne -1 + $pos1:=$col.lastIndexOf("e") //returns 12 + $pos2:=$col.lastIndexOf("e";6) //returns 4 + $pos3:=$col.lastIndexOf("e";15) //returns 12 + $pos4:=$col.lastIndexOf("e";-2) //returns 10 + $pos5:=$col.lastIndexOf("x") //returns -1 ``` @@ -1544,10 +1545,10 @@ Optionally, you can pass the index of collection from which to start a reverse s ## .length -
    Historique -| Version | Modifications | -| ------- | ------------- | -| v16 R5 | Ajoutées | +
    History +| Version | Changes | +| ------- | ------- | +| v16 R5 | Added |
    @@ -1561,7 +1562,7 @@ The `.length` property returns the number The `.length` property is initialized when the collection is created. Adding or removing elements updates the length, if necessary. This property is **read-only** (you cannot use it to set the size of the collection). -#### Exemple +#### Example ```4d var $col : Collection //$col.length initialized to 0 @@ -1578,10 +1579,10 @@ The `.length` property is initialized when the collection is created. Adding or ## .map() -
    Historique -| Version | Modifications | -| ------- | ------------- | -| v16 R6 | Ajoutées | +
    History +| Version | Changes | +| ------- | ------- | +| v16 R6 | Added |
    @@ -1589,11 +1590,11 @@ The `.length` property is initialized when the collection is created. Adding or -| Paramètres | Type | | Description | +| Parameter | Type | | Description | | ---------- | ---------- |:--:| -------------------------------------------------------- | -| methodName | Texte | -> | Name of method used to transform the collection elements | +| methodName | Text | -> | Name of method used to transform the collection elements | | param | any | -> | Parameter(s) for the method | -| Résultat | Collection | <- | Collection of transformed values | +| Result | Collection | <- | Collection of transformed values | @@ -1616,7 +1617,7 @@ In *methodName*, pass the name of the method to use to evaluate collection eleme * *$1.result* (any type): new transformed value to add to the resulting collection * *$1.stop* (boolean): **true** to stop the method callback. The returned value is the last calculated. -#### Exemple +#### Example ```4d @@ -1644,20 +1645,20 @@ Here is the ***Percentage*** method: ## .max() -
    Historique -| Version | Modifications | -| ------- | ------------- | -| v16 R6 | Ajoutées | +
    History +| Version | Changes | +| ------- | ------- | +| v16 R6 | Added |
    **.max**( { *propertyPath* : Text } ) : any -| Paramètres | Type | | Description | +| Parameter | Type | | Description | | ------------ | ----------------------------------------------- |:--:| ---------------------------------------------- | -| propertyPath | Texte | -> | Object property path to be used for evaluation | -| Résultat | Boolean, Text, Number, Collection, Object, Date | <- | Maximum value in the collection | +| propertyPath | Text | -> | Object property path to be used for evaluation | +| Result | Boolean, Text, Number, Collection, Object, Date | <- | Maximum value in the collection | @@ -1672,7 +1673,7 @@ If the collection contains objects, pass the *propertyPath* parameter to indicat If the collection is empty, `.max()` returns *Undefined*. -#### Exemple +#### Example ```4d @@ -1694,20 +1695,20 @@ If the collection is empty, `.max()` returns *Undefined*. ## .min() -
    Historique -| Version | Modifications | -| ------- | ------------- | -| v16 R6 | Ajoutées | +
    History +| Version | Changes | +| ------- | ------- | +| v16 R6 | Added |
    **.min**( { *propertyPath* : Text } ) : any -| Paramètres | Type | | Description | +| Parameter | Type | | Description | | ------------ | ----------------------------------------------- |:--:| ---------------------------------------------- | -| propertyPath | Texte | -> | Object property path to be used for evaluation | -| Résultat | Boolean, Text, Number, Collection, Object, Date | <- | Minimum value in the collection | +| propertyPath | Text | -> | Object property path to be used for evaluation | +| Result | Boolean, Text, Number, Collection, Object, Date | <- | Minimum value in the collection | @@ -1722,7 +1723,7 @@ If the collection contains objects, pass the *propertyPath* parameter to indicat If the collection is empty, `.min()` returns *Undefined*. -#### Exemple +#### Example ```4d @@ -1744,10 +1745,10 @@ If the collection is empty, `.min()` returns *Undefined*. ## .orderBy() -
    Historique -| Version | Modifications | -| ------- | ------------- | -| v16 R6 | Ajoutées | +
    History +| Version | Changes | +| ------- | ------- | +| v16 R6 | Added |
    @@ -1755,12 +1756,12 @@ If the collection is empty, `.min()` returns *Undefined*. -| Paramètres | Type | | Description | -| ----------- | ----------- |:--:| ------------------------------------------------- | -| pathStrings | Texte | -> | Property path(s) on which to order the collection | -| pathObjects | Collection | -> | Collection of criteria objects | -| ascOrDesc | Entier long | -> | `ck ascending` or `ck descending` (scalar values) | -| Résultat | Collection | <- | Ordered copy of the collection (shallow copy) | +| Parameter | Type | | Description | +| ----------- | ---------- |:--:| ------------------------------------------------- | +| pathStrings | Text | -> | Property path(s) on which to order the collection | +| pathObjects | Collection | -> | Collection of criteria objects | +| ascOrDesc | Integer | -> | `ck ascending` or `ck descending` (scalar values) | +| Result | Collection | <- | Ordered copy of the collection (shallow copy) | @@ -1786,10 +1787,10 @@ You can also pass a criteria parameter to define how the collection elements mus * *ascOrDesc* : Integer. You pass one of the following constants from the **Objects and collections** theme: - | Constant | Type | Valeur | Commentaire | - | ------------- | ----------- | ------ | ------------------------------------------------- | - | ck ascending | Entier long | 0 | Elements are ordered in ascending order (default) | - | ck descending | Entier long | 1 | Elements are ordered in descending order | + | Constant | Type | Value | Comment | + | ------------- | ------- | ----- | ------------------------------------------------- | + | ck ascending | Longint | 0 | Elements are ordered in ascending order (default) | + | ck descending | Longint | 1 | Elements are ordered in descending order | This syntax orders scalar values in the collection only (other element types such as objects or collections are returned unordered). @@ -1803,7 +1804,7 @@ If the collection contains elements of different types, they are first grouped b 6. collections 7. dates -#### Exemple 1 +#### Example 1 Ordering a collection of numbers in ascending and descending order: @@ -1818,7 +1819,7 @@ Ordering a collection of numbers in ascending and descending order: ``` -#### Exemple 2 +#### Example 2 Ordering a collection of objects based on a text formula with property names: @@ -1882,10 +1883,10 @@ Ordering with a property path: ## .orderByMethod() -
    Historique -| Version | Modifications | -| ------- | ------------- | -| v16 R6 | Ajoutées | +
    History +| Version | Changes | +| ------- | ------- | +| v16 R6 | Added |
    @@ -1893,11 +1894,11 @@ Ordering with a property path: -| Paramètres | Type | | Description | +| Parameter | Type | | Description | | ---------- | ---------- |:--:| ------------------------------------------------ | -| methodName | Texte | -> | Name of method used to specify the sorting order | +| methodName | Text | -> | Name of method used to specify the sorting order | | extraParam | expression | -> | Parameter(s) for the method | -| Résultat | Collection | <- | Sorted copy of the collection (shallow copy) | +| Result | Collection | <- | Sorted copy of the collection (shallow copy) | @@ -1918,7 +1919,7 @@ In *methodName*, pass a comparison method that compares two values and returns * * *methodName* sets the following parameter: * *$1.result* (boolean): **true** if *$1.value < $1.value2*, **false** otherwise -#### Exemple 1 +#### Example 1 You want to sort a collection of strings in numerical order rather than alphabetical order: @@ -1939,7 +1940,7 @@ You want to sort a collection of strings in numerical order rather than alphabet -#### Exemple 2 +#### Example 2 You want to sort a collection of strings on their length: @@ -1966,10 +1967,10 @@ Here is the code for ***WordLength***: ## .pop() -
    Historique -| Version | Modifications | -| ------- | ------------- | -| v16 R6 | Ajoutées | +
    History +| Version | Changes | +| ------- | ------- | +| v16 R6 | Added |
    @@ -1977,9 +1978,9 @@ Here is the code for ***WordLength***: **.pop()** : any -| Paramètres | Type | | Description | -| ---------- | ---- |:--:| -------------------------- | -| Résultat | any | <- | Last element of collection | +| Parameter | Type | | Description | +| --------- | ---- |:--:| -------------------------- | +| Result | any | <- | Last element of collection | @@ -1990,7 +1991,7 @@ The `.pop()` function removes the last ele When applied to an empty collection, `.pop()` returns ***undefined***. -#### Exemple +#### Example `.pop()`, used in conjunction with [`.push()`](#push), can be used to implement a first-in, last-out stack feature: @@ -2014,20 +2015,20 @@ When applied to an empty collection, `.pop()` returns ***undefined***. ## .push() -
    Historique -| Version | Modifications | -| ------- | ------------- | -| v16 R6 | Ajoutées | +
    History +| Version | Changes | +| ------- | ------- | +| v16 R6 | Added |
    **.push**( *element* : any { ;...*elementN* } ) : Collection -| Paramètres | Type | | Description | -| ---------- | ---------- |:--:| --------------------------------------------- | -| element | Mixed | -> | Element(s) to add to the collection | -| Résultat | Collection | <- | Original collection containing added elements | +| Parameter | Type | | Description | +| --------- | ---------- |:--:| --------------------------------------------- | +| element | Mixed | -> | Element(s) to add to the collection | +| Result | Collection | <- | Original collection containing added elements | @@ -2037,7 +2038,7 @@ The `.push()` function appends one or mor > This function modifies the original collection. -#### Exemple 1 +#### Example 1 ```4d var $col : Collection @@ -2049,7 +2050,7 @@ The `.push()` function appends one or mor -#### Exemple 2 +#### Example 2 You want to sort the resutling collection: @@ -2072,11 +2073,11 @@ You want to sort the resutling collection: ## .query() -
    Historique -| Version | Modifications | +
    History +| Version | Changes | | ------- | ------------------------ | | v17 R5 | Support of querySettings | -| v16 R6 | Ajoutées | +| v16 R6 | Added |
    @@ -2084,12 +2085,12 @@ You want to sort the resutling collection: -| Paramètres | Type | | Description | +| Parameter | Type | | Description | | ------------- | ---------- |:--:| ------------------------------------------------- | -| queryString | Texte | -> | Search criteria | +| queryString | Text | -> | Search criteria | | value | Mixed | -> | Value(s) to compare when using placeholder(s) | | querySettings | Objet | -> | Query options: parameters, attributes | -| Résultat | Collection | <- | Element(s) matching queryString in the collection | +| Result | Collection | <- | Element(s) matching queryString in the collection | @@ -2108,7 +2109,7 @@ For detailed information on how to build a query using , value and *querySetting -#### Exemple 1 +#### Example 1 ```4d var $c; $c2; $c3 : Collection @@ -2123,7 +2124,7 @@ For detailed information on how to build a query using , value and *querySetting ``` -#### Exemple 2 +#### Example 2 ```4d @@ -2180,10 +2181,10 @@ More examples of queries can be found in the `dataClass.query()` page. ## .reduce() -
    Historique -| Version | Modifications | -| ------- | ------------- | -| v16 R6 | Ajoutées | +
    History +| Version | Changes | +| ------- | ------- | +| v16 R6 | Added |
    @@ -2191,12 +2192,12 @@ More examples of queries can be found in the `dataClass.query()` page. -| Paramètres | Type | | Description | +| Parameter | Type | | Description | | ---------- | ----------------------------------------------- |:--:| -------------------------------------------------------------------- | -| methodName | Texte | -> | Name of the function to call to process collection elements | +| methodName | Text | -> | Name of the function to call to process collection elements | | initValue | Text, Number, Object, Collection, Date, Boolean | -> | Value to use as the first argument to the first call of *methodName* | | param | expression | -> | Parameter(s) to pass to *methodName* | -| Résultat | Text, Number, Object, Collection, Date, Boolean | <- | Result of the accumulator value | +| Result | Text, Number, Object, Collection, Date, Boolean | <- | Result of the accumulator value | @@ -2222,7 +2223,7 @@ You can pass the value to initialize the accumulator in *initValue*. If omitted, * *$1.stop* (boolean, optional): **true** to stop the method callback. The returned value is the last calculated. -#### Exemple 1 +#### Example 1 ```4d @@ -2239,7 +2240,7 @@ With the following ***Multiply*** method: End if ``` -#### Exemple +#### Example This example allows reducing several collection elements to a single one: @@ -2270,10 +2271,10 @@ With the following ***Flatten*** method: ## .remove() -
    Historique -| Version | Modifications | -| ------- | ------------- | -| v16 R6 | Ajoutées | +
    History +| Version | Changes | +| ------- | ------- | +| v16 R6 | Added |
    @@ -2281,11 +2282,11 @@ With the following ***Flatten*** method: -| Paramètres | Type | | Description | -| ---------- | ----------- |:--:| ----------------------------------------------------- | -| index | Entier long | -> | Element at which to start removal | -| howMany | Entier long | -> | Number of elements to remove, or 1 element if omitted | -| Résultat | Collection | <- | Original collection without removed element(s) | +| Parameter | Type | | Description | +| --------- | ---------- |:--:| ----------------------------------------------------- | +| index | Integer | -> | Element at which to start removal | +| howMany | Integer | -> | Number of elements to remove, or 1 element if omitted | +| Result | Collection | <- | Original collection without removed element(s) | @@ -2307,7 +2308,7 @@ In *howMany*, pass the number of elements to remove from *index*. If *howMany* i If you try to remove an element from an empty collection, the method does nothing (no error is generated). -#### Exemple +#### Example ```4d @@ -2330,10 +2331,10 @@ If you try to remove an element from an empty collection, the method does nothin ## .resize() -
    Historique -| Version | Modifications | -| ------- | ------------- | -| v16 R6 | Ajoutées | +
    History +| Version | Changes | +| ------- | ------- | +| v16 R6 | Added |
    @@ -2342,11 +2343,11 @@ If you try to remove an element from an empty collection, the method does nothin **.resize**( *size* : Integer { ; *defaultValue* : any } ) : Collection -| Paramètres | Type | | Description | +| Parameter | Type | | Description | | ------------ | ----------------------------------------------- |:--:| ---------------------------------- | -| size | Entier long | -> | New size of the collection | +| size | Integer | -> | New size of the collection | | defaultValue | Number, Text, Object, Collection, Date, Boolean | -> | Default value to fill new elements | -| Résultat | Collection | <- | Resized original collection | +| Result | Collection | <- | Resized original collection | @@ -2360,7 +2361,7 @@ The `.resize()` function sets the colle By default, new elements are filled will **null** values. You can specify the value to fill in added elements using the *defaultValue* parameter. -#### Exemple +#### Example ```4d @@ -2388,19 +2389,19 @@ By default, new elements are filled will **null** values. You can specify the va ## .reverse() -
    Historique -| Version | Modifications | -| ------- | ------------- | -| v16 R6 | Ajoutées | +
    History +| Version | Changes | +| ------- | ------- | +| v16 R6 | Added |
    **.reverse( )** : Collection -| Paramètres | Type | | Description | -| ---------- | ---------- |:--:| ------------------------------- | -| Résultat | Collection | <- | Inverted copy of the collection | +| Parameter | Type | | Description | +| --------- | ---------- |:--:| ------------------------------- | +| Result | Collection | <- | Inverted copy of the collection | @@ -2409,7 +2410,7 @@ By default, new elements are filled will **null** values. You can specify the va The `.reverse()` function returns a deep copy of the collection with all its elements in reverse order. If the original collection is a shared collection, the returned collection is also a shared collection. > This function does not modify the original collection. -#### Exemple +#### Example ```4d @@ -2427,19 +2428,19 @@ The `.reverse()` function returns a de ## .shift() -
    Historique -| Version | Modifications | -| ------- | ------------- | -| v16 R6 | Ajoutées | +
    History +| Version | Changes | +| ------- | ------- | +| v16 R6 | Added |
    **.shift()** : any -| Paramètres | Type | | Description | -| ---------- | ---- |:--:| --------------------------- | -| Résultat | any | <- | First element of collection | +| Parameter | Type | | Description | +| --------- | ---- |:--:| --------------------------- | +| Result | any | <- | First element of collection | @@ -2450,7 +2451,7 @@ The `.shift()` function removes the firs If the collection is empty, this method does nothing. -#### Exemple +#### Example ```4d @@ -2471,21 +2472,21 @@ If the collection is empty, this method does nothing. ## .slice() -
    Historique -| Version | Modifications | -| ------- | ------------- | -| v16 R6 | Ajoutées | +
    History +| Version | Changes | +| ------- | ------- | +| v16 R6 | Added |
    **.slice**( *startFrom* : Integer { ; *end* : Integer } ) : Collection -| Paramètres | Type | | Description | -| ---------- | ----------- |:--:| -------------------------------------------------------- | -| startFrom | Entier long | -> | Index to start the search at (included) | -| end | Entier long | -> | End index (not included) | -| Résultat | Collection | <- | New collection containing sliced elements (shallow copy) | +| Parameter | Type | | Description | +| --------- | ---------- |:--:| -------------------------------------------------------- | +| startFrom | Integer | -> | Index to start the search at (included) | +| end | Integer | -> | End index (not included) | +| Result | Collection | <- | New collection containing sliced elements (shallow copy) | @@ -2501,7 +2502,7 @@ The returned collection contains the element specified by *startFrom* and all su * If *end* < 0 , it is recalculated as *end:=end+length*. * If *end < startFrom* (passed or calculated values), the method does nothing. -#### Exemple +#### Example ```4d @@ -2522,10 +2523,10 @@ The returned collection contains the element specified by *startFrom* and all su ## .some() -
    Historique -| Version | Modifications | -| ------- | ------------- | -| v16 R6 | Ajoutées | +
    History +| Version | Changes | +| ------- | ------- | +| v16 R6 | Added |
    @@ -2533,21 +2534,21 @@ The returned collection contains the element specified by *startFrom* and all su -| Paramètres | Type | | Description | -| ---------- | ----------- |:--:| --------------------------------------------------------- | -| startFrom | Entier long | -> | Index to start the test at | -| methodName | Texte | -> | Name of the method to call for the test | -| param | Mixed | -> | Parameter(s) to pass to *methodName* | -| Résultat | Booléen | <- | True if at least one element successfully passed the test | +| Parameter | Type | | Description | +| ---------- | ------- |:--:| --------------------------------------------------------- | +| startFrom | Integer | -> | Index to start the test at | +| methodName | Text | -> | Name of the method to call for the test | +| param | Mixed | -> | Parameter(s) to pass to *methodName* | +| Result | Booléen | <- | True if at least one element successfully passed the test | #### Description -La fonction `.some()` retourne true si au moins un élément de la collection a réussi un test implémenté dans la méthode *methodName* fournie. +The `.some()` function returns true if at least one element in the collection successfully passed a test implemented in the provided *methodName* method. -In *methodName*, pass the name of the method to use to evaluate collection elements, along with its parameter(s) in *param* (optional). *methodName* can perform any test, with or without the parameter(s). Cette méthode reçoit un `objet` comme premier paramètre ($1) et doit définir *$1.result* sur **True** pour chaque élément du test. +In *methodName*, pass the name of the method to use to evaluate collection elements, along with its parameter(s) in *param* (optional). *methodName* can perform any test, with or without the parameter(s). This method receives an `Object` as first parameter ($1) and must set *$1.result* to **True** for every element fulfilling the test. *methodName* receives the following parameters: @@ -2557,19 +2558,19 @@ In *methodName*, pass the name of the method to use to evaluate collection eleme *methodName* sets the following parameter(s): -* *$1.result* (booléen) : **true** si l'évaluation de la valeur de l'élément est réussie, sinon **false**. +* *$1.result* (boolean): **true** if the element value evaluation is successful, **false** otherwise. * *$1.stop* (boolean, optional): **true** to stop the method callback. The returned value is the last calculated. -Dans tous les cas, au moment où la fonction `.some()` rencontre le premier élément de collection retournant true dans *$1.result*, elle arrête d'appeler *methodName* et retourne **true**. +In any case, at the point where `.some()` function encounters the first collection element returning true in *$1.result*, it stops calling *methodName* and returns **true**. -Par défaut, `.some()` teste toute la collection. Vous pouvez éventuellement passer l'index d'un élément à partir duquel vous pouvez démarrer le test dans *startFrom*. +By default, `.some()` tests the whole collection. Optionally, you can pass the index of an element from which to start the test in *startFrom*. -* Si *startFrom* >= la longueur de la collection, **False** est retourné, ce qui signifie que la collection n'est pas testée. -* Si *startFrom* < 0, il est considéré comme le décalage depuis la fin de la collection. +* If *startFrom* >= the collection's length, **False** is returned, which means the collection is not tested. +* If *startFrom* < 0, it is considered as the offset from the end of the collection. * If *startFrom* = 0, the whole collection is searched (default). -#### Exemple +#### Example ```4d @@ -2603,10 +2604,10 @@ With the following *NumberGreaterThan0* method: ## .sort() -
    Historique -| Version | Modifications | -| ------- | ------------- | -| v16 R6 | Ajoutées | +
    History +| Version | Changes | +| ------- | ------- | +| v16 R6 | Added |
    @@ -2614,22 +2615,22 @@ With the following *NumberGreaterThan0* method: -| Paramètres | Type | | Description | +| Parameter | Type | | Description | | ---------- | ---------- |:--:| ------------------------------------------------ | -| methodName | Texte | -> | Name of method used to specify the sorting order | +| methodName | Text | -> | Name of method used to specify the sorting order | | extraParam | any | -> | Parameter(s) for the method | -| Résultat | Collection | <- | Collection d'origine triée | +| Result | Collection | <- | Original collection sorted | #### Description -La fonction `.sort()` trie les éléments de la collection d'origine et retourne également la collection triée. +The `.sort()` function sorts the elements of the original collection and also returns the sorted collection. > This function modifies the original collection. -Si `.sort()` est appelé sans paramètre, seules les valeurs scalaires (numérique, texte, date, booléens) sont triées. Les éléments sont triés par défaut par ordre croissant, en fonction de leur type. +If `.sort()` is called with no parameters, only scalar values (number, text, date, booleans) are sorted. Elements are sorted by default in ascending order, according to their type. -Si vous souhaitez trier les éléments de la collection dans un autre ordre ou trier n'importe quel type d'élément, vous devez fournir, dans *methodName*, une méthode de comparaison qui compare deux valeurs et retourne **true** dans *$1.result* si la première valeur est inférieure à la deuxième valeur. You can provide additional parameters to *methodName* if necessary. +If you want to sort the collection elements in some other order or sort any type of element, you must supply in *methodName* a comparison method that compares two values and returns **true** in *$1.result* if the first value is lower than the second value. You can provide additional parameters to *methodName* if necessary. * *methodName* will receive the following parameters: * $1 (object), where: @@ -2650,7 +2651,7 @@ If the collection contains elements of different types, they are first grouped b 6. collections 7. dates -#### Exemple 1 +#### Example 1 ```4d @@ -2660,7 +2661,7 @@ If the collection contains elements of different types, they are first grouped b // $col=["Artie","Chip","Henry","Jane","Mary","Tom",1,2,3,4,5,6] ``` -#### Exemple 2 +#### Example 2 ```4d var $col; $col2 : Collection @@ -2691,38 +2692,38 @@ If the collection contains elements of different types, they are first grouped b ## .sum() -
    Historique -| Version | Modifications | -| ------- | ------------- | -| v16 R6 | Ajoutées | +
    History +| Version | Changes | +| ------- | ------- | +| v16 R6 | Added |
    **.sum**( { *propertyPath* : Text } ) : Real -| Paramètres | Type | | Description | -| ------------ | ----- |:--:| ----------------------------------------------- | -| propertyPath | Texte | -> | Object property path to be used for calculation | -| Résultat | Réel | <- | Somme des valeurs de collection | +| Parameter | Type | | Description | +| ------------ | ---- |:--:| ----------------------------------------------- | +| propertyPath | Text | -> | Object property path to be used for calculation | +| Result | Real | <- | Sum of collection values | #### Description -La fonction `.sum()` retourne la somme de toutes les valeurs de l'instance de collection. +The `.sum()` function returns the sum for all values in the collection instance. Only numerical elements are taken into account for the calculation (other element types are ignored). If the collection contains objects, pass the *propertyPath* parameter to indicate the object property to take into account. -`.sum()` retourne 0 si : +`.sum()` returns 0 if: * the collection is empty, * the collection does not contain numerical elements, * *propertyPath* is not found in the collection. -#### Exemple 1 +#### Example 1 ```4d @@ -2732,7 +2733,7 @@ If the collection contains objects, pass the *propertyPath* parameter to indicat $vSum:=$col.sum() //32 ``` -#### Exemple 2 +#### Example 2 ```4d var $col : Collection @@ -2753,32 +2754,32 @@ If the collection contains objects, pass the *propertyPath* parameter to indicat ## .unshift() -
    Historique -| Version | Modifications | -| ------- | ------------- | -| v16 R6 | Ajoutées | +
    History +| Version | Changes | +| ------- | ------- | +| v16 R6 | Added |
    **.unshift**( *value* : any { ;...*valueN* : any } ) : Collection -| Paramètres | Type | | Description | -| ---------- | ----------------------------------------- |:--:| --------------------------------------------- | -| value | Texte, Numérique, Objet, Collection, Date | -> | Valeur(s) à insérer au début de la collection | -| Résultat | Réel | <- | Collection contenant des éléments ajoutés | +| Parameter | Type | | Description | +| --------- | -------------------------------------- |:--:| ----------------------------------------------------- | +| value | Text, Number, Object, Collection, Date | -> | Value(s) to insert at the beginning of the collection | +| Result | Real | <- | Collection containing added element(s) | #### Description -La fonction `.unshift()` insère la ou les *valeur(s)* données au début de la collection et retourne la collection modifiée. +The `.unshift()` function inserts the given *value*(s) at the beginning of the collection and returns the modified collection. > This function modifies the original collection. -Si plusieurs valeurs sont passées, elles sont insérées toutes en même temps, ce qui signifie qu'elles apparaissent dans la collection résultante dans le même ordre que dans la liste d'arguments. +If several values are passed, they are inserted all at once, which means that they appear in the resulting collection in the same order as in the argument list. -#### Exemple +#### Example ```4d diff --git a/website/translated_docs/fr/API/cryptoKeyClass.md b/website/translated_docs/fr/API/cryptoKeyClass.md index 4264febc985567..32816fcbe89417 100644 --- a/website/translated_docs/fr/API/cryptoKeyClass.md +++ b/website/translated_docs/fr/API/cryptoKeyClass.md @@ -4,32 +4,32 @@ title: CryptoKey --- -La classe `CryptoKey` du langage 4D contient une paire de clés de chiffrement asymétrique. +The `CryptoKey` class in the 4D language encapsulates an asymetric encryption key pair. -Cette classe est disponible depuis le "class store" de `4D`. +This class is available from the `4D` class store. -### Exemple +### Example -L'extrait de code suivant illustre la signature et la vérification d'un message à l'aide d'une nouvelle paire de clés ECDSA, afin de créer, par exemple, un token Web JSON ES256. +The following sample code signs and verifies a message using a new ECDSA key pair, for example in order to make a ES256 JSON Web token. ```4d - // Générer une nouvelle paire de clés ECDSA + // Generate a new ECDSA key pair $key:=4D.CryptoKey.new(New object("type";"ECDSA";"curve";"prime256v1")) - // Obtenir une signature en base64 -$message:="hello world" + // Get signature as base64 +$message:="hello world" $signature:=$key.sign($message;New object("hash";"SHA256")) - // Vérifier la signature + // Verify signature $status:=$key.verify($message;$signature;New object("hash";"SHA256")) ASSERT($status.success) ``` -### Sommaire +### Summary | | | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| [](#4dcryptokeynew)

        | +| [](#4dcryptokeynew)

        | | [](#curve)

         | | [](#decrypt)

        | | [](#encrypt)

        | @@ -46,60 +46,62 @@ ASSERT($status.success) + + ## 4D.CryptoKey.new() -

    Historique -| Version | Modifications | -| ------- | ------------- | -| v18 R4 | Ajoutées | +
    History +| Version | Changes | +| ------- | ------- | +| v18 R4 | Added |
    **4D.CryptoKey.new**( *settings* : Object ) : 4D.CryptoKey - -| Paramètres | Type | | Description | -| ---------- | ------------ | -- | --------------------------------------------------------------------------- | -| settings | Objet | -> | Paramètres pour générer ou charger une paire de clés | -| result | 4D.CryptoKey | <- | Objet contenant une paire de clés de chiffrement| + +| Parameter | Type | | Description | +| --------- | ------------ | -- | ---------------------------------------------------------------------- | +| settings | Objet | -> | Settings to generate or load a key pair | +| result | 4D.CryptoKey | <- | Object encapsulating an encryption key pair| | -The `4D.CryptoKey.new()` function creates a new `4D.CryptoKey` object encapsulating an encryption key pair, based upon the *settings* object parameter. Elle permet de générer une nouvelle clé RSA ou ECDSA, ou de charger une paire de clés existante à partir de la définition PEM. +The `4D.CryptoKey.new()` function creates a new `4D.CryptoKey` object encapsulating an encryption key pair, based upon the *settings* object parameter. It allows to generate a new RSA or ECDSA key, or to load an existing key pair from a PEM definition. #### *settings* -| Propriété | Type | Description | -| --------------- | ------- | ------------------------------------------------- | -| [curve](#curve) | Texte | Name of ECDSA curve | -| [pem](#pem) | Texte | Définition PEM d'une clé de chiffrement à charger | -| [size](#size) | integer | Size of RSA key in bits | -| [type](#type) | Texte | Type of the key: "RSA", "ECDSA", or "PEM" | +| Property | Type | Description | +| --------------- | ------- | ---------------------------------------------- | +| [curve](#curve) | text | Name of ECDSA curve | +| [pem](#pem) | text | PEM definition of an encryption key to load | +| [size](#size) | integer | Size of RSA key in bits | +| [type](#type) | text | Type of the key: "RSA", "ECDSA", or "PEM" | #### *cryptoKey* -L'objet `cryptoKey` retourné encapsule une paire de clés de chiffrement. C'est un objet partagé et peut être alors utilisé par de multiples traitements 4D simultanés. - +The returned `cryptoKey` object encapsulates an encryption key pair. It is a shared object and can therefore be used by multiple 4D processes simultaneously. + ## .curve -
    Historique -| Version | Modifications | -| ------- | ------------- | -| v18 R4 | Ajoutées | +
    History +| Version | Changes | +| ------- | ------- | +| v18 R4 | Added |
    -**.curve** : Texte +**.curve** : Text -Défini uniquement pour les clés ECDSA : le nom de la courbe normalisée de la clé. +Defined only for ECDSA keys: the normalised curve name of the key. Usually "prime256v1" for ES256 (default), "secp384r1" for ES384, "secp521r1" for ES512. @@ -107,87 +109,87 @@ Usually "prime256v1" for ES256 (default), "secp384r1" for ES384, "secp521r1" for ## .decrypt() -
    Historique -| Version | Modifications | -| ------- | ------------- | -| v18 R4 | Ajoutées | +
    History +| Version | Changes | +| ------- | ------- | +| v18 R4 | Added |
    **.decrypt**( *message* : Text ; *options* : Object ) : Object -| Paramètres | Type | | Description | -| ---------- | ----- | -- | --------------------------------------------------------------------------------- | -| message | Texte | -> | Chaine message à déchiffrer à l'aide de `options.encodingEncrypted` et decrypted. | -| options | Objet | -> | Options de décodage | -| Résultat | Objet | <- | Statut | +| Parameter | Type | | Description | +| --------- | ----- | -- | ----------------------------------------------------------------------------- | +| message | Text | -> | Message string to be decoded using `options.encodingEncrypted` and decrypted. | +| options | Objet | -> | Decoding options | +| Result | Objet | <- | Status | -La fonction `.encrypt()` déchiffre le paramètre *message* à l'aide de la clé **private** key. L'algorithme utilisé dépend du type de clé. +The `.decrypt()` function decrypts the *message* parameter using the **private** key. The algorithm used depends on the type of the key. -La clé doit être une clé RSA, l'algorithme est RSA-OAEP (voir [RFC 3447](https://tools.ietf.org/html/rfc3447)). +The key must be a RSA key, the algorithm is RSA-OAEP (see [RFC 3447](https://tools.ietf.org/html/rfc3447)). #### *options* -| Propriété | Type | Description | -| ----------------- | ----- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| hash | Texte | Algorithme de hachage à utiliser. For example: "SHA256", "SHA384", or "SHA512". | -| encodingEncrypted | Texte | Chiffrement utilisé pour convertir le paramètre `message` en représentation binaire à déchiffrer. Peut être "Base64" ou "Base64URL". La valeur par défaut est "Base64". | -| encodingDecrypted | Texte | Encodage utilisé pour convertir le message binaire déchiffré en chaîne de résultat. Peut être "UTF-8", "Base64" ou "Base64URL". La valeur par défaut est "UTF-8". | +| Property | Type | Description | +| ----------------- | ---- | ------------------------------------------------------------------------------------------------------------------------------------------------ | +| hash | text | Digest algorithm to use. For example: "SHA256", "SHA384", or "SHA512". | +| encodingEncrypted | text | Encoding used to convert the `message` parameter into the binary representation to decrypt. Can be "Base64" or "Base64URL". Default is "Base64". | +| encodingDecrypted | text | Encoding used to convert the binary decrypted message into the result string. Can be "UTF-8", "Base64", or "Base64URL". Default is "UTF-8". | -#### *Résultat* +#### *Result* -La fonction renvoie un objet "status" avec la propriété `success` définie sur `true` si le *message* a pu être déchiffré avec succès. +The function returns a status object with `success` property set to `true` if the *message* could be successfully decrypted. -| Propriété | Type | Description | -| --------- | ---------- | --------------------------------------------------------------------------- | -| success | boolean | True si le message a été déchiffré avec succès | -| result | Texte | Message déchiffré et décodé à l'aide de `options.encodingDecrypted` | -| errors | collection | Si `success` est mis sur `false`, il peut contenir une collection d'erreurs | +| Property | Type | Description | +| -------- | ---------- | ------------------------------------------------------------------- | +| success | boolean | True if the message has been successfully decrypted | +| result | text | Message decrypted and decoded using the `options.encodingDecrypted` | +| errors | collection | If `success` is `false`, may contain a collection of errors | -Si le *message* n'a pas pu être déchiffré car il n'a pas été chiffré avec la même clé ou le même algorithme, l'objet `status` retourné contient une collection d'erreurs dans `status.errors`. +In case the *message* couldn't be decrypted because it was not encrypted with the same key or algorithm, the `status` object being returned contains an error collection in `status.errors`. ## .encrypt() -
    Historique -| Version | Modifications | -| ------- | ------------- | -| v18 R4 | Ajoutées | +
    History +| Version | Changes | +| ------- | ------- | +| v18 R4 | Added |
    **.encrypt**( *message* : Text ; *options* : Object ) : Text -| Paramètres | Type | | Description | -| ---------- | ----- | -- | ------------------------------------------------------------------------------- | -| message | Texte | -> | Chaine message à chiffrer à l'aide de `options.encodingDecrypted` et encrypted. | -| options | Objet | -> | Options de chiffrement | -| Résultat | Texte | <- | Message chiffré et encodé à l'aide de `options.encodingEncrypted` | +| Parameter | Type | | Description | +| --------- | ----- | -- | ----------------------------------------------------------------------------- | +| message | Text | -> | Message string to be encoded using `options.encodingDecrypted` and encrypted. | +| options | Objet | -> | Encoding options | +| Result | Text | <- | Message encrypted and encoded using the `options.encodingEncrypted` | -La fonction `.encrypt()` crypte le paramètre *message* à l'aide de la clé **publique**. L'algorithme utilisé dépend du type de clé. +The `.encrypt()` function encrypts the *message* parameter using the **public** key. The algorithm used depends on the type of the key. -La clé doit être une clé RSA, l'algorithme est RSA-OAEP (voir [RFC 3447](https://tools.ietf.org/html/rfc3447)). +The key must be a RSA key, the algorithm is RSA-OAEP (see [RFC 3447](https://tools.ietf.org/html/rfc3447)). ##### *options* -| Propriété | Type | Description | -| ----------------- | ----- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| hash | Texte | Algorithme de hachage à utiliser. For example: "SHA256", "SHA384", or "SHA512". | -| encodingEncrypted | Texte | Chiffrement utilisé pour convertir le message chiffré binaire en chaîne de résultat. Peut être "Base64" ou "Base64URL". La valeur par défaut est "Base64". | -| encodingDecrypted | Texte | Chiffrement utilisé pour convertir le paramètre `message` en représentation binaire à chiffrer. Peut être "UTF-8", "Base64" ou "Base64URL". La valeur par défaut est "UTF-8". | +| Property | Type | Description | +| ----------------- | ---- | --------------------------------------------------------------------------------------------------------------------------------------------------------- | +| hash | text | Digest algorithm to use. For example: "SHA256", "SHA384", or "SHA512". | +| encodingEncrypted | text | Encoding used to convert the binary encrypted message into the result string. Can be "Base64", or "Base64URL". Default is "Base64". | +| encodingDecrypted | text | Encoding used to convert the `message` parameter into the binary representation to encrypt. Can be "UTF-8", "Base64", or "Base64URL". Default is "UTF-8". | -#### *Résultat* +#### *Result* -La valeur retournée est un message chiffré. +The returned value is an encrypted message. @@ -196,10 +198,10 @@ La valeur retournée est un message chiffré. ## .getPrivateKey() -
    Historique -| Version | Modifications | -| ------- | ------------- | -| v18 R4 | Ajoutées | +
    History +| Version | Changes | +| ------- | ------- | +| v18 R4 | Added |
    @@ -207,16 +209,16 @@ La valeur retournée est un message chiffré. -| Paramètres | Type | | Description | -| ---------- | ----- | -- | -------------------------- | -| Résultat | Texte | <- | Clé primaire au format PEM | +| Parameter | Type | | Description | +| --------- | ---- | -- | ------------------------- | +| Result | Text | <- | Private key in PEM format | -La fonction `.getPrivateKey()` retourne la clé privée de l'objet `cryptoKey` au format PEM, ou une chaîne vide si aucune n'est disponible. +The `.getPrivateKey()` function returns the private key of the `cryptoKey` object in PEM format, or an empty string if none is available. -#### *Résultat* +#### *Result* -La valeur retournée est la clé privée. +The returned value is the private key. @@ -224,44 +226,44 @@ La valeur retournée est la clé privée. ## .getPublicKey() -
    Historique -| Version | Modifications | -| ------- | ------------- | -| v18 R4 | Ajoutées | +
    History +| Version | Changes | +| ------- | ------- | +| v18 R4 | Added |
    **.getPublicKey( )** : Text -| Paramètres | Type | | Description | -| ---------- | ----- | -- | -------------------------- | -| Résultat | Texte | <- | Clé publique au format PEM | +| Parameter | Type | | Description | +| --------- | ---- | -- | ------------------------ | +| Result | Text | <- | Public key in PEM format | -La fonction `.getPublicKey()` retourne la clé publique de l'objet `cryptoKey` au format PEM, ou une chaîne vide si aucune n'est disponible. +The `.getPublicKey()` function returns the public key of the `cryptoKey` object in PEM format, or an empty string if none is available. -#### *Résultat* +#### *Result* -La valeur retournée est la clé publique. +The returned value is the public key. --- ## .pem -
    Historique -| Version | Modifications | -| ------- | ------------- | -| v18 R4 | Ajoutées | +
    History +| Version | Changes | +| ------- | ------- | +| v18 R4 | Added |
    **.pem** : Text -PEM definition of an encryption key to load. Si la clé est une clé privée, la clé publique RSA ou ECDSA en sera déduite. +PEM definition of an encryption key to load. If the key is a private key, the RSA or ECDSA public key will be deduced from it. @@ -269,39 +271,39 @@ La valeur retournée est la clé publique. ## .sign() -
    Historique -| Version | Modifications | -| ------- | ------------- | -| v18 R4 | Ajoutées | +
    History +| Version | Changes | +| ------- | ------- | +| v18 R4 | Added |
    .**sign** (*message* : Text ; *options* : Text) : Text -| Paramètres | Type | | Description | -| ---------- | ----- | -- | -------------------------------------------------------------------------- | -| message | Texte | -> | Chaîne message à signer | -| options | Objet | -> | Options de signature | -| Résultat | Texte | <- | Signature en représentation Base64 ou Base64URL, selon l'option "encoding" | +| Parameter | Type | | Description | +| --------- | ----- | -- | ------------------------------------------------------------------------------- | +| message | Text | -> | Message string to sign | +| options | Objet | -> | Signing options | +| Result | Text | <- | Signature in Base64 or Base64URL representation, depending on "encoding" option | -La fonction `.sign()` signe la représentation utf8 de la chaîne *message* à l'aide des clés d'objet `cryptoKey` et des *options* fournies. Elle retourne sa signature au format base64 ou base64URL, selon la valeur de l'attribut `options.encoding` que vous avez passé. +The `.sign()` function signs the utf8 representation of a *message* string using the `cryptoKey` object keys and provided *options*. It returns its signature in base64 or base64URL format, depending on the value of the `options.encoding` attribute you passed. -La `cryptoKey` doit contenir une clé **privée** valide. +The `cryptoKey` must contain a valid **private** key. #### *options* -| Propriété | Type | Description | -| ----------------- | ------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| hash | Texte | Algorithme de hachage à utiliser. For example: "SHA256", "SHA384", or "SHA512". Lorsqu'elle est utilisée pour produire un JWT, la taille du hachage doit correspondre à la taille de l'algorithme PS@, ES@, RS@ ou PS@ | -| encodingEncrypted | Texte | Chiffrement utilisé pour convertir le message chiffré binaire en chaîne de résultat. Peut être "Base64" ou "Base64URL". La valeur par défaut est "Base64". | -| pss | boolean | Utilise le Probabilistic Signature Scheme (PSS). Ignoré si la clé n'est pas une clé RSA. Passez `true` lors de la production d'un JWT pour l'algorithme PS@ | -| encoding | Texte | ERepresentation to be used for result signature. Valeurs possibles : "Base64" ou "Base64URL". La valeur par défaut est "Base64". | +| Property | Type | Description | +| ----------------- | ------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| hash | text | Digest algorithm to use. For example: "SHA256", "SHA384", or "SHA512". When used to produce a JWT, the hash size must match the PS@, ES@, RS@, or PS@ algorithm size | +| encodingEncrypted | text | Encoding used to convert the binary encrypted message into the result string. Can be "Base64", or "Base64URL". Default is "Base64". | +| pss | boolean | Use Probabilistic Signature Scheme (PSS). Ignored if the key is not an RSA key. Pass `true` when producing a JWT for PS@ algorithm | +| encoding | text | ERepresentation to be used for result signature. Possible values: "Base64" or "Base64URL". Default is "Base64". | -#### *Résultat* +#### *Result* -Représentation utf8 de la chaîne *message*. +The utf8 representation of the *message* string. @@ -309,79 +311,79 @@ Représentation utf8 de la chaîne *message*. ## .size -
    Historique -| Version | Modifications | -| ------- | ------------- | -| v18 R4 | Ajoutées | +
    History +| Version | Changes | +| ------- | ------- | +| v18 R4 | Added |
    **.size** : Integer -Défini uniquement pour les clés RSA : la taille de la clé en bits. Habituellement 2048 (par défaut). +Defined only for RSA keys: the size of the key in bits. Typically 2048 (default). ## .type -
    Historique -| Version | Modifications | -| ------- | ------------- | -| v18 R4 | Ajoutées | +
    History +| Version | Changes | +| ------- | ------- | +| v18 R4 | Added |
    -**.type** : Texte +**.type** : Text -Name of the key type - "RSA", "ECDSA", "PEM"
  • "RSA": an RSA key pair, using `settings.size` as [.size](#size).
  • "ECDSA": an Elliptic Curve Digital Signature Algorithm key pair, using `settings.curve` as [.curve](#curve). A noter que les clés ECDSA ne peuvent pas être utilisées pour le chiffrement, mais uniquement pour la signature.
  • "PEM": a key pair definition in PEM format, using `settings.pem` as [.pem](#pem). +Name of the key type - "RSA", "ECDSA", "PEM"
  • "RSA": an RSA key pair, using `settings.size` as [.size](#size).
  • "ECDSA": an Elliptic Curve Digital Signature Algorithm key pair, using `settings.curve` as [.curve](#curve). Note that ECDSA keys cannot be used for encryption but only for signature.
  • "PEM": a key pair definition in PEM format, using `settings.pem` as [.pem](#pem). ## .verify() -
    Historique -| Version | Modifications | -| ------- | ------------- | -| v18 R4 | Ajoutées | +
    History +| Version | Changes | +| ------- | ------- | +| v18 R4 | Added |
    **.verify**( *message* : Text ; *signature* : Text ; *options* : Object) : object -| Paramètres | Type | | Description | -| ---------- | ----- | -- | ----------------------------------------------------------------------------------------------- | -| message | Texte | -> | Chaîne message utilisée pour générer la signature | -| signature | Texte | -> | Signature à vérifier, en représentation Base64 ou Base64URL, selon la valeur `options.encoding` | -| options | Objet | -> | Options de signature | -| Résultat | Objet | <- | Statut de la vérification | +| Parameter | Type | | Description | +| --------- | ----- | -- | ------------------------------------------------------------------------------------------------- | +| message | Text | -> | Message string that was used to produce the signature | +| signature | Text | -> | Signature to verify, in Base64 or Base64URL representation, depending on `options.encoding` value | +| options | Objet | -> | Signing options | +| Result | Objet | <- | Status of the verification | -La fonction `.verify()` vérifie la signature base64 par rapport à la représentation utf8 du *message* à l'aide des clés d'objet `cryptoKey` et des *options* fournies. +The `.verify()` function verifies the base64 signature against the utf8 representation of *message* using the `cryptoKey` object keys and provided *options*. -La `cryptoKey` doit contenir une clé **publique** valide. +The `cryptoKey` must contain a valid **public** key. #### *options* -| Propriété | Type | Description | -| --------- | ------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| hash | Texte | Algorithme de hachage à utiliser. For example: "SHA256", "SHA384", or "SHA512". Lorsqu'elle est utilisée pour produire un JWT, la taille du hachage doit correspondre à la taille de l'algorithme PS@, ES@, RS@ ou PS@ | -| pss | boolean | Utilise le Probabilistic Signature Scheme (PSS). Ignoré si la clé n'est pas une clé RSA. Passez `true` lors de la vérification d'un JWT pour l'algorithme PS@ | -| encoding | Texte | Représentation de la signature fournie. Valeurs possibles : "Base64" ou "Base64URL". La valeur par défaut est "Base64". | +| Property | Type | Description | +| -------- | ------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| hash | text | Digest algorithm to use. For example: "SHA256", "SHA384", or "SHA512". When used to produce a JWT, the hash size must match the PS@, ES@, RS@, or PS@ algorithm size | +| pss | boolean | Use Probabilistic Signature Scheme (PSS). Ignored if the key is not an RSA key. Pass `true` when verifying a JWT for PS@ algorithm | +| encoding | text | Representation of provided signature. Possible values are "Base64" or "Base64URL". Default is "Base64". | -#### *Résultat* +#### *Result* -La fonction retourne un objet status avec la propriété `success` définie sur `true` si le `message` a pu être déchiffré avec succès (c'est-à-dire si la signature est correspondante). +The function returns a status object with `success` property set to `true` if `message` could be successfully verified (i.e. the signature matches). -Si la signature n'a pas pu être vérifiée car elle n'a pas été signée avec le même *message*, la clé ou l'algorithme, l'objet `status` retourné contient une collection d'erreurs dans `status.errors`. +In case the signature couldn't be verified because it was not signed with the same *message*, key or algorithm, the `status` object being returned contains an error collection in `status.errors`. -| Propriété | Type | Description | -| --------- | ---------- | --------------------------------------------------------------------------- | -| success | boolean | True si la signature correspond au message | -| errors | collection | Si `success` est mis sur `false`, il peut contenir une collection d'erreurs | +| Property | Type | Description | +| -------- | ---------- | ----------------------------------------------------------- | +| success | boolean | True if the signature matches the message | +| errors | collection | If `success` is `false`, may contain a collection of errors | diff --git a/website/translated_docs/fr/API/dataclassAttributeClass.md b/website/translated_docs/fr/API/dataclassAttributeClass.md index bc1601762a9a4e..6c982321a293e8 100644 --- a/website/translated_docs/fr/API/dataclassAttributeClass.md +++ b/website/translated_docs/fr/API/dataclassAttributeClass.md @@ -3,11 +3,11 @@ id: dataclassAttributeClass title: DataClassAttribute --- -Dataclass attributes are available as properties of their respective classes. Par exemple: +Dataclass attributes are available as properties of their respective classes. For example: ```4d - nameAttribute:=ds.Company.name //référence à un attribut de classe - revenuesAttribute:=ds.Company["revenues"] //méthode alternative + nameAttribute:=ds.Company.name //reference to class attribute + revenuesAttribute:=ds.Company["revenues"] //alternate way ``` This code assigns to *nameAttribute* and *revenuesAttribute* references to the name and revenues attributes of the Company class. This syntax does NOT return values held inside of the attribute, but instead returns references to the attributes themselves. To handle values, you need to go through [**Entities**](entityClass.md). @@ -16,7 +16,7 @@ This code assigns to *nameAttribute* and *revenuesAttribute* references to the n > Dataclass attribute objects can be modified, but the underlying database structure will not be altered. -### Sommaire +### Summary | | | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | @@ -38,15 +38,15 @@ This code assigns to *nameAttribute* and *revenuesAttribute* references to the n ## .autoFilled -
    Historique -| Version | Modifications | -| ------- | ------------- | -| v17 R5 | Ajoutées | +
    History +| Version | Changes | +| ------- | ------- | +| v17 R5 | Added |
    -**.autoFilled** : Booléen +**.autoFilled** : Boolean #### Description @@ -68,15 +68,15 @@ This property is not returned if `.kind` = "relatedEntity" or "relatedEntities". ## .fieldNumber -
    Historique -| Version | Modifications | -| ------- | ------------- | -| v17 R5 | Ajoutées | +
    History +| Version | Changes | +| ------- | ------- | +| v17 R5 | Added |
    -**.fieldNumber** : Entier +**.fieldNumber** : Integer #### Description @@ -95,10 +95,10 @@ This property is not returned if `.kind` = "relatedEntity" or "relatedEntities". ## .fieldType -
    Historique -| Version | Modifications | -| ------- | ------------- | -| v17 R5 | Ajoutées | +
    History +| Version | Changes | +| ------- | ------- | +| v17 R5 | Added |
    @@ -110,13 +110,13 @@ This property is not returned if `.kind` = "relatedEntity" or "relatedEntities". The `.fieldType` property contains the 4D database type of the attribute. It depends on the attribute kind (see [`.kind`](#kind)). -**Valeurs possibles :** +**Possible values:** -| dataClassAttribute.kind | fieldType | Commentaire | -| ----------------------- | --------------------------- | ----------------------- | -| storage | Corresponding 4D field type | Voir la commande `Type` | -| relatedEntity | 38 (Is object) | | -| relatedEntities | 42 (Is collection) | | +| dataClassAttribute.kind | fieldType | Comment | +| ----------------------- | --------------------------- | ------------------ | +| storage | Corresponding 4D field type | See `Type` command | +| relatedEntity | 38 (Is object) | | +| relatedEntities | 42 (Is collection) | | @@ -125,15 +125,15 @@ The `.fieldType` property ## .indexed -
    Historique -| Version | Modifications | -| ------- | ------------- | -| v17 R5 | Ajoutées | +
    History +| Version | Changes | +| ------- | ------- | +| v17 R5 | Added |
    -**.indexed** : Booléen +**.indexed** : Boolean #### Description @@ -151,10 +151,10 @@ This property is not returned if `.kind` = "relatedEntity" or "relatedEntities". ## .inverseName -
    Historique -| Version | Modifications | -| ------- | ------------- | -| v17 R5 | Ajoutées | +
    History +| Version | Changes | +| ------- | ------- | +| v17 R5 | Added |
    @@ -177,10 +177,10 @@ This property is not returned if `.kind` = "storage". It must be of the "related ## .keyWordIndexed -
    Historique -| Version | Modifications | -| ------- | ------------- | -| v17 R5 | Ajoutées | +
    History +| Version | Changes | +| ------- | ------- | +| v17 R5 | Added |
    @@ -202,10 +202,10 @@ This property is not returned if [`.kind`](#kind) = "relatedEntity" or "relatedE ## .kind -
    Historique -| Version | Modifications | -| ------- | ------------- | -| v17 R5 | Ajoutées | +
    History +| Version | Changes | +| ------- | ------- | +| v17 R5 | Added |
    @@ -222,7 +222,7 @@ The `.kind` property returns th * "relatedEntities": 1 -> N relation attribute (reference to an entity selection) -#### Exemple +#### Example Given the following table and relation: @@ -244,10 +244,10 @@ Given the following table and relation: ## .mandatory -
    Historique -| Version | Modifications | -| ------- | ------------- | -| v17 R5 | Ajoutées | +
    History +| Version | Changes | +| ------- | ------- | +| v17 R5 | Added |
    @@ -271,10 +271,10 @@ This property is not returned if [`.kind`](#kind) = "relatedEntity" or "relatedE ## .name -
    Historique -| Version | Modifications | -| ------- | ------------- | -| v17 R5 | Ajoutées | +
    History +| Version | Changes | +| ------- | ------- | +| v17 R5 | Added |
    @@ -284,9 +284,9 @@ This property is not returned if [`.kind`](#kind) = "relatedEntity" or "relatedE #### Description -La propriété `.name` retourne le nom de l'objet `dataClassAttribute` en chaîne. +The `.name` property returns the name of the `dataClassAttribute` object as string. -#### Exemple +#### Example ```4d var $attName : Text @@ -300,10 +300,10 @@ La propriété `.name` retourne ## .relatedDataClass -
    Historique -| Version | Modifications | -| ------- | ------------- | -| v17 R5 | Ajoutées | +
    History +| Version | Changes | +| ------- | ------- | +| v17 R5 | Added |
    @@ -313,13 +313,13 @@ La propriété `.name` retourne #### Description -> Cette propriété n'est disponible qu'avec les attributs de la propriété "relatedEntity" ou "relatedEntities" [`.kind`](#kind). +> This property is only available with attributes of the "relatedEntity" or "relatedEntities" [`.kind`](#kind) property. -La propriété `.relatedDataClass` retourne le nom de la dataclass associée à l'attribut. +The `.relatedDataClass` property returns the name of the dataclass related to the attribute. -#### Exemple +#### Example -Considérons les tableaux et relations suivants : +Given the following tables and relations: ![](assets/en/API/dataclassAttribute4.png) @@ -337,30 +337,30 @@ Considérons les tableaux et relations suivants : ## .type -
    Historique -| Version | Modifications | -| ------- | ------------- | -| v17 R5 | Ajoutées | +
    History +| Version | Changes | +| ------- | ------- | +| v17 R5 | Added |
    -**.type** : Texte +**.type** : Text #### Description -La propriété `.type` contient le type de valeur conceptuelle de l'attribut, utile pour la programmation générique. +The `.type` property contains the conceptual value type of the attribute, useful for generic programming. -Le type de valeur conceptuelle dépend de l'attribut [`.kind`](#kind). +The conceptual value type depends on the attribute [`.kind`](#kind). -**Valeurs possibles :** +**Possible values:** -| dataClassAttribute.kind | type | Commentaire | -| ----------------------- | -------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | -| storage | "number", "date", "object", "bool", "image", ou "string" | "nombre" est rertourné pour tous les types numériques, y compris la durée. "string" est retourné pour les types de champs uuid, alpha et text | -| relatedEntity | nom de dataClass associé | Ex : "Companies" | -| relatedEntities | nom de dataClass associé + suffixe "Selection" | Ex : "EmployeeSelection" | +| dataClassAttribute.kind | type | Comment | +| ----------------------- | -------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------ | +| storage | "number", "date", "object", "bool", "image", or "string" | "number" is returned for any numeric types including duration. "string" is returned for uuid, alpha and text field types | +| relatedEntity | related dataClass name | Ex: "Companies" | +| relatedEntities | related dataClass name + "Selection" suffix | Ex: "EmployeeSelection" | @@ -370,23 +370,23 @@ Le type de valeur conceptuelle dépend de l'attribut [`.kind`](#kind). ## .unique -
    Historique -| Version | Modifications | -| ------- | ------------- | -| v17 R5 | Ajoutées | +
    History +| Version | Changes | +| ------- | ------- | +| v17 R5 | Added |
    -**.unique** : Booléen +**.unique** : Boolean #### Description -La propriété `.unique` contient True si la valeur d'attribut doit être unique. Cette propriété correspond à la propriété de champ 4D "Unique". +The `.unique` property contains True if the attribute value must be unique. This property corresponds to the "Unique" 4D field property. This property is not returned if [`.kind`](#kind) = "relatedEntity" or "relatedEntities". -> Pour la programmation générique, vous pouvez utiliser **Bool** (dataClassAttribute.unique) pour obtenir une valeur valide (false) même si `.unique` n'est pas retourné. +> For generic programming, you can use **Bool**(dataClassAttribute.unique) to get a valid value (false) even if `.unique` is not returned. diff --git a/website/translated_docs/fr/API/dataclassClass.md b/website/translated_docs/fr/API/dataclassClass.md index ca3e087e3a7273..40a02c2620f98d 100644 --- a/website/translated_docs/fr/API/dataclassClass.md +++ b/website/translated_docs/fr/API/dataclassClass.md @@ -8,7 +8,7 @@ A [DataClass](ORDA/dsMapping.md#dataclass) provides an object interface to a dat -### Sommaire +### Summary | | | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | @@ -27,10 +27,10 @@ A [DataClass](ORDA/dsMapping.md#dataclass) provides an object interface to a dat ## .*attributeName* -
    Historique -| Version | Modifications | -| ------- | ------------- | -| v17 | Ajoutées | +
    History +| Version | Changes | +| ------- | ------- | +| v17 | Added |
    @@ -44,7 +44,7 @@ The attributes of dataclasses are ## .all() -
    Historique -| Version | Modifications | +
    History +| Version | Changes | | ------- | ----------------------------------- | | v17 R5 | Support of the *settings* parameter | -| v17 | Ajoutées | +| v17 | Added |
    @@ -110,10 +110,10 @@ Considering the following table properties: **.all** ( { *settings* : Object } ) : 4D.EntitySelection -| Paramètres | Type | | Description | -| ---------- | ------------------ |:--:| --------------------------------------------------- | -| settings | Objet | -> | Build option: context | -| Résultat | 4D.EntitySelection | <- | References on all entities related to the Dataclass | +| Parameter | Type | | Description | +| --------- | ------------------ |:--:| --------------------------------------------------- | +| settings | Objet | -> | Build option: context | +| Result | 4D.EntitySelection | <- | References on all entities related to the Dataclass | @@ -131,12 +131,12 @@ Lazy loading is applied. In the optional *settings* parameter, you can pass an object containing additional options. The following property is supported: -| Propriété | Type | Description | -| --------- | ----- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| context | Texte | Label for the optimization context applied to the entity selection. This context will be used by the code that handles the entity selection so that it can benefit from the optimization. This feature is [designed for ORDA client/server processing](ORDA/entities.md#client-server-optimization). | +| Property | Type | Description | +| -------- | ---- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| context | Text | Label for the optimization context applied to the entity selection. This context will be used by the code that handles the entity selection so that it can benefit from the optimization. This feature is [designed for ORDA client/server processing](ORDA/entities.md#client-server-optimization). | -#### Exemple +#### Example ```4d var $allEmp : cs.EmployeeSelection @@ -151,11 +151,11 @@ In the optional *settings* parameter, you can pass an object containing addition ## .fromCollection() -
    Historique -| Version | Modifications | +
    History +| Version | Changes | | ------- | ----------------------------------- | | v17 R5 | Support of the *settings* parameter | -| v17 | Ajoutées | +| v17 | Added |
    @@ -163,11 +163,11 @@ In the optional *settings* parameter, you can pass an object containing addition -| Paramètres | Type | | Description | -| ---------- | ------------------ |:--:| ------------------------------------------------ | -| objectCol | Collection | -> | Collection of objects to be mapped with entities | -| settings | Objet | -> | Build option: context | -| Résultat | 4D.EntitySelection | <- | Entity selection filled from the collection | +| Parameter | Type | | Description | +| --------- | ------------------ |:--:| ------------------------------------------------ | +| objectCol | Collection | -> | Collection of objects to be mapped with entities | +| settings | Objet | -> | Build option: context | +| Result | 4D.EntitySelection | <- | Entity selection filled from the collection | @@ -208,12 +208,12 @@ If a \_\_STAMP attribute is given, a check is performed with the stamp in the da In the optional *settings* parameter, you can pass an object containing additional options. The following property is supported: -| Propriété | Type | Description | -| --------- | ----- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| context | Texte | Label for the optimization context applied to the entity selection. This context will be used by the code that handles the entity selection so that it can benefit from the optimization. This feature is [designed for ORDA client/server processing](ORDA/entities.md#client-server-optimization). | +| Property | Type | Description | +| -------- | ---- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| context | Text | Label for the optimization context applied to the entity selection. This context will be used by the code that handles the entity selection so that it can benefit from the optimization. This feature is [designed for ORDA client/server processing](ORDA/entities.md#client-server-optimization). | -#### Exemple 1 +#### Example 1 We want to update an existing entity. The \_\_NEW property is not given, the employee primary key is given and exists: @@ -233,7 +233,7 @@ We want to update an existing entity. The \_\_NEW property is not given, the emp $employees:=ds.Employee.fromCollection($empsCollection) ``` -#### Exemple 2 +#### Example 2 We want to update an existing entity. The \_\_NEW property is not given, the employee primary key is with the \_\_KEY attribute and exists: @@ -336,7 +336,7 @@ In this example, the first entity will be created and saved but the second will //duplicated key error for the second entity ``` -#### Voir également +#### See also [**.toCollection()**](entitySelectionClass.md#tocollection) @@ -346,10 +346,10 @@ In this example, the first entity will be created and saved but the second will ## .get() -
    Historique -| Version | Modifications | -| ------- | ------------- | -| v17 | Ajoutées | +
    History +| Version | Changes | +| ------- | ------- | +| v17 | Added |
    @@ -358,11 +358,11 @@ In this example, the first entity will be created and saved but the second will -| Paramètres | Type | | Description | +| Parameter | Type | | Description | | ---------- | --------------- |:--:| ------------------------------------------- | | primaryKey | Integer OR Text | -> | Primary key value of the entity to retrieve | | settings | Objet | -> | Build option: context | -| Résultat | 4D.Entity | <- | Entity matching the designated primary key | +| Result | 4D.Entity | <- | Entity matching the designated primary key | #### Description @@ -379,13 +379,13 @@ Lazy loading is applied, which means that related data is loaded from disk only In the optional *settings* parameter, you can pass an object containing additional options. The following property is supported: -| Propriété | Type | Description | -| --------- | ----- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| context | Texte | Label for the automatic optimization context applied to the entity. This context will be used by the subsequent code that loads the entity so that it can benefit from the optimization. This feature is [designed for ORDA client/server processing](ORDA/entities.md#client-server-optimization). | +| Property | Type | Description | +| -------- | ---- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| context | Text | Label for the automatic optimization context applied to the entity. This context will be used by the subsequent code that loads the entity so that it can benefit from the optimization. This feature is [designed for ORDA client/server processing](ORDA/entities.md#client-server-optimization). | -#### Exemple 1 +#### Example 1 ```4d var $entity : cs.EmployeeEntity @@ -394,7 +394,7 @@ In the optional *settings* parameter, you can pass an object containing addition $entity2:=ds.Invoice.get("DGGX20030") // return the entity whose primary key value is "DGGX20030" ``` -#### Exemple 2 +#### Example 2 This example illustrates the use of the *context* property: @@ -425,19 +425,19 @@ This example illustrates the use of the *context* property: ## .getDataStore() -
    Historique -| Version | Modifications | -| ------- | ------------- | -| v17 R5 | Ajoutées | +
    History +| Version | Changes | +| ------- | ------- | +| v17 R5 | Added |
    **.getDataStore()** : cs.DataStore -| Paramètres | Type | | Description | -| ---------- | ------------ |:--:| -------------------------- | -| Résultat | cs.DataStore | <- | Datastore of the dataclass | +| Parameter | Type | | Description | +| --------- | ------------ |:--:| -------------------------- | +| Result | cs.DataStore | <- | Datastore of the dataclass | @@ -451,7 +451,7 @@ The datastore can be: * a remote datastore, opened using the `Open datastore` command. -#### Exemple +#### Example The ***SearchDuplicate*** project method searches for duplicated values in any dataclass. @@ -479,19 +479,19 @@ The ***SearchDuplicate*** project method searches for duplicated values in any d ## .getInfo() -
    Historique -| Version | Modifications | -| ------- | ------------- | -| v17 R5 | Ajoutées | +
    History +| Version | Changes | +| ------- | ------- | +| v17 R5 | Added |
    **.getInfo()** : Object -| Paramètres | Type | | Description | -| ---------- | ----- | -- | ---------------------------- | -| Résultat | Objet | <- | Information on the dataclass | +| Parameter | Type | | Description | +| --------- | ----- | -- | ---------------------------- | +| Result | Objet | <- | Information on the dataclass | @@ -501,15 +501,15 @@ The `.getInfo( )` function returns **Returned object** -| Propriété | Type | Description | -| ----------- | ----------- | ---------------------------------------- | -| name | Texte | Nom de la dataclass | -| primaryKey | Texte | Name of the primary key of the dataclass | -| tableNumber | Entier long | Internal 4D table number | +| Property | Type | Description | +| ----------- | ------- | ---------------------------------------- | +| name | Text | Name of the dataclass | +| primaryKey | Text | Name of the primary key of the dataclass | +| tableNumber | Integer | Internal 4D table number | -#### Exemple 1 +#### Example 1 ```4d #DECLARE ($entity : Object) @@ -523,7 +523,7 @@ The `.getInfo( )` function returns End if ``` -#### Exemple 2 +#### Example 2 ```4d var $settings : Object @@ -552,19 +552,19 @@ The `.getInfo( )` function returns ## .new() -
    Historique -| Version | Modifications | -| ------- | ------------- | -| v17 | Ajoutées | +
    History +| Version | Changes | +| ------- | ------- | +| v17 | Added |
    **.new()** : 4D.Entity -| Paramètres | Type | | Description | -| ---------- | --------- | -- | --------------------------------- | -| Résultat | 4D.Entity | <- | New entity matching the Dataclass | +| Parameter | Type | | Description | +| --------- | --------- | -- | --------------------------------- | +| Result | 4D.Entity | <- | New entity matching the Dataclass | @@ -576,7 +576,7 @@ The entity object is created in memory and is not saved in the database until th **4D Server**: In client-server, if the primary key of the corresponding table is auto-incremented, it will be calculated when the entity is saved on the server. -#### Exemple +#### Example This example creates a new entity in the "Log" Dataclass and records information in the "info" attribute: @@ -595,28 +595,28 @@ This example creates a new entity in the "Log" Dataclass and records information ## .newSelection() -
    Historique -| Version | Modifications | -| ------- | ------------- | -| v17 | Ajoutées | +
    History +| Version | Changes | +| ------- | ------- | +| v17 | Added |
    **.newSelection**( { *keepOrder* : Integer } ) : 4D.EntitySelection -| Paramètres | Type | | Description | -| ---------- | ------------------ | -- | --------------------------------------------------------------------------------------------------------------------------------------------- | -| keepOrder | Entier long | -> | `dk keep ordered`: creates an ordered entity selection,
    `dk non ordered`: creates an unordered entity selection (default if omitted) | -| Résultat | 4D.EntitySelection | <- | New blank entity selection related to the dataclass | +| 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 | #### Description -La fonction `.newSelection()` crée une nouvelle sélection d'entité vide, non partageable, liée à la dataclass, en mémoire. +The `.newSelection( )` function creates a new, blank, non-shareable entity selection, related to the dataclass, in memory. -> Pour plus d'informations sur les sélections d'entités non partageables, veuillez vous reporter à [cette section](ORDA/entities.md#shareable-or-non-shareable-entity-selections). +> For information on non-shareable entity selections, please refer to [this section](ORDA/entities.md#shareable-or-non-shareable-entity-selections). If you want to create an ordered entity selection, pass the `dk keep ordered` selector in the *keepOrder* parameter. By default if you omit this parameter, or if you pass the `dk non ordered` selector, the method creates an unordered entity selection. Unordered entity selections are faster but you cannot rely on entity positions. For more information, please see [Ordered vs Unordered entity selections](ORDA/dsMapping.md#ordered-or-unordered-entity-selection). @@ -624,7 +624,7 @@ If you want to create an ordered entity selection, pass the `dk keep ordered` se When created, the entity selection does not contain any entities (`mySelection.length` returns 0). This method lets you build entity selections gradually by making subsequent calls to the [`add()`](entitySelectionClass.md#add) function. -#### Exemple +#### Example ```4d @@ -641,23 +641,23 @@ When created, the entity selection does not contain any entities (`mySelection.l ## .query() -
    Historique -| Version | Modifications | -| ------- | ------------- | -| v17 | Ajoutées | +
    History +| Version | Changes | +| ------- | ------- | +| v17 | Added |
    **.query**( *queryString* : Text { ; *...value* : expression } { ; *querySettings* : Object } ) : 4D.EntitySelection
    **.query**( *formula* : Object { ; *querySettings* : Object } ) : 4D.EntitySelection -| Paramètres | Type | | Description | +| Parameter | Type | | Description | | ------------- | ------------------ | -- | --------------------------------------------------------------------------------------------------------------------------- | -| queryString | Texte | -> | Search criteria as string | +| queryString | Text | -> | Search criteria as string | | formula | Objet | -> | Search criteria as formula object | | value | expression | -> | Value(s) to use for indexed placeholder(s) | | querySettings | Objet | -> | Query options: parameters, attributes, args, allowFormulas, context, queryPath, queryPlan | -| Résultat | 4D.EntitySelection | <- | New entity selection made up of entities from dataclass meeting the search criteria specified in *queryString* or *formula* | +| Result | 4D.EntitySelection | <- | New entity selection made up of entities from dataclass meeting the search criteria specified in *queryString* or *formula* | @@ -695,19 +695,19 @@ where: * **comparator**: symbol that compares *attributePath* and *value*. The following symbols are supported: - | Comparison | Symbol(s) | Commentaire | + | Comparison | Symbol(s) | Comment | | ------------------------------------ | ----------- | -------------------------------------------------------------------------------------------------------------- | | Equal to | =, == | Gets matching data, supports the wildcard (@), neither case-sensitive nor diacritic. | | | ===, IS | Gets matching data, considers the @ as a standard character, neither case-sensitive nor diacritic | | Not equal to | #, != | Supports the wildcard (@) | | | !==, IS NOT | Considers the @ as a standard character | - | Inférieur à | < | | - | Supérieur à | > | | - | Inférieur ou égal à | <= | | - | Supérieur ou égal à | >= | | + | Less than | < | | + | Greater than | > | | + | Less than or equal to | <= | | + | Greater than or equal to | >= | | | Included in | IN | Gets data equal to at least one of the values in a collection or in a set of values, supports the wildcard (@) | | Not condition applied on a statement | NOT | Parenthesis are mandatory when NOT is used before a statement containing several operators | - | Contient mot-clé | % | Keywords can be used in attributes of string or picture type | + | Contains keyword | % | Keywords can be used in attributes of string or picture type | * **value**: the value to compare to the current value of the property of each entity in the entity selection or element in the collection. It can be a **placeholder** (see **Using placeholders** below) or any expression matching the data type property.

    When using a constant value, the following rules must be respected: * **text** type constant can be passed with or without simple quotes (see **Using quotes** below). To query a string within a string (a "contains" query), use the wildcard symbol (@) in value to isolate the string to be searched for as shown in this example: "@Smith@". The following keywords are forbidden for text constants: true, false. @@ -720,14 +720,14 @@ where: | Conjunction | Symbol(s) | | ----------- | ----------------------- | | AND | &, &&, and | - | OU | |,||, or | + | OR | |,||, or | * **order by attributePath**: you can include an order by *attributePath* statement in the query so that the resulting data will be sorted according to that statement. You can use multiple order by statements, separated by commas (e.g., order by *attributePath1* desc, *attributePath2* asc). By default, the order is ascending. Pass 'desc' to define a descending order and 'asc' to define an ascending order. > *If you use this statement, the returned entity selection is ordered (for more information, please refer to [Ordered vs Unordered entity selections](ORDA/dsMapping.md#ordered-or-unordered-entity-selection)). **Using quotes** -When you use quotes within queries, you must use single quotes ' ' inside the query and double quotes " " to enclose the whole query, otherwise an error is returned. Par exemple: +When you use quotes within queries, you must use single quotes ' ' inside the query and double quotes " " to enclose the whole query, otherwise an error is returned. For example: ```4d "employee.name = 'smith' AND employee.firstname = 'john'" @@ -770,8 +770,8 @@ Two types of placeholders can be used: **indexed placeholders** and **named plac | - | Indexed placeholders | Named placeholders | | ---------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| Définition | Parameters are inserted as :paramIndex (for example :1, :2...) in queryString and their corresponding values are provided by the sequence of value parameter(s). You can use up to 128 value parameters | Parameters are inserted as :paramName (for example :myparam) and their values are provided in the attributes and/or parameters objects in the querySettings parameter | -| Exemple | $r:=class.query(":1=:2";"city";"Chicago") | $o.attributes:=New object("att";"city")
    $o.parameters:=New object("name";"Chicago")
    $r:=class.query(":att=:name";$o) | +| Definition | Parameters are inserted as :paramIndex (for example :1, :2...) in queryString and their corresponding values are provided by the sequence of value parameter(s). You can use up to 128 value parameters | Parameters are inserted as :paramName (for example :myparam) and their values are provided in the attributes and/or parameters objects in the querySettings parameter | +| Example | $r:=class.query(":1=:2";"city";"Chicago") | $o.attributes:=New object("att";"city")
    $o.parameters:=New object("name";"Chicago")
    $r:=class.query(":att=:name";$o) | You can mix all argument kinds in *queryString*. A *queryString* can contain, for *attributePath*, *formula* and *value* parameters: @@ -800,7 +800,7 @@ You can mix all argument kinds in *queryString*. A *queryString* can contain, fo 2. It prevents having to worry about formatting or character issues, especially when handling *attributePath* or *value* parameters that might contain non-alphanumeric characters such as ".", "['... -3. It allows the use of variables or expressions in query arguments. Voici quelques exemples : +3. It allows the use of variables or expressions in query arguments. Examples: ```4d $result:=$col.query("address.city = :1 & name =:2";$city;$myVar+"@") @@ -837,21 +837,21 @@ The formula must have been created using the `Formula` or `Formula from string` **querySettings parameter** -In the *querySettings* parameter, you can pass an object containing additional options. Les propriétés suivantes sont prises en charge : +In the *querySettings* parameter, you can pass an object containing additional options. The following properties are supported: -| Propriété | Type | Description | +| Property | Type | Description | | ------------- | ------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | parameters | Objet | **Named placeholders for values** used in the *queryString* or *formula*. Values are expressed as property / value pairs, where property is the placeholder name inserted for a value in the *queryString* or *formula* (":placeholder") and value is the value to compare. You can mix indexed placeholders (values directly passed in value parameters) and named placeholder values in the same query. | | attributes | Objet | **Named placeholders for attribute paths** used in the *queryString* or *formula*. Attributes are expressed as property / value pairs, where property is the placeholder name inserted for an attribute path in the *queryString* or *formula* (":placeholder"), and value can be a string or a collection of strings. Each value is a path that can designate either a scalar or a related attribute of the dataclass or a property in an object field of the dataclass

    TypeDescription
    ChaineattributePath expressed using the dot notation, e.g. "name" or "user.address.zipCode"
    Collection of stringsEach string of the collection represents a level of attributePath, e.g. \["name"] or \["user","address","zipCode"]. Using a collection allows querying on attributes with names that are not compliant with dot notation, e.g. \["4Dv17.1","en/fr"]
    You can mix indexed placeholders (values directly passed in *value* parameters) and named placeholder values in the same query. | | args | Objet | Parameter(s) to pass to formulas, if any. The **args** object will be received in $1 within formulas and thus its values will be available through *$1.property* (see example 3). | | allowFormulas | Booléen | True to allow the formula calls in the query (default). Pass false to disallow formula execution. If set to false and `query()` is given a formula, an error is sent (1278 - Formula not allowed in this member method). | -| context | Texte | Label for the automatic optimization context applied to the entity selection. This context will be used by the code that handles the entity selection so that it can benefit from the optimization. This feature is designed for client/server processing; for more information, please refer to the **Client/server optimization** section. | +| context | Text | Label for the automatic optimization context applied to the entity selection. This context will be used by the code that handles the entity selection so that it can benefit from the optimization. This feature is designed for client/server processing; for more information, please refer to the **Client/server optimization** section. | | queryPlan | Booléen | In the resulting entity selection, returns or does not return the detailed description of the query just before it is executed, i.e. the planned query. The returned property is an object that includes each planned query and subquery (in the case of a complex query). This option is useful during the development phase of an application. It is usually used in conjunction with queryPath. Default if omitted: false. **Note**: This property is supported only by the `entitySelection.query( )` and `dataClass.query( )` functions. | | queryPath | Booléen | In the resulting entity selection, returns or does not return the detailed description of the query as it is actually performed. The returned property is an object that contains the actual path used for the query (usually identical to that of the queryPlan, but may differ if the engine manages to optimize the query), as well as the processing time and the number of records found. This option is useful during the development phase of an application. Default if omitted: false. **Note**: This property is supported only by the `entitySelection.query( )` and `dataClass.query( )` functions. | **About queryPlan and queryPath** -The information recorded in `queryPlan`/`queryPath` include the query type (indexed and sequential) and each necessary subquery along with conjunction operators. Les chemins d'accès des requêtes contiennent également le nombre d'entités identifiées et la durée d'exécution de chaque critère de recherche. You may find it useful to analyze this information while developing your application(s). Généralement, la description du plan de requête et son chemin d'accès sont identiques mais ils peuvent différer car 4D peut intégrer des optimisations dynamiques lorsqu'une requête est exécutée, afin d'améliorer les performances. Par exemple, le moteur 4D peut convertir dynamiquement une requête indexée en requête séquentielle s'il estime que ce processus est plus rapide. Ce cas particulier peut se produire lorsque le nombre d'entités recherchées est faible. +The information recorded in `queryPlan`/`queryPath` include the query type (indexed and sequential) and each necessary subquery along with conjunction operators. Query paths also contain the number of entities found and the time required to execute each search criterion. You may find it useful to analyze this information while developing your application(s). Generally, the description of the query plan and its path are identical but they can differ because 4D can implement dynamic optimizations when a query is executed in order to improve performance. For example, the 4D engine can dynamically convert an indexed query into a sequential one if it estimates that it is faster. This particular case can occur when the number of entities being searched for is low. For example, if you execute the following query: @@ -880,7 +880,7 @@ queryPath: steps:[{steps:[{description:[index : Company.revenues ] > 10000000,time:0,recordsfounds:933}]}]}]}]} ``` -#### Exemple 1 +#### Example 1 This section provides various examples of queries. @@ -945,7 +945,7 @@ Query with queryPlan and queryPath objects: ```4d $entitySelection:=ds.Employee.query("(firstName = :1 or firstName = :2) and (lastName = :3 or lastName = :4)";"D@";"R@";"S@";"K@";New object("queryPlan";True;"queryPath";True)) - //vous pouvez ensuite obtenir ces propriétés dans la sélection d'entité résultante + //you can then get these properties in the resulting entity selection var $queryPlan; $queryPath : Object $queryPlan:=$entitySelection.queryPlan $queryPath:=$entitySelection.queryPath @@ -980,7 +980,7 @@ Query with indexed placeholders for attributes: ```4d var $es : cs.EmployeeSelection $es:=ds.Employee.query(":1 = 1234 and :2 = 'Smith'";"salesperson.userId";"name") - //salesperson est une entité reliée + //salesperson is a related entity ``` Query with indexed placeholders for attributes and named placeholders for values: @@ -991,7 +991,7 @@ var $querySettings : Object $querySettings:=New object $querySettings.parameters:=New object("customerName";"Smith") $es:=ds.Customer.query(":1 = 1234 and :2 = :customerName";"salesperson.userId";"name";$querySettings) - //salesperson est une entité reliée + //salesperson is a related entity ``` Query with indexed placeholders for attributes and values: @@ -1000,10 +1000,10 @@ Query with indexed placeholders for attributes and values: ```4d var $es : cs.EmployeeSelection $es:=ds.Clients.query(":1 = 1234 and :2 = :3";"salesperson.userId";"name";"Smith") - //salesperson est une entité reliée + //salesperson is a related entity ``` -#### Exemple 2 +#### Example 2 This section illustrates queries with named placeholders for attributes. @@ -1051,12 +1051,12 @@ Query with named placeholders for attributes and values: var $es : cs.EmployeeSelection var $name : Text $querySettings:=New object - //Placeholders pour les valeurs - //Il est demandé à l'utilisateur de saisir un nom - $name:=Request("Veuillez saisir un nom à rechercher :") + //Named placeholders for values + //The user is asked for a name + $name:=Request("Please enter the name to search:") If(OK=1) $querySettings.parameters:=New object("givenName";$name) - //Placeholders pour les chemins d'attributs + //Named placeholders for attribute paths $querySettings.attributes:=New object("attName";"name") $es:=ds.Employee.query(":attName= :givenName";$querySettings) End if @@ -1112,7 +1112,7 @@ A text formula in *queryString* receives a parameter: ``` ```4d - //méthode checkName + //checkName method #DECLARE($exclude : Text) -> $result : Boolean $result:=(Position($exclude;This.lastname)=0) ``` @@ -1126,7 +1126,7 @@ Using the same ***checkName*** method, a `Formula` object as placeholder receive $settings:=New object() $settings.args:=New object("filter";"-") $es:=ds.Students.query(":1 and nationality=:2";$formula;"French";$settings) - $settings.args.filter:="*" // modifie les paramètres sans mettre à jour l'objet $formula + $settings.args.filter:="*" // change the parameters without updating the $formula object $es:=ds.Students.query(":1 and nationality=:2";$formula;"French";$settings) ``` @@ -1139,7 +1139,7 @@ We want to disallow formulas, for example when the user enters their query: $queryString:=Request("Enter your query:") if(OK=1) $settings:=New object("allowFormulas";False) - $es:=ds.Students.query($queryString;$settings) //Une erreur est gnérée si $queryString contient une formule + $es:=ds.Students.query($queryString;$settings) //An error is raised if $queryString contains a formula End if ``` diff --git a/website/translated_docs/fr/API/datastoreClass.md b/website/translated_docs/fr/API/datastoreClass.md index 5574e1eb193b71..478a9d29dfc1bd 100644 --- a/website/translated_docs/fr/API/datastoreClass.md +++ b/website/translated_docs/fr/API/datastoreClass.md @@ -8,15 +8,16 @@ A [Datastore](ORDA/dsMapping.md#datastore) is the interface object provided by O * [ds](#ds): a shortcut to the main datastore * [Open datastore](#open-datastore): to open any remote datastore -### Sommaire +### Summary -| | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | [](#canceltransaction)

        | | [](#dataclassname)

         | | [](#encryptionstatus)

         | | [](#getinfo)

         | | [](#getrequestlog)

         | +| [](#makeSelectionsAlterable)

         | | [](#providedatakey)

         | | [](#startrequestlog)

         | | [](#starttransaction)

         | @@ -29,21 +30,21 @@ A [Datastore](ORDA/dsMapping.md#datastore) is the interface object provided by O ## ds -

    Historique -| Version | Modifications | +
    History +| Version | Changes | | ------- | ---------------------------- | | v18 | Support of localID parameter | -| v17 | Ajoutées | +| v17 | Added |
    **ds** { ( *localID* : Text ) } : cs.DataStore -| Paramètres | Type | | Description | -| ---------- | ------------ | -- | ------------------------------------------ | -| localID | Texte | -> | Local ID of the remote datastore to return | -| Résultat | cs.DataStore | <- | Reference to the datastore | +| Parameter | Type | | Description | +| --------- | ------------ | -- | ------------------------------------------ | +| localID | Text | -> | Local ID of the remote datastore to return | +| Result | cs.DataStore | <- | Reference to the datastore | @@ -65,7 +66,7 @@ Using `ds` requires that the target database is compliant with ORDA, as specifie -#### Exemple 1 +#### Example 1 Using the main datastore on the 4D database: @@ -73,9 +74,9 @@ Using the main datastore on the 4D database: $result:=ds.Employee.query("firstName = :1";"S@") ``` -#### Exemple 2 +#### Example 2 -```4d +```4d var $connectTo; $firstFrench; $firstForeign : Object var $frenchStudents; $foreignStudents : cs.DataStore @@ -92,7 +93,7 @@ Using the main datastore on the 4D database: ``` ```4d - //méthode getFirst + //getFirst method //getFirst(localID;dataclass) -> entity #DECLARE( $localId : Text; $dataClassName : Text ) -> $entity : 4D.Entity @@ -104,21 +105,21 @@ Using the main datastore on the 4D database: ## Open datastore -
    Historique -| Version | Modifications | -| ------- | ------------- | -| v18 | Ajoutées | +
    History +| Version | Changes | +| ------- | ------- | +| v18 | Added |
    **Open datastore**( *connectionInfo* : Object ; *localID* : Text ) : cs.DataStore -| Paramètres | Type | | Description | +| Parameter | Type | | Description | | -------------- | ------------ | -- | ------------------------------------------------------------------------- | | connectionInfo | Objet | -> | Connection properties used to reach the remote datastore | -| localID | Texte | -> | Id to assign to the opened datastore on the local application (mandatory) | -| Résultat | cs.DataStore | <- | Datastore object | +| localID | Text | -> | Id to assign to the opened datastore on the local application (mandatory) | +| Result | cs.DataStore | <- | Datastore object | @@ -146,14 +147,14 @@ Once the session is opened, the following statements become equivalent and retur Pass in *connectionInfo* an object describing the remote datastore you want to connect to. It can contain the following properties (all properties are optional except *hostname*): -| Propriété | Type | Description | -| ----------- | ----------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| hostname | Texte | Name or IP address of the remote database + ":" + port number (port number is mandatory) | -| user | Texte | User name | -| password | Texte | User password | -| idleTimeout | Entier long | Inactivity session timeout (in minutes), after which the session is automatically closed by 4D. If omitted, default value is 60 (1h). The value cannot be < 60 (if a lower value is passed, the timeout is set to 60). For more information, see **Closing sessions**. | -| tls | Booléen | Use secured connection(*). If omitted, false by default. Using a secured connection is recommended whenever possible. | -| type | Texte | Must be "4D Server" | +| Property | Type | Description | +| ----------- | ------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| hostname | Text | Name or IP address of the remote database + ":" + port number (port number is mandatory) | +| user | Text | User name | +| password | Text | User password | +| idleTimeout | Longint | Inactivity session timeout (in minutes), after which the session is automatically closed by 4D. If omitted, default value is 60 (1h). The value cannot be < 60 (if a lower value is passed, the timeout is set to 60). For more information, see **Closing sessions**. | +| tls | Booléen | Use secured connection(*). If omitted, false by default. Using a secured connection is recommended whenever possible. | +| type | Text | Must be "4D Server" | (*) If tls is true, the HTTPS protocol is used if: @@ -161,24 +162,24 @@ Pass in *connectionInfo* an object describing the remote datastore you want to c * the given port is the right HTTPS port configured in the database settings * a valid certificate and private encryption key are installed in the database. Otherwise, error "1610 - A remote request to host xxx has failed" is raised -#### Exemple 1 +#### Example 1 Connection to a remote datastore without user / password: ```4d - var $connectTo : Object + var $connectTo : Object var $remoteDS : cs.DataStore $connectTo:=New object("type";"4D Server";"hostname";"192.168.18.11:8044") $remoteDS:=Open datastore($connectTo;"students") ALERT("This remote datastore contains "+String($remoteDS.Students.all().length)+" students") ``` -#### Exemple 2 +#### Example 2 Connection to a remote datastore with user / password / timeout / tls: ```4d - var $connectTo : Object + var $connectTo : Object var $remoteDS : cs.DataStore $connectTo:=New object("type";"4D Server";"hostname";\"192.168.18.11:4443";\ "user";"marie";"password";$pwd;"idleTimeout";70;"tls";True) @@ -191,7 +192,7 @@ Connection to a remote datastore with user / password / timeout / tls: Working with several remote datastores: ```4d - var $connectTo : Object + var $connectTo : Object var $frenchStudents; $foreignStudents : cs.DataStore $connectTo:=New object("hostname";"192.168.18.11:8044") $frenchStudents:=Open datastore($connectTo;"french") @@ -203,17 +204,17 @@ Working with several remote datastores: #### Error management -In case of error, the command returns **Null**. If the remote datastore cannot be reached (wrong address, web server not started, http and https not enabled...), error 1610 "A remote request to host XXX has failed" is raised. You can intercept this error with a method installed by `ON ERR CALL`. +In case of error, the command returns **Null**. If the remote datastore cannot be reached (wrong address, web server not started, http and https not enabled...), error 1610 "A remote request to host XXX has failed" is raised. You can intercept this error with a method installed by `ON ERR CALL`. ## *.dataclassName* -
    Historique -| Version | Modifications | -| ------- | ------------- | -| v17 | Ajoutées | +
    History +| Version | Changes | +| ------- | ------- | +| v17 | Added |
    @@ -225,7 +226,7 @@ In case of error, the command returns **Null**. If the remote datastore cannot b Each dataclass in a datastore is available as a property of the [DataStore object](ORDA/dsMapping.md#datastore)data. The returned object contains a description of the dataclass. -#### Exemple +#### Example ```4d var $emp : cs.Employee @@ -246,10 +247,10 @@ Each dataclass in a datastore is available as a property of the [DataStore objec ## .cancelTransaction() -
    Historique -| Version | Modifications | -| ------- | ------------- | -| v18 | Ajoutées | +
    History +| Version | Changes | +| ------- | ------- | +| v18 | Added |
    @@ -257,9 +258,9 @@ Each dataclass in a datastore is available as a property of the [DataStore objec **.cancelTransaction()** -| Paramètres | Type | | Description | -| ---------- | ---- |::| ------------------------------- | -| | | | Does not require any parameters | +| Parameter | Type | | Description | +| --------- | ---- |::| ------------------------------- | +| | | | Does not require any parameters | @@ -272,7 +273,7 @@ The `.cancelTransaction()` function cancels any changes made to the data during You can nest several transactions (sub-transactions). If the main transaction is cancelled, all of its sub-transactions are also cancelled, even if they were validated individually using the [`.validateTransaction()`](#validatetransactions) function. -#### Exemple +#### Example See example for the [`.startTransaction()`](#starttransaction) function. @@ -284,10 +285,10 @@ See example for the [`.startTransaction()`](#starttransaction) function. ## .encryptionStatus() -
    Historique -| Version | Modifications | -| ------- | ------------- | -| v17 R5 | Ajoutées | +
    History +| Version | Changes | +| ------- | ------- | +| v17 R5 | Added |
    @@ -295,9 +296,9 @@ See example for the [`.startTransaction()`](#starttransaction) function. -| Paramètres | Type | | Description | -| ---------- | ----- |:--:| --------------------------------------------------------------------------- | -| Résultat | Objet | <- | Information about the encryption of the current datastore and of each table | +| Parameter | Type | | Description | +| --------- | ----- |:--:| --------------------------------------------------------------------------- | +| Result | Objet | <- | Information about the encryption of the current datastore and of each table | @@ -307,18 +308,18 @@ The `.encryptionStatus()` function ## .getInfo() -
    Historique -| Version | Modifications | -| ------- | ------------- | -| v17 | Ajoutées | +
    History +| Version | Changes | +| ------- | ------- | +| v17 | Added |
    @@ -369,9 +370,9 @@ You want to know the number of encrypted tables in the current data file: **.getInfo()**: Object -| Paramètres | Type | | Description | -| ---------- | ----- |:--:| -------------------- | -| Résultat | Objet | <- | Datastore properties | +| Parameter | Type | | Description | +| --------- | ----- |:--:| -------------------- | +| Result | Objet | <- | Datastore properties | #### Description @@ -380,18 +381,18 @@ The `.getInfo()` function returns **Returned object** -| Propriété | Type | Description | -| ---------- | ------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| type | string |
  • "4D": main datastore, available through ds
  • "4D Server": remote datastore, open with Open datastore
  • | -| networked | boolean |
  • True: the datastore is reached through a network connection.
  • False: the datastore is not reached through a network connection (local database)
  • | -| localID | Texte | ID of the datastore on the machine. Corresponds to the localId string given with the `Open datastore` command. Empty string ("") for main datastore. | -| connection | object | Object describing the remote datastore connection (not returned for main datastore). Available properties:

    PropriétéTypeDescription
    hostnameTexteIP address or name of the remote datastore + ":" + port number
    tlsbooleanTrue if secured connection is used with the remote datastore
    idleTimeoutnumberSession inactivity timeout (in minutes)
    userTexteUser authenticated on the remote datastore
    | +| Property | Type | Description | +| ---------- | ------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| type | string |

  • "4D": main datastore, available through ds
  • "4D Server": remote datastore, open with Open datastore
  • | +| networked | boolean |
  • True: the datastore is reached through a network connection.
  • False: the datastore is not reached through a network connection (local database)
  • | +| localID | text | ID of the datastore on the machine. Corresponds to the localId string given with the `Open datastore` command. Empty string ("") for main datastore. | +| connection | object | Object describing the remote datastore connection (not returned for main datastore). Available properties:

    PropertyTypeDescription
    hostnametextIP address or name of the remote datastore + ":" + port number
    tlsbooleanTrue if secured connection is used with the remote datastore
    idleTimeoutnumberSession inactivity timeout (in minutes)
    usertextUser authenticated on the remote datastore
    | * If the `.getInfo()` function is executed on a 4D Server or 4D single-user, `networked` is False. * If the `.getInfo()` function is executed on a remote 4D, `networked` is True -#### Exemple 1 +#### Example 1 ```4d var $info : Object @@ -403,7 +404,7 @@ The `.getInfo()` function returns //{"type":"4D","networked":true,"localID":""} ``` -#### Exemple 2 +#### Example 2 On a remote datastore: @@ -419,8 +420,8 @@ On a remote datastore: //"localID":"students", //"networked":true, //"connection":{hostname:"111.222.33.44:8044","tls":false,"idleTimeout":2880,"user":"marie"}} -``` - +``` + @@ -429,19 +430,19 @@ On a remote datastore: ## .getRequestLog() -

    Historique -| Version | Modifications | -| ------- | ------------- | -| v17 R6 | Ajoutées | +
    History +| Version | Changes | +| ------- | ------- | +| v17 R6 | Added |
    **.getRequestLog()** : Collection -| Paramètres | Type | | Description | -| ---------- | ---------- |:--:| ------------------------------------------------------------ | -| Résultat | Collection | <- | Collection of objects, where each object describes a request | +| Parameter | Type | | Description | +| --------- | ---------- |:--:| ------------------------------------------------------------ | +| Result | Collection | <- | Collection of objects, where each object describes a request | @@ -451,28 +452,61 @@ The `.getRequestLog()` function + +## .makeSelectionsAlterable() + +
    History +| Version | Changes | +| ------- | ------- | +| v18 R5 | Added | +
    + + +**.makeSelectionsAlterable()** + + +| Parameter | Type | | Description | +| --------- | ---- |::| ------------------------------- | +| | | | Does not require any parameters | + + + +#### Description + +The `.makeSelectionsAlterable()` function sets all entity selections as alterable by default in all the current application datastores (including [remote datastores](ORDA/remoteDatastores.md)). It is intended to be used once, for example in the `On Startup` database method. + +When this function is not called, new entity selections can be shareable, depending on the nature of their "parent", or [how they are created](ORDA/entities.md#shareable-or-non-shareable-entity-selections). + +> This function does not modify entity selections created by [`.copy()`](#copy) or `OB Copy` when the explicit `ck shared` option is used. + + +> **Compatibility**: This function must only be used in projects converted from 4D versions prior to 4D v18 R5 and containing [.add()](entitySelectionClass.md#add) calls. In this context, using `.makeSelectionsAlterable()` can save time by restoring instantaneously the previous 4D behavior in existing projects. On the other hand, using this method in new projects created in 4D v18 R5 and higher **is not recommended**, since it prevents entity selections to be shared, which provides greater performance and scalabitlity. + + + + ## .provideDataKey() -
    Historique -| Version | Modifications | -| ------- | ------------- | -| v17 R5 | Ajoutées | +
    History +| Version | Changes | +| ------- | ------- | +| v17 R5 | Added |
    @@ -480,11 +514,11 @@ See Example 2 of [`.startRequestLog()`](#startrequestlog). -| Paramètres | Type | | Description | +| Parameter | Type | | Description | | ------------- | ----- | -- | ------------------------------------- | -| curPassPhrase | Texte | -> | Current encryption passphrase | +| curPassPhrase | Text | -> | Current encryption passphrase | | curDataKey | Objet | -> | Current data encryption key | -| Résultat | Objet | <- | Result of the encryption key matching | +| Result | Objet | <- | Result of the encryption key matching | @@ -504,28 +538,28 @@ If a valid data encryption key is provided, it is added to the *keyChain* in mem * all data loaded from encryptable tables is decrypted in memory -**Résultat** +**Result** The result of the command is described in the returned object: -| Propriété | | Type | Description | +| Property | | Type | Description | | ---------- | ------------------------ | ---------- | ------------------------------------------------------------------------------- | | success | | Booléen | True if the provided encryption key matches the encrypted data, False otherwise | | | | | Properties below are returned only if success is *FALSE* | -| status | | Nombre | Error code (4 if the provided encryption key is wrong) | -| statusText | | Texte | Error message | +| status | | Number | Error code (4 if the provided encryption key is wrong) | +| statusText | | Text | Error message | | errors | | Collection | Stack of errors. The first error has the highest index | -| | \[ ].componentSignature | Texte | Internal component name | -| | \[ ].errCode | Nombre | Error number | -| | \[ ].message | Texte | Error message | +| | \[ ].componentSignature | Text | Internal component name | +| | \[ ].errCode | Number | Error number | +| | \[ ].message | Text | Error message | If no *curPassphrase* or *curDataKey* is given, `.provideDataKey()` returns **null** (no error is generated). -#### Exemple +#### Example -```4d +```4d var $keyStatus : Object var $passphrase : Text @@ -539,7 +573,7 @@ If no *curPassphrase* or *curDataKey* is given, `.provideDataKey()` returns **nu End if End if ``` - + @@ -548,10 +582,10 @@ If no *curPassphrase* or *curDataKey* is given, `.provideDataKey()` returns **nu ## .startRequestLog() -
    Historique -| Version | Modifications | -| ------- | ------------- | -| v17 R6 | Ajoutées | +
    History +| Version | Changes | +| ------- | ------- | +| v17 R6 | Added |
    @@ -559,10 +593,10 @@ If no *curPassphrase* or *curDataKey* is given, `.provideDataKey()` returns **nu -| Paramètres | Type | | Description | -| ---------- | ----------- | -- | ------------------------------------ | -| file | 4D.File | -> | File object | -| reqNum | Entier long | -> | Number of requests to keep in memory | +| Parameter | Type | | Description | +| --------- | ------- | -- | ------------------------------------ | +| file | 4D.File | -> | File object | +| reqNum | Integer | -> | Number of requests to keep in memory | @@ -583,11 +617,11 @@ The ORDA request log can be sent to a file or to memory, depending on the parame For a description of the ORDA request log format, please refer to the [**ORDA client requests**](https://doc.4d.com/4Dv18/4D/18/Description-of-log-files.300-4575486.en.html#4385373) section. -#### Exemple 1 +#### Example 1 You want to log ORDA client requests in a file and use the log sequence number: -```4d +```4d var $file : 4D.File var $e : cs.PersonsEntity @@ -600,11 +634,11 @@ You want to log ORDA client requests in a file and use the log sequence number: SET DATABASE PARAMETER(Client Log Recording;0) ``` -#### Exemple 2 +#### Example 2 You want to log ORDA client requests in memory: -```4d +```4d var $es : cs.PersonsSelection var $log : Collection @@ -617,7 +651,7 @@ You want to log ORDA client requests in memory: $log:=ds.getRequestLog() ALERT("The longest request lasted: "+String($log.max("duration"))+" ms") ``` - + @@ -626,19 +660,19 @@ You want to log ORDA client requests in memory: ## .startTransaction() -
    Historique -| Version | Modifications | -| ------- | ------------- | -| v18 | Ajoutées | +
    History +| Version | Changes | +| ------- | ------- | +| v18 | Added |
    **.startTransaction()** -| Paramètres | Type | | Description | -| ---------- | ---- | | ------------------------------- | -| | | | Does not require any parameters | +| Parameter | Type | | Description | +| --------- | ---- | | ------------------------------- | +| | | | Does not require any parameters | @@ -650,10 +684,10 @@ The `.startTransaction()` function + ## .stopRequestLog() -
    Historique -| Version | Modifications | -| ------- | ------------- | -| v17 R6 | Ajoutées | +
    History +| Version | Changes | +| ------- | ------- | +| v17 R6 | Added |
    **.stopRequestLog()** -| Paramètres | Type | | Description | -| ---------- | ---- | | ------------------------------- | -| | | | Does not require any parameters | +| Parameter | Type | | Description | +| --------- | ---- | | ------------------------------- | +| | | | Does not require any parameters | @@ -716,7 +751,7 @@ The `.stopRequestLog()` function ## .validateTransaction() -
    Historique -| Version | Modifications | -| ------- | ------------- | -| v18 | Ajoutées | +
    History +| Version | Changes | +| ------- | ------- | +| v18 | Added |
    **.validateTransaction()** -| Paramètres | Type | | Description | -| ---------- | ---- | | ------------------------------- | -| | | | Does not require any parameters | +| Parameter | Type | | Description | +| --------- | ---- | | ------------------------------- | +| | | | Does not require any parameters | @@ -753,7 +788,7 @@ The function saves the changes to the data on the datastore that occurred during You can nest several transactions (sub-transactions). If the main transaction is cancelled, all of its sub-transactions are also cancelled, even if they were validated individually using this function. -#### Exemple +#### Example See example for [`.startTransaction()`](#starttransaction). diff --git a/website/translated_docs/fr/API/directory.md b/website/translated_docs/fr/API/directory.md index ec12f2a22a8d75..292320e367505c 100644 --- a/website/translated_docs/fr/API/directory.md +++ b/website/translated_docs/fr/API/directory.md @@ -1,6 +1,6 @@ --- id: directory -title: Classe Directory +title: Directory Class --- ## Description @@ -9,10 +9,10 @@ title: Classe Directory ## .creationDate -
    Historique -| Version | Modifications | -| ------- | ------------- | -| v17 R5 | Ajoutées | +
    History +| Version | Changes | +| ------- | ------- | +| v17 R5 | Added |
    @@ -21,9 +21,9 @@ title: Classe Directory #### Description -La propriété `.creationDate` retourne la date de création du dossier.. +The `.creationDate` property returns the creation date of the folder. -Cette propriété est en **lecture seule**. +This property is **read-only**. @@ -32,10 +32,10 @@ Cette propriété est en **lecture seule**. ## .creationTime -
    Historique -| Version | Modifications | -| ------- | ------------- | -| v17 R5 | Ajoutées | +
    History +| Version | Changes | +| ------- | ------- | +| v17 R5 | Added |
    @@ -45,9 +45,9 @@ Cette propriété est en **lecture seule**. #### Description -La propriété `.creationTime` retourne l'heure de création du dossier (exprimée en nombre de secondes, commençant à 00:00). +The `.creationTime` property returns the creation time of the folder (expressed as a number of seconds beginning at 00:00). -Cette propriété est en **lecture seule**. +This property is **read-only**. @@ -57,10 +57,10 @@ Cette propriété est en **lecture seule**. ## .exists -
    Historique -| Version | Modifications | -| ------- | ------------- | -| v17 R5 | Ajoutées | +
    History +| Version | Changes | +| ------- | ------- | +| v17 R5 | Added |
    @@ -69,9 +69,9 @@ Cette propriété est en **lecture seule**. #### Description -La propriété `.exists` retourne true si le dossier existe sur le disque, et retourne false dans le cas contraire. +The `.exists` property returns true if the folder exists on disk, and false otherwise. -Cette propriété est en **lecture seule**. +This property is **read-only**. @@ -82,10 +82,10 @@ Cette propriété est en **lecture seule**. ## .extension -
    Historique -| Version | Modifications | -| ------- | ------------- | -| v17 R5 | Ajoutées | +
    History +| Version | Changes | +| ------- | ------- | +| v17 R5 | Added |
    @@ -94,9 +94,9 @@ Cette propriété est en **lecture seule**. #### Description -La propriété `.extension` retourne l'extension du nom du dossier (le cas échéant). Une extension commence toujours par ".". La propriété retourne une chaîne vide si le nom du dossier n'a pas d'extension. +The `.extension` property returns the extension of the folder name (if any). An extension always starts with ".". The property returns an empty string if the folder name does not have an extension. -Cette propriété est en **lecture seule**. +This property is **read-only**. @@ -106,10 +106,10 @@ Cette propriété est en **lecture seule**. ## .fullName -
    Historique -| Version | Modifications | -| ------- | ------------- | -| v17 R5 | Ajoutées | +
    History +| Version | Changes | +| ------- | ------- | +| v17 R5 | Added |
    @@ -118,9 +118,9 @@ Cette propriété est en **lecture seule**. #### Description -La propriété `.fullName` retourne le nom complet du dossier, y compris son extension (le cas échéant). +The `.fullName` property returns the full name of the folder, including its extension (if any). -Cette propriété est en **lecture seule**. +This property is **read-only**. @@ -130,10 +130,10 @@ Cette propriété est en **lecture seule**. ## .hidden -
    Historique -| Version | Modifications | -| ------- | ------------- | -| v17 R5 | Ajoutées | +
    History +| Version | Changes | +| ------- | ------- | +| v17 R5 | Added |
    @@ -142,9 +142,9 @@ Cette propriété est en **lecture seule**. #### Description -La propriété `.hidden` retourne true si le dossier est défini comme "hidden" au niveau du système, et retourne false dans le cas contraire. +The `.hidden` property returns true if the folder is set as "hidden" at the system level, and false otherwise. -Cette propriété est en **lecture seule**. +This property is **read-only**. @@ -154,10 +154,10 @@ Cette propriété est en **lecture seule**. ## .isAlias -
    Historique -| Version | Modifications | -| ------- | ------------- | -| v17 R5 | Ajoutées | +
    History +| Version | Changes | +| ------- | ------- | +| v17 R5 | Added |
    @@ -167,9 +167,9 @@ Cette propriété est en **lecture seule**. #### Description -La propriété `.isAlias` retourne toujours **false** pour un objet `Folder`. +The `.isAlias` property returns always **false** for a `Folder` object. -Cette propriété est en **lecture seule**. +This property is **read-only**. @@ -178,10 +178,10 @@ Cette propriété est en **lecture seule**. ## .isFile -
    Historique -| Version | Modifications | -| ------- | ------------- | -| v17 R5 | Ajoutées | +
    History +| Version | Changes | +| ------- | ------- | +| v17 R5 | Added |
    @@ -190,9 +190,9 @@ Cette propriété est en **lecture seule**. #### Description -La propriété `.isFile` retournetoujours **false** pour un dossier. +The `.isFile` property returns always **false** for a folder. -Cette propriété est en **lecture seule**. +This property is **read-only**. @@ -201,10 +201,10 @@ Cette propriété est en **lecture seule**. ## .isFolder -
    Historique -| Version | Modifications | -| ------- | ------------- | -| v17 R5 | Ajoutées | +
    History +| Version | Changes | +| ------- | ------- | +| v17 R5 | Added |
    @@ -213,9 +213,9 @@ Cette propriété est en **lecture seule**. #### Description -La propriété `.isFolder` retourne toujours **false** pour un dossier. +The `.isFolder` property returns always **true** for a folder. -Cette propriété est en **lecture seule**. +This property is **read-only**. @@ -224,10 +224,10 @@ Cette propriété est en **lecture seule**. ## .isPackage -
    Historique -| Version | Modifications | -| ------- | ------------- | -| v17 R5 | Ajoutées | +
    History +| Version | Changes | +| ------- | ------- | +| v17 R5 | Added |
    @@ -236,11 +236,11 @@ Cette propriété est en **lecture seule**. #### Description -La propriété `.isPackage` retourne true si le dossier est un package sous macOS (et s'il existe sur le disque). Sinon, elle retourne false. +The `.isPackage` property returns true if the folder is a package on macOS (and exists on disk). Otherwise, it returns false. -Sous Windows, `.isPackage` retourne toujours **false**. +On Windows, `.isPackage` always returns **false**. -Cette propriété est en **lecture seule**. +This property is **read-only**. @@ -250,10 +250,10 @@ Cette propriété est en **lecture seule**. ## .modificationDate -
    Historique -| Version | Modifications | -| ------- | ------------- | -| v17 R5 | Ajoutées | +
    History +| Version | Changes | +| ------- | ------- | +| v17 R5 | Added |
    @@ -264,7 +264,7 @@ Cette propriété est en **lecture seule**. The `.modificationDate` property returns the date of the folder's last modification. -Cette propriété est en **lecture seule**. +This property is **read-only**. @@ -274,10 +274,10 @@ Cette propriété est en **lecture seule**. ## .modificationTime -
    Historique -| Version | Modifications | -| ------- | ------------- | -| v17 R5 | Ajoutées | +
    History +| Version | Changes | +| ------- | ------- | +| v17 R5 | Added |
    @@ -288,7 +288,7 @@ Cette propriété est en **lecture seule**. The `.modificationTime` property returns the time of the folder's last modification (expressed as a number of seconds beginning at 00:00). -Cette propriété est en **lecture seule**. +This property is **read-only**. @@ -297,10 +297,10 @@ Cette propriété est en **lecture seule**. ## .name -
    Historique -| Version | Modifications | -| ------- | ------------- | -| v17 R5 | Ajoutées | +
    History +| Version | Changes | +| ------- | ------- | +| v17 R5 | Added |
    @@ -313,7 +313,7 @@ Cette propriété est en **lecture seule**. The `.name` property returns the name of the folder, without extension (if any). -Cette propriété est en **lecture seule**. +This property is **read-only**. @@ -322,10 +322,10 @@ Cette propriété est en **lecture seule**. ## .original -
    Historique -| Version | Modifications | -| ------- | ------------- | -| v17 R5 | Ajoutées | +
    History +| Version | Changes | +| ------- | ------- | +| v17 R5 | Added |
    @@ -336,7 +336,7 @@ Cette propriété est en **lecture seule**. The `.original` property returns the same Folder object as the folder. -Cette propriété est en **lecture seule**. +This property is **read-only**. > This property is available on folders to allow generic code to process folders or files. @@ -347,10 +347,10 @@ Cette propriété est en **lecture seule**. ## .parent -
    Historique -| Version | Modifications | -| ------- | ------------- | -| v17 R5 | Ajoutées | +
    History +| Version | Changes | +| ------- | ------- | +| v17 R5 | Added |
    @@ -363,7 +363,7 @@ The `.parent` property returns the parent If the folder does not have a parent (root), the null value is returned. -Cette propriété est en **lecture seule**. +This property is **read-only**. @@ -373,10 +373,10 @@ Cette propriété est en **lecture seule**. ## .path -
    Historique -| Version | Modifications | -| ------- | ------------- | -| v17 R5 | Ajoutées | +
    History +| Version | Changes | +| ------- | ------- | +| v17 R5 | Added |
    @@ -387,7 +387,7 @@ Cette propriété est en **lecture seule**. The `.path` property returns the POSIX path of the folder. If the path represents a filesystem (e.g., "/DATA/"), the filesystem is returned. -Cette propriété est en **lecture seule**. +This property is **read-only**. @@ -396,10 +396,10 @@ Cette propriété est en **lecture seule**. ## .platformPath -
    Historique -| Version | Modifications | -| ------- | ------------- | -| v17 R5 | Ajoutées | +
    History +| Version | Changes | +| ------- | ------- | +| v17 R5 | Added |
    @@ -410,7 +410,7 @@ Cette propriété est en **lecture seule**. The `.platformPath` property returns the path of the folder expressed with the current platform syntax. -Cette propriété est en **lecture seule**. +This property is **read-only**. @@ -424,22 +424,22 @@ Cette propriété est en **lecture seule**. ## .copyTo() -
    Historique -| Version | Modifications | -| ------- | ------------- | -| v17 R5 | Ajoutées | +
    History +| Version | Changes | +| ------- | ------- | +| v17 R5 | Added |
    **.copyTo**( *destinationFolder* : 4D.Folder { ; *newName* : Text } { ; *overwrite* : Integer } ) : 4D Folder -| Paramètres | Type | | Description | -| ----------------- | ----------- |:--:| ------------------------------------------- | -| destinationFolder | 4D.Folder | -> | Destination folder | -| newName | Texte | -> | Name for the copy | -| overwrite | Entier long | -> | `fk overwrite` to replace existing elements | -| Résultat | 4D.Folder | <- | Copied file or folder | +| Parameter | Type | | Description | +| ----------------- | --------- |:--:| ------------------------------------------- | +| destinationFolder | 4D.Folder | -> | Destination folder | +| newName | Text | -> | Name for the copy | +| overwrite | Integer | -> | `fk overwrite` to replace existing elements | +| Result | 4D.Folder | <- | Copied file or folder | @@ -453,16 +453,16 @@ By default, the folder is copied with the name of the original folder. If you wa If a folder with the same name already exists in the *destinationFolder*, by default 4D generates an error. You can pass the `fk overwrite` constant in the *overwrite* parameter to ignore and overwrite the existing file -| Constant | Valeur | Commentaire | -| -------------- | ------ | ----------------------------------- | -| `fk overwrite` | 4 | Overwrite existing elements, if any | +| Constant | Value | Comment | +| -------------- | ----- | ----------------------------------- | +| `fk overwrite` | 4 | Overwrite existing elements, if any | -**Valeur retournée** +**Returned value** The copied `Folder` object. -#### Exemple +#### Example You want to copy a Pictures *folder* from the user's Document folder to the Database folder: @@ -480,20 +480,20 @@ $copiedImages:=$userImages.copyTo(Folder(fk database folder);fk overwrite) ## .file() -
    Historique -| Version | Modifications | -| ------- | ------------- | -| v17 R5 | Ajoutées | +
    History +| Version | Changes | +| ------- | ------- | +| v17 R5 | Added |
    **.file**( *path* : Text ) : 4D.File -| Paramètres | Type | | Description | -| ---------- | ------- | -- | ------------------------------------ | -| path | Texte | -> | Relative POSIX file pathname | -| Résultat | 4D.File | <- | `File` object (null if invalid path) | +| Parameter | Type | | Description | +| --------- | ------- | -- | ------------------------------------ | +| path | Text | -> | Relative POSIX file pathname | +| Result | 4D.File | <- | `File` object (null if invalid path) | #### Description @@ -502,11 +502,11 @@ The `.file()` function creates a `File` ob In *path*, pass a relative POSIX path to designate the file to return. The path will be evaluated from the parent folder as root. -**Valeur retournée** +**Returned value** A `File` object or null if *path* is invalid. -#### Exemple +#### Example ```4d var $myPDF : 4D.File @@ -520,20 +520,20 @@ $myPDF:=Folder(fk documents folder).file("Pictures/info.pdf") ## .files() -
    Historique -| Version | Modifications | -| ------- | ------------- | -| v17 R5 | Ajoutées | +
    History +| Version | Changes | +| ------- | ------- | +| v17 R5 | Added |
    **.files**( { *options* : Integer } ) : Collection -| Paramètres | Type | | Description | -| ---------- | ----------- | -- | ----------------------------------- | -| options | Entier long | -> | File list options | -| Résultat | Collection | <- | Collection of children file objects | +| Parameter | Type | | Description | +| --------- | ---------- | -- | ----------------------------------- | +| options | Integer | -> | File list options | +| Result | Collection | <- | Collection of children file objects | #### Description @@ -543,16 +543,16 @@ The `.files()` function returns a collect By default, if you omit the *options* parameter, only the files at the first level of the folder are returned in the collection, as well as invisible files or folders. You can modify this by passing, in the *options* parameter, one or more of the following constants: -| Constant | Valeur | Commentaire | -| --------------------- | ------ | ----------------------------------------------------------------------------------- | -| `fk recursive` | 1 | The collection contains files or folders of the specified folder and its subfolders | -| `fk ignore invisible` | 8 | Invisible files or folders are not listed | +| Constant | Value | Comment | +| --------------------- | ----- | ----------------------------------------------------------------------------------- | +| `fk recursive` | 1 | The collection contains files or folders of the specified folder and its subfolders | +| `fk ignore invisible` | 8 | Invisible files or folders are not listed | -**Valeur retournée** +**Returned value** Collection of `File` objects. -#### Exemple 1 +#### Example 1 You want to know if there are invisible files in the Database folder: @@ -565,7 +565,7 @@ You want to know if there are invisible files in the Database folder: End if ``` -#### Exemple 2 +#### Example 2 You want to get all files that are not invisible in the Documents folder: @@ -581,20 +581,20 @@ You want to get all files that are not invisible in the Documents folder: ## .folder() -
    Historique -| Version | Modifications | -| ------- | ------------- | -| v17 R5 | Ajoutées | +
    History +| Version | Changes | +| ------- | ------- | +| v17 R5 | Added |
    **.folder**( *path* : Text ) : 4D.Folder -| Paramètres | Type | | Description | -| ---------- | --------- | -- | ---------------------------------------------- | -| path | Texte | -> | Relative POSIX file pathname | -| Résultat | 4D.Folder | <- | Created folder object (null if invalid *path*) | +| Parameter | Type | | Description | +| --------- | --------- | -- | ---------------------------------------------- | +| path | Text | -> | Relative POSIX file pathname | +| Result | 4D.Folder | <- | Created folder object (null if invalid *path*) | #### Description @@ -603,11 +603,11 @@ The `.folder()` function creates a `Fold In *path*, pass a relative POSIX path to designate the folder to return. The path will be evaluated from the parent folder as root. -**Valeur retournée** +**Returned value** A `Folder` object or null if *path* is invalid. -#### Exemple +#### Example ```4d var $mypicts : 4D.Folder @@ -621,20 +621,20 @@ A `Folder` object or null if *path* is invalid. ## .folders() -
    Historique -| Version | Modifications | -| ------- | ------------- | -| v17 R5 | Ajoutées | +
    History +| Version | Changes | +| ------- | ------- | +| v17 R5 | Added |
    **.folders**( { *options* : Integer } ) : Collection -| Paramètres | Type | | Description | -| ---------- | ----------- | -- | ------------------------------------- | -| options | Entier long | -> | Folder list options | -| Résultat | Collection | <- | Collection of children folder objects | +| Parameter | Type | | Description | +| --------- | ---------- | -- | ------------------------------------- | +| options | Integer | -> | Folder list options | +| Result | Collection | <- | Collection of children folder objects | #### Description @@ -643,16 +643,16 @@ The `.folders()` function returns a col By default, if you omit the *options* parameter, only the folders at the first level of the folder are returned in the collection. You can modify this by passing, in the *options* parameter, one or more of the following constants: -| Constant | Valeur | Commentaire | -| --------------------- | ------ | ----------------------------------------------------------------------------------- | -| `fk recursive` | 1 | The collection contains files or folders of the specified folder and its subfolders | -| `fk ignore invisible` | 8 | Invisible files or folders are not listed | +| Constant | Value | Comment | +| --------------------- | ----- | ----------------------------------------------------------------------------------- | +| `fk recursive` | 1 | The collection contains files or folders of the specified folder and its subfolders | +| `fk ignore invisible` | 8 | Invisible files or folders are not listed | -**Valeur retournée** +**Returned value** Collection of `Folder` objects. -#### Exemple +#### Example You want the collection of all folders and subfolders of the database folder: @@ -668,20 +668,20 @@ You want the collection of all folders and subfolders of the database folder: ## .getIcon() -
    Historique -| Version | Modifications | -| ------- | ------------- | -| v17 R5 | Ajoutées | +
    History +| Version | Changes | +| ------- | ------- | +| v17 R5 | Added |
    **.getIcon**( { *size* : Integer } ) : Picture -| Paramètres | Type | | Description | -| ---------- | ----------- | -- | --------------------------------------------- | -| size | Entier long | -> | Side length for the returned picture (pixels) | -| Résultat | Image | <- | Icône | +| Parameter | Type | | Description | +| --------- | ------- | -- | --------------------------------------------- | +| size | Integer | -> | Side length for the returned picture (pixels) | +| Result | Image | <- | Icon | @@ -693,7 +693,7 @@ The optional *size* parameter specifies the dimensions in pixels of the returned If the folder does not exist on disk, a default blank icon is returned. -**Valeur retournée** +**Returned value** Folder icon [picture](Concepts/dt_picture.md). diff --git a/website/translated_docs/fr/API/document.md b/website/translated_docs/fr/API/document.md index d80cb29f478184..6082fb5be77082 100644 --- a/website/translated_docs/fr/API/document.md +++ b/website/translated_docs/fr/API/document.md @@ -9,10 +9,10 @@ title: Document Class ## .creationDate -
    Historique -| Version | Modifications | -| ------- | ------------- | -| v17 R5 | Ajoutées | +
    History +| Version | Changes | +| ------- | ------- | +| v17 R5 | Added |
    @@ -23,7 +23,7 @@ title: Document Class The `.creationDate` property returns the creation date of the file. -Cette propriété est en **lecture seule**. +This property is **read-only**. @@ -31,10 +31,10 @@ Cette propriété est en **lecture seule**. ## .creationTime -
    Historique -| Version | Modifications | -| ------- | ------------- | -| v17 R5 | Ajoutées | +
    History +| Version | Changes | +| ------- | ------- | +| v17 R5 | Added |
    @@ -45,7 +45,7 @@ Cette propriété est en **lecture seule**. The `.creationTime` property returns the creation time of the file (expressed as a number of seconds beginning at 00:00). -Cette propriété est en **lecture seule**. +This property is **read-only**. @@ -55,10 +55,10 @@ Cette propriété est en **lecture seule**. ## .exists -
    Historique -| Version | Modifications | -| ------- | ------------- | -| v17 R5 | Ajoutées | +
    History +| Version | Changes | +| ------- | ------- | +| v17 R5 | Added |
    @@ -69,7 +69,7 @@ Cette propriété est en **lecture seule**. The `.exists` property returns true if the file exists on disk, and false otherwise. -Cette propriété est en **lecture seule**. +This property is **read-only**. @@ -81,10 +81,10 @@ Cette propriété est en **lecture seule**. ## .extension -
    Historique -| Version | Modifications | -| ------- | ------------- | -| v17 R5 | Ajoutées | +
    History +| Version | Changes | +| ------- | ------- | +| v17 R5 | Added |
    @@ -92,9 +92,9 @@ Cette propriété est en **lecture seule**. #### Description -The `.extension` property returns the extension of the file name (if any). Une extension commence toujours par ".". The property returns an empty string if the file name does not have an extension. +The `.extension` property returns the extension of the file name (if any). An extension always starts with ".". The property returns an empty string if the file name does not have an extension. -Cette propriété est en **lecture seule**. +This property is **read-only**. @@ -105,10 +105,10 @@ Cette propriété est en **lecture seule**. ## .fullName -
    Historique -| Version | Modifications | -| ------- | ------------- | -| v17 R5 | Ajoutées | +
    History +| Version | Changes | +| ------- | ------- | +| v17 R5 | Added |
    @@ -118,7 +118,7 @@ Cette propriété est en **lecture seule**. The `.fullName` property returns the full name of the file, including its extension (if any). -Cette propriété est en **lecture seule**. +This property is **read-only**. @@ -128,10 +128,10 @@ Cette propriété est en **lecture seule**. ## .hidden -
    Historique -| Version | Modifications | -| ------- | ------------- | -| v17 R5 | Ajoutées | +
    History +| Version | Changes | +| ------- | ------- | +| v17 R5 | Added |
    @@ -142,7 +142,7 @@ Cette propriété est en **lecture seule**. The `.hidden` property returns true if the file is set as "hidden" at the system level, and false otherwise. -Cette propriété est en **lecture seule**. +This property is **read-only**. @@ -152,10 +152,10 @@ Cette propriété est en **lecture seule**. ## .isAlias -
    Historique -| Version | Modifications | -| ------- | ------------- | -| v17 R5 | Ajoutées | +
    History +| Version | Changes | +| ------- | ------- | +| v17 R5 | Added |
    @@ -166,7 +166,7 @@ Cette propriété est en **lecture seule**. The `.isAlias` property returns true if the file is an alias, a shortcut, or a symbolic link, and false otherwise. -Cette propriété est en **lecture seule**. +This property is **read-only**. @@ -175,10 +175,10 @@ Cette propriété est en **lecture seule**. ## .isFile -
    Historique -| Version | Modifications | -| ------- | ------------- | -| v17 R5 | Ajoutées | +
    History +| Version | Changes | +| ------- | ------- | +| v17 R5 | Added |
    @@ -189,7 +189,7 @@ Cette propriété est en **lecture seule**. The `.isFile` property returns always true for a file. -Cette propriété est en **lecture seule**. +This property is **read-only**. @@ -198,10 +198,10 @@ Cette propriété est en **lecture seule**. ## .isFolder -
    Historique -| Version | Modifications | -| ------- | ------------- | -| v17 R5 | Ajoutées | +
    History +| Version | Changes | +| ------- | ------- | +| v17 R5 | Added |
    @@ -212,7 +212,7 @@ Cette propriété est en **lecture seule**. The `.isFolder` property returns always false for a file. -Cette propriété est en **lecture seule**. +This property is **read-only**. @@ -222,10 +222,10 @@ Cette propriété est en **lecture seule**. ## .isWritable -
    Historique -| Version | Modifications | -| ------- | ------------- | -| v17 R5 | Ajoutées | +
    History +| Version | Changes | +| ------- | ------- | +| v17 R5 | Added |
    @@ -237,9 +237,9 @@ Cette propriété est en **lecture seule**. The `.isWritable` property returns true if the file exists on disk and is writable. > The property checks the ability of the 4D application to write on the disk (access rights), it does not solely rely on the *writable* attribute of the file. -Cette propriété est en **lecture seule**. +This property is **read-only**. -**Exemple** +**Example** ```4d $myFile:=File("C:\\Documents\\Archives\\ReadMe.txt";fk platform path) @@ -256,10 +256,10 @@ Cette propriété est en **lecture seule**. ## .modificationDate -
    Historique -| Version | Modifications | -| ------- | ------------- | -| v17 R5 | Ajoutées | +
    History +| Version | Changes | +| ------- | ------- | +| v17 R5 | Added |
    @@ -270,7 +270,7 @@ Cette propriété est en **lecture seule**. The `.modificationDate` property returns the date of the file's last modification. -Cette propriété est en **lecture seule**. +This property is **read-only**. @@ -280,10 +280,10 @@ Cette propriété est en **lecture seule**. ## .modificationTime -
    Historique -| Version | Modifications | -| ------- | ------------- | -| v17 R5 | Ajoutées | +
    History +| Version | Changes | +| ------- | ------- | +| v17 R5 | Added |
    @@ -294,7 +294,7 @@ Cette propriété est en **lecture seule**. The `.modificationTime` property returns the time of the file's last modification (expressed as a number of seconds beginning at 00:00). -Cette propriété est en **lecture seule**. +This property is **read-only**. @@ -303,10 +303,10 @@ Cette propriété est en **lecture seule**. ## .name -
    Historique -| Version | Modifications | -| ------- | ------------- | -| v17 R5 | Ajoutées | +
    History +| Version | Changes | +| ------- | ------- | +| v17 R5 | Added |
    @@ -317,7 +317,7 @@ Cette propriété est en **lecture seule**. The `.name` property returns the name of the file without extension (if any). -Cette propriété est en **lecture seule**. +This property is **read-only**. @@ -325,10 +325,10 @@ Cette propriété est en **lecture seule**. ## .original -
    Historique -| Version | Modifications | -| ------- | ------------- | -| v17 R5 | Ajoutées | +
    History +| Version | Changes | +| ------- | ------- | +| v17 R5 | Added |
    @@ -344,7 +344,7 @@ The `.original` property returns the targ For non-alias files, the property returns the same file object as the file. -Cette propriété est en **lecture seule**. +This property is **read-only**. @@ -354,10 +354,10 @@ Cette propriété est en **lecture seule**. ## .parent -
    Historique -| Version | Modifications | -| ------- | ------------- | -| v17 R5 | Ajoutées | +
    History +| Version | Changes | +| ------- | ------- | +| v17 R5 | Added |
    @@ -368,7 +368,7 @@ Cette propriété est en **lecture seule**. The `.parent` property returns the parent folder object of the file. If the path represents a system path (e.g., "/DATA/"), the system path is returned. -Cette propriété est en **lecture seule**. +This property is **read-only**. @@ -378,10 +378,10 @@ Cette propriété est en **lecture seule**. ## .path -
    Historique -| Version | Modifications | -| ------- | ------------- | -| v17 R5 | Ajoutées | +
    History +| Version | Changes | +| ------- | ------- | +| v17 R5 | Added |
    @@ -392,7 +392,7 @@ Cette propriété est en **lecture seule**. The `.path` property returns the POSIX path of the file. If the path represents a filesystem (e.g., "/DATA/"), the filesystem is returned. -Cette propriété est en **lecture seule**. +This property is **read-only**. @@ -401,10 +401,10 @@ Cette propriété est en **lecture seule**. ## .platformPath -
    Historique -| Version | Modifications | -| ------- | ------------- | -| v17 R5 | Ajoutées | +
    History +| Version | Changes | +| ------- | ------- | +| v17 R5 | Added |
    @@ -415,7 +415,7 @@ Cette propriété est en **lecture seule**. The `.platformPath` property returns the path of the file expressed with the current platform syntax. -Cette propriété est en **lecture seule**. +This property is **read-only**. @@ -425,10 +425,10 @@ Cette propriété est en **lecture seule**. ## .size -
    Historique -| Version | Modifications | -| ------- | ------------- | -| v17 R5 | Ajoutées | +
    History +| Version | Changes | +| ------- | ------- | +| v17 R5 | Added |
    @@ -439,7 +439,7 @@ Cette propriété est en **lecture seule**. The `.size` property returns the size of the file expressed in bytes. If the file does not exist on disk, the size is 0. -Cette propriété est en **lecture seule**. +This property is **read-only**. @@ -455,22 +455,22 @@ Cette propriété est en **lecture seule**. ## .copyTo() -
    Historique -| Version | Modifications | -| ------- | ------------- | -| v17 R5 | Ajoutées | +
    History +| Version | Changes | +| ------- | ------- | +| v17 R5 | Added |
    **.copyTo**( *destinationFolder* : 4D.Folder { ; *newName* : Text } { ; *overwrite* : Integer } ) : 4D.File -| Paramètres | Type | | Description | -| ----------------- | ----------- |:--:| ------------------------------------------- | -| destinationFolder | 4D.Folder | -> | Destination folder | -| newName | Texte | -> | Name for the copy | -| overwrite | Entier long | -> | `fk overwrite` to replace existing elements | -| Résultat | 4D.File | <- | Copied file | +| Parameter | Type | | Description | +| ----------------- | --------- |:--:| ------------------------------------------- | +| destinationFolder | 4D.Folder | -> | Destination folder | +| newName | Text | -> | Name for the copy | +| overwrite | Integer | -> | `fk overwrite` to replace existing elements | +| Result | 4D.File | <- | Copied file | @@ -484,16 +484,16 @@ By default, the file is copied with the name of the original file. If you want t If a file with the same name already exists in the *destinationFolder*, by default 4D generates an error. You can pass the `fk overwrite` constant in the *overwrite* parameter to ignore and overwrite the existing file -| Constant | Valeur | Commentaire | -| -------------- | ------ | ----------------------------------- | -| `fk overwrite` | 4 | Overwrite existing elements, if any | +| Constant | Value | Comment | +| -------------- | ----- | ----------------------------------- | +| `fk overwrite` | 4 | Overwrite existing elements, if any | -**Valeur retournée** +**Returned value** The copied `File` object. -#### Exemple +#### Example You want to copy a picture *file* from the user's document folder to the application folder: @@ -510,19 +510,19 @@ $copy:=$source.copyTo(Folder("/PACKAGE");fk overwrite) ## .getContent() -
    Historique -| Version | Modifications | -| ------- | ------------- | -| v17 R5 | Ajoutées | +
    History +| Version | Changes | +| ------- | ------- | +| v17 R5 | Added |
    **.getContent( )** : Blob -| Paramètres | Type | | Description | -| ---------- | ---- | -- | ------------ | -| Résultat | Blob | <- | File content | +| Parameter | Type | | Description | +| --------- | ---- | -- | ------------ | +| Result | Blob | <- | File content | @@ -530,11 +530,11 @@ $copy:=$source.copyTo(Folder("/PACKAGE");fk overwrite) The `.getContent()` function returns a `BLOB` containing the entire content of a file. For information on BLOBs, please refer to the [BLOB](Concepts/dt_blob.md) section. -**Valeur retournée** +**Returned value** A `Blob`. -#### Exemple +#### Example To save a document's contents in a `BLOB` field: @@ -553,20 +553,20 @@ To save a document's contents in a `BLOB` field: ## .getIcon() -
    Historique -| Version | Modifications | -| ------- | ------------- | -| v17 R5 | Ajoutées | +
    History +| Version | Changes | +| ------- | ------- | +| v17 R5 | Added |
    **.getIcon**( { *size* : Integer } ) : Picture -| Paramètres | Type | | Description | -| ---------- | ----------- | -- | --------------------------------------------- | -| size | Entier long | -> | Side length for the returned picture (pixels) | -| Résultat | Image | <- | Icône | +| Parameter | Type | | Description | +| --------- | ------- | -- | --------------------------------------------- | +| size | Integer | -> | Side length for the returned picture (pixels) | +| Result | Image | <- | Icon | @@ -578,7 +578,7 @@ The optional *size* parameter specifies the dimensions in pixels of the returned If the file does not exist on disk, a default blank icon is returned. -**Valeur retournée** +**Returned value** File icon [picture](../Concepts/picture.html). @@ -591,10 +591,10 @@ File icon [picture](../Concepts/picture.html). ## .getText() -
    Historique -| Version | Modifications | -| ------- | ------------- | -| v17 R5 | Ajoutées | +
    History +| Version | Changes | +| ------- | ------- | +| v17 R5 | Added |
    @@ -602,12 +602,12 @@ File icon [picture](../Concepts/picture.html). -| Paramètres | Type | | Description | -| ----------- | ----------- | -- | ------------------------------- | -| charSetName | Texte | -> | Name of character set | -| charSetNum | Entier long | -> | Number of character set | -| breakMode | Entier long | -> | Processing mode for line breaks | -| Résultat | Texte | <- | Text from the document | +| Parameter | Type | | Description | +| ----------- | ------- | -- | ------------------------------- | +| charSetName | Text | -> | Name of character set | +| charSetNum | Integer | -> | Number of character set | +| breakMode | Integer | -> | Processing mode for line breaks | +| Result | Text | <- | Text from the document | @@ -625,21 +625,21 @@ If the document contains a Byte Order Mark (BOM), 4D uses the character set that In *breakMode*, you can pass a number indicating the processing to apply to end-of-line characters in the document. The following constants of the "System Documents" theme are available: -| Constant | Valeur | Commentaire | -| ----------------------------- | ------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `Document unchanged` | 0 | No processing | -| `Document with native format` | 1 | (Default) Line breaks are converted to the native format of the operating system: CR (carriage return) under OS X, CRLF (carriage return + line feed) under Windows | -| `Document with CRLF` | 2 | Line breaks are converted to Windows format: CRLF (carriage return + line feed) | -| `Document with CR` | 3 | Line breaks are converted to OS X format: CR (carriage return) | -| `Document with LF` | 4 | Line breaks are converted to Unix format: LF (line feed) | +| Constant | Value | Comment | +| ----------------------------- | ----- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `Document unchanged` | 0 | No processing | +| `Document with native format` | 1 | (Default) Line breaks are converted to the native format of the operating system: CR (carriage return) under OS X, CRLF (carriage return + line feed) under Windows | +| `Document with CRLF` | 2 | Line breaks are converted to Windows format: CRLF (carriage return + line feed) | +| `Document with CR` | 3 | Line breaks are converted to OS X format: CR (carriage return) | +| `Document with LF` | 4 | Line breaks are converted to Unix format: LF (line feed) | By default, when you omit the *breakMode* parameter, line breaks are processed in native mode (1). -**Valeur retournée** +**Returned value** Text of the file. -#### Exemple +#### Example Given the following text document (fields are separated by tabs): diff --git a/website/translated_docs/fr/API/emailObjectClass.md b/website/translated_docs/fr/API/emailObjectClass.md index fa3fe6c7999dd2..3e681a9655c80c 100644 --- a/website/translated_docs/fr/API/emailObjectClass.md +++ b/website/translated_docs/fr/API/emailObjectClass.md @@ -47,7 +47,7 @@ Email objects provide the following properties: All properties that contain email addresses ([`from`](#from), [`cc`](#cc), [`bcc`](#bcc), [`to`](#to), [`sender`](#sender), [`replyTo`](#replyto)) accept a value of text, object, or collection type. -#### Texte +#### Text - single email: "somebody@domain.com" - single display name+email: "Somebody " @@ -57,10 +57,10 @@ All properties that contain email addresses ([`from`](#from), [`cc`](#cc), [`bcc An object with two properties: -| Propriété | Type | Description | -| --------- | ----- | -------------------------- | -| name | Texte | Display name (can be null) | -| email | Texte | Email address | +| Property | Type | Description | +| -------- | ---- | -------------------------- | +| name | Text | Display name (can be null) | +| email | Text | Email address | #### Collection @@ -145,15 +145,15 @@ The `.bodyStructure` property contains the -**.messageId** : Texte +**.messageId** : Text #### Description -La propriété `.messageId` contient un en-tête d'identificateur de message ("message-id"). +The `.messageId` property contains a message identifier header ("message-id"). -Cet en-tête est généralement "desChiffresOuDesLettres@nomdededomaine", par exemple "abcdef.123456@4d.com". Cet identifiant unique est notamment utilisé sur les forums ou les listes de diffusion publiques. En général, les serveurs de messagerie ajoutent automatiquement cet en-tête aux messages qu'ils envoient. +This header is usually "lettersOrNumbers@domainname", e.g. "abcdef.123456@4d.com". This unique ID is used in particular on forums or public mailing lists. In general, mail servers automatically add this header to the messages they send. ## .receivedAt -**.receivedAt** : Texte +**.receivedAt** : Text #### Description [IMAP transporter](imapTransporterClass.md) only. -La propriété `.receivedAt` contient l'horodatage de l'arrivée de l'e-mail sur le serveur IMAP au format ISO 8601 UTC (ex : 2020-09-13T16:11:53Z). +The `.receivedAt` property contains the timestamp of the email's arrival on the IMAP server in ISO 8601 UTC format (ex: 2020-09-13T16:11:53Z). @@ -400,7 +400,7 @@ La propriété `.receivedAt` contient collection de tous les identifiants de messages de la chaîne de réponses précédente. +The `.references` property contains the Collection of all message-ids of messages in the preceding reply chain. For specific formatting requirements, please consult the [RFC#5322](https://tools.ietf.org/html/rfc5322). @@ -410,7 +410,7 @@ For specific formatting requirements, please consult the [RFC#5322](https://tool ## .replyTo -**.replyTo** : Texte
    **.replyTo** : Objet
    **.replyTo** : Collection +**.replyTo** : Text
    **.replyTo** : Object
    **.replyTo** : Collection #### Description @@ -424,7 +424,7 @@ The `.replyTo` property contains the -**.sendAt** : Texte +**.sendAt** : Text #### Description @@ -437,7 +437,7 @@ The `.sendAt` property contains the -**.sender** : Texte
    **.sender** : Objet
    **.sender** : Collection +**.sender** : Text
    **.sender** : Object
    **.sender** : Collection #### Description @@ -473,7 +473,7 @@ The `.size` property contains the siz ## .subject -**.subject** : Texte +**.subject** : Text #### Description @@ -487,23 +487,23 @@ The `.subject` property contains the -**.textBody** : Texte +**.textBody** : Text #### Description -La propriété `.textBody` contient la représentation en texte brut du message électronique (le jeu de caractères par défaut est UTF-8) (facultatif, SMTP uniquement). See [Handling body part](#handling-body-part) section. +The `.textBody` property contains the Plain text representation of the email message (default charset is UTF-8) (optional, SMTP only). See [Handling body part](#handling-body-part) section. ## .to -**.to** : Texte
    **.to** : Objet
    **.to** : Collection +**.to** : Text
    **.to** : Object
    **.to** : Collection #### Description -La propriété `.to` contient le ou les [destinataires](#email-addresses) principaux de l'e-mail. +The `.to` property contains the primary recipient [addresse(s)](#email-addresses) of the email. diff --git a/website/translated_docs/fr/API/entityClass.md b/website/translated_docs/fr/API/entityClass.md index d9f4fea2eb1d9d..4b95f0a81fe305 100644 --- a/website/translated_docs/fr/API/entityClass.md +++ b/website/translated_docs/fr/API/entityClass.md @@ -6,7 +6,7 @@ title: Entity An [entity](ORDA/dsMapping.md#entity) is an instance of a [Dataclass](ORDA/dsMapping.md#dataclass), like a record of the table matching the dataclass in its associated datastore. It contains the same attributes as the dataclass as well as the data values and specific properties and functions. -### Sommaire +### Summary | | | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | @@ -41,10 +41,10 @@ An [entity](ORDA/dsMapping.md#entity) is an instance of a [Dataclass](ORDA/dsMap ## .*attributeName* -
    Historique -| Version | Modifications | -| ------- | ------------- | -| v17 | Ajoutées | +
    History +| Version | Changes | +| ------- | ------- | +| v17 | Added |
    @@ -63,7 +63,7 @@ The attribute value type depends on the attribute [kind](dataclassAttributeClass * If *attributeName* kind is **relatedEntities**: `.attributeName` returns a new entity selection of related entities. Duplications are removed (an unordered entity selection is returned). -#### Exemple +#### Example ```4d var $myEntity : cs.EmployeeEntity @@ -81,10 +81,10 @@ The attribute value type depends on the attribute [kind](dataclassAttributeClass ## .clone() -
    Historique -| Version | Modifications | -| ------- | ------------- | -| v17 | Ajoutées | +
    History +| Version | Changes | +| ------- | ------- | +| v17 | Added |
    @@ -92,9 +92,9 @@ The attribute value type depends on the attribute [kind](dataclassAttributeClass **.clone()** : 4D.Entity -| Paramètres | Type | | Description | -| ---------- | --------- |:--:| --------------------------------- | -| Résultat | 4D.Entity | <- | New entity referencing the record | +| Parameter | Type | | Description | +| --------- | --------- |:--:| --------------------------------- | +| Result | 4D.Entity | <- | New entity referencing the record | @@ -106,7 +106,7 @@ The `.clone()` function creates in memo This function can only be used with entities already saved in the database. It cannot be called on a newly created entity (for which [`.isNew()`](#isnew) returns **True**). -#### Exemple +#### Example ```4d var $emp; $empCloned : cs.EmployeeEntity @@ -126,10 +126,10 @@ This function can only be used with entities already saved in the database. It c ## .diff() -
    Historique -| Version | Modifications | -| ------- | ------------- | -| v17 | Ajoutées | +
    History +| Version | Changes | +| ------- | ------- | +| v17 | Added |
    @@ -137,11 +137,11 @@ This function can only be used with entities already saved in the database. It c -| Paramètres | Type | | Description | +| Parameter | Type | | Description | | ------------------- | ---------- |:--:| ---------------------------------------------- | | entityToCompare | 4D.Entity | -> | Entity to be compared with the original entity | | attributesToCompare | Collection | -> | Name of attributes to be compared | -| Résultat | Collection | <- | Differences between the entities | +| Result | Collection | <- | Differences between the entities | @@ -155,11 +155,11 @@ In *attributesToCompare*, you can designate specific attributes to compare. If p The differences are returned as a collection of objects whose properties are: -| Nom de propriété | Type | Description | -| ---------------- | ------------------------------- | ------------------------------------------- | -| attributeName | Chaine | Name of the attribute | -| value | any - Depends on attribute type | Value of the attribute in the entity | -| otherValue | any - Depends on attribute type | Value of the attribute in *entityToCompare* | +| Property name | Type | Description | +| ------------- | ------------------------------- | ------------------------------------------- | +| attributeName | Chaine | Name of the attribute | +| value | any - Depends on attribute type | Value of the attribute in the entity | +| otherValue | any - Depends on attribute type | Value of the attribute in *entityToCompare* | Only attributes with different values are included in the collection. If no differences are found, `.diff()` returns an empty collection. @@ -167,7 +167,7 @@ The function applies for properties whose [kind](dataclassAttributeClass.md#kind If one of the compared entities is **Null**, an error is raised. -#### Exemple 1 +#### Example 1 ```4d @@ -218,7 +218,7 @@ $diff2: ] ``` -#### Exemple 2 +#### Example 2 ```4d var vCompareResult1; vCompareResult2; vCompareResult3; $attributesToInspect : Collection @@ -330,10 +330,10 @@ vCompareResult3 (only differences on $e1 touched attributes are returned) ## .drop() -
    Historique -| Version | Modifications | -| ------- | ------------- | -| v17 | Ajoutées | +
    History +| Version | Changes | +| ------- | ------- | +| v17 | Added |
    @@ -341,10 +341,10 @@ vCompareResult3 (only differences on $e1 touched attributes are returned) **.drop**( {*mode* : Integer} ) : Object -| Paramètres | Type | | Description | -| ---------- | ----------- |:--:| ------------------------------------------------------------------------------- | -| mode | Entier long | -> | `dk force drop if stamp changed`: Forces the drop even if the stamp has changed | -| Résultat | Objet | <- | Result of drop operation | +| Parameter | Type | | Description | +| --------- | ------- |:--:| ------------------------------------------------------------------------------- | +| mode | Integer | -> | `dk force drop if stamp changed`: Forces the drop even if the stamp has changed | +| Result | Objet | <- | Result of drop operation | #### Description @@ -357,42 +357,42 @@ By default, if the *mode* parameter is omitted, the function will return an erro Otherwise, you can pass the `dk force drop if stamp changed` option in the *mode* parameter: in this case, the entity is dropped even if the stamp has changed (and the primary key is still the same). -**Résultat** +**Result** The object returned by `.drop( )` contains the following properties: -| Propriété | | Type | Description | -| ------------- | ------------------- | ------------------- | --------------------------------------------------------------------------------------------------------------------- | -| success | | boolean | true if the drop action is successful, false otherwise. | -| | | | ***Available only in case of error:*** | -| status(*) | | number | Error code, see below | -| statusText(*) | | Texte | Description of the error, see below | -| | | | ***Available only in case of pessimistic lock error:*** | -| LockKindText | | Texte | "Locked by record" | -| lockInfo | | object | Information about the lock origin | -| | task_id | number | Process id | -| | user_name | Texte | Session user name on the machine | -| | user4d_id | Texte | User name in the 4D database directory | -| | host_name | Texte | Machine name | -| | task_name | Texte | Process name | -| | client_version | Texte | | -| | | | ***Available only in case of serious error (serious error can be trying to duplicate a primary key, disk full...):*** | -| errors | | collection d'objets | | -| | message | Texte | Error message | -| | component signature | Texte | internal component signature (e.g. "dmbg" stands for the database component) | -| | errCode | number | Error code | +| Property | | Type | Description | +| ------------- | ------------------- | --------------------- | --------------------------------------------------------------------------------------------------------------------- | +| success | | boolean | true if the drop action is successful, false otherwise. | +| | | | ***Available only in case of error:*** | +| status(*) | | number | Error code, see below | +| statusText(*) | | text | Description of the error, see below | +| | | | ***Available only in case of pessimistic lock error:*** | +| LockKindText | | text | "Locked by record" | +| lockInfo | | object | Information about the lock origin | +| | task_id | number | Process id | +| | user_name | text | Session user name on the machine | +| | user4d_id | text | User name in the 4D database directory | +| | host_name | text | Machine name | +| | task_name | text | Process name | +| | client_version | text | | +| | | | ***Available only in case of serious error (serious error can be trying to duplicate a primary key, disk full...):*** | +| errors | | collection of objects | | +| | message | text | Error message | +| | component signature | text | internal component signature (e.g. "dmbg" stands for the database component) | +| | errCode | number | Error code | (\*) The following values can be returned in the *status* and *statusText* properties of *Result* object in case of error: -| Constant | Valeur | Commentaire | -| ----------------------------------------- | ------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `dk status entity does not exist anymore` | 5 | The entity no longer exists in the data. This error can occur in the following cases:
  • the entity has been dropped (the stamp has changed and the memory space is now free)
  • the entity has been dropped and replaced by another one with another primary key (the stamp has changed and a new entity now uses the memory space). When using entity.drop( ), this error can be returned when dk force drop if stamp changed option is used. When using entity.lock( ), this error can be returned when dk reload if stamp changed option is used
  • **Associated statusText**: "Entity does not exist anymore" | -| `dk status locked` | 3 | The entity is locked by a pessimistic lock.
    **Associated statusText**: "Already locked" | -| `dk status serious error` | 4 | A serious error is a low-level database error (e.g. duplicated key), a hardware error, etc.
    **Associated statusText**: "Other error" | -| `dk status stamp has changed` | 2 | The internal stamp value of the entity does not match the one of the entity stored in the data (optimistic lock).

  • with `.save( )`: error only if the `dk auto merge` option is not used
  • with `.drop( )`: error only if the `dk force drop if stamp changed` option is not used
  • with `.lock( )`: error only if the `dk reload if stamp changed` option is not used
  • **Associated statusText**: "Stamp has changed"
  • | +| Constant | Value | Comment | +| ----------------------------------------- | ----- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `dk status entity does not exist anymore` | 5 | The entity no longer exists in the data. This error can occur in the following cases:
  • the entity has been dropped (the stamp has changed and the memory space is now free)
  • the entity has been dropped and replaced by another one with another primary key (the stamp has changed and a new entity now uses the memory space). When using entity.drop( ), this error can be returned when dk force drop if stamp changed option is used. When using entity.lock( ), this error can be returned when dk reload if stamp changed option is used
  • **Associated statusText**: "Entity does not exist anymore" | +| `dk status locked` | 3 | The entity is locked by a pessimistic lock.
    **Associated statusText**: "Already locked" | +| `dk status serious error` | 4 | A serious error is a low-level database error (e.g. duplicated key), a hardware error, etc.
    **Associated statusText**: "Other error" | +| `dk status stamp has changed` | 2 | The internal stamp value of the entity does not match the one of the entity stored in the data (optimistic lock).

  • with `.save( )`: error only if the `dk auto merge` option is not used
  • with `.drop( )`: error only if the `dk force drop if stamp changed` option is not used
  • with `.lock( )`: error only if the `dk reload if stamp changed` option is not used
  • **Associated statusText**: "Stamp has changed"
  • | -#### Exemple 1 +#### Example 1 Example without `dk force drop if stamp changed` option: @@ -411,7 +411,7 @@ Example without `dk force drop if stamp changed` option: End case ``` -#### Exemple 2 +#### Example 2 Example with `dk force drop if stamp changed` option: @@ -438,10 +438,10 @@ Example with `dk force drop if stamp changed` option: ## .first() -
    Historique -| Version | Modifications | -| ------- | ------------- | -| v17 | Ajoutées | +
    History +| Version | Changes | +| ------- | ------- | +| v17 | Added |
    @@ -449,9 +449,9 @@ Example with `dk force drop if stamp changed` option: **.first()**: 4D.Entity -| Paramètres | Type | | Description | -| ---------- | --------- |:--:| -------------------------------------------------------------------- | -| Résultat | 4D.Entity | <- | Reference to first entity of an entity selection (Null if not found) | +| Parameter | Type | | Description | +| --------- | --------- |:--:| -------------------------------------------------------------------- | +| Result | 4D.Entity | <- | Reference to first entity of an entity selection (Null if not found) | #### Description @@ -460,7 +460,7 @@ The `.first()` function returns a refer If the entity does not belong to any existing entity selection (i.e. [.getSelection( )](#getselection) returns Null), the function returns a Null value. -#### Exemple +#### Example ```4d var $employees : cs.EmployeeSelection @@ -477,10 +477,10 @@ If the entity does not belong to any existing entity selection (i.e. [.getSelect ## .fromObject() -
    Historique -| Version | Modifications | -| ------- | ------------- | -| v17 | Ajoutées | +
    History +| Version | Changes | +| ------- | ------- | +| v17 | Added |
    @@ -488,9 +488,9 @@ If the entity does not belong to any existing entity selection (i.e. [.getSelect **.fromObject**( *filler* : Object ) -| Paramètres | Type | | Description | -| ---------- | ----- |:--:| ------------------------------------ | -| filler | Objet | -> | Object from which to fill the entity | +| Parameter | Type | | Description | +| --------- | ----- |:--:| ------------------------------------ | +| filler | Objet | -> | Object from which to fill the entity | #### Description @@ -509,7 +509,7 @@ The mapping between the object and the entity is done on the attribute names: * *filler* contains a property object with the same name as the related entity, containing a single property named "\_\_KEY". * if the related entity does not exist, it is ignored. -#### Exemple +#### Example With the following $o object: @@ -566,10 +566,10 @@ You could also use a related entity given as an object: ## .getDataClass() -
    Historique -| Version | Modifications | -| ------- | ------------- | -| v17 R5 | Ajoutées | +
    History +| Version | Changes | +| ------- | ------- | +| v17 R5 | Added |
    @@ -577,9 +577,9 @@ You could also use a related entity given as an object: **.getDataClass()** : 4D.DataClass -| Paramètres | Type | | Description | -| ---------- | ------------ |:--:| -------------------------------------------- | -| Résultat | 4D.DataClass | <- | DataClass object to which the entity belongs | +| Parameter | Type | | Description | +| --------- | ------------ |:--:| -------------------------------------------- | +| Result | 4D.DataClass | <- | DataClass object to which the entity belongs | #### Description @@ -587,7 +587,7 @@ You could also use a related entity given as an object: The `.getDataClass()` function returns the dataclass of the entity. This function is useful when writing generic code. -#### Exemple +#### Example The following generic code duplicates any entity: @@ -613,10 +613,10 @@ The following generic code duplicates any entity: ## .getKey() -
    Historique -| Version | Modifications | -| ------- | ------------- | -| v17 | Ajoutées | +
    History +| Version | Changes | +| ------- | ------- | +| v17 | Added |
    @@ -624,11 +624,11 @@ The following generic code duplicates any entity: **.getKey**( { *mode* : Integer } ) : Text
    **.getKey**( { *mode* : Integer } ) : Integer -| Paramètres | Type | | Description | -| ---------- | ----------- |:--:| --------------------------------------------------------------------------------------- | -| mode | Entier long | -> | `dk key as string`: primary key is returned as a string, no matter the primary key type | -| Résultat | Texte | <- | Value of the text primary key of the entity | -| Résultat | Entier long | <- | Value of the numeric primary key of the entity | +| Parameter | Type | | Description | +| --------- | ------- |:--:| --------------------------------------------------------------------------------------- | +| mode | Integer | -> | `dk key as string`: primary key is returned as a string, no matter the primary key type | +| Result | Text | <- | Value of the text primary key of the entity | +| Result | Integer | <- | Value of the numeric primary key of the entity | @@ -638,7 +638,7 @@ The `.getKey()` function returns the p Primary keys can be numbers (Integer) or strings. You can "force" the returned primary key value to be a string, no matter the actual primary key type, by passing the `dk key as string` option in the *mode* parameter. -#### Exemple +#### Example ```4d @@ -657,10 +657,10 @@ Primary keys can be numbers (Integer) or strings. You can "force" the returned p ## .getSelection() -
    Historique -| Version | Modifications | -| ------- | ------------- | -| v17 | Ajoutées | +
    History +| Version | Changes | +| ------- | ------- | +| v17 | Added |
    @@ -668,9 +668,9 @@ Primary keys can be numbers (Integer) or strings. You can "force" the returned p **.getSelection()**: 4D.EntitySelection -| Paramètres | Type | | Description | -| ---------- | ------------------ |:--:| ---------------------------------------------------------------- | -| Résultat | 4D.EntitySelection | <- | Entity selection to which the entity belongs (Null if not found) | +| Parameter | Type | | Description | +| --------- | ------------------ |:--:| ---------------------------------------------------------------- | +| Result | 4D.EntitySelection | <- | Entity selection to which the entity belongs (Null if not found) | #### Description @@ -679,7 +679,7 @@ The `.getSelection()` function r If the entity does not belong to an entity selection, the function returns Null. -#### Exemple +#### Example ```4d @@ -701,10 +701,10 @@ If the entity does not belong to an entity selection, the function returns Null. ## .getStamp() -
    Historique -| Version | Modifications | -| ------- | ------------- | -| v17 | Ajoutées | +
    History +| Version | Changes | +| ------- | ------- | +| v17 | Added |
    @@ -712,9 +712,9 @@ If the entity does not belong to an entity selection, the function returns Null. **.getStamp()** : Integer -| Paramètres | Type | | Description | -| ---------- | ----------- |:--:| ------------------------------------------------------- | -| Résultat | Entier long | <- | Stamp of the entity (0 if entity has just been created) | +| Parameter | Type | | Description | +| --------- | ------- |:--:| ------------------------------------------------------- | +| Result | Integer | <- | Stamp of the entity (0 if entity has just been created) | #### Description @@ -725,7 +725,7 @@ The internal stamp is automatically incremented by 4D each time the entity is sa > For a new entity (never saved), the function returns 0. To know if an entity has just been created, it is recommended to use [.isNew()](#isnew). -#### Exemple +#### Example ```4d @@ -750,10 +750,10 @@ The internal stamp is automatically incremented by 4D each time the entity is sa ## .indexOf() -
    Historique -| Version | Modifications | -| ------- | ------------- | -| v17 | Ajoutées | +
    History +| Version | Changes | +| ------- | ------- | +| v17 | Added |
    @@ -761,10 +761,10 @@ The internal stamp is automatically incremented by 4D each time the entity is sa **.indexOf**( { *entitySelection* : 4D.EntitySelection } ) : Integer -| Paramètres | Type | | Description | +| Parameter | Type | | Description | | --------------- | ------------------ |:--:| ------------------------------------------------------------------ | | entitySelection | 4D.EntitySelection | -> | Position of the entity is given according to this entity selection | -| Résultat | Entier long | <- | Position of the entity in an entity selection | +| Result | Integer | <- | Position of the entity in an entity selection | #### Description @@ -778,7 +778,7 @@ The resulting value is included between 0 and the length of the entity selection * If the entity does not have an entity selection or does not belong to *entitySelection*, the function returns -1. * If *entitySelection* is Null or does not belong to the same dataclass as the entity, an error is raised. -#### Exemple +#### Example ```4d @@ -800,10 +800,10 @@ The resulting value is included between 0 and the length of the entity selection ## .isNew() -
    Historique -| Version | Modifications | -| ------- | ------------- | -| v17 | Ajoutées | +
    History +| Version | Changes | +| ------- | ------- | +| v17 | Added |
    @@ -811,9 +811,9 @@ The resulting value is included between 0 and the length of the entity selection **.isNew()** : Boolean -| Paramètres | Type | | Description | -| ---------- | ------- |:--:| ------------------------------------------------------------------------- | -| Résultat | Booléen | <- | True if entity has just been created and not yet saved. Otherwise, False. | +| Parameter | Type | | Description | +| --------- | ------- |:--:| ------------------------------------------------------------------------- | +| Result | Booléen | <- | True if entity has just been created and not yet saved. Otherwise, False. | #### Description @@ -821,7 +821,7 @@ The resulting value is included between 0 and the length of the entity selection The `.isNew()` function returns True if the entity to which it is applied has just been created and has not yet been saved in the datastore. Otherwise, it returns False. -#### Exemple +#### Example ```4d @@ -841,10 +841,10 @@ The `.isNew()` function returns True i ## .last() -
    Historique -| Version | Modifications | -| ------- | ------------- | -| v17 | Ajoutées | +
    History +| Version | Changes | +| ------- | ------- | +| v17 | Added |
    @@ -852,9 +852,9 @@ The `.isNew()` function returns True i **.last()** : 4D.Entity -| Paramètres | Type | | Description | -| ---------- | --------- |:--:| ------------------------------------------------------------------- | -| Résultat | 4D.Entity | <- | Reference to last entity of an entity selection (Null if not found) | +| Parameter | Type | | Description | +| --------- | --------- |:--:| ------------------------------------------------------------------- | +| Result | 4D.Entity | <- | Reference to last entity of an entity selection (Null if not found) | #### Description @@ -864,7 +864,7 @@ The `.last()` function returns a referen If the entity does not belong to any existing entity selection (i.e. [.getSelection( )](#getselection) returns Null), the function returns a Null value. -#### Exemple +#### Example ```4d @@ -882,10 +882,10 @@ If the entity does not belong to any existing entity selection (i.e. [.getSelect ## .lock() -
    Historique -| Version | Modifications | -| ------- | ------------- | -| v17 | Ajoutées | +
    History +| Version | Changes | +| ------- | ------- | +| v17 | Added |
    @@ -893,10 +893,10 @@ If the entity does not belong to any existing entity selection (i.e. [.getSelect **.lock**( { *mode* : Integer } ) : Object -| Paramètres | Type | | Description | -| ---------- | ----------- |:--:| -------------------------------------------------------------------- | -| mode | Entier long | -> | `dk reload if stamp changed`: Reload before locking if stamp changed | -| Résultat | Objet | <- | Result of lock operation | +| Parameter | Type | | Description | +| --------- | ------- |:--:| -------------------------------------------------------------------- | +| mode | Integer | -> | `dk reload if stamp changed`: Reload before locking if stamp changed | +| Result | Objet | <- | Result of lock operation | #### Description @@ -914,46 +914,46 @@ By default, if the *mode* parameter is omitted, the function will return an erro Otherwise, you can pass the `dk reload if stamp changed` option in the *mode* parameter: in this case, no error is returned and the entity is reloaded when the stamp has changed (if the entity still exists and the primary key is still the same). -**Résultat** +**Result** The object returned by `.lock( )` contains the following properties: -| Propriété | | Type | Description | -| ---------------- | ------------------- | ------------------- | ------------------------------------------------------------------------------------------------------------------- | -| success | | boolean | true if the lock action is successful (or if the entity is already locked in the current process), false otherwise. | -| | | | ***Available only if `dk reload if stamp changed` option is used:*** | -| **wasReloaded** | | boolean | true if the entity was reloaded with success, false otherwise. | -| | | | ***Available only in case of error:*** | -| status(\*) | | number | Error code, see below | -| statusText(\*) | | Texte | Description of the error, see below | -| | | | ***Available only in case of pessimistic lock error:*** | -| lockKindText | | Texte | "Locked by record" | -| lockInfo | | object | Information about the lock origin | -| | task_id | number | Process ID | -| | user_name | Texte | Session user name on the machine | -| | user4d_alias | Texte | Name or alias of the 4D user | -| | user4d_id | number | User id in the 4D database directory | -| | host_name | Texte | Machine name | -| | task_name | Texte | Process name | -| | client_version | Texte | | -| | | | ***Available only in case of serious error*** (primary key already exists, disk full...): | -| errors | | collection d'objets | | -| | message | Texte | Error message | -| | component signature | Texte | internal component signature (e.g. "dmbg" stands for the database component) | -| | errCode | number | Error code | +| Property | | Type | Description | +| ---------------- | ------------------- | --------------------- | ------------------------------------------------------------------------------------------------------------------- | +| success | | boolean | true if the lock action is successful (or if the entity is already locked in the current process), false otherwise. | +| | | | ***Available only if `dk reload if stamp changed` option is used:*** | +| **wasReloaded** | | boolean | true if the entity was reloaded with success, false otherwise. | +| | | | ***Available only in case of error:*** | +| status(\*) | | number | Error code, see below | +| statusText(\*) | | text | Description of the error, see below | +| | | | ***Available only in case of pessimistic lock error:*** | +| lockKindText | | text | "Locked by record" | +| lockInfo | | object | Information about the lock origin | +| | task_id | number | Process ID | +| | user_name | text | Session user name on the machine | +| | user4d_alias | text | Name or alias of the 4D user | +| | user4d_id | number | User id in the 4D database directory | +| | host_name | text | Machine name | +| | task_name | text | Process name | +| | client_version | text | | +| | | | ***Available only in case of serious error*** (primary key already exists, disk full...): | +| errors | | collection of objects | | +| | message | text | Error message | +| | component signature | text | internal component signature (e.g. "dmbg" stands for the database component) | +| | errCode | number | Error code | (\*) The following values can be returned in the *status* and *statusText* properties of the *Result* object in case of error: -| Constant | Valeur | Commentaire | -| ----------------------------------------- | ------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `dk status entity does not exist anymore` | 5 | The entity no longer exists in the data. This error can occur in the following cases:
  • the entity has been dropped (the stamp has changed and the memory space is now free)
  • the entity has been dropped and replaced by another one with another primary key (the stamp has changed and a new entity now uses the memory space). When using `.drop( )`, this error can be returned when dk force drop if stamp changed option is used. When using `.lock( )`, this error can be returned when `dk reload if stamp changed` option is used

  • **Associated statusText**: "Entity does not exist anymore" | -| `dk status locked` | 3 | The entity is locked by a pessimistic lock.

    **Associated statusText**: "Already locked" | -| `dk status serious error` | 4 | A serious error is a low-level database error (e.g. duplicated key), a hardware error, etc.

    **Associated statusText**: "Other error" | -| `dk status stamp has changed` | 2 | The internal stamp value of the entity does not match the one of the entity stored in the data (optimistic lock).

  • with `.save( )`: error only if the `dk auto merge` option is not used
  • with `.drop( )`: error only if the `dk force drop if stamp changed` option is not used
  • with `.lock( )`: error only if the `dk reload if stamp changed` option is not used

  • **Associated statusText**: "Stamp has changed" | +| Constant | Value | Comment | +| ----------------------------------------- | ----- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `dk status entity does not exist anymore` | 5 | The entity no longer exists in the data. This error can occur in the following cases:
  • the entity has been dropped (the stamp has changed and the memory space is now free)
  • the entity has been dropped and replaced by another one with another primary key (the stamp has changed and a new entity now uses the memory space). When using `.drop( )`, this error can be returned when dk force drop if stamp changed option is used. When using `.lock( )`, this error can be returned when `dk reload if stamp changed` option is used

  • **Associated statusText**: "Entity does not exist anymore" | +| `dk status locked` | 3 | The entity is locked by a pessimistic lock.

    **Associated statusText**: "Already locked" | +| `dk status serious error` | 4 | A serious error is a low-level database error (e.g. duplicated key), a hardware error, etc.

    **Associated statusText**: "Other error" | +| `dk status stamp has changed` | 2 | The internal stamp value of the entity does not match the one of the entity stored in the data (optimistic lock).

  • with `.save( )`: error only if the `dk auto merge` option is not used
  • with `.drop( )`: error only if the `dk force drop if stamp changed` option is not used
  • with `.lock( )`: error only if the `dk reload if stamp changed` option is not used

  • **Associated statusText**: "Stamp has changed" | -#### Exemple 1 +#### Example 1 Example with error: @@ -971,7 +971,7 @@ Example with error: ``` -#### Exemple 2 +#### Example 2 Example with `dk reload if stamp changed` option: @@ -995,10 +995,10 @@ Example with `dk reload if stamp changed` option: ## .next() -
    Historique -| Version | Modifications | -| ------- | ------------- | -| v17 | Ajoutées | +
    History +| Version | Changes | +| ------- | ------- | +| v17 | Added |
    @@ -1006,9 +1006,9 @@ Example with `dk reload if stamp changed` option: **.next()** : 4D.Entity -| Paramètres | Type | | Description | -| ---------- | --------- |:--:| -------------------------------------------------------------------- | -| Résultat | 4D.Entity | <- | Reference to next entity in the entity selection (Null if not found) | +| Parameter | Type | | Description | +| --------- | --------- |:--:| -------------------------------------------------------------------- | +| Result | 4D.Entity | <- | Reference to next entity in the entity selection (Null if not found) | #### Description @@ -1020,7 +1020,7 @@ If the entity does not belong to any existing entity selection (i.e. [.getSelect If there is no valid next entity in the entity selection (i.e. you are on the last entity of the selection), the function returns Null. If the next entity has been dropped, the function returns the next valid entity (and eventually Null). -#### Exemple +#### Example ```4d var $employees : cs.EmployeeSelection @@ -1037,10 +1037,10 @@ If there is no valid next entity in the entity selection (i.e. you are on the la ## .previous() -
    Historique -| Version | Modifications | -| ------- | ------------- | -| v17 | Ajoutées | +
    History +| Version | Changes | +| ------- | ------- | +| v17 | Added |
    @@ -1048,9 +1048,9 @@ If there is no valid next entity in the entity selection (i.e. you are on the la **.previous()** : 4D.Entity -| Paramètres | Type | | Description | -| ---------- | --------- |:--:| ------------------------------------------------------------------------ | -| Résultat | 4D.Entity | <- | Reference to previous entity in the entity selection (Null if not found) | +| Parameter | Type | | Description | +| --------- | --------- |:--:| ------------------------------------------------------------------------ | +| Result | 4D.Entity | <- | Reference to previous entity in the entity selection (Null if not found) | #### Description @@ -1062,7 +1062,7 @@ If the entity does not belong to any existing entity selection (i.e. [.getSelect If there is no valid previous entity in the entity selection (i.e. you are on the first entity of the selection), the function returns Null. If the previous entity has been dropped, the function returns the previous valid entity (and eventually Null). -#### Exemple +#### Example ```4d var $employees : cs.EmployeeSelection @@ -1079,10 +1079,10 @@ If there is no valid previous entity in the entity selection (i.e. you are on th ## .reload( ) -
    Historique -| Version | Modifications | -| ------- | ------------- | -| v17 | Ajoutées | +
    History +| Version | Changes | +| ------- | ------- | +| v17 | Added |
    @@ -1090,34 +1090,34 @@ If there is no valid previous entity in the entity selection (i.e. you are on th **.reload()** : Object -| Paramètres | Type | | Description | -| ---------- | ----- |:--:| ------------- | -| Résultat | Objet | <- | Status object | +| Parameter | Type | | Description | +| --------- | ----- |:--:| ------------- | +| Result | Objet | <- | Status object | #### Description The `.reload()` function reloads the content of the entity in memory, according to information stored in the table related to the dataclass in the datastore. The reload is done only if the entity still exists with the same primary key. -**Résultat** +**Result** The object returned by `.reload( )` contains the following properties: -| Propriété | Type | Description | +| Property | Type | Description | | ---------------- | ------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- | | success | boolean | True if the reload action is successful, False otherwise.

    ***Available only in case of error***: | | status(\*) | number | Error code, see below | -| statusText(\*) | Texte | Description of the error, see below | +| statusText(\*) | text | Description of the error, see below | (\*) The following values can be returned in the *status* and *statusText* properties of *Result* object in case of error: -| Constant | Valeur | Commentaire | -| ----------------------------------------- | ------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `dk status entity does not exist anymore` | 5 | The entity no longer exists in the data. This error can occur in the following cases:

  • the entity has been dropped (the stamp has changed and the memory space is now free)
  • the entity has been dropped and replaced by another one with another primary key (the stamp has changed and a new entity now uses the memory space). When using `.drop( )`, this error can be returned when `dk force drop if stamp changed` option is used. When using `.lock( )`, this error can be returned when `dk reload if stamp changed` option is used

  • ***Associated statusText***: "Entity does not exist anymore" | -| `dk status serious error` | 4 | A serious error is a low-level database error (e.g. duplicated key), a hardware error, etc.
    ***Associated statusText***: "Other error" | +| Constant | Value | Comment | +| ----------------------------------------- | ----- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `dk status entity does not exist anymore` | 5 | The entity no longer exists in the data. This error can occur in the following cases:
  • the entity has been dropped (the stamp has changed and the memory space is now free)
  • the entity has been dropped and replaced by another one with another primary key (the stamp has changed and a new entity now uses the memory space). When using `.drop( )`, this error can be returned when `dk force drop if stamp changed` option is used. When using `.lock( )`, this error can be returned when `dk reload if stamp changed` option is used

  • ***Associated statusText***: "Entity does not exist anymore" | +| `dk status serious error` | 4 | A serious error is a low-level database error (e.g. duplicated key), a hardware error, etc.
    ***Associated statusText***: "Other error" | -#### Exemple +#### Example ```4d var $employee : cs.EmployeeEntity @@ -1142,10 +1142,10 @@ The object returned by `.reload( )` contains the following properties: ## .save() -
    Historique -| Version | Modifications | -| ------- | ------------- | -| v17 | Ajoutées | +
    History +| Version | Changes | +| ------- | ------- | +| v17 | Added |
    @@ -1153,10 +1153,10 @@ The object returned by `.reload( )` contains the following properties: **.save**( { *mode* : Integer } ) : Object -| Paramètres | Type | | Description | -| ---------- | ----------- |:--:| ------------------------------------------------- | -| mode | Entier long | -> | `dk auto merge`: Enables the automatic merge mode | -| Résultat | Objet | <- | Result of save operation | +| Parameter | Type | | Description | +| --------- | ------- |:--:| ------------------------------------------------- | +| mode | Integer | -> | `dk auto merge`: Enables the automatic merge mode | +| Result | Objet | <- | Result of save operation | #### Description @@ -1172,20 +1172,20 @@ By default, if the *mode* parameter is omitted, the method will return an error Otherwise, you can pass the `dk auto merge` option in the *mode* parameter: when the automatic merge mode is enabled, a modification done concurrently by another process/user on the same entity but on a different attribute will not result in an error. The resulting data saved in the entity will be the combination (the "merge") of all non-concurrent modifications (if modifications were applied to the same attribute, the save fails and an error is returned, even with the auto merge mode). > The automatic merge mode is not available for attributes of Picture, Object, and Text type when stored outside of the record. Concurrent changes in these attributes will result in a `dk status stamp has changed` error. -**Résultat** +**Result** The object returned by `.save()` contains the following properties: -| Propriété | | Type | Description | +| Property | | Type | Description | | ---------------- | | ------- | ------------------------------------------------------- | | success | | boolean | True if the save action is successful, False otherwise. | | | | | ***Available only if `dk auto merge` option is used***: | | autoMerged | | boolean | True if an auto merge was done, False otherwise. | | | | | ***Available only in case of error***: | | status(\*) | | number | Error code, see below | -| statusText(\*) | | Texte | Description of the error, see below | +| statusText(\*) | | text | Description of the error, see below | | | | | ***Available only in case of pessimistic lock error***: | -| lockKindText | | Texte | "Locked by record" | +| lockKindText | | text | "Locked by record" | | lockInfo | | object | Information about the lock | origin| ||task_id| number| Process id| ||user_name |text| Session user name on the machine| ||user4d_id| text| User name in the 4D database directory| ||host_name |text |Machine name| ||task_name| text| Process name| ||client_version| text|| @@ -1194,16 +1194,16 @@ The object returned by `.save()` contains the following properties: (\*) The following values can be returned in the status and statusText properties of Result object in case of error: -| Constant | Valeur | Commentaire | -| ----------------------------------------- | ------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `dk status automerge failed` | 6 | (Only if the `dk auto merge` option is used) The automatic merge option failed when saving the entity.

    **Associated statusText**: "Auto merge failed" | -| `dk status entity does not exist anymore` | 5 | The entity no longer exists in the data. This error can occur in the following cases:

  • the entity has been dropped (the stamp has changed and the memory space is now free)
  • the entity has been dropped and replaced by another one with another primary key (the stamp has changed and a new entity now uses the memory space). When using `.drop( )`, this error can be returned when `dk force drop if stamp changed` option is used. When using `.lock( )`, this error can be returned when `dk reload if stamp changed` option is used

  • **Associated statusText**: "Entity doesnot exist anymore" | -| `dk status locked` | 3 | The entity is locked by a pessimistic lock.

    **Associated statusText**: "Already locked" | -| `dk status serious error` | 4 | A serious error is a low-level database error (e.g. duplicated key), a hardware error, etc.

    **Associated statusText**: "Other error" | -| `dk status stamp has changed` | 2 | The internal stamp value of the entity does not match the one of the entity stored in the data (optimistic lock).

  • with `.save( )`: error only if the `dk auto merge` option is not used
  • with `.drop( )`: error only if the `dk force drop if stamp changed` option is not used
  • with `.lock( )`: error only if the `dk reload if stamp changed` option is not used

  • **Associated statusText**: "Stamp has changed" | +| Constant | Value | Comment | +| ----------------------------------------- | ----- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `dk status automerge failed` | 6 | (Only if the `dk auto merge` option is used) The automatic merge option failed when saving the entity.

    **Associated statusText**: "Auto merge failed" | +| `dk status entity does not exist anymore` | 5 | The entity no longer exists in the data. This error can occur in the following cases:

  • the entity has been dropped (the stamp has changed and the memory space is now free)
  • the entity has been dropped and replaced by another one with another primary key (the stamp has changed and a new entity now uses the memory space). When using `.drop( )`, this error can be returned when `dk force drop if stamp changed` option is used. When using `.lock( )`, this error can be returned when `dk reload if stamp changed` option is used

  • **Associated statusText**: "Entity doesnot exist anymore" | +| `dk status locked` | 3 | The entity is locked by a pessimistic lock.

    **Associated statusText**: "Already locked" | +| `dk status serious error` | 4 | A serious error is a low-level database error (e.g. duplicated key), a hardware error, etc.

    **Associated statusText**: "Other error" | +| `dk status stamp has changed` | 2 | The internal stamp value of the entity does not match the one of the entity stored in the data (optimistic lock).

  • with `.save( )`: error only if the `dk auto merge` option is not used
  • with `.drop( )`: error only if the `dk force drop if stamp changed` option is not used
  • with `.lock( )`: error only if the `dk reload if stamp changed` option is not used

  • **Associated statusText**: "Stamp has changed" | -#### Exemple 1 +#### Example 1 Creating a new entity: @@ -1219,7 +1219,7 @@ Creating a new entity: End if ``` -#### Exemple 2 +#### Example 2 Updating an entity without `dk auto merge` option: @@ -1268,10 +1268,10 @@ Updating an entity with `dk auto merge` option: ## .toObject() -
    Historique -| Version | Modifications | -| ------- | ------------- | -| v17 | Ajoutées | +
    History +| Version | Changes | +| ------- | ------- | +| v17 | Added |
    @@ -1279,12 +1279,12 @@ Updating an entity with `dk auto merge` option: **.toObject**() : Object
    **.toObject**( *filterString* : Text { ; *options* : Integer} ) : Object
    **.toObject**( *filterCol* : Collection { ; *options* : Integer } ) : Object -| Paramètres | Type | | Description | -| ------------ | ----------- |:--:| ------------------------------------------------------------------------------------------------------- | -| filterString | Texte | -> | Attribute(s) to extract (comma-separated string) | -| filterCol | Collection | -> | Collection of attribute(s) to extract | -| options | Entier long | -> | `dk with primary key`: adds the \_KEY property;
    `dk with stamp`: adds the \_STAMP property | -| Résultat | Objet | <- | Object built from the entity | +| Parameter | Type | | Description | +| ------------ | ---------- |:--:| ------------------------------------------------------------------------------------------------------- | +| filterString | Text | -> | Attribute(s) to extract (comma-separated string) | +| filterCol | Collection | -> | Collection of attribute(s) to extract | +| options | Integer | -> | `dk with primary key`: adds the \_KEY property;
    `dk with stamp`: adds the \_STAMP property | +| Result | Objet | <- | Object built from the entity | #### Description @@ -1317,7 +1317,7 @@ If a filter is specified for attributes of the relatedEntities [kind](dataclassA In the *options* parameter, you can pass the `dk with primary key` and/or`dk with stamp` selector(s) to add the entity's primary keys and/or stamps in extracted objects. -#### Exemple 1 +#### Example 1 The following structure will be used throughout all examples of this section: @@ -1355,7 +1355,7 @@ Returns: -#### Exemple 2 +#### Example 2 Extracting the primary key and the stamp: @@ -1555,10 +1555,10 @@ Returns: ## .touched( ) -
    Historique -| Version | Modifications | -| ------- | ------------- | -| v17 | Ajoutées | +
    History +| Version | Changes | +| ------- | ------- | +| v17 | Added |
    @@ -1566,9 +1566,9 @@ Returns: **.touched()** : Boolean -| Paramètres | Type | | Description | -| ---------- | ------- |:--:| ------------------------------------------------------------------------------------- | -| Résultat | Booléen | <- | True if at least one entity attribute has been modified and not yet saved, else False | +| Parameter | Type | | Description | +| --------- | ------- |:--:| ------------------------------------------------------------------------------------- | +| Result | Booléen | <- | True if at least one entity attribute has been modified and not yet saved, else False | #### Description @@ -1579,7 +1579,7 @@ If an attribute has been modified or calculated, the function returns True, else This function returns False for a new entity that has just been created (with [`.new( )`](dataclassClass.md#new)). Note however that if you use a function which calculates an attribute of the entity, the `.touched()` function will then return True. For example, if you call [`.getKey()`](#getkey) to calculate the primary key, `.touched()` returns True. -#### Exemple +#### Example In this example, we check to see if it is necessary to save the entity: @@ -1599,10 +1599,10 @@ In this example, we check to see if it is necessary to save the entity: ## .touchedAttributes( ) -
    Historique -| Version | Modifications | -| ------- | ------------- | -| v17 | Ajoutées | +
    History +| Version | Changes | +| ------- | ------- | +| v17 | Added |
    @@ -1610,9 +1610,9 @@ In this example, we check to see if it is necessary to save the entity: **.touchedAttributes()** : Collection -| Paramètres | Type | | Description | -| ---------- | ---------- |:--:| ------------------------------------------------ | -| Résultat | Collection | <- | Names of touched attributes, or empty collection | +| Parameter | Type | | Description | +| --------- | ---------- |:--:| ------------------------------------------------ | +| Result | Collection | <- | Names of touched attributes, or empty collection | #### Description @@ -1625,7 +1625,7 @@ In the case of a related entity having been touched (i.e., the foreign key), the If no entity attribute has been touched, the method returns an empty collection. -#### Exemple 1 +#### Example 1 ```4d @@ -1641,7 +1641,7 @@ If no entity attribute has been touched, the method returns an empty collection. ``` -#### Exemple 2 +#### Example 2 ```4d @@ -1675,10 +1675,10 @@ In this case: ## .unlock() -
    Historique -| Version | Modifications | -| ------- | ------------- | -| v17 | Ajoutées | +
    History +| Version | Changes | +| ------- | ------- | +| v17 | Added |
    @@ -1686,9 +1686,9 @@ In this case: **.unlock()** : Object -| Paramètres | Type | | Description | -| ---------- | ----- |:--:| ------------- | -| Résultat | Objet | <- | Status object | +| Parameter | Type | | Description | +| --------- | ----- |:--:| ------------- | +| Result | Objet | <- | Status object | #### Description @@ -1698,7 +1698,7 @@ The `.unlock()` function removes the p > For more information, please refer to [Entity locking](ORDA/entities.md#entity-locking) section. 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). -> When a record is locked, it must be unlocked from the locking process and on the entity reference which put the lock. Par exemple: +> When a record is locked, it must be unlocked from the locking process and on the entity reference which put the lock. For example: ```4d $e1:=ds.Emp.all()[0] @@ -1708,15 +1708,15 @@ A record is automatically unlocked when it is no longer referenced by any entiti $res:=$e1.unlock() //$res.success=true ``` -**Résultat** +**Result** The object returned by `.unlock()` contains the following property: -| Propriété | Type | Description | -| --------- | ------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| success | Booléen | True if the unlock action is successful, False otherwise. If the unlock is done on a dropped entity, on a non locked record, or on a record locked by another process or entity, success is False. | +| Property | Type | Description | +| -------- | ------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| success | Booléen | True if the unlock action is successful, False otherwise. If the unlock is done on a dropped entity, on a non locked record, or on a record locked by another process or entity, success is False. | -#### Exemple +#### Example ```4d var $employee : cs.EmployeeEntity diff --git a/website/translated_docs/fr/API/entitySelectionClass.md b/website/translated_docs/fr/API/entitySelectionClass.md index 49a6eafadeadf6..6b65bce95e12b7 100644 --- a/website/translated_docs/fr/API/entitySelectionClass.md +++ b/website/translated_docs/fr/API/entitySelectionClass.md @@ -7,7 +7,7 @@ title: EntitySelection An entity selection is an object containing one or more reference(s) to [entities](ORDA/dsMapping.md#entity) belonging to the same [Dataclass](ORDA/dsMapping.md#dataclass). An entity selection can contain 0, 1 or X entities from the dataclass -- where X can represent the total number of entities contained in the dataclass. -### Sommaire +### Summary | | | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | @@ -23,6 +23,7 @@ An entity selection is an object containing one or more reference(s) to [entitie | [](#extract)

        | | [](#first)

        | | [](#getdataclass)

        | +| [](#isalterable)

        | | [](#isordered)

        | | [](#last)

        | | [](#length)

        | @@ -43,14 +44,54 @@ An entity selection is an object containing one or more reference(s) to [entitie + +**Create entity selection** ( *dsTable* : Table { ; *settings* : Object } ) : 4D.EntitySelection + + +| Parameter | Type | | Description | +| --------- | ------------------ |:--:| ------------------------------------------------------------------------------------------- | +| dsTable | Table | -> | Table in the 4D database whose current selection will be used to build the entity selection | +| settings | Objet | -> | Build option: context | +| Result | 4D.EntitySelection | <- | Entity selection matching the dataclass related to the given table | + + + +#### Description + +The `Create entity selection` command builds and returns a new, [alterable](ORDA/entities.md#shareable-or-alterable-entity-selections) entity selection related to the dataclass matching the given *dsTable*, according to the current selection of this table. + +If the current selection is sorted, an [ordered](ORDA/dsMapping.md#ordered-or-unordered-entity-selection) entity selection is created (the order of the current selection is kept). If the current selection is unsorted, an unordered entity selection is created. + +If the *dsTable* is not exposed in [`ds`](API/datastoreClass.md#ds), an error is returned. This command cannot be used with a Remote datastore. + +In the optional *settings* parameter, you can pass an object containing the following property: + +| Property | Type | Description | +| -------- | ---- | ----------------------------------------------------------------------------------------------------------------- | +| context | Text | Label for the [optimization context](ORDA/entities.md#clientserver-optimization) applied to the entity selection. | + + +#### Example + +```4d +var $employees : cs.EmployeeSelection +ALL RECORDS([Employee]) +$employees:=Create entity selection([Employee]) +// The $employees entity selection now contains a set of reference +// on all entities related to the Employee dataclass +``` + +#### See also + +[`dataClass.newSelection()`](dataclassClass.md#newselection) ## [*index*] -

    Historique -| Version | Modifications | -| ------- | ------------- | -| v17 | Ajoutées | +
    History +| Version | Changes | +| ------- | ------- | +| v17 | Added |
    @@ -68,7 +109,7 @@ Note that the corresponding entity is reloaded from the datastore. * If *index* is out of range, an error is returned. * If *index* corresponds to a dropped entity, a Null value is returned. -> **Warning**: `EntitySelection[index]` is a non assignable expression, which means that it cannot be used as en editable entity reference with methods like [`.lock()`](entityClass.md#lock) or [`.save()`](entityClass.md#save). To work with the corresponding entity, you need to assign the returned expression to an assignable expression, such as a variable. Voici quelques exemples : +> **Warning**: `EntitySelection[index]` is a non assignable expression, which means that it cannot be used as en editable entity reference with methods like [`.lock()`](entityClass.md#lock) or [`.save()`](entityClass.md#save). To work with the corresponding entity, you need to assign the returned expression to an assignable expression, such as a variable. Examples: ```4d $sel:=ds.Employee.all() //create the entity selection @@ -82,7 +123,7 @@ Note that the corresponding entity is reloaded from the datastore. $entity.save() //OK ``` -#### Exemple +#### Example ```4d @@ -100,10 +141,10 @@ Note that the corresponding entity is reloaded from the datastore. ## .*attributeName* -
    Historique -| Version | Modifications | -| ------- | ------------- | -| v17 | Ajoutées | +
    History +| Version | Changes | +| ------- | ------- | +| v17 | Added |
    @@ -119,7 +160,7 @@ Any dataclass attribute can be used as a property of an entity selection to retu * If *attributeName* kind is `relatedEntities`: `.attributeName` returns a new entity selection of related values of the same type as *attributeName*. Duplications are removed (an unordered entity selection is returned). -Lorsqu'un attribut de relation est utilisé comme propriété d'une sélection d'entité, le résultat est toujours une autre sélection d'entité, même si une seule entité est retournée. In this case, if no entities are returned, the result is an empty entity selection. +When a relation attribute is used as a property of an entity selection, the result is always another entity selection, even if only one entity is returned. In this case, if no entities are returned, the result is an empty entity selection. If the attribute does not exist in the entity selection, an error is returned. @@ -128,7 +169,7 @@ If the attribute does not exist in the entity selection, an error is returned. -#### Exemple 1 +#### Example 1 Projection of storage values: @@ -149,7 +190,7 @@ The resulting collection is a collection of strings, for example: ] ``` -#### Exemple 2 +#### Example 2 Projection of related entity: @@ -180,11 +221,11 @@ The resulting object is an entity selection of Employee with duplications remove ## .add() -
    Historique -| Version | Modifications | -| ------- | --------------------------------------------- | -| v18 R5 | Only supports non-shareable entity selections | -| v17 | Ajoutées | +
    History +| Version | Changes | +| ------- | ----------------------------------------- | +| v18 R5 | Only supports alterable entity selections | +| v17 | Added |
    @@ -192,10 +233,10 @@ The resulting object is an entity selection of Employee with duplications remove **.add**( *entity* : 4D.Entity ) : 4D.EntitySelection -| Paramètres | Type | | Description | -| ---------- | ------------------ |:--:| --------------------------------------------- | -| entity | 4D.Entity | -> | Entity to be added to the entity selection | -| Résultat | 4D.EntitySelection | -> | Entity selection including the added *entity* | +| Parameter | Type | | Description | +| --------- | ------------------ |:--:| --------------------------------------------- | +| entity | 4D.Entity | -> | Entity to be added to the entity selection | +| Result | 4D.EntitySelection | -> | Entity selection including the added *entity* | @@ -204,7 +245,7 @@ The resulting object is an entity selection of Employee with duplications remove The `.add()` function adds the specified *entity* to the entity selection and returns the modified entity selection. > This function modifies the original entity selection. -**Warning:** The entity selection must be *non-shareable*, i.e. it has been created for example by [`.newSelection()`](dataclassClass.md#newselection) or `Create entity selection`, otherwise `.add()` will return an error. Shareable entity selections do not accept the addition of entities. For more information, please refer to the [Shareable vs Non-shareable entity selections](ORDA/entities.md#shareable-or-non-shareable-entity-selections) section. +**Warning:** The entity selection must be *alterable*, i.e. it has been created for example by [`.newSelection()`](dataclassClass.md#newselection) or `Create entity selection`, otherwise `.add()` will return an error. Shareable entity selections do not accept the addition of entities. For more information, please refer to the [Shareable or alterable entity selections](ORDA/entities.md#shareable-or-alterable-entity-selections) section. * If the entity selection is ordered, *entity* is added at the end of the selection. If a reference to the same entity already belongs to the entity selection, it is duplicated and a new reference is added. @@ -215,7 +256,7 @@ The modified entity selection is returned by the function, so that function call An error occurs if *entity* and the entity selection are not related to the same Dataclass. If *entity* is Null, no error is raised. -#### Exemple 1 +#### Example 1 ```4d var $employees : cs.EmployeeSelection @@ -227,7 +268,7 @@ An error occurs if *entity* and the entity selection are not related to the same $employees.add($employee) //The $employee entity is added to the $employees entity selection ``` -#### Exemple 2 +#### Example 2 Calls to the function can be chained: @@ -248,10 +289,10 @@ Calls to the function can be chained: ## .and() -
    Historique -| Version | Modifications | -| ------- | ------------- | -| v17 | Ajoutées | +
    History +| Version | Changes | +| ------- | ------- | +| v17 | Added |
    @@ -259,11 +300,11 @@ Calls to the function can be chained: -| Paramètres | Type | | Description | +| Parameter | Type | | Description | | --------------- | ------------------ |:--:| ------------------------------------------------------------------------------ | | entity | 4D.Entity | -> | Entity to intersect with | | entitySelection | 4D.EntitySelection | -> | Entity selection to intersect with | -| Résultat | 4D.EntitySelection | <- | New entity selection with the result of intersection with logical AND operator | +| Result | 4D.EntitySelection | <- | New entity selection with the result of intersection with logical AND operator | @@ -280,7 +321,7 @@ If the original entity selection or the *entitySelection* parameter is empty, or If the original entity selection and the parameter are not related to the same dataclass, an error is raised. -#### Exemple 1 +#### Example 1 ```4d @@ -297,7 +338,7 @@ If the original entity selection and the parameter are not related to the same d ``` -#### Exemple 2 +#### Example 2 We want to have a selection of employees named "Jones" who live in New York: @@ -314,10 +355,10 @@ We want to have a selection of employees named "Jones" who live in New York: ## .average() -
    Historique -| Version | Modifications | -| ------- | ------------- | -| v17 | Ajoutées | +
    History +| Version | Changes | +| ------- | ------- | +| v17 | Added |
    @@ -325,10 +366,10 @@ We want to have a selection of employees named "Jones" who live in New York: **.average**( *attributePath* : Text ) : Real -| Paramètres | Type | | Description | -| ------------- | ----- |:--:| ------------------------------------------------------------------------------------- | -| attributePath | Texte | -> | Attribute path to be used for calculation | -| Résultat | Réel | <- | Arithmetic mean (average) of entity attribute values (Null if empty entity selection) | +| Parameter | Type | | Description | +| ------------- | ---- |:--:| ------------------------------------------------------------------------------------- | +| attributePath | Text | -> | Attribute path to be used for calculation | +| Result | Real | <- | Arithmetic mean (average) of entity attribute values (Null if empty entity selection) | #### Description @@ -348,7 +389,7 @@ An error is returned if: * *attributePath* is not found in the entity selection dataclass. -#### Exemple +#### Example We want to obtain a list of employees whose salary is higher than the average salary: @@ -366,10 +407,10 @@ We want to obtain a list of employees whose salary is higher than the average sa ## .contains() -
    Historique -| Version | Modifications | -| ------- | ------------- | -| v17 | Ajoutées | +
    History +| Version | Changes | +| ------- | ------- | +| v17 | Added |
    @@ -377,10 +418,10 @@ We want to obtain a list of employees whose salary is higher than the average sa **.contains**( *entity* : 4D.Entity ) : Boolean -| Paramètres | Type | | Description | -| ---------- | --------- |:--:| -------------------------------------------------------------- | -| entity | 4D.Entity | -> | Entity to evaluate | -| Résultat | Booléen | <- | True if the entity belongs to the entity selection, else False | +| Parameter | Type | | Description | +| --------- | --------- |:--:| -------------------------------------------------------------- | +| entity | 4D.Entity | -> | Entity to evaluate | +| Result | Booléen | <- | True if the entity belongs to the entity selection, else False | #### Description @@ -391,7 +432,7 @@ In *entity*, specify the entity to search for in the entity selection. If entity If *entity* and the entity selection do not belong to the same dataclass, an error is raised. -#### Exemple +#### Example ```4d var $employees : cs.EmployeeSelection @@ -414,10 +455,10 @@ If *entity* and the entity selection do not belong to the same dataclass, an err ## .count() -
    Historique -| Version | Modifications | -| ------- | ------------- | -| v17 | Ajoutées | +
    History +| Version | Changes | +| ------- | ------- | +| v17 | Added |
    @@ -425,10 +466,10 @@ If *entity* and the entity selection do not belong to the same dataclass, an err **.count**( *attributePath* : Text ) : Real -| Paramètres | Type | | Description | -| ------------- | ----- |:--:| ----------------------------------------------------------------- | -| attributePath | Texte | -> | Path of the attribute to be used for calculation | -| Résultat | Réel | <- | Number of non null *attributePath* values in the entity selection | +| Parameter | Type | | Description | +| ------------- | ---- |:--:| ----------------------------------------------------------------- | +| attributePath | Text | -> | Path of the attribute to be used for calculation | +| Result | Real | <- | Number of non null *attributePath* values in the entity selection | #### Description @@ -441,7 +482,7 @@ An error is returned if: * *attributePath* is a related attribute, * *attributePath* is not found in the entity selection dataclass. -#### Exemple +#### Example We want to find out the total number of employees for a company without counting any whose job title has not been specified: @@ -459,10 +500,10 @@ We want to find out the total number of employees for a company without counting ## .copy() -
    Historique -| Version | Modifications | -| ------- | ------------- | -| v18 R5 | Ajoutées | +
    History +| Version | Changes | +| ------- | ------- | +| v18 R5 | Added |
    @@ -470,10 +511,10 @@ We want to find out the total number of employees for a company without counting **.copy**( { *option* : Integer } ) : 4D.EntitySelection -| Paramètres | Type | | Description | -| ---------- | ------------------ |:--:| ------------------------------------------------ | -| option | Entier long | -> | `ck shared`: return a shareable entity selection | -| Résultat | 4D.EntitySelection | <- | Copy of the entity selection | +| Parameter | Type | | Description | +| --------- | ------------------ |:--:| ------------------------------------------------ | +| option | Integer | -> | `ck shared`: return a shareable entity selection | +| Result | 4D.EntitySelection | <- | Copy of the entity selection | #### Description @@ -482,11 +523,11 @@ The `.copy()` function returns > This function does not modify the original entity selection. -By default, if the *option* parameter is omitted, the function returns a new, non-shareable entity selection (even if the function is applied to a shareable entity selection). Pass the `ck shared` constant in the *option* parameter if you want to create a shareable entity selection. +By default, if the *option* parameter is omitted, the function returns a new, alterable entity selection (even if the function is applied to a shareable entity selection). Pass the `ck shared` constant in the *option* parameter if you want to create a shareable entity selection. -> For information on the shareable property of entity selections, please refer to the [Shareable vs Non-shareable entity selections](ORDA/entities.md#shareable-or-non-shareable-entity-selections) section. +> For information on the shareable property of entity selections, please refer to the [Shareable or alterable entity selections](ORDA/entities.md#shareable-or-alterable-entity-selections) section. -#### Exemple +#### Example You create a new, empty entity selection of products when the form is loaded: @@ -522,10 +563,10 @@ Then this entity selection is updated with products and you want to share the pr ## .distinct() -
    Historique -| Version | Modifications | -| ------- | ------------- | -| v17 | Ajoutées | +
    History +| Version | Changes | +| ------- | ------- | +| v17 | Added |
    @@ -533,11 +574,11 @@ Then this entity selection is updated with products and you want to share the pr **.distinct**( *attributePath* : Text { ; *option* : Integer } ) : Collection -| Paramètres | Type | | Description | -| ------------- | ----------- |:--:| ---------------------------------------------------------------- | -| attributePath | Texte | -> | Path of attribute whose distinct values you want to get | -| option | Entier long | -> | `dk diacritical`: diacritical evaluation ("A" # "a" for example) | -| Résultat | Collection | <- | Collection with only distinct values | +| Parameter | Type | | Description | +| ------------- | ---------- |:--:| ---------------------------------------------------------------- | +| attributePath | Text | -> | Path of attribute whose distinct values you want to get | +| option | Integer | -> | `dk diacritical`: diacritical evaluation ("A" # "a" for example) | +| Result | Collection | <- | Collection with only distinct values | #### Description @@ -560,7 +601,7 @@ An error is returned if: * *attributePath* is a related attribute, * *attributePath* is not found in the entity selection dataclass. -#### Exemple +#### Example You want to get a collection containing a single element per country name: @@ -576,10 +617,10 @@ You want to get a collection containing a single element per country name: ## .drop() -
    Historique -| Version | Modifications | -| ------- | ------------- | -| v17 | Ajoutées | +
    History +| Version | Changes | +| ------- | ------- | +| v17 | Added |
    @@ -587,10 +628,10 @@ You want to get a collection containing a single element per country name: **.drop**( { *mode* : Integer } ) : 4D.EntitySelection -| Paramètres | Type | | Description | -| ---------- | ------------------ |:--:| ------------------------------------------------------------------------------------------------ | -| mode | Entier long | -> | `dk stop dropping on first error`: stops method execution on first non-droppable entity | -| Résultat | 4D.EntitySelection | <- | Empty entity selection if successful, else entity selection containing non-droppable entity(ies) | +| Parameter | Type | | Description | +| --------- | ------------------ |:--:| ------------------------------------------------------------------------------------------------ | +| mode | Integer | -> | `dk stop dropping on first error`: stops method execution on first non-droppable entity | +| Result | 4D.EntitySelection | <- | Empty entity selection if successful, else entity selection containing non-droppable entity(ies) | #### Description @@ -600,7 +641,7 @@ The `.drop()` function removes If a locked entity is encountered during the execution of `.drop()`, it is not removed. By default, the method processes all entities of the entity selection and returns non-droppable entities in the entity selection. If you want the method to stop execution at the first encountered non-droppable entity, pass the `dk stop dropping on first error` constant in the *mode* parameter. -#### Exemple +#### Example Example without the `dk stop dropping on first error` option: @@ -636,10 +677,10 @@ Example with the `dk stop dropping on first error` option: ## .extract() -
    Historique -| Version | Modifications | -| ------- | ------------- | -| v18 R3 | Ajoutées | +
    History +| Version | Changes | +| ------- | ------- | +| v18 R3 | Added |
    @@ -648,12 +689,12 @@ Example with the `dk stop dropping on first error` option: -| Paramètres | Type | | Description | -| ------------- | ----------- |:--:| --------------------------------------------------------------------------------------- | -| attributePath | Texte | -> | Attribute path whose values must be extracted to the new collection | -| targetPath | Texte | -> | Target attribute path or attribute name | -| option | Entier long | -> | `ck keep null`: include null attributes in the returned collection (ignored by default) | -| Résultat | Collection | <- | Collection containing extracted values | +| Parameter | Type | | Description | +| ------------- | ---------- |:--:| --------------------------------------------------------------------------------------- | +| attributePath | Text | -> | Attribute path whose values must be extracted to the new collection | +| targetPath | Text | -> | Target attribute path or attribute name | +| option | Integer | -> | `ck keep null`: include null attributes in the returned collection (ignored by default) | +| Result | Collection | <- | Collection containing extracted values | #### Description @@ -692,7 +733,7 @@ If several *attributePath* are given, a *targetPath* must be given for each. Onl > Entities of a collection of entities accessed by \[ ] are not reloaded from the database. -#### Exemple +#### Example Given the following table and relation: @@ -739,10 +780,10 @@ Given the following table and relation: ## .first() -
    Historique -| Version | Modifications | -| ------- | ------------- | -| v17 | Ajoutées | +
    History +| Version | Changes | +| ------- | ------- | +| v17 | Added |
    @@ -750,9 +791,9 @@ Given the following table and relation: **.first()** : 4D.Entity -| Paramètres | Type | | Description | -| ---------- | --------- |:--:| ---------------------------------------------------------------------------------- | -| Résultat | 4D.Entity | <- | Reference to the first entity of the entity selection (Null if selection is empty) | +| Parameter | Type | | Description | +| --------- | --------- |:--:| ---------------------------------------------------------------------------------- | +| Result | 4D.Entity | <- | Reference to the first entity of the entity selection (Null if selection is empty) | #### Description @@ -777,7 +818,7 @@ There is, however, a difference between both statements when the selection is em $entity:=$entitySel[0] //generates an error ``` -#### Exemple +#### Example ```4d @@ -796,20 +837,21 @@ There is, however, a difference between both statements when the selection is em ## .getDataClass() -
    Historique -| Version | Modifications | -| ------- | ------------- | -| v17 R5 | Ajoutées | +
    History +| Version | Changes | +| ------- | ------- | +| v17 R5 | Added |
    **.getDataClass()** : 4D.DataClass + -| Paramètres | Type | | Description | -| ---------- | ------------ |:--:| ------------------------------------------------------ | -| Résultat | 4D.DataClass | <- | Dataclass object to which the entity selection belongs | +| Parameter | Type | | Description | +| --------- | ------------ |:--:| ------------------------------------------------------ | +| Result | 4D.DataClass | <- | Dataclass object to which the entity selection belongs | #### Description @@ -818,7 +860,7 @@ The `.getDataClass()` function + +## .isAlterable() + +
    History + +| Version | Changes | +| ------- | ------- | +| v18 R5 | Added | + +
    + + +**.isAlterable()** : Boolean + + +| Parameter | Type | | Description | +| --------- | ------- |:--:| ---------------------------------------------------------- | +| Result | Booléen | <- | True if the entity selection is alterable, False otherwise | + + +#### Description + +The `.isAlterable()` function returns True if the entity selection is alterable, and False if the entity selection is not alterable. + +For more information, please refer to [Shareable or alterable entity selections](ORDA/entities.md#shareable-or-alterable-entity-selections). + +#### Example + +You are about to display `Form.products` in a [list box](FormObjects/listbox_overview.md) to allow the user to add new products. You want to make sure it is alterable so that the user can add new products without error: + +```4d +If (Not(Form.products.isAlterable())) + Form.products:=Form.products.copy() +End if +... +Form.products.add(Form.product) +``` + + + + ## .isOrdered() -
    Historique +
    History -| Version | Modifications | -| ------- | ------------- | -| v17 | Ajoutées | +| Version | Changes | +| ------- | ------- | +| v17 | Added |
    @@ -858,9 +941,9 @@ The following generic code duplicates all entities of the entity selection: **.isOrdered()** : Boolean -| Paramètres | Type | | Description | -| ---------- | ------- |:--:| -------------------------------------------------------- | -| Résultat | Booléen | <- | True if the entity selection is ordered, False otherwise | +| Parameter | Type | | Description | +| --------- | ------- |:--:| -------------------------------------------------------- | +| Result | Booléen | <- | True if the entity selection is ordered, False otherwise | #### Description @@ -871,7 +954,7 @@ The `.isOrdered()` function ## .last() -
    Historique -| Version | Modifications | -| ------- | ------------- | -| v17 | Ajoutées | +
    History +| Version | Changes | +| ------- | ------- | +| v17 | Added |
    @@ -909,9 +992,9 @@ For more information, please refer to [Ordered or unordered entity selection](OR **.last()** : 4D.Entity -| Paramètres | Type | | Description | -| ---------- | --------- |:--:| ------------------------------------------------------------------------------------- | -| Résultat | 4D.Entity | <- | Reference to the last entity of the entity selection (Null if empty entity selection) | +| Parameter | Type | | Description | +| --------- | --------- |:--:| ------------------------------------------------------------------------------------- | +| Result | 4D.Entity | <- | Reference to the last entity of the entity selection (Null if empty entity selection) | #### Description @@ -927,7 +1010,7 @@ The result of this function is similar to: If the entity selection is empty, the function returns Null. -#### Exemple +#### Example ```4d @@ -946,10 +1029,10 @@ If the entity selection is empty, the function returns Null. ## .length -
    Historique -| Version | Modifications | -| ------- | ------------- | -| v17 | Ajoutées | +
    History +| Version | Changes | +| ------- | ------- | +| v17 | Added |
    @@ -964,7 +1047,7 @@ The `.length` property returns Entity selections always have a `.length` property. -#### Exemple +#### Example ```4d var $vSize : Integer @@ -978,21 +1061,22 @@ Entity selections always have a `.length` property. ## .max() -
    Historique -| Version | Modifications | -| ------- | ------------- | -| v17 | Ajoutées | +
    History +| Version | Changes | +| ------- | ------- | +| v17 | Added |
    **.max**( *attributePath* : Text ) : any + -| Paramètres | Type | | Description | -| ------------- | ----- |:--:| ------------------------------------------------ | -| attributePath | Texte | -> | Path of the attribute to be used for calculation | -| Résultat | any | <- | Highest value of attribute | +| Parameter | Type | | Description | +| ------------- | ---- |:--:| ------------------------------------------------ | +| attributePath | Text | -> | Path of the attribute to be used for calculation | +| Result | any | <- | Highest value of attribute | #### Description @@ -1010,7 +1094,7 @@ An error is returned if: -#### Exemple +#### Example We want to find the highest salary among all the female employees: @@ -1027,10 +1111,10 @@ We want to find the highest salary among all the female employees: ## .min() -
    Historique -| Version | Modifications | -| ------- | ------------- | -| v17 | Ajoutées | +
    History +| Version | Changes | +| ------- | ------- | +| v17 | Added |
    @@ -1038,10 +1122,10 @@ We want to find the highest salary among all the female employees: **.min**( *attributePath* : Text ) : any -| Paramètres | Type | | Description | -| ------------- | ----- |:--:| ------------------------------------------------ | -| attributePath | Texte | -> | Path of the attribute to be used for calculation | -| Résultat | any | <- | Lowest value of attribute | +| Parameter | Type | | Description | +| ------------- | ---- |:--:| ------------------------------------------------ | +| attributePath | Text | -> | Path of the attribute to be used for calculation | +| Result | any | <- | Lowest value of attribute | #### Description @@ -1058,7 +1142,7 @@ An error is returned if: * *attributePath* is not found in the entity selection dataclass. -#### Exemple +#### Example In this example, we want to find the lowest salary among all the female employees: @@ -1075,10 +1159,10 @@ In this example, we want to find the lowest salary among all the female employee ## .minus() -
    Historique -| Version | Modifications | -| ------- | ------------- | -| v17 | Ajoutées | +
    History +| Version | Changes | +| ------- | ------- | +| v17 | Added |
    @@ -1086,11 +1170,11 @@ In this example, we want to find the lowest salary among all the female employee **.minus**( *entity* : 4D.Entity ) : 4D.EntitySelection
    **.minus**( *entitySelection* : 4D.EntitySelection ) : 4D.EntitySelection -| Paramètres | Type | | Description | +| Parameter | Type | | Description | | --------------- | ------------------ |:--:| ------------------------------------------------------------------------ | | entity | 4D.Entity | -> | Entity to substract | | entitySelection | 4D.EntitySelection | -> | Entity selection to substract | -| Résultat | 4D.EntitySelection | <- | New entity selection or a new reference on the existing entity selection | +| Result | 4D.EntitySelection | <- | New entity selection or a new reference on the existing entity selection | #### Description @@ -1108,7 +1192,7 @@ If *entitySelection* is empty or if *entity* is Null, a new reference to the ori If the original entity selection and the parameter are not related to the same dataclass, an error is raised. -#### Exemple 1 +#### Example 1 ```4d var $employees; $result : cs.EmployeeSelection @@ -1124,7 +1208,7 @@ If the original entity selection and the parameter are not related to the same d ``` -#### Exemple 2 +#### Example 2 We want to have a selection of female employees named "Jones" who live in New York : @@ -1141,10 +1225,10 @@ We want to have a selection of female employees named "Jones" who live in New Yo ## .or() -
    Historique -| Version | Modifications | -| ------- | ------------- | -| v17 | Ajoutées | +
    History +| Version | Changes | +| ------- | ------- | +| v17 | Added |
    @@ -1152,11 +1236,11 @@ We want to have a selection of female employees named "Jones" who live in New Yo **.or**( *entity* : 4D.Entity ) : 4D.EntitySelection
    **.or**( *entitySelection* : 4D.EntitySelection ) : 4D.EntitySelection -| Paramètres | Type | | Description | +| Parameter | Type | | Description | | --------------- | ------------------ |:--:| ---------------------------------------------------------------------- | | entity | 4D.Entity | -> | Entity to intersect with | | entitySelection | 4D.EntitySelection | -> | Entity selection to intersect with | -| Résultat | 4D.EntitySelection | <- | New entity selection or new reference to the original entity selection | +| Result | 4D.EntitySelection | <- | New entity selection or new reference to the original entity selection | #### Description @@ -1174,7 +1258,7 @@ If *entitySelection* is empty or if *entity* is Null, a new reference to the ori If the original entity selection and the parameter are not related to the same dataclass, an error is raised. -#### Exemple 1 +#### Example 1 ```4d var $employees1; $employees2; $result : cs.EmployeeSelection @@ -1183,7 +1267,7 @@ If the original entity selection and the parameter are not related to the same d $result:=$employees1.or($employees2) //$result contains "Colin Hetrick", "Grady Harness","Cath Kidston" ``` -#### Exemple 2 +#### Example 2 ```4d var $employees; $result : cs.EmployeeSelection @@ -1201,10 +1285,10 @@ If the original entity selection and the parameter are not related to the same d ## .orderBy() -
    Historique -| Version | Modifications | -| ------- | ------------- | -| v17 | Ajoutées | +
    History +| Version | Changes | +| ------- | ------- | +| v17 | Added |
    @@ -1212,11 +1296,11 @@ If the original entity selection and the parameter are not related to the same d **.orderBy**( *pathString* : Text ) : 4D.EntitySelection
    **.orderBy**( *pathObjects* : Collection ) : 4D.EntitySelection -| Paramètres | Type | | Description | +| Parameter | Type | | Description | | ----------- | ------------------ |:--:| --------------------------------------------------------------------- | -| pathString | Texte | -> | Attribute path(s) and sorting instruction(s) for the entity selection | +| pathString | Text | -> | Attribute path(s) and sorting instruction(s) for the entity selection | | pathObjects | Collection | -> | Collection of criteria objects | -| Résultat | 4D.EntitySelection | <- | New entity selection in the specified order | +| Result | 4D.EntitySelection | <- | New entity selection in the specified order | #### Description @@ -1249,7 +1333,7 @@ By default, attributes are sorted in ascending order ("descending" is false). You can add as many objects in the criteria collection as necessary. > Null values are evaluated as less than other values. -#### Exemple +#### Example ```4d @@ -1277,10 +1361,10 @@ You can add as many objects in the criteria collection as necessary. ## .orderByFormula( ) -
    Historique -| Version | Modifications | -| ------- | ------------- | -| v17 R6 | Ajoutées | +
    History +| Version | Changes | +| ------- | ------- | +| v17 R6 | Added |
    @@ -1288,13 +1372,13 @@ You can add as many objects in the criteria collection as necessary. **.orderByFormula**( *formulaString* : Text { ; *sortOrder* : Integer } { ; *settings* : Object} ) : 4D.EntitySelection
    **.orderByFormula**( *formulaObj* : Object { ; *sortOrder* : Integer } { ; *settings* : Object} ) : 4D.EntitySelection -| Paramètres | Type | | Description | +| Parameter | Type | | Description | | ------------- | ------------------ |:--:| ------------------------------------------- | -| formulaString | Texte | -> | Formula string | +| formulaString | Text | -> | Formula string | | formulaObj | Objet | -> | Formula object | -| sortOrder | Entier long | -> | `dk ascending` (default) or `dk descending` | +| sortOrder | Integer | -> | `dk ascending` (default) or `dk descending` | | settings | Objet | -> | Parameter(s) for the formula | -| Résultat | 4D.EntitySelection | <- | New ordered entity selection | +| Result | 4D.EntitySelection | <- | New ordered entity selection | #### Description @@ -1312,16 +1396,16 @@ The *formulaString* or *formulaObj* is executed for each entity of the entity se By default if you omit the *sortOrder* parameter, the resulting entity selection is sorted in ascending order. Optionnally, you can pass one of the following values in the *sortOrder* parameter: -| Constant | Valeur | Commentaire | -| ------------- | ------ | ------------------------------ | -| dk ascending | 0 | Ascending sort order (default) | -| dk descending | 1 | Descending sort order | +| Constant | Value | Comment | +| ------------- | ----- | ------------------------------ | +| dk ascending | 0 | Ascending sort order (default) | +| dk descending | 1 | Descending sort order | Within the *formulaString* or *formulaObj*, the processed entity and thus its attributes are available through the `This` command (for example, `This.lastName`). You can pass parameter(s) to the formula using the `args` property (object) of the `settings` parameter: the formula receives the `settings.args` object in $1. -#### Exemple 1 +#### Example 1 Sorting students using a formula provided as text: @@ -1344,7 +1428,7 @@ Same sort order but using a formula object: ``` -#### Exemple 2 +#### Example 2 A formula is given as a formula object with parameters; `settings.args` object is received as $1 in the ***computeAverage*** method. @@ -1398,12 +1482,12 @@ In this example, the "marks" object field in the **Students** dataClass contains ## .query() -
    Historique -| Version | Modifications | +
    History +| Version | Changes | | ------- | ---------------------------------- | | v17 R6 | Support of Formula parameters | | v17 R5 | Support of placeholders for values | -| v17 | Ajoutées | +| v17 | Added |
    @@ -1411,13 +1495,13 @@ In this example, the "marks" object field in the **Students** dataClass contains **.query**( *queryString* : Text { ; *...value* : expression } { ; *querySettings* : Object } ) : 4D.EntitySelection
    **.query**( *formula* : Object { ; *querySettings* : Object } ) : 4D.EntitySelection -| Paramètres | Type | | Description | +| Parameter | Type | | Description | | ------------- | ------------------ |:--:| ------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| queryString | Texte | -> | Search criteria as string | +| queryString | Text | -> | Search criteria as string | | formula | Objet | -> | Search criteria as formula object | | value | expression | -> | Value(s) to use for indexed placeholder(s) | | querySettings | Objet | -> | Query options: parameters, attributes, args, allowFormulas, context, queryPath, queryPlan | -| Résultat | 4D.EntitySelection | <- | New entity selection made up of entities from entity selection meeting the search criteria specified in *queryString* or *formula*| +| Result | 4D.EntitySelection | <- | New entity selection made up of entities from entity selection meeting the search criteria specified in *queryString* or *formula*| | @@ -1431,7 +1515,7 @@ If no matching entities are found, an empty `EntitySelection` is returned. For detailed information on how to build a query using *queryString*, *value*, and *querySettings* parameters, please refer to the DataClass [`.query()`](dataclassClass.md#query) function description. > By default if you omit the **order by** statement in the *queryString*, the returned entity selection is [not ordered](ORDA/dsMapping.md#ordered-or-unordered-entity-selection). Note however that, in Client/Server mode, it behaves like an ordered entity selection (entities are added at the end of the selection). -#### Exemple 1 +#### Example 1 ```4d @@ -1441,7 +1525,7 @@ For detailed information on how to build a query using *queryString*, *value*, a ``` -#### Exemple 2 +#### Example 2 More examples of queries can be found in the DataClass [`.query()`](dataclassClass.md#query) page. @@ -1452,10 +1536,10 @@ More examples of queries can be found in the DataClass [`.query()`](dataclassCla ## .queryPath -
    Historique -| Version | Modifications | -| ------- | ------------- | -| v17 | Ajoutées | +
    History +| Version | Changes | +| ------- | ------- | +| v17 | Added |
    @@ -1476,10 +1560,10 @@ For more information, refer to the **querySettings parameter** paragraph in the ## .queryPlan -
    Historique -| Version | Modifications | -| ------- | ------------- | -| v17 | Ajoutées | +
    History +| Version | Changes | +| ------- | ------- | +| v17 | Added |
    @@ -1499,10 +1583,10 @@ For more information, refer to the **querySettings parameter** paragraph in the ## .refresh() -
    Historique -| Version | Modifications | -| ------- | ------------- | -| v18 R3 | Ajoutées | +
    History +| Version | Changes | +| ------- | ------- | +| v18 R3 | Added |
    @@ -1510,9 +1594,9 @@ For more information, refer to the **querySettings parameter** paragraph in the **.refresh()** -| Paramètres | Type | | Description | -| ---------- | ---- |::| ------------------------------- | -| | | | Does not require any parameters | +| Parameter | Type | | Description | +| --------- | ---- |::| ------------------------------- | +| | | | Does not require any parameters | #### Description @@ -1522,7 +1606,7 @@ The `.refresh()` function im By default, the local ORDA cache is invalidated after 30 seconds. In the context of client / server applications using both ORDA and the classic language, this method allows you to make sure a remote application will always work with the latest data. -#### Exemple 1 +#### Example 1 In this example, classic and ORDA code modify the same data simultaneously: @@ -1550,7 +1634,7 @@ In this example, classic and ORDA code modify the same data simultaneously: ``` -#### Exemple 2 +#### Example 2 A list box displays the Form.students entity selection and several clients work on it. @@ -1579,10 +1663,10 @@ A list box displays the Form.students entity selection and several clients work ## .slice() -
    Historique -| Version | Modifications | -| ------- | ------------- | -| v17 | Ajoutées | +
    History +| Version | Changes | +| ------- | ------- | +| v17 | Added |
    @@ -1590,11 +1674,11 @@ A list box displays the Form.students entity selection and several clients work **.slice**( *startFrom* : Integer { ; *end* : Integer } ) : 4D.EntitySelection -| Paramètres | Type | | Description | -| ---------- | ------------------ |:--:| -------------------------------------------------------------- | -| startFrom | Entier long | -> | Index to start the operation at (included) | -| end | Entier long | -> | End index (not included) | -| Résultat | 4D.EntitySelection | <- | New entity selection containing sliced entities (shallow copy) | +| Parameter | Type | | Description | +| --------- | ------------------ |:--:| -------------------------------------------------------------- | +| startFrom | Integer | -> | Index to start the operation at (included) | +| end | Integer | -> | End index (not included) | +| Result | 4D.EntitySelection | <- | New entity selection containing sliced entities (shallow copy) | #### Description @@ -1611,7 +1695,7 @@ The returned entity selection contains the entities specified by *startFrom* and If the entity selection contains entities that were dropped in the meantime, they are also returned. -#### Exemple 1 +#### Example 1 You want to get a selection of the first 9 entities of the entity selection: @@ -1622,7 +1706,7 @@ $sliced:=$sel.slice(0;9) // ``` -#### Exemple 2 +#### Example 2 Assuming we have ds.Employee.all().length = 10 @@ -1638,10 +1722,10 @@ $slice:=ds.Employee.all().slice(-1;-2) //tries to return entities from index 9 t ## .sum( ) -
    Historique -| Version | Modifications | -| ------- | ------------- | -| v17 | Ajoutées | +
    History +| Version | Changes | +| ------- | ------- | +| v17 | Added |
    @@ -1650,10 +1734,10 @@ $slice:=ds.Employee.all().slice(-1;-2) //tries to return entities from index 9 t **.sum**( *attributePath* : Text ) : Real -| Paramètres | Type | | Description | -| ------------- | ----- |:--:| ------------------------------------------------ | -| attributePath | Texte | -> | Path of the attribute to be used for calculation | -| Résultat | Réel | <- | Sum of entity selection values | +| Parameter | Type | | Description | +| ------------- | ---- |:--:| ------------------------------------------------ | +| attributePath | Text | -> | Path of the attribute to be used for calculation | +| Result | Real | <- | Sum of entity selection values | #### Description @@ -1672,7 +1756,7 @@ An error is returned if: -#### Exemple +#### Example ```4d var $sel : cs.EmployeeSelection @@ -1688,10 +1772,10 @@ $sum:=$sel.sum("salary") ## .toCollection( ) -
    Historique -| Version | Modifications | -| ------- | ------------- | -| v17 | Ajoutées | +
    History +| Version | Changes | +| ------- | ------- | +| v17 | Added |
    @@ -1699,14 +1783,14 @@ $sum:=$sel.sum("salary") **.toCollection**( { *options* : Integer { ; *begin* : Integer { ; *howMany* : Integer } } ) : *Collection*
    **.toCollection**( *filterString* : Text {; *options* : Integer { ; *begin* : Integer { ; *howMany* : Integer }}} ) : *Collection*
    **.toCollection**( *filterCol* : Collection {; *options* : Integer { ; *begin* : Integer { ; *howMany* : Integer }}} ) : *Collection* -| Paramètres | Type | | Description | -| ------------ | ----------- |:--:| ------------------------------------------------------------------------------------ | -| filterString | Texte | -> | String with entity attribute path(s) to extract | -| filterCol | Collection | -> | Collection of entity attribute path(s) to extract | -| options | Entier long | -> | `dk with primary key`: adds the primary key
    `dk with stamp`: adds the stamp | -| begin | Entier long | -> | Designates the starting index | -| howMany | Entier long | -> | Number of entities to extract | -| Résultat | Collection | <- | Collection of objects containing attributes and values of entity selection | +| Parameter | Type | | Description | +| ------------ | ---------- |:--:| ------------------------------------------------------------------------------------ | +| filterString | Text | -> | String with entity attribute path(s) to extract | +| filterCol | Collection | -> | Collection of entity attribute path(s) to extract | +| options | Integer | -> | `dk with primary key`: adds the primary key
    `dk with stamp`: adds the stamp | +| begin | Integer | -> | Designates the starting index | +| howMany | Integer | -> | Number of entities to extract | +| Result | Collection | <- | Collection of objects containing attributes and values of entity selection | #### Description @@ -1748,7 +1832,7 @@ An empty collection is returned if: * *begin* is greater than the length of the entity selection. -#### Exemple 1 +#### Example 1 The following structure will be used throughout all examples of this section: @@ -1809,7 +1893,7 @@ Returns: ] ``` -#### Exemple 2 +#### Example 2 Example with options: @@ -1898,6 +1982,7 @@ Returns: "lastName": "Durham" } ] + ``` #### Example 4 @@ -2090,6 +2175,7 @@ Returns: }, { "firstName": "Gary", + "lastName": "Reichert", "directReports": [ { diff --git a/website/translated_docs/fr/API/fileClass.md b/website/translated_docs/fr/API/fileClass.md index c6bb7bc8178a23..f7a26b8634de0b 100644 --- a/website/translated_docs/fr/API/fileClass.md +++ b/website/translated_docs/fr/API/fileClass.md @@ -5,7 +5,7 @@ title: File `File` objects are created with the [`File`](#file) command. They contain references to disk files that may or may not actually exist on disk. For example, when you execute the `File` command to create a new file, a valid `File` object is created but nothing is actually stored on disk until you call the [`file.create( )`](#create) function. -### Exemple +### Example The following example creates a preferences file in the project folder: @@ -53,10 +53,10 @@ $created:=File("/PACKAGE/SpecialPrefs/"+Current user+".myPrefs").create() ## File -
    Historique -| Version | Modifications | -| ------- | ------------- | -| v17 R5 | Ajoutées | +
    History +| Version | Changes | +| ------- | ------- | +| v17 R5 | Added |
    @@ -64,13 +64,13 @@ $created:=File("/PACKAGE/SpecialPrefs/"+Current user+".myPrefs").create() -| Paramètres | Type | | Description | -| ------------ | ----------- |:--:| ----------------------------------------------- | -| path | Texte | -> | File path | -| fileConstant | Entier long | -> | 4D file constant | -| pathType | Entier long | -> | `fk posix path` (default) or `fk platform path` | -| * | | -> | * to return file of host database | -| Résultat | 4D.File | <- | New file object | +| Parameter | Type | | Description | +| ------------ | ------- |:--:| ----------------------------------------------- | +| path | Text | -> | File path | +| fileConstant | Integer | -> | 4D file constant | +| pathType | Integer | -> | `fk posix path` (default) or `fk platform path` | +| * | | -> | * to return file of host database | +| Result | 4D.File | <- | New file object | @@ -86,37 +86,37 @@ In the *path* parameter, pass a file path string. You can use a custom string or By default, 4D expects a path expressed with the POSIX syntax. If you work with platform pathnames (Windows or macOS), you must declare it using the *pathType* parameter. The following constants are available: -| Constant | Valeur | Commentaire | -| ---------------- | ------ | --------------------------------------------------------------------------------------- | -| fk platform path | 1 | Path expressed with a platform-specific syntax (mandatory in case of platform pathname) | -| fk posix path | 0 | Path expressed with POSIX syntax (default) | +| Constant | Value | Comment | +| ---------------- | ----- | --------------------------------------------------------------------------------------- | +| fk platform path | 1 | Path expressed with a platform-specific syntax (mandatory in case of platform pathname) | +| fk posix path | 0 | Path expressed with POSIX syntax (default) | **File ( fileConstant { ; \* } )** In the *fileConstant* parameter, pass a 4D built-in or system file, using one of the following constants: -| Constant | Valeur | Commentaire | -| ------------------------------- | ------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| Backup history file | 19 | Backup history file (see Configuration and trace files). Stored in the backup destination folder. | -| Backup log file | 13 | Current backup journal file. Stored in the application Logs folder. | -| Backup settings file | 1 | Default backup.4DSettings file (xml format), stored in the Settings folder of the project | -| Backup settings file for data | 17 | backup.4DSettings file (xml format) for the data file, stored in the Settings folder of the data folder | -| Build application log file | 14 | Current log file in xml format of the application builder. Stored in the Logs folder. | -| Build application settings file | 20 | Default settings file of the application builder ("buildApp.4DSettings"). Stored in the Settings folder of the project. | -| Compacting log file | 6 | Log file of the most recent compacting done with the Compact data file command or the Maintenance and security center. Stored in the Logs folder. | -| Current backup settings file | 18 | backup.4DSettings file currently used by the application. It can be the backup settings file (default) or a custom user backup settings file defined for the data file | -| Debug log file | 12 | Log file created by the `SET DATABASE PARAMETER(Debug log recording)` command. Stored in the Logs folder. | -| Diagnostic log file | 11 | Log file created by the `SET DATABASE PARAMETER(Diagnostic log recording)` command. Stored in the Logs folder. | -| Directory file | 16 | directory.json file, containing the description of users and groups (if any) for the project application. It can be located either in the user settings folder (default, global to the project), or in the data settings folder (specific to a data file). | -| HTTP debug log file | 9 | Log file created by the `WEB SET OPTION(Web debug log)` command. Stored in the Logs folder. | -| HTTP log file | 8 | Log file created by the `WEB SET OPTION(Web log recording)` command. Stored in Logs folder. | -| Last backup file | 2 | Last backup file, named \[bkpNum].4BK, stored at a custom location. | -| Repair log file | 7 | Log file of database repairs made on the database in the Maintenance and Security Center (MSC). Stored in the Logs folder. | -| Request log file | 10 | Standard client/server request log file (excluding Web requests) created by the `SET DATABASE PARAMETER(4D Server log recording)` or `SET DATABASE PARAMETER(Client log recording)` commands. If executed on the server, the server log file is returned (stored in the Logs folder on the server). If executed on the client, the client log file is returned (stored in the client local Logs folder). | -| SMTP log file | 15 | Log file created by the `SET DATABASE PARAMETER(SMTP Log)` command. Stored in the Logs folder. | -| User settings file | 3 | settings.4DSettings file for all data files, stored in Preferences folder next to structure file if enabled. | -| User settings file for data | 4 | settings.4DSettings file for current data file, stored in Preferences folder next to the data file. | -| Verification log file | 5 | Log files created by the `VERIFY CURRENT DATA FILE` and `VERIFY DATA FILE` commands or the Maintenance and Security Center (MSC). Stored in the Logs folder. | +| Constant | Value | Comment | +| ------------------------------- | ----- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| Backup history file | 19 | Backup history file (see Configuration and trace files). Stored in the backup destination folder. | +| Backup log file | 13 | Current backup journal file. Stored in the application Logs folder. | +| Backup settings file | 1 | Default backup.4DSettings file (xml format), stored in the Settings folder of the project | +| Backup settings file for data | 17 | backup.4DSettings file (xml format) for the data file, stored in the Settings folder of the data folder | +| Build application log file | 14 | Current log file in xml format of the application builder. Stored in the Logs folder. | +| Build application settings file | 20 | Default settings file of the application builder ("buildApp.4DSettings"). Stored in the Settings folder of the project. | +| Compacting log file | 6 | Log file of the most recent compacting done with the Compact data file command or the Maintenance and security center. Stored in the Logs folder. | +| Current backup settings file | 18 | backup.4DSettings file currently used by the application. It can be the backup settings file (default) or a custom user backup settings file defined for the data file | +| Debug log file | 12 | Log file created by the `SET DATABASE PARAMETER(Debug log recording)` command. Stored in the Logs folder. | +| Diagnostic log file | 11 | Log file created by the `SET DATABASE PARAMETER(Diagnostic log recording)` command. Stored in the Logs folder. | +| Directory file | 16 | directory.json file, containing the description of users and groups (if any) for the project application. It can be located either in the user settings folder (default, global to the project), or in the data settings folder (specific to a data file). | +| HTTP debug log file | 9 | Log file created by the `WEB SET OPTION(Web debug log)` command. Stored in the Logs folder. | +| HTTP log file | 8 | Log file created by the `WEB SET OPTION(Web log recording)` command. Stored in Logs folder. | +| Last backup file | 2 | Last backup file, named \[bkpNum].4BK, stored at a custom location. | +| Repair log file | 7 | Log file of database repairs made on the database in the Maintenance and Security Center (MSC). Stored in the Logs folder. | +| Request log file | 10 | Standard client/server request log file (excluding Web requests) created by the `SET DATABASE PARAMETER(4D Server log recording)` or `SET DATABASE PARAMETER(Client log recording)` commands. If executed on the server, the server log file is returned (stored in the Logs folder on the server). If executed on the client, the client log file is returned (stored in the client local Logs folder). | +| SMTP log file | 15 | Log file created by the `SET DATABASE PARAMETER(SMTP Log)` command. Stored in the Logs folder. | +| User settings file | 3 | settings.4DSettings file for all data files, stored in Preferences folder next to structure file if enabled. | +| User settings file for data | 4 | settings.4DSettings file for current data file, stored in Preferences folder next to the data file. | +| Verification log file | 5 | Log files created by the `VERIFY CURRENT DATA FILE` and `VERIFY DATA FILE` commands or the Maintenance and Security Center (MSC). Stored in the Logs folder. | If the target *fileConstant* does not exist, a null object is returned. No errors are raised. @@ -132,10 +132,10 @@ If the command is called from a component, pass the optional * parameter to get ## .create() -
    Historique -| Version | Modifications | -| ------- | ------------- | -| v17 R5 | Ajoutées | +
    History +| Version | Changes | +| ------- | ------- | +| v17 R5 | Added |
    @@ -146,9 +146,9 @@ If the command is called from a component, pass the optional * parameter to get **.create()** : Boolean -| Paramètres | Type | | Description | -| ---------- | ------- | -- | ---------------------------------------------------------- | -| Résultat | Booléen | <- | True if the file was created successfully, false otherwise | +| Parameter | Type | | Description | +| --------- | ------- | -- | ---------------------------------------------------------- | +| Result | Booléen | <- | True if the file was created successfully, false otherwise | #### Description @@ -157,12 +157,12 @@ The `.create()` function creates a file If necessary, the function creates the folder hierachy as described in the [platformPath](#platformpath) or [path](#path) properties. If the file already exists on disk, the function does nothing (no error is thrown) and returns false. -**Valeur retournée** +**Returned value** * **True** if the file is created successfully; * **False** if a file with the same name already exists or if an error occured. -#### Exemple +#### Example Creation of a preferences file in the database folder: @@ -179,22 +179,22 @@ Creation of a preferences file in the database folder: ## .createAlias() -
    Historique -| Version | Modifications | -| ------- | ------------- | -| v17 R5 | Ajoutées | +
    History +| Version | Changes | +| ------- | ------- | +| v17 R5 | Added |
    **.createAlias**( *destinationFolder* : 4D.Folder ; *aliasName* : Text { ; *aliasType* : Integer } ) : 4D.File -| Paramètres | Type | | Description | -| ----------------- | ----------- | -- | -------------------------------------------- | -| destinationFolder | 4D.Folder | -> | Destination folder for the alias or shortcut | -| aliasName | Texte | -> | Name of the alias or shortcut | -| aliasType | Entier long | -> | Type of the alias link | -| Résultat | 4D.File | <- | Alias or shortcut file reference | +| Parameter | Type | | Description | +| ----------------- | --------- | -- | -------------------------------------------- | +| destinationFolder | 4D.Folder | -> | Destination folder for the alias or shortcut | +| aliasName | Text | -> | Name of the alias or shortcut | +| aliasType | Integer | -> | Type of the alias link | +| Result | 4D.File | <- | Alias or shortcut file reference | @@ -206,10 +206,10 @@ Pass the name of the alias or shortcut to create in the *aliasName* parameter. By default on macOS, the function creates a standard alias. You can also create a symbolic link by using the *aliasType* parameter. The following constants are available: -| Constant | Valeur | Commentaire | -| ------------------ | ------ | -------------------------- | -| `fk alias link` | 0 | Alias link (default) | -| `fk symbolic link` | 1 | Symbolic link (macOS only) | +| Constant | Value | Comment | +| ------------------ | ----- | -------------------------- | +| `fk alias link` | 0 | Alias link (default) | +| `fk symbolic link` | 1 | Symbolic link (macOS only) | On Windows, a shortcut (.lnk file) is always created (the *aliasType* parameter is ignored). @@ -218,7 +218,7 @@ On Windows, a shortcut (.lnk file) is always created (the *aliasType* parameter A `4D.File` object with the `isAlias` property set to **true**. -#### Exemple +#### Example You want to create an alias to a file in your database folder: @@ -243,10 +243,10 @@ You want to create an alias to a file in your database folder: ## .delete() -
    Historique -| Version | Modifications | -| ------- | ------------- | -| v17 R5 | Ajoutées | +
    History +| Version | Changes | +| ------- | ------- | +| v17 R5 | Added |
    @@ -255,9 +255,9 @@ You want to create an alias to a file in your database folder: -| Paramètres | Type | | Description | -| ---------- | ---- | | ------------------------------- | -| | | | Does not require any parameters | +| Parameter | Type | | Description | +| --------- | ---- | | ------------------------------- | +| | | | Does not require any parameters | @@ -270,7 +270,7 @@ If the file is currently open, an error is generated. If the file does not exist on disk, the function does nothing (no error is generated). > **WARNING**: `.delete( )` can delete any file on a disk. This includes documents created with other applications, as well as the applications themselves. `.delete( )` should be used with extreme caution. Deleting a file is a permanent operation and cannot be undone. -#### Exemple +#### Example You want to delete a specific file in the database folder: @@ -350,10 +350,10 @@ You want to delete a specific file in the database folder: ## .moveTo() -
    Historique -| Version | Modifications | -| ------- | ------------- | -| v17 R5 | Ajoutées | +
    History +| Version | Changes | +| ------- | ------- | +| v17 R5 | Added |
    @@ -361,11 +361,11 @@ You want to delete a specific file in the database folder: **.moveTo**( *destinationFolder* : 4D.Folder { ; *newName* : Text } ) : 4D.File -| Paramètres | Type | | Description | +| Parameter | Type | | Description | | ----------------- | --------- | -- | ---------------------------- | | destinationFolder | 4D.Folder | -> | Destination folder | -| newName | Texte | -> | Full name for the moved file | -| Résultat | 4D.File | <- | Moved file | +| newName | Text | -> | Full name for the moved file | +| Result | 4D.File | <- | Moved file | @@ -382,7 +382,7 @@ By default, the file retains its name when moved. If you want to rename the move The moved `File` object. -#### Exemple +#### Example ```4d @@ -418,10 +418,10 @@ $myFile.moveTo($DocFolder.folder("Archives");"Infos_old.txt") ## .rename() -
    Historique -| Version | Modifications | -| ------- | ------------- | -| v17 R5 | Ajoutées | +
    History +| Version | Changes | +| ------- | ------- | +| v17 R5 | Added |
    @@ -429,10 +429,10 @@ $myFile.moveTo($DocFolder.folder("Archives");"Infos_old.txt") **.rename**( *newName* : Text ) : 4D.File -| Paramètres | Type | | Description | -| ---------- | ------- | -- | -------------------------- | -| newName | Texte | -> | New full name for the file | -| Résultat | 4D.File | <- | Renamed file | +| Parameter | Type | | Description | +| --------- | ------- | -- | -------------------------- | +| newName | Text | -> | New full name for the file | +| Result | 4D.File | <- | Renamed file | #### Description @@ -448,7 +448,7 @@ Note that the function modifies the full name of the file, i.e. if you do not pa The renamed `File` object. -#### Exemple +#### Example You want to rename "ReadMe.txt" in "ReadMe_new.txt": @@ -463,10 +463,10 @@ You want to rename "ReadMe.txt" in "ReadMe_new.txt": ## .setContent() -
    Historique -| Version | Modifications | -| ------- | ------------- | -| v17 R5 | Ajoutées | +
    History +| Version | Changes | +| ------- | ------- | +| v17 R5 | Added |
    @@ -474,9 +474,9 @@ You want to rename "ReadMe.txt" in "ReadMe_new.txt": **.setContent** ( *content* : Blob ) -| Paramètres | Type | | Description | -| ---------- | ---- | -- | ------------------------- | -| content | BLOB | -> | New contents for the file | +| Parameter | Type | | Description | +| --------- | ---- | -- | ------------------------- | +| content | BLOB | -> | New contents for the file | @@ -485,7 +485,7 @@ You want to rename "ReadMe.txt" in "ReadMe_new.txt": The `.setContent( )` function rewrites the entire content of the file using the data stored in the *content* BLOB. For information on BLOBs, please refer to the [BLOB](Concepts/dt_blob.md) section. -#### Exemple +#### Example ```4d $myFile:=Folder(fk documents folder).file("Archives/data.txt") @@ -500,10 +500,10 @@ The `.setContent( )` function rewrit ## .setText() -
    Historique -| Version | Modifications | -| ------- | ------------- | -| v17 R5 | Ajoutées | +
    History +| Version | Changes | +| ------- | ------- | +| v17 R5 | Added |
    @@ -512,12 +512,12 @@ The `.setContent( )` function rewrit -| Paramètres | Type | | Description | -| ----------- | ----------- | -- | ---------------------------------------------------------- | -| Texte | Texte | -> | Text to store in the file | -| charSetName | Texte | -> | Name of character set | -| charSetNum | Entier long | -> | Number of character set | -| breakMode | Entier long | -> | Processing mode for line breaks| +| Parameter | Type | | Description | +| ----------- | ------- | -- | ---------------------------------------------------------- | +| text | Text | -> | Text to store in the file | +| charSetName | Text | -> | Name of character set | +| charSetNum | Integer | -> | Number of character set | +| breakMode | Integer | -> | Processing mode for line breaks| | @@ -540,19 +540,19 @@ If a Byte Order Mark (BOM) exists for the character set, 4D inserts it into the In *breakMode*, you can pass a number indicating the processing to apply to end-of-line characters before saving them in the file. The following constants, found in the **System Documents** theme are available: -| Constant | Valeur | Commentaire | -| ----------------------------- | ------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `Document unchanged` | 0 | No processing | -| `Document with native format` | 1 | (Default) Line breaks are converted to the native format of the operating system: CR (carriage return) in macOS, CRLF (carriage return + line feed) in Windows | -| `Document with CRLF` | 2 | Line breaks are converted to Windows format: CRLF (carriage return + line feed) | -| `Document with CR` | 3 | Line breaks are converted to OS X format: CR (carriage return) | -| `Document with LF` | 4 | Line breaks are converted to Unix format: LF (line feed) | +| Constant | Value | Comment | +| ----------------------------- | ----- | -------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `Document unchanged` | 0 | No processing | +| `Document with native format` | 1 | (Default) Line breaks are converted to the native format of the operating system: CR (carriage return) in macOS, CRLF (carriage return + line feed) in Windows | +| `Document with CRLF` | 2 | Line breaks are converted to Windows format: CRLF (carriage return + line feed) | +| `Document with CR` | 3 | Line breaks are converted to OS X format: CR (carriage return) | +| `Document with LF` | 4 | Line breaks are converted to Unix format: LF (line feed) | By default, when you omit the *breakMode* parameter, line breaks are processed in native mode (1). -#### Exemple +#### Example ```4d $myFile:=File("C:\\Documents\\Hello.txt";fk platform path) diff --git a/website/translated_docs/fr/API/folderClass.md b/website/translated_docs/fr/API/folderClass.md index 32509d1784c0c2..8f20bc3e6cfcfe 100644 --- a/website/translated_docs/fr/API/folderClass.md +++ b/website/translated_docs/fr/API/folderClass.md @@ -7,7 +7,7 @@ title: Folder `Folder` objects are created with the [`Folder`](#folder) command. They contain references to folders that may or may not actually exist on disk. For example, when you execute the `Folder` command to create a new folder, a valid `Folder` object is created but nothing is actually stored on disk until you call the [`folder.create( )`](#create-) function. -### Exemple +### Example The following example creates a "JohnSmith" folder: @@ -49,10 +49,10 @@ Form.curfolder:=Folder("C:\\Users\\JohnSmith\\";fk platform path) ## Folder -
    Historique -| Version | Modifications | -| ------- | ------------- | -| v17 R5 | Ajoutées | +
    History +| Version | Changes | +| ------- | ------- | +| v17 R5 | Added |
    @@ -60,13 +60,13 @@ Form.curfolder:=Folder("C:\\Users\\JohnSmith\\";fk platform path) -| Paramètres | Type | | Description | -| -------------- | ----------- |:--:| ----------------------------------------------- | -| path | Texte | -> | Folder path | -| folderConstant | Entier long | -> | 4D folder constant | -| pathType | Entier long | -> | `fk posix path` (default) or `fk platform path` | -| * | | -> | * to return folder of host database | -| Résultat | 4D.Folder | <- | New folder object | +| Parameter | Type | | Description | +| -------------- | --------- |:--:| ----------------------------------------------- | +| path | Text | -> | Folder path | +| folderConstant | Integer | -> | 4D folder constant | +| pathType | Integer | -> | `fk posix path` (default) or `fk platform path` | +| * | | -> | * to return folder of host database | +| Result | 4D.Folder | <- | New folder object | @@ -82,30 +82,30 @@ In the *path* parameter, pass a folder path string. You can use a custom string By default, 4D expects a path expressed with the POSIX syntax. If you work with platform pathnames (Windows or macOS), you must declare it using the *pathType* parameter. The following constants are available: -| Constant | Valeur | Commentaire | -| ---------------- | ------ | --------------------------------------------------------------------------------------- | -| fk platform path | 1 | Path expressed with a platform-specific syntax (mandatory in case of platform pathname) | -| fk posix path | 0 | Path expressed with POSIX syntax (default) | +| Constant | Value | Comment | +| ---------------- | ----- | --------------------------------------------------------------------------------------- | +| fk platform path | 1 | Path expressed with a platform-specific syntax (mandatory in case of platform pathname) | +| fk posix path | 0 | Path expressed with POSIX syntax (default) | **Folder ( folderConstant { ; \* } )** In the *folderConstant* parameter, pass a 4D built-in or system folder, using one of the following constants: -| Constant | Valeur | Commentaire | -| -------------------------- | ------ | --------------------------------------------------------------------------------------------------- | -| fk applications folder | 116 | | -| fk data folder | 9 | Associated filesystem: "/DATA" | -| fk database folder | 4 | Associated filesystem: "/PACKAGE" | -| fk desktop folder | 115 | | -| fk documents folder | 117 | Document folder of the user | -| fk licenses folder | 1 | Folder containing the machine's 4D license files | -| fk logs folder | 7 | Associated filesystem: "/LOGS" | -| fk mobileApps folder | 10 | Associated filesystem: "/DATA" | -| fk remote database folder | 3 | 4D database folder created on each 4D remote machine | -| fk resources folder | 6 | Associated filesystem: "/RESOURCES" | -| fk system folder | 100 | | -| fk user preferences folder | 0 | 4D folder that stores user preference files within the \ directory. | -| fk web root folder | 8 | Current Web root folder of the database: if within the package "/PACKAGE/path", otherwise full path | +| Constant | Value | Comment | +| -------------------------- | ----- | --------------------------------------------------------------------------------------------------- | +| fk applications folder | 116 | | +| fk data folder | 9 | Associated filesystem: "/DATA" | +| fk database folder | 4 | Associated filesystem: "/PACKAGE" | +| fk desktop folder | 115 | | +| fk documents folder | 117 | Document folder of the user | +| fk licenses folder | 1 | Folder containing the machine's 4D license files | +| fk logs folder | 7 | Associated filesystem: "/LOGS" | +| fk mobileApps folder | 10 | Associated filesystem: "/DATA" | +| fk remote database folder | 3 | 4D database folder created on each 4D remote machine | +| fk resources folder | 6 | Associated filesystem: "/RESOURCES" | +| fk system folder | 100 | | +| fk user preferences folder | 0 | 4D folder that stores user preference files within the \ directory. | +| fk web root folder | 8 | Current Web root folder of the database: if within the package "/PACKAGE/path", otherwise full path | If the command is called from a component, pass the optional * parameter to get the path of the host database. Otherwise, if you omit the * parameter, a null object is always returned. @@ -118,10 +118,10 @@ If the command is called from a component, pass the optional * parameter to get ## .create() -
    Historique -| Version | Modifications | -| ------- | ------------- | -| v17 R5 | Ajoutées | +
    History +| Version | Changes | +| ------- | ------- | +| v17 R5 | Added |
    @@ -130,9 +130,9 @@ If the command is called from a component, pass the optional * parameter to get **.create()** : Boolean -| Paramètres | Type | | Description | -| ---------- | ------- | -- | ------------------------------------------------------------ | -| Résultat | Booléen | <- | True if the folder was created successfully, false otherwise | +| Parameter | Type | | Description | +| --------- | ------- | -- | ------------------------------------------------------------ | +| Result | Booléen | <- | True if the folder was created successfully, false otherwise | @@ -143,12 +143,12 @@ The `.create()` function creates a fol If necessary, the function creates the folder hierachy as described in the [platformPath](#platformpath) or [path](#path) properties. If the folder already exists on disk, the function does nothing (no error is thrown) and returns false. -**Valeur retournée** +**Returned value** * **True** if the folder is created successfully; * **False** if a folder with the same name already exists or if an error occured. -#### Exemple 1 +#### Example 1 Create an empty folder in the database folder: @@ -157,7 +157,7 @@ var $created : Boolean $created:=Folder("/PACKAGE/SpecialPrefs").create() ``` -#### Exemple 2 +#### Example 2 Creation of the "/Archives2019/January/" folder in the database folder: @@ -178,10 +178,10 @@ End if ## .createAlias() -
    Historique -| Version | Modifications | -| ------- | ------------- | -| v17 R5 | Ajoutées | +
    History +| Version | Changes | +| ------- | ------- | +| v17 R5 | Added |
    @@ -191,12 +191,12 @@ End if -| Paramètres | Type | | Description | -| ----------------- | ----------- | -- | -------------------------------------------- | -| destinationFolder | 4D.Folder | -> | Destination folder for the alias or shortcut | -| aliasName | Texte | -> | Name of the alias or shortcut | -| aliasType | Entier long | -> | Type of the alias link | -| Résultat | 4D.File | <- | Alias or shortcut reference | +| Parameter | Type | | Description | +| ----------------- | --------- | -- | -------------------------------------------- | +| destinationFolder | 4D.Folder | -> | Destination folder for the alias or shortcut | +| aliasName | Text | -> | Name of the alias or shortcut | +| aliasType | Integer | -> | Type of the alias link | +| Result | 4D.File | <- | Alias or shortcut reference | @@ -208,10 +208,10 @@ Pass the name of the alias or shortcut to create in the *aliasName* parameter. By default on macOS, the function creates a standard alias. You can also create a symbolic link by using the *aliasType* parameter. The following constants are available: -| Constant | Valeur | Commentaire | -| ------------------ | ------ | -------------------------- | -| `fk alias link` | 0 | Alias link (default) | -| `fk symbolic link` | 1 | Symbolic link (macOS only) | +| Constant | Value | Comment | +| ------------------ | ----- | -------------------------- | +| `fk alias link` | 0 | Alias link (default) | +| `fk symbolic link` | 1 | Symbolic link (macOS only) | On Windows, a shortcut (.lnk file) is always created (the *aliasType* parameter is ignored). @@ -219,7 +219,7 @@ On Windows, a shortcut (.lnk file) is always created (the *aliasType* parameter A `4D.File` object with the `isAlias` property set to **true**. -#### Exemple +#### Example You want to create an alias to an archive folder in your database folder: @@ -240,10 +240,10 @@ $aliasFile:=$myFolder.createAlias(Folder("/PACKAGE");"Jan2019") ## .delete() -
    Historique -| Version | Modifications | -| ------- | ------------- | -| v17 R5 | Ajoutées | +
    History +| Version | Changes | +| ------- | ------- | +| v17 R5 | Added |
    @@ -253,9 +253,9 @@ $aliasFile:=$myFolder.createAlias(Folder("/PACKAGE");"Jan2019") -| Paramètres | Type | | Description | -| ---------- | ----------- | -- | ---------------------- | -| option | Entier long | -> | Folder deletion option | +| Parameter | Type | | Description | +| --------- | ------- | -- | ---------------------- | +| option | Integer | -> | Folder deletion option | @@ -266,10 +266,10 @@ The `.delete()` function deletes the f By default, for security reasons, if you omit the option parameter, `.delete( )` only allows empty folders to be deleted. If you want the command to be able to delete folders that are not empty, you must use the option parameter with one of the following constants: -| Constant | Valeur | Commentaire | -| ---------------------- | ------ | ------------------------------------------------ | -| `Delete only if empty` | 0 | Deletes folder only when it is empty | -| `Delete with contents` | 1 | Deletes folder along with everything it contains | +| Constant | Value | Comment | +| ---------------------- | ----- | ------------------------------------------------ | +| `Delete only if empty` | 0 | Deletes folder only when it is empty | +| `Delete with contents` | 1 | Deletes folder along with everything it contains | When `Delete only if empty` is passed or if you omit the option parameter: @@ -356,10 +356,10 @@ When `Delete with contents` is passed: ## .moveTo() -
    Historique -| Version | Modifications | -| ------- | ------------- | -| v17 R5 | Ajoutées | +
    History +| Version | Changes | +| ------- | ------- | +| v17 R5 | Added |
    @@ -367,11 +367,11 @@ When `Delete with contents` is passed: **.moveTo**( *destinationFolder* : 4D.Folder { ; *newName* : Text } ) : 4D.Folder -| Paramètres | Type | | Description | +| Parameter | Type | | Description | | ----------------- | --------- | -- | ------------------------------ | | destinationFolder | 4D.Folder | -> | Destination folder | -| newName | Texte | -> | Full name for the moved folder | -| Résultat | 4D.Folder | <- | Moved folder | +| newName | Text | -> | Full name for the moved folder | +| Result | 4D.Folder | <- | Moved folder | @@ -387,7 +387,7 @@ By default, the folder retains its name when moved. If you want to rename the mo The moved `Folder` object. -#### Exemple +#### Example You want to move and rename a folder: @@ -426,10 +426,10 @@ You want to move and rename a folder: ## .rename() -
    Historique -| Version | Modifications | -| ------- | ------------- | -| v17 R5 | Ajoutées | +
    History +| Version | Changes | +| ------- | ------- | +| v17 R5 | Added |
    @@ -437,10 +437,10 @@ You want to move and rename a folder: -| Paramètres | Type | | Description | -| ---------- | --------- | -- | ---------------------------- | -| newName | Texte | -> | New full name for the folder | -| Résultat | 4D.Folder | <- | Renamed folder | +| Parameter | Type | | Description | +| --------- | --------- | -- | ---------------------------- | +| newName | Text | -> | New full name for the folder | +| Result | 4D.Folder | <- | Renamed folder | @@ -456,7 +456,7 @@ The *newName* parameter must comply with naming rules (e.g., it must not contain The renamed `Folder` object. -#### Exemple +#### Example ```4d diff --git a/website/translated_docs/fr/API/formulaClass.md b/website/translated_docs/fr/API/formulaClass.md index 40c314ea630813..d1a3ec095db790 100644 --- a/website/translated_docs/fr/API/formulaClass.md +++ b/website/translated_docs/fr/API/formulaClass.md @@ -24,16 +24,16 @@ This property is an "object function", i.e. a function which is bound to its par $f.message() //displays "Hello world" ``` -La syntaxe avec des crochets est également prise en charge : +Syntax with brackets is also supported: ```4d $f["message"]() //displays "Hello world" ``` -Note that, even if it does not have parameters (see below), an object function to be executed must be called with ( ) parenthesis. En appelant uniquement une seule propriété, une nouvelle référence à la formule sera retournée (et ne sera pas exécutée) : +Note that, even if it does not have parameters (see below), an object function to be executed must be called with ( ) parenthesis. Calling only the object property will return a new reference to the formula (and will not execute it): ```4d - $o:=$f.message //retourne l'objet formule en $o + $o:=$f.message //returns the formula object in $o ``` You can also execute a function using the [`apply()`](#apply) and [`call()`](#call) functions: @@ -44,7 +44,7 @@ You can also execute a function using the [`apply()`](#apply) and [`call()`](#ca #### Passing parameters -You can pass parameters to your formulas using the [sequential parameter syntax](Concepts/parameters.md#sequential-parameters) based upon $1, $2...$n. Par exemple, vous pouvez écrire : +You can pass parameters to your formulas using the [sequential parameter syntax](Concepts/parameters.md#sequential-parameters) based upon $1, $2...$n. For example, you can write: ```4d var $f : Object @@ -64,7 +64,7 @@ Or using the [.call()](#call) function: #### Parameters to a single method -For more convenience, when the formula is made of a single project method, parameters can be omitted in the formula object initialization. They can just be passed when the formula is called. Par exemple: +For more convenience, when the formula is made of a single project method, parameters can be omitted in the formula object initialization. They can just be passed when the formula is called. For example: ```4d var $f : 4D.Function @@ -95,7 +95,7 @@ A `4D.Function` object contains a piece of code that can be executed from an obj -### Sommaire +### Summary | | @@ -110,21 +110,21 @@ A `4D.Function` object contains a piece of code that can be executed from an obj ## Formula -
    Historique -| Version | Modifications | +
    History +| Version | Changes | | ------- | -------------------------------- | | v17 R6 | Renamed (New formula -> Formula) | -| v17 R3 | Ajoutées | +| v17 R3 | Added |
    **Formula** ( *formulaExp* : Expression ) : 4D.Function -| Paramètres | Type | | Description | +| Parameter | Type | | Description | | ---------- | ----------- |:--:| ----------------------------------------- | | formulaExp | Expression | -> | Formula to be returned as object | -| Résultat | 4D.Function | <- | Native function encapsulating the formula | +| Result | 4D.Function | <- | Native function encapsulating the formula | @@ -159,7 +159,7 @@ If *formulaExp* uses local variables, their values are copied and stored in the The object created by `Formula` can be saved, for example, in a database field or in a blob document. -#### Exemple 1 +#### Example 1 A simple formula: @@ -173,7 +173,7 @@ A simple formula: $result:=$o.f() // returns 3 ``` -#### Exemple 2 +#### Example 2 A formula using local variables: @@ -248,21 +248,21 @@ Calling a formula using object notation: ## Formula from string -
    Historique -| Version | Modifications | +
    History +| Version | Changes | | ------- | ------------------------------------------------------ | | v17 R6 | Renamed New formula from string -> Formula from string | -| v17 R3 | Ajoutées | +| v17 R3 | Added |
    **Formula from string**( *formulaString* : Text ) : 4D.Function -| Paramètres | Type | | Description | +| Parameter | Type | | Description | | ------------- | ----------- |:--:| --------------------------------------- | -| formulaString | Texte | -> | Text formula to be returned as object | -| Résultat | 4D.Function | <- | Native object encapsulating the formula | +| formulaString | Text | -> | Text formula to be returned as object | +| Result | 4D.Function | <- | Native object encapsulating the formula | @@ -274,7 +274,7 @@ This command is similar to [`Formula`](#formula), except that it handles a text- > Because local variable contents can not be accessed by name in compiled mode, they can not be used in *formulaString*. An attempt to access a local variable with `Formula from string` will result in an error (-10737). -#### Exemple +#### Example The following code will create a dialog accepting a formula in text format: @@ -305,21 +305,21 @@ The following code will create a dialog accepting a formula in text format: ## .apply() -
    Historique -| Version | Modifications | -| ------- | ------------- | -| v17 R3 | Ajoutées | +
    History +| Version | Changes | +| ------- | ------- | +| v17 R3 | Added |
    **.apply**() : any
    **.apply**( *thisObj* : Object { ; *formulaParams* : Collection } ) : any -| Paramètres | Type | | Description | +| Parameter | Type | | Description | | ------------- | ---------- |:--:| ----------------------------------------------------------------------- | | thisObj | Objet | -> | Object to be returned by the This command in the formula | | formulaParams | Collection | -> | Collection of values to be passed as $1...$n when `formula` is executed | -| Résultat | any | <- | Value from formula execution | +| Result | any | <- | Value from formula execution | @@ -335,7 +335,7 @@ You can also pass a collection to be used as $1...$n parameters in the formula u Note that `.apply()` is similar to [`.call()`](#call) except that parameters are passed as a collection. This can be useful for passing calculated results. -#### Exemple 1 +#### Example 1 ```4d var $f : 4D.Function @@ -346,7 +346,7 @@ Note that `.apply()` is similar to [`.call()`](#call) except that parameters are ``` -#### Exemple 2 +#### Example 2 ```4d var $calc : 4D.Function @@ -366,21 +366,21 @@ Note that `.apply()` is similar to [`.call()`](#call) except that parameters are ## .call() -
    Historique -| Version | Modifications | -| ------- | ------------- | -| v17 R3 | Ajoutées | +
    History +| Version | Changes | +| ------- | ------- | +| v17 R3 | Added |
    **.call**() : any
    **.call**( *thisObj* : Object { ; ...*params* : any } ) : any -| Paramètres | Type | | Description | -| ---------- | ----- | -- | --------------------------------------------------------- | -| thisObj | Objet | -> | Object to be returned by the This command in the formula | -| params | any | -> | Value(s) to be passed as $1...$n when formula is executed | -| Résultat | any | <- | Value from formula execution | +| Parameter | Type | | Description | +| --------- | ----- | -- | --------------------------------------------------------- | +| thisObj | Objet | -> | Object to be returned by the This command in the formula | +| params | any | -> | Value(s) to be passed as $1...$n when formula is executed | +| Result | any | <- | Value from formula execution | @@ -394,7 +394,7 @@ You can also pass values to be used as *$1...$n* parameters in the formula using Note that `.call()` is similar to [`.apply()`](#apply) except that parameters are passed directly. -#### Exemple 1 +#### Example 1 ```4d var $f : 4D.Function @@ -402,7 +402,7 @@ Note that `.call()` is similar to [`.apply()`](#apply) except that parameters ar $result:=$f.call(Null;"hello") // returns "HELLO" ``` -#### Exemple 2 +#### Example 2 ```4d $o:=New object("value";50) @@ -417,10 +417,10 @@ Note that `.call()` is similar to [`.apply()`](#apply) except that parameters ar ## .source -
    Historique -| Version | Modifications | -| ------- | ------------- | -| v18 R2 | Ajoutées | +
    History +| Version | Changes | +| ------- | ------- | +| v18 R2 | Added |
    @@ -431,9 +431,9 @@ Note that `.call()` is similar to [`.apply()`](#apply) except that parameters ar The `.source` property contains the source expression of the `formula` as text. -Cette propriété est en **lecture seule**. +This property is **read-only**. -#### Exemple +#### Example ```4d var $of : 4D.Function diff --git a/website/translated_docs/fr/API/imapTransporterClass.md b/website/translated_docs/fr/API/imapTransporterClass.md index 887e53b2d8f4e8..c41739c5d42814 100644 --- a/website/translated_docs/fr/API/imapTransporterClass.md +++ b/website/translated_docs/fr/API/imapTransporterClass.md @@ -38,20 +38,20 @@ IMAP Transporter objects are instantiated with the [IMAP New transporter](#imap- ## IMAP New transporter -
    Historique -| Version | Modifications | -| ------- | ------------- | -| v18 R4 | Ajoutées | +
    History +| Version | Changes | +| ------- | ------- | +| v18 R4 | Added |
    **IMAP New transporter**( *server* : Object ) : 4D.IMAPTransporter -| Paramètres | Type | | Description | -| ---------- | ------------------ |:--:| --------------------------------------------------- | -| server | Objet | -> | Mail server information | -| Résultat | 4D.IMAPTransporter | <- | [IMAP transporter object](#imap-transporter-object) | +| Parameter | Type | | Description | +| --------- | ------------------ |:--:| --------------------------------------------------- | +| server | Objet | -> | Mail server information | +| Result | 4D.IMAPTransporter | <- | [IMAP transporter object](#imap-transporter-object) | @@ -63,7 +63,7 @@ In the *server* parameter, pass an object containing the following properties: | *server* | Default value (if omitted) | | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------- | -| [](#acceptunsecureconnection)

        | Faux | +| [](#acceptunsecureconnection)

        | False | | [](#authenticationmode)

        | the most secure authentication mode supported by the server is used | | [](#checkconnectiondelay)

        | 300 | | [](#connectiontimeout)

        | 30 | @@ -75,12 +75,12 @@ In the *server* parameter, pass an object containing the following properties: > **Warning**: Make sure the defined timeout is lower than the server timeout, otherwise the client timeout will be useless. -#### Résultat +#### Result The function returns an [**IMAP transporter object**](#imap-transporter-object). All returned properties are **read-only**. > The IMAP connection is automatically closed when the transporter object is destroyed. -#### Exemple +#### Example ```4d $server:=New object @@ -117,10 +117,10 @@ The function returns an [**IMAP transporter object**](#imap-transporter-object). ## .checkConnectionDelay -

    Historique -| Version | Modifications | -| ------- | ------------- | -| v18 R4 | Ajoutées | +
    History +| Version | Changes | +| ------- | ------- | +| v18 R4 | Added |
    @@ -141,21 +141,21 @@ The `.checkConnectionDelay` property contains ## .copy() -
    Historique -| Version | Modifications | -| ------- | ------------- | -| v18 R5 | Ajoutées | +
    History +| Version | Changes | +| ------- | ------- | +| v18 R5 | Added |
    **.copy**( *msgsIDs* : Collection ; *destinationBox* : Text ) : Object
    **.copy**( *allMsgs* : Integer ; *destinationBox* : Text ) : Object -| Paramètres | Type | | Description | -| -------------- | ----------- |:--:| ------------------------------------------------ | -| msgsIDs | Collection | -> | Collection of message unique IDs (strings) | -| allMsgs | Entier long | -> | `IMAP all`: All messages in the selected mailbox | -| destinationBox | Texte | -> | Mailbox to receive copied messages | -| Résultat | Objet | <- | Status of the copy operation | +| Parameter | Type | | Description | +| -------------- | ---------- |:--:| ------------------------------------------------ | +| msgsIDs | Collection | -> | Collection of message unique IDs (strings) | +| allMsgs | Integer | -> | `IMAP all`: All messages in the selected mailbox | +| destinationBox | Text | -> | Mailbox to receive copied messages | +| Result | Objet | <- | Status of the copy operation | @@ -175,19 +175,19 @@ The *destinationBox* parameter allows you to pass a text value with the name of The function returns an object describing the IMAP status: -| Propriété | | Type | Description | +| Property | | Type | Description | | ---------- | ----------------------- | ---------- | ---------------------------------------------------------------------------------------- | | success | | Booléen | True if the operation is successful, False otherwise | -| statusText | | Texte | Status message returned by the IMAP server, or last error returned in the 4D error stack | +| statusText | | Text | Status message returned by the IMAP server, or last error returned in the 4D error stack | | errors | | Collection | 4D error stack (not returned if a IMAP server response is received) | -| errors | \[].errcode | Nombre | 4D error code | -| errors | \[].message | Texte | Description of the 4D error | -| errors | \[].componentSignature | Texte | Signature of the internal component which returned the error | +| errors | \[].errcode | Number | 4D error code | +| errors | \[].message | Text | Description of the 4D error | +| errors | \[].componentSignature | Text | Signature of the internal component which returned the error | -#### Exemple 1 +#### Example 1 To copy a selection of messages: @@ -215,7 +215,7 @@ To copy a selection of messages: $status:=$transporter.copy($mailIds;"documents") ``` -#### Exemple 2 +#### Example 2 To copy all messages in the current mailbox: @@ -246,21 +246,21 @@ To copy all messages in the current mailbox: ## .delete() -
    Historique -| Version | Modifications | -| ------- | ------------- | -| v18 R5 | Ajoutées | +
    History +| Version | Changes | +| ------- | ------- | +| v18 R5 | Added |
    **.delete**( *msgsIDs* : Collection ) : Object
    **.delete**( *allMsgs* : Integer ) : Object -| Paramètres | Type | | Description | -| ---------- | ----------- |:--:| ------------------------------------------------ | -| msgsIDs | Collection | -> | Collection of message unique IDs (strings) | -| allMsgs | Entier long | -> | `IMAP all`: All messages in the selected mailbox | -| Résultat | Objet | <- | Status of the delete operation | +| Parameter | Type | | Description | +| --------- | ---------- |:--:| ------------------------------------------------ | +| msgsIDs | Collection | -> | Collection of message unique IDs (strings) | +| allMsgs | Integer | -> | `IMAP all`: All messages in the selected mailbox | +| Result | Objet | <- | Status of the delete operation | @@ -280,19 +280,19 @@ Executing this function does not actually remove messages. Messages with the "de The function returns an object describing the IMAP status: -| Propriété | | Type | Description | +| Property | | Type | Description | | ---------- | ----------------------- | ---------- | ---------------------------------------------------------------------------------------- | | success | | Booléen | True if the operation is successful, False otherwise | -| statusText | | Texte | Status message returned by the IMAP server, or last error returned in the 4D error stack | +| statusText | | Text | Status message returned by the IMAP server, or last error returned in the 4D error stack | | errors | | Collection | 4D error stack (not returned if a IMAP server response is received) | -| errors | \[].errcode | Nombre | 4D error code | -| errors | \[].message | Texte | Description of the 4D error | -| errors | \[].componentSignature | Texte | Signature of the internal component which returned the error | +| errors | \[].errcode | Number | 4D error code | +| errors | \[].message | Text | Description of the 4D error | +| errors | \[].componentSignature | Text | Signature of the internal component which returned the error | -#### Exemple 1 +#### Example 1 To delete a selection of messages: @@ -320,7 +320,7 @@ To delete a selection of messages: $status:=$transporter.delete($mailIds) ``` -#### Exemple 2 +#### Example 2 To delete all messages in the current mailbox: @@ -351,21 +351,21 @@ To delete all messages in the current mailbox: ## .getBoxInfo() -
    Historique -| Version | Modifications | +
    History +| Version | Changes | | ------- | ---------------- | | v18 R5 | name is optional | -| v18 R4 | Ajoutées | +| v18 R4 | Added |
    **.getBoxInfo**( { *name* : Text }) : Object -| Paramètres | Type | | Description | -| ---------- | ----- |:--:| ------------------- | -| name | Texte | -> | Name of the mailbox | -| Résultat | Objet | <- | boxInfo object | +| Parameter | Type | | Description | +| --------- | ----- |:--:| ------------------- | +| name | Text | -> | Name of the mailbox | +| Result | Objet | <- | boxInfo object | @@ -380,15 +380,15 @@ In the optional *name* parameter, pass the name of the mailbox to access. The na The `boxInfo` object returned contains the following properties: -| Propriété | Type | Description | +| Property | Type | Description | | ---------- | ------ | ------------------------------------------------------------------- | -| name | Texte | Name of the mailbox | -| mailCount | number | Nombre de messages contenus dans la boîte de réception | +| name | text | Name of the mailbox | +| mailCount | number | Number of messages in the mailbox | | mailRecent | number | Number of messages with the "recent" flag (indicating new messages) | -#### Exemple +#### Example ```4d var $transporter : 4D.IMAPTransporter @@ -406,19 +406,19 @@ The `boxInfo` object returned contains the following properties: ## .getBoxList() -
    Historique -| Version | Modifications | -| ------- | ------------- | -| v18 R4 | Ajoutées | +
    History +| Version | Changes | +| ------- | ------- | +| v18 R4 | Added |
    **.getBoxList()** : Collection -| Paramètres | Type | | Description | -| ---------- | ---------- |:--:| ----------------------------- | -| Résultat | Collection | <- | Collection of mailbox objects | +| Parameter | Type | | Description | +| --------- | ---------- |:--:| ----------------------------- | +| Result | Collection | <- | Collection of mailbox objects | @@ -426,13 +426,13 @@ The `boxInfo` object returned contains the following properties: The `.getBoxList()` function returns a collection of mailboxes describing all of the available mailboxes. This function allows you to locally manage the list of messages located on the IMAP mail server. -#### Résultat +#### Result Each object of the returned collection contains the following properties: -| Propriété | Type | Description | +| Property | Type | Description | | ---------------- | ------- | ------------------------------------------------------------------------------------------------------------------- | -| \[].name | Texte | Name of the mailbox | +| \[].name | text | Name of the mailbox | | \[].selectable | boolean | Indicates whether or not the access rights allow the mailbox to be selected:
    • true - the mailbox can be selected
    • false - the mailbox can not be selected
    | | \[].inferior | boolean | Indicates whether or not the access rights allow creating a lower hierachy in the mailbox:
    • true - a lower level can be created
    • false - a lower level can not be created
    | | \[].interesting | boolean | Indicates if the mailbox has been marked "interesting" by the server:
    • true - The mailbox has been marked "interesting" by the server. For example, it may contain new messages.
    • false - The mailbox has not been marked "interesting" by the server.
    | @@ -443,7 +443,7 @@ If the account does not contain any mailboxes, an empty collection is returned. > * If the connection has not been used since the designated connection delay (see `IMAP New transporter`), the `.checkConnection( )` function is automatically called. -#### Exemple +#### Example ```4d @@ -467,19 +467,19 @@ If the account does not contain any mailboxes, an empty collection is returned. ## .getDelimiter() -
    Historique -| Version | Modifications | -| ------- | ------------- | -| v18 R4 | Ajoutées | +
    History +| Version | Changes | +| ------- | ------- | +| v18 R4 | Added |
    **.getDelimiter()** : Text -| Paramètres | Type | | Description | -| ---------- | ----- |:--:| ----------------------------- | -| Résultat | Texte | <- | Hierarchy delimiter character | +| Parameter | Type | | Description | +| --------- | ---- |:--:| ----------------------------- | +| Result | Text | <- | Hierarchy delimiter character | @@ -493,7 +493,7 @@ The delimiter is a character which can be used to: * search higher or lower within the mailbox hierarchy -#### Résultat +#### Result Mailbox name delimiter character. > * If there is no open connection, `.getDelimiter( )` will open a connection. @@ -501,7 +501,7 @@ Mailbox name delimiter character. -#### Exemple +#### Example ```4d @@ -525,22 +525,22 @@ Mailbox name delimiter character. ## .getMail() -
    Historique -| Version | Modifications | -| ------- | ------------- | -| v18 R4 | Ajoutées | +
    History +| Version | Changes | +| ------- | ------- | +| v18 R4 | Added |
    **.getMail**( *msgNumber*: Integer { ; *options* : Object } ) : Object
    **.getMail**( *msgID*: Text { ; *options* : Object } ) : Object -| Paramètres | Type | | Description | -| ---------- | ----------- |:--:| ------------------------------------------------ | -| msgNumber | Entier long | -> | Sequence number of the message | -| msgID | Texte | -> | ID unique du message | -| options | Objet | -> | Message handling instructions | -| Résultat | Objet | <- | [Email object](emailObjectClass.md#email-object) | +| Parameter | Type | | Description | +| --------- | ------- |:--:| ------------------------------------------------ | +| msgNumber | Integer | -> | Sequence number of the message | +| msgID | Text | -> | Unique ID of the message | +| options | Objet | -> | Message handling instructions | +| Result | Objet | <- | [Email object](emailObjectClass.md#email-object) | @@ -555,7 +555,7 @@ In the first parameter, you can pass either: The optional *options* parameter allows you pass an object defining additional instructions for handling the message. The following properties are available: -| Propriété | Type | Description | +| Property | Type | Description | | ---------- | ------- | --------------------------------------------------------------------------------------------------------------------------- | | updateSeen | boolean | If True, the message is marked as "seen" in the mailbox. If False, the message is not marked as "seen". Default value: True | | withBody | boolean | Pass True to return the body of the message. If False, only the message header is returned. Default value: True | @@ -564,11 +564,11 @@ The optional *options* parameter allows you pass an object defining additional i > * If there is no open connection, `.getMail()` will open a connection the last mailbox specified with [`.selectBox()`](#selectbox)`. -#### Résultat +#### Result `.getMail()` returns an [`Email` object](emailObjectClass.md#email-object) with the following specific IMAP properties: *id*, *receivedAt*, and *size*. -#### Exemple +#### Example You want to get the message with ID = 1: @@ -600,23 +600,23 @@ You want to get the message with ID = 1: ## .getMails() -
    Historique -| Version | Modifications | -| ------- | ------------- | -| v18 R5 | Ajoutées | +
    History +| Version | Changes | +| ------- | ------- | +| v18 R5 | Added |
    **.getMails**( *ids* : Collection { ; *options* : Object } ) : Object
    **.getMails**( *startMsg* : Integer ; *endMsg* : Integer { ; *options* : Object } ) : Object -| Paramètres | Type | | Description | -| ---------- | ----------- |:--:| ------------------------------------------------------ | -| ids | Collection | -> | Collection of message ID | -| startMsg | Entier long | -> | Sequence number of the first message | -| endMsg | Entier long | -> | Sequence number of the last message | -| options | Objet | -> | Message handling instructions | -| Résultat | Objet | <- | Object containing:
    • a collection of [Email objects](emailObjectClass.md#email-object) and
    • a collection of IDs or numbers for missing messages, if any
    | +| Parameter | Type | | Description | +| --------- | ---------- |:--:| ------------------------------------------------------ | +| ids | Collection | -> | Collection of message ID | +| startMsg | Integer | -> | Sequence number of the first message | +| endMsg | Integer | -> | Sequence number of the last message | +| options | Objet | -> | Message handling instructions | +| Result | Objet | <- | Object containing:
    • a collection of [Email objects](emailObjectClass.md#email-object) and
    • a collection of IDs or numbers for missing messages, if any
    | @@ -648,7 +648,7 @@ The optional *options* parameter allows you to define the parts of the messages **Options** -| Propriété | Type | Description | +| Property | Type | Description | | ---------- | ------- | ----------------------------------------------------------------------------------------------------------------------------------------- | | updateSeen | Booléen | If True, the specified messages are marked as "seen" in the mailbox. If False, the messages are not marked as "seen". Default value: True | | withBody | Booléen | Pass True to return the body of the specified messages. If False, only the message headers are returned. Default value: True | @@ -656,18 +656,18 @@ The optional *options* parameter allows you to define the parts of the messages > * If there is no open connection, `.getMails()` will open a connection the last mailbox specified with [`.selectBox()`](#selectbox). -#### Résultat +#### Result `.getMails()` returns an object containing the following collections: -| Propriété | Type | Description | -| --------- | ---------- | ---------------------------------------------------------------------------------------------------------------------------------- | -| liste | Collection | Collection of [`Email` objects](emailObjectClass.md#email-object). If no Email objects are found, an empty collection is returned. | -| notFound | Collection | Collection of:
    • first syntax - previously passed message IDs that do not exist
    • second syntax - sequence numbers of messages between startMsg and endMsg that do not exist
    An empty collection is returned if all messages are found. | +| Property | Type | Description | +| -------- | ---------- | ---------------------------------------------------------------------------------------------------------------------------------- | +| list | Collection | Collection of [`Email` objects](emailObjectClass.md#email-object). If no Email objects are found, an empty collection is returned. | +| notFound | Collection | Collection of:
    • first syntax - previously passed message IDs that do not exist
    • second syntax - sequence numbers of messages between startMsg and endMsg that do not exist
    An empty collection is returned if all messages are found. | -#### Exemple +#### Example You want to retrieve the 20 most recent emails without changing their "seen" status: @@ -704,10 +704,10 @@ You want to retrieve the 20 most recent emails without changing their "seen" sta ## .getMIMEAsBlob() -
    Historique -| Version | Modifications | -| ------- | ------------- | -| v18 R4 | Ajoutées | +
    History +| Version | Changes | +| ------- | ------- | +| v18 R4 | Added |
    @@ -715,12 +715,12 @@ You want to retrieve the 20 most recent emails without changing their "seen" sta -| Paramètres | Type | | Description | -| ---------- | ----------- |:--:| --------------------------------------------------------------------------------------------- | -| msgNumber | Entier long | -> | Sequence number of the message | -| msgID | Texte | -> | ID unique du message | -| updateSeen | Booléen | -> | If True, the message is marked "seen" in the mailbox. If False the message is left untouched. | -| Résultat | BLOB | <- | Blob of the MIME string returned from the mail server | +| Parameter | Type | | Description | +| ---------- | ------- |:--:| --------------------------------------------------------------------------------------------- | +| msgNumber | Integer | -> | Sequence number of the message | +| msgID | Text | -> | Unique ID of the message | +| updateSeen | Booléen | -> | If True, the message is marked "seen" in the mailbox. If False the message is left untouched. | +| Result | BLOB | <- | Blob of the MIME string returned from the mail server | @@ -742,12 +742,12 @@ The optional *updateSeen* parameter allows you to specify if the message is mark > * If there is no open connection, `.getMIMEAsBlob()` will open a connection the last mailbox specified with `.selectBox( )`. -#### Résultat +#### Result `.getMIMEAsBlob()` returns a `BLOB` which can be archived in a database or converted to an [`Email` object](emailObjectClass.md#email-object) with the `MAIL Convert from MIME` command. -#### Exemple +#### Example ```4d @@ -788,22 +788,22 @@ The optional *updateSeen* parameter allows you to specify if the message is mark ## .move() -
    Historique -| Version | Modifications | -| ------- | ------------- | -| v18 R5 | Ajoutées | +
    History +| Version | Changes | +| ------- | ------- | +| v18 R5 | Added |
    **.move**( *msgsIDs* : Collection ; *destinationBox* : Text ) : Object
    **.move**( *allMsgs* : Integer ; *destinationBox* : Text ) : Object -| Paramètres | Type | | Description | -| -------------- | ----------- |:--:| ------------------------------------------------ | -| msgsIDs | Collection | -> | Collection of message unique IDs (strings) | -| allMsgs | Entier long | -> | `IMAP all`: All messages in the selected mailbox | -| destinationBox | Texte | -> | Mailbox to receive moved messages | -| Résultat | Objet | <- | Status of the move operation | +| Parameter | Type | | Description | +| -------------- | ---------- |:--:| ------------------------------------------------ | +| msgsIDs | Collection | -> | Collection of message unique IDs (strings) | +| allMsgs | Integer | -> | `IMAP all`: All messages in the selected mailbox | +| destinationBox | Text | -> | Mailbox to receive moved messages | +| Result | Objet | <- | Status of the move operation | @@ -825,19 +825,19 @@ The *destinationBox* parameter allows you to pass a text value with the name of The function returns an object describing the IMAP status: -| Propriété | | Type | Description | +| Property | | Type | Description | | ---------- | ----------------------- | ---------- | ---------------------------------------------------------------------------------------- | | success | | Booléen | True if the operation is successful, False otherwise | -| statusText | | Texte | Status message returned by the IMAP server, or last error returned in the 4D error stack | +| statusText | | Text | Status message returned by the IMAP server, or last error returned in the 4D error stack | | errors | | Collection | 4D error stack (not returned if a IMAP server response is received) | -| errors | \[].errcode | Nombre | 4D error code | -| errors | \[].message | Texte | Description of the 4D error | -| errors | \[].componentSignature | Texte | Signature of the internal component which returned the error | +| errors | \[].errcode | Number | 4D error code | +| errors | \[].message | Text | Description of the 4D error | +| errors | \[].componentSignature | Text | Signature of the internal component which returned the error | -#### Exemple 1 +#### Example 1 To move a selection of messages: @@ -864,7 +864,7 @@ To move a selection of messages: $status:=$transporter.move($mailIds;"documents") ``` -#### Exemple 2 +#### Example 2 To move all messages in the current mailbox: @@ -895,21 +895,21 @@ To move all messages in the current mailbox: ## .numToID() -
    Historique -| Version | Modifications | -| ------- | ------------- | -| v18 R5 | Ajoutées | +
    History +| Version | Changes | +| ------- | ------- | +| v18 R5 | Added |
    **.numToID**( *startMsg* : Integer ; *endMsg* : Integer ) : Collection -| Paramètres | Type | | Description | -| ---------- | ----------- |:--:| ------------------------------------ | -| startMsg | Entier long | -> | Sequence number of the first message | -| endMsg | Entier long | -> | Sequence number of the last message | -| Résultat | Collection | <- | Collection of unique IDs | +| Parameter | Type | | Description | +| --------- | ---------- |:--:| ------------------------------------ | +| startMsg | Integer | -> | Sequence number of the first message | +| endMsg | Integer | -> | Sequence number of the last message | +| Result | Collection | <- | Collection of unique IDs | @@ -922,11 +922,11 @@ In the *startMsg* parameter, pass an integer value corresponding to the number o In the *endMsg* parameter, pass an integer value corresponding to the number of the last message to be included in a sequential range. If you pass a negative number (*endMsg* <= 0), the last message of the mailbox will be used as the end of the sequence. -#### Résultat +#### Result The function returns a collection of strings (unique IDs). -#### Exemple +#### Example ```4d @@ -962,20 +962,20 @@ The function returns a collection of strings (unique IDs). ## .searchMails() -
    Historique -| Version | Modifications | -| ------- | ------------- | -| v18 R5 | Ajoutées | +
    History +| Version | Changes | +| ------- | ------- | +| v18 R5 | Added |
    **.searchMails**( *searchCriteria* : Text ) : Collection -| Paramètres | Type | | Description | +| Parameter | Type | | Description | | -------------- | ---------- |:--:| ----------------------------- | -| searchCriteria | Texte | -> | Search criteria | -| Résultat | Collection | <- | Collection of message numbers | +| searchCriteria | Text | -> | Search criteria | +| Result | Collection | <- | Collection of message numbers | @@ -985,7 +985,7 @@ The function returns a collection of strings (unique IDs). The `.searchMails()` function searches for messages that match the given *searchCriteria* in the current mailbox. *searchCriteria* consists of one or more search keys. -*searchCriteria* is a text parameter listing one or more search keys (see [Authorized search-keys](#authorized-search-keys) below) associated or not with values to look for. A search key may be a single or multiple items. Par exemple: +*searchCriteria* is a text parameter listing one or more search keys (see [Authorized search-keys](#authorized-search-keys) below) associated or not with values to look for. A search key may be a single or multiple items. For example: ``` SearchKey1 = FLAGGED @@ -1085,7 +1085,7 @@ Search-keys may request the value to search for: **LARGER** : Messages with a size larger than the specified number of bytes. **SMALLER** : Messages with a size smaller than the specified number of bytes. **NOT** : Messages that do not match the specified search key. -**OU** : Messages that match either search key. +**OR** : Messages that match either search key. @@ -1094,21 +1094,21 @@ Search-keys may request the value to search for: ## .selectBox() -
    Historique -| Version | Modifications | -| ------- | ------------- | -| v18 R4 | Ajoutées | +
    History +| Version | Changes | +| ------- | ------- | +| v18 R4 | Added |
    **.selectBox**( *name* : Text { ; *state* : Integer } ) : Object -| Paramètres | Type | | Description | -| ---------- | ----------- |:--:| --------------------- | -| name | Texte | -> | Name of the mailbox | -| state | Entier long | -> | Mailbox access status | -| Résultat | Objet | <- | boxInfo object | +| Parameter | Type | | Description | +| --------- | ------- |:--:| --------------------- | +| name | Text | -> | Name of the mailbox | +| state | Integer | -> | Mailbox access status | +| Result | Objet | <- | boxInfo object | @@ -1121,10 +1121,10 @@ In the *name* parameter, pass the name of the mailbox to access. The name repres The optional *state* parameter defines the type of access to the mailbox. The possible values are: -| Constant | Valeur | Commentaire | -| --------------------- | ------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| IMAP read only state | 1 | The selected mailbox is accessed with read only privileges. Messages with a "recent" flag (indicating new messages) remain unchanged. | -| IMAP read write state | 0 | The selected mailbox is accessed with read and write privileges. Messages are considered "seen" and lose the "recent" flag (indicating new messages). (Default value) | +| Constant | Value | Comment | +| --------------------- | ----- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| IMAP read only state | 1 | The selected mailbox is accessed with read only privileges. Messages with a "recent" flag (indicating new messages) remain unchanged. | +| IMAP read write state | 0 | The selected mailbox is accessed with read and write privileges. Messages are considered "seen" and lose the "recent" flag (indicating new messages). (Default value) | > * The function generates an error and returns **Null** if name designates a non-existing mailbox. > * If there is no open connection, `.selectBox()` will open a connection. > * If the connection has not been used since the designated connection delay (see `IMAP New transporter`), the [`.checkConnection()`](#checkconnection) function is automatically called. @@ -1133,14 +1133,14 @@ The optional *state* parameter defines the type of access to the mailbox. The po The `boxInfo` object returned contains the following properties: -| Propriété | Type | Description | -| ---------- | ------ | ------------------------------------------------------ | -| name | Texte | Name of the mailbox | -| mailCount | number | Nombre de messages contenus dans la boîte de réception | -| mailRecent | number | Number of messages with the "recent" flag | +| Property | Type | Description | +| ---------- | ------ | ----------------------------------------- | +| name | Text | Name of the mailbox | +| mailCount | number | Number of messages in the mailbox | +| mailRecent | number | Number of messages with the "recent" flag | -#### Exemple +#### Example ```4d diff --git a/website/translated_docs/fr/API/overview.md b/website/translated_docs/fr/API/overview.md index 40ed294fbbcb5e..1a3cc49931b167 100644 --- a/website/translated_docs/fr/API/overview.md +++ b/website/translated_docs/fr/API/overview.md @@ -1,27 +1,27 @@ --- id: overview -title: Aperçu - API des classes +title: Class API Overview --- -Cette section décrit l'API de classes 4D intégrées ainsi que les commandes associées du constructeur. Les propriétés et fonctions de classe 4D sont disponibles via les objets d'instance de classe. +This section describes the built-in 4D class API as well as the associated constructor commands. 4D class functions and properties are available through class instance objects. - functions must be called on instances with the () operator. For example, `collection.sort()`. - properties are accessed without parentheses, for example `file.creationTime`. You can also use the \[] syntax, for example `file["creationTime"]`. -## Conventions d'écriture +## Writing conventions -Les conventions suivantes sont utilisées dans la syntaxe de la fonction : +The following conventions are used in the function syntax: -- les caractères `{ }` (accolades) indiquent des paramètres facultatifs. Par exemple, `.delete( { option : Integer } )` signifie que le paramètre *option* peut être omis lors de l'appel de la fonction. -- la notation `{ ; ...param }` indique un nombre illimité de paramètres. Par exemple, `.concat( value : any { ;...valueN } ) : Collection` signifie qu'un nombre illimité de valeurs de n'importe quel type peut être passé à la fonction. +- the `{ }` characters (braces) indicate optional parameters. For example, `.delete( { option : Integer } )` means that the *option* parameter may be omitted when calling the function. +- the `{ ; ...param }` notation indicates an unlimited number of parameters. For example, `.concat( value : any { ;...valueN } ) : Collection` means that an unlimited number of values of any type can be passed to the function. - the `any` keyword is used for parameters that can be of any type that can be stored within attributes (number, text, boolean, date, time, object, collection...). -## Autres ressources +## Other resources -Pour une présentation générale des fondements et concepts du langage 4D, veuillez consulter la section [Concepts du langage 4D](Concepts/about.md). +For an overall presentation of the 4D Language basics and concepts, please go to the [4D Language Concepts](Concepts/about.md) section. -Pour une description du langage «classique» de 4D, veuillez vous reporter au manuel de *Langage 4D* sur [doc.4d.com](https://doc.4d.com). +For a description of the 4D "classic" language, please go to the *4D Language Reference* on [doc.4d.com](https://doc.4d.com). diff --git a/website/translated_docs/fr/API/pop3TransporterClass.md b/website/translated_docs/fr/API/pop3TransporterClass.md index 031635ca74119b..f0d985d5d22baa 100644 --- a/website/translated_docs/fr/API/pop3TransporterClass.md +++ b/website/translated_docs/fr/API/pop3TransporterClass.md @@ -3,12 +3,12 @@ id: pop3TransporterClass title: POP3Transporter --- -La classe `POP3Transporter` vous permet de récupérer des messages à partir d'un serveur de messagerie POP3. +The `POP3Transporter` class allows you to retrieve messages from a POP3 email server. -### Objet POP3 Transporter +### POP3 Transporter object -Les objets Transporter POP3 sont instanciés avec la commande [POP3 New transporter](#pop3-new-transporter). They provide the following properties and functions: +POP3 Transporter objects are instantiated with the [POP3 New transporter](#pop3-new-transporter) command. They provide the following properties and functions: | | @@ -34,57 +34,57 @@ Les objets Transporter POP3 sont instanciés avec la commande [POP3 New transpor ## POP3 New transporter -
    Historique -| Version | Modifications | -| ------- | ------------- | -| v18 R2 | Ajoutées | +
    History +| Version | Changes | +| ------- | ------- | +| v18 R2 | Added |
    **POP3 New transporter**( *server* : Object ) : 4D.POP3Transporter -| Paramètres | Type | | Description | -| ---------- | ------------------ |:--:| -------------------------------------------------- | -| server | object | -> | Mail server information | -| Résultat | 4D.POP3Transporter | <- | [Objet POP3 transporter](#pop3-transporter-object) | +| Parameter | Type | | Description | +| --------- | ------------------ |:--:| --------------------------------------------------- | +| server | object | -> | Mail server information | +| Result | 4D.POP3Transporter | <- | [POP3 transporter object](#pop3-transporter-object) | #### Description -La commande `POP3 New transporter` configure une nouvelle connexion POP3en fonction du paramètre *server* et retourne un nouvel objet *[POP3 transporter](#pop3-transporter-object)*. The returned transporter object will then usually be used to receive emails. +The `POP3 New transporter` command configures a new POP3 connectionaccording to the *server* parameter and returns a new *[POP3 transporter](#pop3-transporter-object)* object. The returned transporter object will then usually be used to receive emails. In the *server* parameter, pass an object containing the following properties: | *server* | Default value (if omitted) | | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------- | -| [](#acceptunsecureconnection)

        | Faux | +| [](#acceptunsecureconnection)

        | False | | [](#authenticationmode)

        | the most secure authentication mode supported by the server is used | | [](#connectiontimeout)

        | 30 | | [](#host)

        | *mandatory* | | [](#logfile)

        | none | -| **.password** : Text

    Mot de passe utilisateur pour l'authentification sur le serveur (non retourné dans l'objet *[SMTP transporter](#smtptransporterobject)*) | none | +| **.password** : Text

    User password for authentication on the server (not returned in *[SMTP transporter](#smtptransporterobject)* object) | none | | [](#port)

        | 995 | | [](#user)

        | none | -#### Résultat +#### Result -La fonction retourne un [**objet POP3 transporter**](#pop3-transporter-object). All returned properties are **read-only**. -> La connexion POP3 est automatiquement fermée lorsque l'objet transporteur est détruit. +The function returns a [**POP3 transporter object**](#pop3-transporter-object). All returned properties are **read-only**. +> The POP3 connection is automatically closed when the transporter object is destroyed. -#### Exemple +#### Example ```4d var $server : Object $server:=New object - $server.host:="pop.gmail.com" //Obligatoire + $server.host:="pop.gmail.com" //Mandatory $server.port:=995 $server.user:="4d@gmail.com" $server.password:="XXXXXXXX" - $server.logFile:="LogTest.txt" //log à enregistrer dans le dossier Logs + $server.logFile:="LogTest.txt" //log to save in the Logs folder var $transporter : 4D.POP3Transporter $transporter:=POP3 New transporter($server) @@ -109,7 +109,7 @@ La fonction retourne un [**objet POP3 transporter**](#pop3-transporter-object). -#### Exemple +#### Example ```4d var $pw : Text @@ -142,19 +142,19 @@ La fonction retourne un [**objet POP3 transporter**](#pop3-transporter-object). ## .delete() -

    Historique -| Version | Modifications | -| ------- | ------------- | -| v18 R2 | Ajoutées | +
    History +| Version | Changes | +| ------- | ------- | +| v18 R2 | Added |
    **.delete**( *msgNumber* : Integer ) -| Paramètres | Type | | Description | -| ---------- | ----------- |:--:| ------------------------------- | -| msgNumber | Entier long | -> | Number of the message to delete | +| Parameter | Type | | Description | +| --------- | ------- |:--:| ------------------------------- | +| msgNumber | Integer | -> | Number of the message to delete | @@ -167,20 +167,20 @@ In the *msgNumber* parameter, pass the number of the email to delete. This numbe Executing this method does not actually remove any email. The flagged email will be deleted from the POP3 server only when the `POP3_transporter` object (created with `POP3 New transporter`) is destroyed. The flag could be also be removed using the `.undeleteAll()` method. > If the current session unexpectedly terminates and the connection is closed (e.g., timeout, network failure, etc.), an error message is generated and messages marked for deletion will remain on the POP3 server. -##### Exemple +##### Example ```4d $mailInfoList:=$POP3_transporter.getMailInfoList() For each($mailInfo;$mailInfoList) - // Marquer votre e-mail comme "à supprimer à la fin de la session" + // Mark your mail as "to be deleted at the end of the session" $POP3_transporter.delete($mailInfo.number) End for each - // Forcer la fermeture de la session pour supprimer les e-mails marqués pour suppression + // Force the session closure to delete the mails marked for deletion CONFIRM("Selected messages will be deleted.";"Delete";"Undo") - If(OK=1) //suppression confirmée + If(OK=1) //deletion confirmed $POP3_transporter:=Null Else - $POP3_transporter.undeleteAll() //supprimer les marqueurs de suppression + $POP3_transporter.undeleteAll() //remove deletion flags End if ``` @@ -189,19 +189,19 @@ Executing this method does not actually remove any email. The flagged email will ## .getBoxInfo() -
    Historique -| Version | Modifications | -| ------- | ------------- | -| v18 R2 | Ajoutées | +
    History +| Version | Changes | +| ------- | ------- | +| v18 R2 | Added |
    **.getBoxInfo()** : Object -| Paramètres | Type | | Description | -| ---------- | ----- |:--:| -------------- | -| Résultat | Objet | <- | boxInfo object | +| Parameter | Type | | Description | +| --------- | ----- |:--:| -------------- | +| Result | Objet | <- | boxInfo object | @@ -211,20 +211,20 @@ The `.getBoxInfo()` function **.getMail**( *msgNumber* : Integer ) : Object -| Paramètres | Type | | Description | -| ---------- | ----------- |:--:| ------------------------------------------------ | -| msgNumber | Entier long | -> | Number of the message in the list | -| Résultat | Objet | <- | [Email object](emailObjectClass.md#email-object) | +| Parameter | Type | | Description | +| --------- | ------- |:--:| ------------------------------------------------ | +| msgNumber | Integer | -> | Number of the message in the list | +| Result | Objet | <- | [Email object](emailObjectClass.md#email-object) | @@ -266,8 +266,8 @@ Pass in *msgNumber* the number of the message to retrieve. This number is return The method returns Null if: -* *msgNumber* désigne un message inexistant, -* le message a été marqué pour suppression à l'aide de `.delete()`. +* *msgNumber* designates a non-existing message, +* the message was marked for deletion using `.delete( )`. **Returned object** @@ -275,7 +275,7 @@ The method returns Null if: `.getMail()` returns an [`Email` object](emailObjectClass.md#email-object). -##### Exemple +##### Example You want to know the sender of the first mail of the mailbox: @@ -285,7 +285,7 @@ You want to know the sender of the first mail of the mailbox: var $sender : Variant $server:=New object - $server.host:="pop.gmail.com" //Obligatoire + $server.host:="pop.gmail.com" //Mandatory $server.port:=995 $server.user:="4d@gmail.com" $server.password:="XXXXXXXX" @@ -301,20 +301,20 @@ You want to know the sender of the first mail of the mailbox: ## .getMailInfo() -
    Historique -| Version | Modifications | -| ------- | ------------- | -| v18 R2 | Ajoutées | +
    History +| Version | Changes | +| ------- | ------- | +| v18 R2 | Added |
    **.getMailInfo**( *msgNumber* : Integer ) : Object -| Paramètres | Type | | Description | -| ---------- | ----------- |:--:| --------------------------------- | -| msgNumber | Entier long | -> | Number of the message in the list | -| Résultat | Objet | <- | mailInfo object | +| Parameter | Type | | Description | +| --------- | ------- |:--:| --------------------------------- | +| msgNumber | Integer | -> | Number of the message in the list | +| Result | Objet | <- | mailInfo object | @@ -326,25 +326,25 @@ In *msgNumber*, pass the number of the message to retrieve. This number is retur The `mailInfo` object returned contains the following properties: -| Propriété | Type | Description | -| --------- | ------ | --------------------------- | -| size | Nombre | Taille du message en octets | -| id | Texte | ID unique du message | +| Property | Type | Description | +| -------- | ------ | ------------------------ | +| size | Number | Message size in bytes | +| id | Text | Unique ID of the message | The method returns **Null** if: -* *msgNumber* désigne un message inexistant, -* le message a été marqué pour suppression à l'aide de `.delete()`. +* *msgNumber* designates a non-existing message, +* the message was marked for deletion using `.delete( )`. -##### Exemple +##### Example ```4d var $server; $mailInfo : Object var $mailNumber : Integer - $server.host:="pop.gmail.com" //Obligatoire + $server.host:="pop.gmail.com" //Mandatory $server.port:=995 $server.user:="4d@gmail.com" $server.password:="XXXXXXXX" @@ -353,7 +353,7 @@ The method returns **Null** if: $transporter:=POP3 New transporter($server) //message info - $mailInfo:=$transporter.getMailInfo(1) //obtenir le premier e-mail + $mailInfo:=$transporter.getMailInfo(1) //get the first mail If($mailInfo #Null) ALERT("First mail size is:"+String($mailInfo.size)+" bytes.") End if @@ -364,19 +364,19 @@ The method returns **Null** if: ## .getMailInfoList() -
    Historique -| Version | Modifications | -| ------- | ------------- | -| v18 R2 | Ajoutées | +
    History +| Version | Changes | +| ------- | ------- | +| v18 R2 | Added |
    **.getMailInfoList()** : Collection -| Paramètres | Type | | Description | -| ---------- | ---------- |:--:| -------------------------------- | -| Résultat | Collection | <- | Collection of `mailInfo` objects | +| Parameter | Type | | Description | +| --------- | ---------- |:--:| -------------------------------- | +| Result | Collection | <- | Collection of `mailInfo` objects | @@ -386,11 +386,11 @@ The `.getMailInfoList()` function **.getMIMEAsBlob**( *msgNumber* : Integer ) : Blob -| Paramètres | Type | | Description | -| ---------- | ----------- |:--:| ----------------------------------------------------- | -| msgNumber | Entier long | -> | Number of the message in the list | -| Résultat | Blob | <- | Blob of the MIME string returned from the mail server | +| Parameter | Type | | Description | +| --------- | ------- |:--:| ----------------------------------------------------- | +| msgNumber | Integer | -> | Number of the message in the list | +| Result | Blob | <- | Blob of the MIME string returned from the mail server | @@ -458,8 +458,8 @@ In *msgNumber*, pass the number of the message to retrieve. This number is retur The method returns an empty BLOB if: -* *msgNumber* désigne un message inexistant, -* le message a été marqué pour suppression à l'aide de `.delete()`. +* *msgNumber* designates a non-existing message, +* the message was marked for deletion using `.delete()`. **Returned BLOB** @@ -467,7 +467,7 @@ The method returns an empty BLOB if: `.getMIMEAsBlob()` returns a `BLOB` which can be archived in a database or converted to an [`Email` object](emailObjectClass.md#email-object) with the `MAIL Convert from MIME` command. -##### Exemple +##### Example You want to know the total number and size of emails in the mailbox: @@ -511,19 +511,19 @@ You want to know the total number and size of emails in the mailbox: ## .undeleteAll() -
    Historique -| Version | Modifications | -| ------- | ------------- | -| v18 R2 | Ajoutées | +
    History +| Version | Changes | +| ------- | ------- | +| v18 R2 | Added |
    **.undeleteAll()** -| Paramètres | Type | | Description | -| ---------- | ---- |::| ------------------------------- | -| | | | Does not require any parameters | +| Parameter | Type | | Description | +| --------- | ---- |::| ------------------------------- | +| | | | Does not require any parameters | diff --git a/website/translated_docs/fr/API/signalClass.md b/website/translated_docs/fr/API/signalClass.md index 8a33c4ba60b3d2..458776bd1b2298 100644 --- a/website/translated_docs/fr/API/signalClass.md +++ b/website/translated_docs/fr/API/signalClass.md @@ -40,7 +40,7 @@ Once a signal has been released using a `signal.trigger()` call, it cannot be re Since a signal object is a [shared object](Concepts/shared.md), you can use it to return results from called workers/processes, provided that you do not forget to write values within a `Use...End use` structure (see example). -### Exemple +### Example ```4d var $signal : 4D.Signal @@ -80,7 +80,7 @@ Since a signal object is a [shared object](Concepts/shared.md), you can use it t $signal.trigger() ``` -### Sommaire +### Summary | | @@ -97,20 +97,20 @@ Since a signal object is a [shared object](Concepts/shared.md), you can use it t ## New signal -
    Historique -| Version | Modifications | -| ------- | ------------- | -| v17 R4 | Ajoutées | +
    History +| Version | Changes | +| ------- | ------- | +| v17 R4 | Added |
    **New signal** { ( *description* : Text ) } : 4D.Signal -| Paramètres | Type | | Description | +| Parameter | Type | | Description | | ----------- | --------- |:--:| -------------------------------------- | -| description | Texte | -> | Description for the signal | -| Résultat | 4D.Signal | <- | Native object encapsulating the signal | +| description | Text | -> | Description for the signal | +| Result | 4D.Signal | <- | Native object encapsulating the signal | @@ -128,11 +128,11 @@ Optionally, in the *description* parameter you can pass a custom text describing Since the signal object is a shared object, it can also be used to maintain user properties, including the [`.description`](#description) property, by calling the `Use...End use` structure. -**Valeur retournée** +**Returned value** A new [`4D.Signal` object](#signal-object). -#### Exemple +#### Example Here is a typical example of a worker that sets a signal: @@ -169,10 +169,10 @@ The ***doSomething*** method could be like: ## .description -
    Historique -| Version | Modifications | -| ------- | ------------- | -| v17 R4 | Ajoutées | +
    History +| Version | Changes | +| ------- | ------- | +| v17 R4 | Added |
    @@ -193,10 +193,10 @@ This property is **read-write**. ## .signaled -
    Historique -| Version | Modifications | -| ------- | ------------- | -| v17 R4 | Ajoutées | +
    History +| Version | Changes | +| ------- | ------- | +| v17 R4 | Added |
    @@ -207,7 +207,7 @@ This property is **read-write**. The `.signaled` property contains the current state of the `Signal` object. When the signal is created, `.signaled` is **False**. It becomes **True** when the `.trigger( )` is called on the object. -Cette propriété est en **lecture seule**. +This property is **read-only**. @@ -216,19 +216,19 @@ Cette propriété est en **lecture seule**. ## .trigger() -
    Historique -| Version | Modifications | -| ------- | ------------- | -| v17 R4 | Ajoutées | +
    History +| Version | Changes | +| ------- | ------- | +| v17 R4 | Added |
    **.trigger( )** -| Paramètres | Type | | Description | -| ---------- | ---- |::| ------------------------------- | -| | | | Does not require any parameters | +| Parameter | Type | | Description | +| --------- | ---- |::| ------------------------------- | +| | | | Does not require any parameters | @@ -245,20 +245,20 @@ If the signal is already in the signaled state (i.e., the `signaled` property is ## .wait() -
    Historique -| Version | Modifications | -| ------- | ------------- | -| v17 R4 | Ajoutées | +
    History +| Version | Changes | +| ------- | ------- | +| v17 R4 | Added |
    **.wait**( { *timeout* : Real } ) : Boolean -| Paramètres | Type | | Description | -| ---------- | ------- | -- | ---------------------------------------------- | -| timeout | Réel | -> | Maximum waiting time for the signal in seconds | -| Résultat | Booléen | <- | State of the `.signaled` property | +| Parameter | Type | | Description | +| --------- | ------- | -- | ---------------------------------------------- | +| timeout | Real | -> | Maximum waiting time for the signal in seconds | +| Result | Booléen | <- | State of the `.signaled` property | diff --git a/website/translated_docs/fr/API/smtpTransporterClass.md b/website/translated_docs/fr/API/smtpTransporterClass.md index 9623cc5a6b20ff..90731f3c31acef 100644 --- a/website/translated_docs/fr/API/smtpTransporterClass.md +++ b/website/translated_docs/fr/API/smtpTransporterClass.md @@ -33,22 +33,22 @@ SMTP Transporter objects are instantiated with the [SMTP New transporter](#smtp- ## SMTP New transporter -
    Historique -| Version | Modifications | +
    History +| Version | Changes | | ------- | -------------------------------------------- | | v18 | New logFile property | | v17 R5 | New bodyCharset and headerCharset properties | -| v17 R4 | Ajoutées | +| v17 R4 | Added |
    **SMTP New transporter**( *server* : Object ) : 4D.SMTPTransporter -| Paramètres | Type | | Description | -| ---------- | ------------------ |:--:| --------------------------------------------------- | -| server | Objet | -> | Mail server information | -| Résultat | 4D.SMTPTransporter | <- | [SMTP transporter object](#smtp-transporter-object) | +| Parameter | Type | | Description | +| --------- | ------------------ |:--:| --------------------------------------------------- | +| server | Objet | -> | Mail server information | +| Result | 4D.SMTPTransporter | <- | [SMTP transporter object](#smtp-transporter-object) | @@ -67,17 +67,17 @@ In the *server* parameter, pass an object containing the following properties: | *server* | Default value (if omitted) | | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -------------------------- | -| [](#acceptunsecureconnection)

        | Faux | +| [](#acceptunsecureconnection)

        | False | |[](#authenticationmode)

        |the most secure authentication mode supported by the server is used| |[](#bodycharset)

        |`mail mode UTF8` (US-ASCII_UTF8_QP)| |[](#connectiontimeout)

        |30| |[](#headercharset)

        |`mail mode UTF8` (US-ASCII_UTF8_QP)| |[](#host)

        |*mandatory* |[](#keepalive)

        |True| |[](#logfile)

        |none| |**password** : Text

    User password for authentication on the server (not returned in *[SMTP transporter](#smtp-transporter-object)* object)|none| |[](#port)

        |587| |[](#sendtimeout)

        |100| |[](#user)

        |none| -#### Résultat +#### Result The function returns a [**SMTP transporter object**](#smtp-transporter-object). All returned properties are **read-only**. -#### Exemple +#### Example ```4d $server:=New object @@ -128,7 +128,7 @@ The function returns a [**SMTP transporter object**](#smtp-transporter-object). For information about SMTP status codes, please refer to [this page](https://www.usps.org/info/smtp_status.html). -#### Exemple +#### Example ```4d var $pw : Text @@ -174,10 +174,10 @@ For information about SMTP status codes, please refer to [this page](https://www ## .keepAlive -

    Historique -| Version | Modifications | -| ------- | ------------- | -| v17 R4 | Ajoutées | +
    History +| Version | Changes | +| ------- | ------- | +| v17 R4 | Added |
    @@ -210,21 +210,21 @@ The SMTP connection is automatically closed: ## .send() -
    Historique -| Version | Modifications | +
    History +| Version | Changes | | ------- | ------------------------ | | v17 R5 | Support of mime contents | -| v17 R4 | Ajoutées | +| v17 R4 | Added |
    **.send**( *mail* : Object ) : Object -| Paramètres | Type | | Description | -| ---------- | ----- |:--:| ------------------------------------------------- | -| mail | Objet | -> | [Email](emailObjectClass.md#email-object) to send | -| Résultat | Objet | <- | SMTP status | +| Parameter | Type | | Description | +| --------- | ----- |:--:| ------------------------------------------------- | +| mail | Objet | -> | [Email](emailObjectClass.md#email-object) to send | +| Result | Objet | <- | SMTP status | diff --git a/website/translated_docs/fr/API/transporter.md b/website/translated_docs/fr/API/transporter.md index 30edc38f46764e..85e0473f0086d4 100644 --- a/website/translated_docs/fr/API/transporter.md +++ b/website/translated_docs/fr/API/transporter.md @@ -1,6 +1,6 @@ --- id: transporter -title: Classe Transporter +title: Transporter Class --- ## Description @@ -9,10 +9,10 @@ title: Classe Transporter ## .acceptUnsecureConnection -
    Historique -| Version | Modifications | -| ------- | ------------- | -| v17 R4 | Ajoutées | +
    History +| Version | Changes | +| ------- | ------- | +| v17 R4 | Added |
    @@ -45,10 +45,10 @@ Available secured ports are: ## .authenticationMode -
    Historique -| Version | Modifications | -| ------- | ------------- | -| v17 R4 | Ajoutées | +
    History +| Version | Changes | +| ------- | ------- | +| v17 R4 | Added |
    @@ -62,7 +62,7 @@ By default, the most secured mode supported by the server is used. Possible values are: -| Valeur | Constantes | Commentaire | +| Value | Constants | Comment | | -------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------- | | APOP | `POP3 authentication APOP` | Authentication using APOP protocol (POP3 only) | | CRAM-MD5 | `SMTP authentication CRAM MD5`, `POP3 authentication CRAM-MD5`, `IMAP authentication CRAM MD5` | Authentication using CRAM-MD5 protocol | @@ -76,11 +76,11 @@ Possible values are: ## .bodyCharset -
    Historique -| Version | Modifications | +
    History +| Version | Changes | | ------- | ----------------------- | | v18 | Support for UTF8 base64 | -| v17 R5 | Ajoutées | +| v17 R5 | Added |
    @@ -95,9 +95,9 @@ The `.bodyCharset` property contains ## .connectionTimeOut -
    Historique -| Version | Modifications | -| ------- | ------------- | -| v17 R5 | Ajoutées | +
    History +| Version | Changes | +| ------- | ------- | +| v17 R5 | Added |
    @@ -135,10 +135,10 @@ The `.connectionTimeOut` property contains ## .headerCharset -
    Historique -| Version | Modifications | -| ------- | ------------- | -| v17 R5 | Ajoutées | +
    History +| Version | Changes | +| ------- | ------- | +| v17 R5 | Added |
    @@ -153,9 +153,9 @@ The `.headerCharset` property contains ## .host -
    Historique -| Version | Modifications | -| ------- | ------------- | -| v17 R5 | Ajoutées | +
    History +| Version | Changes | +| ------- | ------- | +| v17 R5 | Added |
    @@ -191,10 +191,10 @@ The `.host` property contains the name or ## .logFile -
    Historique -| Version | Modifications | -| ------- | ------------- | -| v17 R5 | Ajoutées | +
    History +| Version | Changes | +| ------- | ------- | +| v17 R5 | Added |
    @@ -222,10 +222,10 @@ Unlike regular log files (enabled via the `SET DATABASE PARAMETER` command), ext ## .port -
    Historique -| Version | Modifications | -| ------- | ------------- | -| v17 R4 | Ajoutées | +
    History +| Version | Changes | +| ------- | ------- | +| v17 R4 | Added |
    @@ -250,10 +250,10 @@ The `.port` property contains the port nu ## .sendTimeOut -
    Historique -| Version | Modifications | -| ------- | ------------- | -| v17 R4 | Ajoutées | +
    History +| Version | Changes | +| ------- | ------- | +| v17 R4 | Added |
    @@ -271,10 +271,10 @@ The `.sendTimeOut` property contains ## .user -
    Historique -| Version | Modifications | -| ------- | ------------- | -| v17 R4 | Ajoutées | +
    History +| Version | Changes | +| ------- | ------- | +| v17 R4 | Added |
    @@ -291,19 +291,19 @@ The `.user` property contains the user na ## .checkConnection() -
    Historique -| Version | Modifications | -| ------- | ------------- | -| v17 R4 | Ajoutées | +
    History +| Version | Changes | +| ------- | ------- | +| v17 R4 | Added |
    **.checkConnection()** : Object -| Paramètres | Type | | Description | -| ---------- | ----- |:--:| ------------------------------------------- | -| Résultat | Objet | <- | Status of the transporter object connection | +| Parameter | Type | | Description | +| --------- | ----- |:--:| ------------------------------------------- | +| Result | Objet | <- | Status of the transporter object connection | @@ -316,15 +316,15 @@ The `.checkConnection()` function -The maximum number of simultaneous sessions. Lorsque vous atteignez la limite, la session la plus ancienne est fermée (et la méthode base `On Web Close Process` est appelée) si le serveur Web doit en créer une nouvelle. The number of simultaneous sessions cannot exceed the total number of web processes (maxConcurrentProcesses property, 100 by default) +The maximum number of simultaneous sessions. Lorsque vous atteignez la limite, la session la plus ancienne est fermée (et la méthode base `On Web Close Process` est appelée) si le serveur Web doit en créer une nouvelle. Lorsque vous atteignez la limite, la session la plus ancienne est fermée (et la méthode base `On Web Close Process` est appelée) si le serveur Web doit en créer une nouvelle. diff --git a/website/translated_docs/fr/Admin/building.md b/website/translated_docs/fr/Admin/building.md index 4389dd967909c5..6fb1bd5a419c03 100644 --- a/website/translated_docs/fr/Admin/building.md +++ b/website/translated_docs/fr/Admin/building.md @@ -3,111 +3,111 @@ id: building title: Générer un package projet --- -4D Developer inclut un générateur d’application final pour créer un package de projet (version finale). Ce générateur simplifie le processus de finalisation et de déploiement des applications compilées 4D. Il gère automatiquement les fonctionnalités spécifiques de différents systèmes d'exploitation et facilite le déploiement d'applications client-serveur. +4D Developer includes a final application builder to create a project package (final build). This builder simplifies the finalization and deployment process for 4D compiled applications. It automatically handles the specific features of different operating systems and facilitates the deployment of client-server applications. -Le générateur d'applications vous permet de : +The application builder allows you to: -* Générer une structure compilée, sans code interprété, -* Générer une application autonome exécutable, c'est-à-dire fusionnée avec 4D Volume Desktop, le moteur de base de données 4D, -* Générer différentes applications à partir de la même structure compilée via un projet XML, -* Générer des applications client-serveur homogènes, -* Générer des applications client-serveur avec mise à jour automatique des composants client et serveur. -* Enregistrer vos paramètres de génération pour une utilisation ultérieure (bouton *Enregistrer les paramètres*). +* Build a compiled structure, without interpreted code, +* Build a stand-alone, double-clickable application, *i.e.*, merged with 4D Volume Desktop, the 4D database engine, +* Build different applications from the same compiled structure via an XML project, +* Build homogeneous client-server applications, +* Build client-server applications with automatic updating of client and server parts. +* Save your build settings for future use (*Save settings* button). -## Aperçu du générateur d'application +## Build application overview -Générer un package de projet peut être réalisée à l'aide de : +Building a project package can be carried out using: -- soit la commande [BUILD APPLICATION](https://doc.4d.com/4Dv18R4/4D/18-R4/BUILD-APPLICATION.301-4982852.en.html), -- soit la[ fenêtre Générateur d'application](#application-builder). +- either the [BUILD APPLICATION](https://doc.4d.com/4Dv18R4/4D/18-R4/BUILD-APPLICATION.301-4982852.en.html) command, +- or the [Build Application window](#application-builder). -Pour afficher la boîte de dialogue du générateur d'application, sélectionnez **Développement** > **Générer l'application...** dans la barre de menus. +To display the Build Application dialog, select **Design** > **Build Application...** from the menu bar. ![](assets/en/Project/buildappProj.png) -La boîte de dialogue du générateur d'application comprend plusieurs pages accessibles via des onglets : +The Build Application dialog includes several pages that can be accessed using tabs: ![](assets/en/Project/appbuilderProj.png) -La génération ne peut s'effectuer qu'une fois le projet compilé. Si vous sélectionnez cette commande sans avoir préalablement compilé le projet ou si le code compilé ne correspond pas au code interprété, une boîte de dialogue d'avertissement apparaît indiquant que le projet doit être (re)compilé. +Building can only be carried out once the project is compiled. If you select this command without having previously compiled the project, or if the compiled code does not correspond to the interpreted code, a warning dialog box appears indicating that the project must be (re)compiled. -### Paramètres du générateur d'application +### Build application settings -Chaque paramètre de générateur d'application est stocké en tant que clé XML dans le fichier de l'application nommé "buildApp.4DSettings", situé dans le dossier Settings du projet. +Each build application parameter is stored as an XML key in the application project file named "buildApp.4DSettings" XML file, located in the Settings folder of the project. -Les paramètres par défaut sont utilisés lors de la première utilisation de la boîte de dialogue du Générateur d'application. Le contenu du fichier est mis à jour, si nécessaire, lorsque vous cliquez sur **Construire** ou **Enregistrer les paramètres**. Vous pouvez définir plusieurs autres fichiers de paramètres XML pour le même projet et les utiliser à l'aide de la commande [BUILD APPLICATION](https://doc.4d.com/4Dv17R6/4D/17-R6/BUILD-APPLICATION.301-4311300.en.html). +Default parameters are used the first time the Build Application dialog box is used. The contents of the project file are updated, if necessary, when you click **Build** or **Save settings**. You can define several other XML settings file for the same project and employ them using the [BUILD APPLICATION](https://doc.4d.com/4Dv17R6/4D/17-R6/BUILD-APPLICATION.301-4311300.en.html) command. -Les clés XML fournissent des options supplémentaires à celles affichées dans la boîte de dialogue du Générateur d'application. La description de ces clés est détaillée dans le manuel [4D Clés XML BuildApplication](https://doc.4d.com/4Dv18R4/4D/18-R4/4D-XML-Keys-BuildApplication.100-5068211.en.html). +XML keys provide additional options besides those displayed in the Build Application dialog box. The description of these keys are detailed in the [4D XML Keys BuildApplication](https://doc.4d.com/4Dv18R4/4D/18-R4/4D-XML-Keys-BuildApplication.100-5068211.en.html) manual. -### Fichier d'historique +### Log file -Lorsqu'une application est créée, 4D génère un fichier journal nommé *BuildApp.log.xml* dans le dossier **Logs** du projet. Le fichier d'historique stocke les informations suivantes pour chaque génération : +When an application is built, 4D generates a log file named *BuildApp.log.xml* in the **Logs** folder of the project. The log file stores the following information for each build: -- Le début et la fin de la génération des cibles, -- Le nom et le chemin d'accès complet des fichiers générés, -- La date et l'heure de la génération, -- Toutes les erreurs qui se sont produites, -- Tout problème de signature (par exemple, un plug-in non signé). +- The start and end of building of targets, +- The name and full access path of the files generated, +- The date and time of the build, +- Any errors that occurred, +- Any signing issues (e.g. a non-signed plug-in). -La vérification de ce fichier peut vous aider à gagner du temps lors des prochaines étapes de déploiement, si vous avez l'intention, par exemple, de notariser votre application. +Checking this file may help you saving time during the subsequent deployment steps, for example if you intend to notarize your application. -> Utilisez la commande `Get 4D file (Build application log file)` pour obtenir l'emplacement du fichier journal. +> Use the `Get 4D file(Build application log file)` command to get the log file location. -## Nom de l'application et dossier de destination +## Application name and destination folder ![](assets/en/Project/buidappstructureProj.png) -Entrez le nom de l'application dans **Nom de l'application**. +Enter the name of the application in **Application Name**. -Spécifiez le dossier de l'application générée dans le**Dossier de destination**. Si le dossier spécifié n'existe pas déjà, 4D vous créera un dossier *Build*. +Specify the folder for the built application in **Destination Folder**. If the specified folder does not already exist, 4D will create a *Build* folder for you. -## Page de structure compilée +## Compiled structure page -Cet onglet vous permet de générer un fichier de structure compilé standard et/ou un composant compilé : +This tab allows you to build a standard compiled structure file and/or a compiled component: ![](assets/en/Project/appbuilderProj.png) -### Générer une structure compilée +### Build compiled structure -Génère une application contenant uniquement du code compilé. +Builds an application containing only compiled code. -Cette fonctionnalité crée un fichier *.4dz* dans un dossier *Compiled Database/\*. Par exemple, si vous avez nommé votre application «MyProject», 4D créera : +This feature creates a *.4dz* file within a *Compiled Database/\* folder. For example, if you have named your application “MyProject”, 4D will create: *\/Compiled Database/MyProject/MyProject.4dz* -> Un fichier .4dz est essentiellement une version compressée du dossier du projet. Les fichiers .4dz peuvent être utilisés par 4D Server, la licence 4D Volume (applications fusionnées) et 4D Developer (4D). La taille compacte et optimisée des fichiers .4dz facilite le déploiement des packages de projet. +> A .4dz file is essentially a zipped (packed) version of the project folder. .4dz files can be used by 4D Server, 4D Volume license (merged applications), and 4D Developer (4D). The compact and optimized size of .4dz files makes project packages easy to deploy. -#### Inclure les dossiers associés +#### Include related folders -Lorsque vous cochez cette option, tous les dossiers liés au projet sont recopiés dans le dossier Build en tant que dossiers *Components* et *Resources*. Pour plus d'informations sur ces dossiers, veuillez vous reporter à la [description de l'architecture du projet](Project/architecture.md). +When you check this option, any folders related to the project are copied into the Build folder as *Components* and *Resources* folders. For more information about these folders, refer to the [description of project architecture](Project/architecture.md). -### Générer un composant +### Build component -Génère un composant compilé à partir de la structure. +Builds a compiled component from the structure. -Un composant est un fichier de structure 4D standard dans lequel des fonctionnalités spécifiques ont été développées. Une fois le composant configuré et installé dans un autre projet 4D (le projet d'application hôte), ses fonctionnalités sont accessibles depuis le projet hôte. +A component is a standard 4D project in which specific functionalities have been developed. Once the component has been configured and installed in another 4D project (the host application project), its functionalities are accessible from the host project. -Si vous avez nommé votre application *Moncomposant*, 4D créera un dossier *Component* contenant le dossier *MyComponent.4dbase* : +If you have named your application, *MyComponent*, 4D will create a *Components* folder containing *MyComponent.4dbase* folder: *\/Components/MyComponent.4dbase/MyComponent.4DZ*. -Le dossier *MyComponent.4dbase* contient : -- fichier *MyComponent.4DZ* -- Un dossier *Resources* - toutes les ressources associées sont automatiquement copiées dans ce dossier. Les autres composants et/ou dossiers de plugins ne sont pas copiés (un composant ne peut pas utiliser de plug-ins ou d'autres composants). +The *MyComponent.4dbase* folder contains: +- *MyComponent.4DZ* file +- A *Resources* folder - any associated Resources are automatically copied into this folder. Any other components and/or plugins folders are not copied (a component cannot use plug-ins or other components). -## Page Application +## Application page This tab allows you can build a stand-alone, single-user version of your application: @@ -123,43 +123,43 @@ The following elements are required for the build: On Windows, this feature creates an executable file (.exe). On macOS, it handles the creation of software packages. -Le principe consiste à fusionner le fichier 4D Volume Desktop avec votre fichier de structure compilé. Les fonctionnalités offertes par le fichier 4D Volume Desktop sont liées à l’offre commerciale à laquelle vous avez souscrite. Pour plus d’informations sur ce point, reportez-vous à la documentation commerciale et au site Internet de [4D Sas (http://www.4d.com/)](http://www.4d.com/). +The principle consists of merging a compiled structure file with 4D Volume Desktop. The functionality provided by the 4D Volume Desktop file is linked with the product offer to which you have subscribed. For more information about this point, refer to the sales documentation and to the [4D Store](http://www.4d.com/). -Vous pouvez définir un fichier de données par défaut ou permettre à l'utilisateur de créer et d'utiliser son propre fichier de données (cf. section [Gestion du fichier de données dans les applications finales](https://doc.4d.com/4Dv17R6/4D/17-R6/Data-file-management-in-final-applications.300-4354729.en.html)). +You can define a default data file or allow users to create and use their own data file (see the [Data file management in final applications](https://doc.4d.com/4Dv17R6/4D/17-R6/Data-file-management-in-final-applications.300-4354729.en.html) section). -Il est possible d'automatiser la mise à jour des applications monopostes fusionnées moyennant l'utilisation d'une séquence de commandes du langage (cf. section [Mise à jour auto des applications serveur ou monopostes](https://doc.4d.com/4Dv17R6/4D/17-R6/Automatic-updating-of-server-or-single-user-applications.300-4354721.en.html)). +It is possible to automate the update of merged single-user applications by means of a sequence of language commands (see [Automatic updating of server or single-user applications](https://doc.4d.com/4Dv17R6/4D/17-R6/Automatic-updating-of-server-or-single-user-applications.300-4354721.en.html). #### 4D Volume Desktop Location In order to build a stand-alone application, you must first designate the folder containing the 4D Volume Desktop file: -* *sous Windows*, le dossier contient notamment les fichiers 4D Volume Desktop.4DE, 4D Volume Desktop.RSR ainsi que différents fichiers et dossiers nécessaires à son fonctionnement. Ces éléments doivent être placés au premier niveau du dossier sélectionné. -* *sous macOS*, 4D Volume Desktop est fourni sous la forme d’un progiciel structuré contenant divers fichiers et dossiers génériques. +* *Windows* - the folder contains the 4D Volume Desktop.4DE, 4D Volume Desktop.RSR, as well as various files and folders required for its operation. These items must be placed at the same level as the selected folder. +* *macOS* - 4D Volume Desktop is provided in the form of a structured software package containing various generic files and folders. -Pour sélectionner le dossier de 4D Volume Desktop, cliquez sur le bouton **[...]**. Une boîte de dialogue vous permettant de désigner le dossier (Windows) ou le progiciel (macOS) de 4D Volume Desktop apparaît. +To select the 4D Volume Desktop folder, click on the **[...]** button. A dialog box appears allowing you to designate the 4D Volume Desktop folder (Windows) or package (macOS). -Une fois le dossier sélectionné, son chemin d’accès complet est affiché et, s’il contient effectivement 4D Volume Desktop, l’option de génération d’application exécutable est activée. +Once the folder is selected, its complete pathname is displayed and, if it actually contains 4D Volume Desktop, the option for building an executable application is activated. -> Le numéro de version de 4D Volume Desktop doit correspondre à celui du 4D Developer Edition. Par exemple, si vous utilisez 4D Developer v18, vous devez sélectionner un 4D Volume Desktop v18. +> The 4D Volume Desktop version number must match the 4D Developer Edition version number. For example, if you use 4D Developer v18, you must select a 4D Volume Desktop v18. #### Data linking mode This option lets you choose the linking mode between the merged application and the local data file. Two data linking modes are available: -* **By application name** (default) - The 4D application automatically opens the most recently opened data file corresponding to the structure file. Cela vous permet de déplacer librement le dossier de l'application sur le disque. This option should generally be used for merged applications, unless you specifically need to duplicate your application. +* **By application name** (default) - The 4D application automatically opens the most recently opened data file corresponding to the structure file. This allows you to move the application package freely on the disk. This option should generally be used for merged applications, unless you specifically need to duplicate your application. -* **By application path** - The merged 4D application will parse the application's *lastDataPath.xml* file and try to open the data file with an "executablePath" attribute that matches the application's full path. Si cette clé est trouvée, son fichier de données correspondant (défini via son attribut "dataFilePath") est ouvert. Otherwise, the last opened data file is opened (default mode). +* **By application path** - The merged 4D application will parse the application's *lastDataPath.xml* file and try to open the data file with an "executablePath" attribute that matches the application's full path. If such an entry is found, its corresponding data file (defined through its "dataFilePath" attribute) is opened. Otherwise, the last opened data file is opened (default mode). For more information about the data linking mode, refer to the [Last data file opened](#last-data-file-opened) section. -#### Fichiers générés +#### Generated files When you click on the **Build** button, 4D automatically creates a **Final Application** folder in the specified **Destination Folder**. Inside the Final Application folder is a subfolder with the name of the specified application in it. If you have specified "MyProject" as the name of the application, you will find the following files in this subfolder (aka MyProject): -* *Sous Windows* +* *Windows* * MyProject.exe - Your executable and a MyProject.rsr (the application resources) * 4D Extensions folder, Resources folder, various libraries (DLL), Native Components folder, SASL Plugins folder - Files necessary for the operation of the application * Database folder - Includes a Resources folder and MyProject.4DZ file. They make up the compiled structure of the project as well as the project Resources folder. **Note**: This folder also contains the *Default Data* folder, if it has been defined (see [Data file management in final applications](#data-file-management-in-final-applicatons). @@ -170,12 +170,12 @@ If you have specified "MyProject" as the name of the application, you will find All these items must be kept in the same folder in order for the executable to operate. * *macOS* - - A software package named MyProject.app containing your application and all the items necessary for its operation, including the plug-ins, components and licenses. Pour plus d’informations sur l’intégration des composants et des plug-ins, reportez-vous à la section [Page Plugins et composants](#plugins-and-components). Pour plus d’informations sur l’intégration des licences, reportez-vous à la [Page Licences & Certificat](#licenses-and-certificate). **Note**: In macOS, the [Application file](https://doc.4d.com/4Dv18R4/4D/18-R4/Application-file.301-4982855.en.html) command of the 4D language returns the pathname of the ApplicationName file (located in the Contents:macOS folder of the software package) and not that of the .comp file (Contents:Resources folder of the software package). + - A software package named MyProject.app containing your application and all the items necessary for its operation, including the plug-ins, components and licenses. For more information about integrating plug-ins and components, refer to the [Plugins and components](#plugins-and-components) section. For more information about integrating licenses, refer to the [Licenses & Certificate](#licenses-and-certificate) section. **Note**: In macOS, the [Application file](https://doc.4d.com/4Dv18R4/4D/18-R4/Application-file.301-4982855.en.html) command of the 4D language returns the pathname of the ApplicationName file (located in the Contents:macOS folder of the software package) and not that of the .comp file (Contents:Resources folder of the software package). #### Customizing 4D Volume Desktop folder -When building a stand-alone application, 4D copies the contents of the 4D Volume Desktop folder into Destination folder > *Final Application* folder. Vous pouvez donc parfaitement personnaliser le contenu du dossier 4D Volume Desktop d’origine en fonction de vos besoins. You can, for example: +When building a stand-alone application, 4D copies the contents of the 4D Volume Desktop folder into Destination folder > *Final Application* folder. You're then able to customize the contents of the original 4D Volume Desktop folder according to your needs. You can, for example: * Install a 4D Volume Desktop version corresponding to a specific language; * Add a custom *PlugIns* folder; @@ -199,13 +199,13 @@ Items must be installed: -## Page Client/Serveur +## Client/Server page On this tab, you can build customized client-server applications that are homogenous, cross-platform and with an automatic update option. ![](assets/en/Project/buildappCSProj.png) -### Qu'est-ce qu'une application Client/Serveur ? +### What is a Client/Server application? A client/server application comes from the combination of three items: @@ -218,7 +218,7 @@ Once built, a client/server application is composed of two customized parts: the Also, the client/server application is customized and its handling simplified: - To launch the server portion, the user simply double-clicks on the server application. The project file does not need to be selected. -- To launch the client portion, the user simply double-clicks the client application, which connects directly to the server application. You do not need to choose a server in a connection dialog box. Le client cible le serveur soit via son nom, lorsque client et serveur sont sur le même sous-réseau, soit via son adresse IP, à définir via la clé XML `IPAddress` dans le fichier buildapp.4DSettings. Si la connexion échoue, [des mécanismes alternatifs spécifiques peuvent être mis en place](#management-of-client-connections). Il est également possible de “forcer” l’affichage de la boîte de dialogue de connexion standard en maintenant la touche **Option** (macOS) ou **Alt** (Windows) enfoncée lors du lancement de l’application cliente. Seule la partie cliente peut se connecter à la partie serveur correspondante. If a user tries to connect to the server portion using a standard 4D application, an error message is returned and connection is impossible. +- To launch the client portion, the user simply double-clicks the client application, which connects directly to the server application. You do not need to choose a server in a connection dialog box. The client targets the server either using its name, when the client and server are on the same sub-network, or using its IP address, which is set using the `IPAddress` XML key in the buildapp.4DSettings file. If the connection fails, [specific alternative mechanisms can be implemented](#management-of-client-connections). You can "force" the display of the standard connection dialog box by holding down the **Option** (macOS) or **Alt** (Windows) key while launching the client application. Only the client portion can connect to the corresponding server portion. If a user tries to connect to the server portion using a standard 4D application, an error message is returned and connection is impossible. - A client/server application can be set so that the client portion [can be updated automatically over the network](#copy-of-client-applications-in-the-server-application). - It is also possible to automate the update of the server part through the use of a sequence of language commands ([SET UPDATE FOLDER](https://doc.4d.com/4Dv17R6/4D/17-R6/SET-UPDATE-FOLDER.301-4311308.en.html) and [RESTART 4D](https://doc.4d.com/4Dv17R6/4D/17-R6/RESTART-4D.301-4311311.en.html)). @@ -226,7 +226,7 @@ Also, the client/server application is customized and its handling simplified: ### Build server application -Check this option to generate the server part of your application during the building phase. Vous devez désigner sur votre disque l’emplacement de l’application 4D Server à utiliser. Ce 4D Server doit correspondre à la plate-forme courante (qui sera également la plate-forme de l’application du serveur). +Check this option to generate the server part of your application during the building phase. You must designate the location on your disk of the 4D Server application to be used. This 4D Server must correspond to the current platform (which will also be the platform of the server application). #### 4D Server location @@ -234,19 +234,15 @@ Click on the **[...]** button and use the *Browse for folder* dialog box to loca #### Current version -Used to indicate the current version number for the application generated. Vous pourrez par la suite accepter ou refuser les connexions des applications clientes en fonction de leur numéro de version. The interval of compatibility for client and server applications is set using specific [XML keys](#build-application-settings)). - -#### Data linking mode - -This option lets you choose the linking mode between the merged application and the local data file. +Used to indicate the current version number for the application generated. You may then accept or reject connections by client applications according to their version number. The interval of compatibility for client and server applications is set using specific [XML keys](#build-application-settings)). #### Data linking mode This option lets you choose the linking mode between the merged application and the local data file. Two data linking modes are available: -* **By application name** (default) - The 4D application automatically opens the most recently opened data file corresponding to the structure file. Cela vous permet de déplacer librement le dossier de l'application sur le disque. This option should generally be used for merged applications, unless you specifically need to duplicate your application. +* **By application name** (default) - The 4D application automatically opens the most recently opened data file corresponding to the structure file. This allows you to move the application package freely on the disk. This option should generally be used for merged applications, unless you specifically need to duplicate your application. -* **By application path** - The merged 4D application will parse the application's *lastDataPath.xml* file and try to open the data file with an "executablePath" attribute that matches the application's full path. Si cette clé est trouvée, son fichier de données correspondant (défini via son attribut "dataFilePath") est ouvert. Otherwise, the last opened data file is opened (default mode). +* **By application path** - The merged 4D application will parse the application's *lastDataPath.xml* file and try to open the data file with an "executablePath" attribute that matches the application's full path. If such an entry is found, its corresponding data file (defined through its "dataFilePath" attribute) is opened. Otherwise, the last opened data file is opened (default mode). For more information about the data linking mode, refer to the [Last data file opened](#last-data-file-opened) section. @@ -257,11 +253,11 @@ Checking this option generates the client part of your application during the bu #### 4D Volume Desktop -You must designate the location on your disk of the 4D Volume Desktop application to be used. Ce 4D Volume Desktop doit correspondre à la plate-forme courante (qui sera également la plate-forme de l’application cliente). Si vous souhaitez générer une version de l’application cliente pour la plate-forme “concurrente”, vous devez répéter l'opération en utilisant une application 4D tournant sur cette plate-forme. Cette étape est nécessaire uniquement pour la version initiale de l'application cliente car les mises à jour suivantes pourront être gérées directement depuis une seule plate-forme via le mécanisme des mises à jour automatiques. For more information about this point, see [Customizing 4D Server and/or 4D Client folders](#customizing-4d-server-and-or-4d-client-folders). +You must designate the location on your disk of the 4D Volume Desktop application to be used. This 4D Volume Desktop must correspond to the current platform (which will also be the platform of the client application). If you want to build a client application for a “concurrent” platform, you must carry out an additional build operation using a 4D application running on that platform. This is only necessary for the initial version of the client application since subsequent updates can be handled directly on the same platform using the automatic update mechanism. For more information about this point, see [Customizing 4D Server and/or 4D Client folders](#customizing-4d-server-and-or-4d-client-folders). -> Le numéro de version de 4D Volume Desktop doit correspondre à celui du 4D Developer Edition. Par exemple, si vous utilisez 4D Developer v18, vous devez sélectionner un 4D Volume Desktop v18. +> The 4D Volume Desktop version number must match the 4D Developer Edition version number. For example, if you use 4D Developer v18, you must select a 4D Volume Desktop v18. -If you want the client application to connect to the server using a specific address (other than the server name published on the sub-network), you must use the `IPAddress` XML key in the buildapp.4DSettings file. Pour plus d'informations sur ce fichier, reportez-vous à la description de la commande`BUILD APPLICATION`. Vous pouvez également mettre en place des mécanismes spécifiques en cas d'échec de la connexion. The different scenarios proposed are described in the [Management of connections by client applications](#management-of-client-connections) paragraph. +If you want the client application to connect to the server using a specific address (other than the server name published on the sub-network), you must use the `IPAddress` XML key in the buildapp.4DSettings file. For more information about this file, refer to the description of the `BUILD APPLICATION` command. You can also implement specific mechanisms in the event of a connection failure. The different scenarios proposed are described in the [Management of connections by client applications](#management-of-client-connections) paragraph. #### Copy of client applications in the server application @@ -286,16 +282,14 @@ To trigger client application update notifications, simply replace the old versi On the client side, when the “old” client application tries to connect to the updated server application, a dialog box is displayed on the client machine, indicating that a new version is available. The user can either update their version or cancel the dialog box. -* If the user clicks **OK**, the new version is downloaded to the client machine over the network. A l’issue du téléchargement, l’ancienne application client quitte, la nouvelle est lancée et se connecte au serveur. The old version of the application is then placed in the machine’s recycle bin. +* If the user clicks **OK**, the new version is downloaded to the client machine over the network. Once the download is complete, the old client application is closed and the new version is launched and connects to the server. The old version of the application is then placed in the machine’s recycle bin. * If the user clicks **Cancel**, the update is cancelled; if the old version of the client application is not in the range of versions accepted by the server (please refer to the following paragraph), the application is closed and connection is impossible. Otherwise (by default), the connection is established. #### Forcing automatic updates In some cases, you may want to prevent client applications from being able to cancel the update download. For example, if you used a new version of the 4D Server source application, the new version of the client application must absolutely be installed on each client machine. -To force the update, simply exclude the current version number of client applications (X-1 and earlier) in the version number range compatible with the server application. Dans ce cas, le mécanisme de mise à jour n’autorisera pas la connexion des applications clientes non mises à jour. For example, if the new version of the client-server application is 6, you can stipulate that any client application with a version number lower than 6 will not be allowed to connect. - -The [current version number](build-server-application) is set on the Client/Server page of the Build Application dialog box. +To force the update, simply exclude the current version number of client applications (X-1 and earlier) in the version number range compatible with the server application. In this case, the update mechanism will not allow non-updated client applications to connect. For example, if the new version of the client-server application is 6, you can stipulate that any client application with a version number lower than 6 will not be allowed to connect. The [current version number](#current_version) is set on the Client/Server page of the Build Application dialog box. The intervals of authorized numbers are set in the application project using specific [XML keys](#build-application-settings). @@ -310,23 +304,21 @@ There are many possible causes for this error. When you get this message, it is * **Read/write privileges** - On the client machine, check that the current user has write access rights for the client application update. -### Fichiers générés +### Generated files Once a client/server application is built, you will find a new folder in the destination folder named **Client Server executable**. This folder contains two subfolders, *\Client* and *\Server*. > These folders are not generated if an error occurs. In this case, open the [log file](#log-file) in order to find out the cause of the error. -The *\Client* folder contains the client portion of the application corresponding to the execution platform of the application builder. Ce dossier doit être installé sur chaque poste client. Le dossier *\Server* contient la partie serveur de l'application. +The *\Client* folder contains the client portion of the application corresponding to the execution platform of the application builder. This folder must be installed on each client machine. The *\Server* folder contains the server portion of the application. The contents of these folders vary depending on the current platform: * *Windows* - Each folder contains the application executable file, named *\Client.exe* for the client part and *\Server.exe* for the server part as well as the corresponding .rsr files. The folders also contain various files and folders necessary for the applications to work and customized items that may be in the original 4D Volume Desktop and 4D Server folders. -* *macOS* - Each folder contains only the application package, named \ Client for the client part and \ Server for the server part. Chaque progiciel contient tous les éléments nécessaires à son fonctionnement. Under macOS, launch a package by double-clicking it. +* *macOS* - Each folder contains only the application package, named \ Client for the client part and \ Server for the server part. Each package contains all the necessary items for the application to work. Under macOS, launch a package by double-clicking it. > The macOS packages built contain the same items as the Windows subfolders. You can display their contents (**Control+click** on the icon) in order to be able to modify them. -If you checked the “Allow automatic update of client application” option, an additional subfolder called *Upgrade4DClient* is added in the *\Server* folder/package.
  • - -If you checked the “Allow automatic update of client application” option, an additional subfolder called *Upgrade4DClient* is added in the *\Server* folder/package. Ce sous-dossier contient l’application cliente au format macOS et/ou Windows sous forme de fichier compressé. This file is used during the automatic client application update. +If you checked the “Allow automatic update of client application” option, an additional subfolder called *Upgrade4DClient* is added in the *\Server* folder/package. This subfolder contains the client application in macOS and/or Windows format as a compressed file. This file is used during the automatic client application update. #### Location of Web files @@ -371,35 +363,35 @@ The basic scenario is: Automatic update 4D Server features ([Current version](#current-version) number, `SET UPDATE FOLDER` command...) work with single-user application as with standard remote application. At connection, the single-user application compares its `CurrentVers` key to the 4D Server version range. If outside the range, the updated client application is downloaded from the server and the Updater launches the local update process. -### Personnalisation des noms de dossier de cache client et/ou serveur +### Customizing client and/or server cache folder names -Les dossiers de cache client et serveur sont utilisés pour stocker des éléments partagés tels que des ressources ou des composants. Ils sont nécessaires pour gérer les échanges entre le serveur et les clients distants. Les applications client/serveur utilisent les chemins d'accès par défaut pour les dossiers de cache système client et serveur. +Client and server cache folders are used to store shared elements such as resources or components. They are required to manage exchanges between server and remote clients. Client/server applications use default pathnames for both client and server system cache folders. -Dans certains cas spécifiques, vous devrez personnaliser les noms de ces dossiers pour implémenter des architectures spécifiques (voir ci-dessous). 4D vous fournit les clés `ClientServerSystemFolderName` et `ServerStructureFolderName` à définir dans le fichier de paramètres *buildApp*. +In some specific cases, you might need to customize the names of these folders to implement specific architectures (see below). 4D provides you with the `ClientServerSystemFolderName` and `ServerStructureFolderName` keys to be set in the *buildApp* settings file. -#### Dossier de cache client +#### Client cache folder -La personnalisation du nom du dossier de cache côté client peut être utile lorsque votre application cliente est utilisée pour se connecter à plusieurs serveurs fusionnés qui sont similaires mais qui utilisent des ensembles de données différents. Dans ce cas, pour enregistrer plusieurs téléchargements inutiles de ressources locales identiques, vous pouvez utiliser le même dossier de cache local personnalisé. +Customizing the client-side cache folder name can be useful when your client application is used to connect to several merged servers which are similar but use different data sets. In this case, to save multiple unnecessary downloads of identical local resources, you can use the same custom local cache folder. -- Configuration par défaut (*pour chaque connexion à un serveur, un dossier cache spécifique est téléchargé/mis à jour*) : +- Default configuration (*for each connection to a server, a specific cache folder is downloaded/updated*): ![](assets/en/Admin/cachea.png) -- À l'aide de la clé `ClientServerSystemFolderName` (*un seul dossier de cache est utilisé pour tous les serveurs*) : +- Using the `ClientServerSystemFolderName` key (*a single cache folder is used for all servers*): ![](assets/en/Admin/cacheb.png) -#### Dossier de cache du serveur +#### Server cache folder -La personnalisation du nom du dossier de cache côté serveur est utile lorsque vous exécutez plusieurs applications serveur identiques créées avec différentes versions de 4D sur le même ordinateur. Si vous souhaitez que chaque serveur utilise son propre ensemble de ressources, vous devez personnaliser le dossier de cache du serveur. +Customizing the server-side cache folder name is useful when you run several identical server applications built with different 4D versions on the same computer. If you want each server to use its own set of resources, you need to customize the server cache folder. -- Configuration par défaut (*les mêmes applications serveur partagent le même dossier de cache*) : +- Default configuration (*same server applications share the same cache folder*): ![](assets/en/Admin/cacheServera.png) -- À l'aide de la clé `ServerStructureFolderName` (*un dossier de cache dédié est utilisé pour chaque application serveur*) : +- Using the `ServerStructureFolderName` key (*a dedicated cache folder is used for each server application*): ![](assets/en/Admin/cacheServerb.png) @@ -414,7 +406,7 @@ The page lists the elements loaded by the current 4D application: ![](assets/en/Project/buildapppluginsProj.png) -* **Active** column - Indicates that the items will be integrated into the application package built. Par défaut, tous les éléments sont inclus. To exclude a plug-in or a component, deselect the check box next to it. +* **Active** column - Indicates that the items will be integrated into the application package built. All the items are checked by default. To exclude a plug-in or a component, deselect the check box next to it. * **Plugins and components** column - Displays the name of the plug-in/component. @@ -443,7 +435,7 @@ The Licences & Certificate page can be used to: ### Licenses -This tab displays the list of available deployment licenses that you can integrate into your application. Par défaut, la liste est vide. Vous devez explicitement ajouter votre licence *4D Developer Professional* ainsi que chaque licence* 4D Desktop Volume* liée à utiliser dans l’application générée. You can add another 4D Developer Professional number and its associated licenses other than the one currently being used. +This tab displays the list of available deployment licenses that you can integrate into your application. By default, the list is empty. You must explicitly add your *4D Developer Professional* license as well as each *4D Desktop Volume* license to be used in the application built. You can add another 4D Developer Professional number and its associated licenses other than the one currently being used. To remove or add a license, use the **[+]** and **[-]** buttons at the bottom of the window. @@ -483,7 +475,7 @@ This option is displayed under both Windows and macOS, but it is only taken into To obtain a developer certificate from Apple, Inc., you can use the commands of the Keychain Access menu or go here: [http://developer.apple.com/library/mac/#documentation/Security/Conceptual/CodeSigningGuide/Procedures/Procedures.html](http://developer.apple.com/library/mac/#documentation/Security/Conceptual/CodeSigningGuide/Procedures/Procedures.html). > This certificate requires the presence of the Apple codesign utility, which is provided by default and usually located in the “/usr/bin/” folder. If an error occurs, make sure that this utility is present on your disk. -* **Generate self-signed certificate** - runs the "Certificate Assistant" that allows you to generate a self-signed certificate. Si vous ne disposez pas d'un certificat de développeur Apple, vous devez fournir un certificat auto-signé. Avec ce certificat, aucun message d'alerte ne s'affiche si l'application est déployée en interne. Si l'application est déployée en externe (c'est-à-dire via http ou e-mail), au lancement, macOS affiche un message d'alerte indiquant que le développeur de l'application n'est pas identifié. L'utilisateur peut "forcer" l'ouverture de l'application.

    In the "Certificate Assistant", be sure to select the appropriate options: ![](assets/en/Admin/Cert1.png) ![](assets/en/Admin/Cert2.png) +* **Generate self-signed certificate** - runs the "Certificate Assistant" that allows you to generate a self-signed certificate. If you do not have an Apple developer certificate, you need to provide a self-signed certificate. With this certificate, no alert message is displayed if the application is deployed internally. If the application is deployed externally (i.e. through http or email), at launch macOS displays an alert message that the application's developer is unidentified. The user can "force" the opening of the application.

    In the "Certificate Assistant", be sure to select the appropriate options: ![](assets/en/Admin/Cert1.png) ![](assets/en/Admin/Cert2.png) > 4D recommends to subscribe to the Apple Developer Program to get access to Developer Certificates that are necessary to notarize applications (see below). @@ -567,7 +559,7 @@ With your compiled applications, 4D automatically uses the last data file opened This may be unsuitable if you want to duplicate a merged application intended to use different data files. Duplicated applications actually share the application's user preferences folder and thus, always use the same data file -- even if the data file is renamed, because the last file used for the application is opened. -4D therefore lets you link the data file path to the application path. Dans ce cas, le fichier de données sera relié via un chemin spécifique et ne sera plus simplement le dernier fichier utilisé. You therefore link your data **by application path**. +4D therefore lets you link the data file path to the application path. In this case, the data file will be linked using a specific path and will not just be the last file opened. You therefore link your data **by application path**. This mode allows you to duplicate your merged applications without breaking the link to the data file. However, with this option, if the application package is moved on the disk, the user will be prompted for a data file, since the application path will no longer match the "executablePath" attribute (after a user has selected a data file, the *lastDataPath.xml* file is updated accordingly). @@ -576,7 +568,7 @@ This mode allows you to duplicate your merged applications without breaking the *Duplication when data linked by application path:* ![](assets/en/Project/datalinking2.png) -You can select the data linking mode during the build application process. Vous pouvez : +You can select the data linking mode during the build application process. You can either: - Use the [Application page](#application) or [Client/Server page](#client-server) of the Build Application dialog box. - Use the **LastDataPathLookup** XML key (single-user application or server application). @@ -584,7 +576,7 @@ You can select the data linking mode during the build application process. Vous ### Defining a default data folder -4D allows you to define a default data file at the application building stage. Au premier lancement de l'application, en l'absence de fichier local (cf. [séquence de lancement décrite ci-dessus](#opening-the-data-file)), le fichier de données par défaut est automatiquement ouvert silencieusement en mode lecture seule par 4D. Cela vous donne un meilleur contrôle sur la création et/ou l'ouverture des fichiers de données lors du premier lancement d'une application fusionnée. +4D allows you to define a default data file at the application building stage. When the application is launched for the first time, if no local data file is found (see [opening sequence described above](#opening-the-data-file)), the default data file is automatically opened silently in read-only mode by 4D. This gives you better control over data file creation and/or opening when launching a merged application for the first time. More specifically, the following cases are covered: @@ -594,7 +586,7 @@ More specifically, the following cases are covered: To define and use a default data file: -- You provide a default data file (named "Default.4DD") and store it in a default folder (named "Default Data") inside the application project folder. This file must be provided along with all other necessary files, depending on the project configuration: index (.4DIndx), external Blobs, journal, etc. Il est de votre responsabilité de livrer un fichier de données par défaut valide. Note however that since a default data file is opened in read-only mode, it is recommended to uncheck the "Use Log File" option in the original structure file before creating the data file. +- You provide a default data file (named "Default.4DD") and store it in a default folder (named "Default Data") inside the application project folder. This file must be provided along with all other necessary files, depending on the project configuration: index (.4DIndx), external Blobs, journal, etc. It is your responsibility to provide a valid default data file. Note however that since a default data file is opened in read-only mode, it is recommended to uncheck the "Use Log File" option in the original structure file before creating the data file. - When the application is built, the default data folder is integrated into the merged application. All files within this default data folder are also embedded. The following graphic illustrates this feature: @@ -629,9 +621,9 @@ The last used and validated server path is automatically saved in a file named " userPrefs:=Get 4D folder(Active 4D Folder) ``` -This mechanism addresses the case where the primary targeted server is temporary unavailable for some reason (maintenance mode for example). Lorsque ce cas se produit pour la première fois, la boîte de dialogue de sélection de serveur est affichée (si elle est autorisée, cf. ci-dessous) et l'utilisateur peut manuellement sélectionner un serveur alternatif, dont le chemin est alors sauvegardé si la connexion est établie et validée. Any subsequent unavailability would be handled automatically through the "lastServer.xml" path information. +This mechanism addresses the case where the primary targeted server is temporary unavailable for some reason (maintenance mode for example). When this case occurs for the first time, the server selection dialog box is displayed (if allowed, see below) and the user can manually select an alternate server, whose path is then saved if the connection is successful. Any subsequent unavailability would be handled automatically through the "lastServer.xml" path information. -> - When client applications cannot permanently benefit from the discovery service, for example because of the network configuration, it is recommended that the developer provide a host name at build time using the [IPAddress](https://doc.4d.com/4Dv17R6/4D/17-R6/IPAddress.300-4465710.en.html) key in the "BuildApp.4DSettings" file. Le mécanisme de sauvegarde du chemin du dernier serveur est conçu pour les cas d'indisponibilité temporaire uniquement. +> - When client applications cannot permanently benefit from the discovery service, for example because of the network configuration, it is recommended that the developer provide a host name at build time using the [IPAddress](https://doc.4d.com/4Dv17R6/4D/17-R6/IPAddress.300-4465710.en.html) key in the "BuildApp.4DSettings" file. The mechanism addresses cases of temporary unavailability. > - Pressing the **Alt/Option** key at startup to display the server selection dialog box is still supported in all cases. @@ -640,7 +632,7 @@ This mechanism addresses the case where the primary targeted server is temporary You can choose whether or not to display the standard server selection dialog box on merged client applications when the server cannot be reached. The configuration depends on the value of the [ServerSelectionAllowed](https://doc.4d.com/4Dv17R6/4D/17-R6/ServerSelectionAllowed.300-4465714.en.html) XML key on the machine where the application was built: -- **Display of an error message with no access possible to the server selection dialog box**. Fonctionnement par défaut. The application can only quit. +- **Display of an error message with no access possible to the server selection dialog box**. Default operation. The application can only quit. `ServerSelectionAllowed`: **False** or key omitted ![](assets/en/Project/connect1.png) - **Display of an error message with access to the server selection dialog box possible**. The user can access the server selection window by clicking on the **Select...** button. diff --git a/website/translated_docs/fr/Admin/licenses.md b/website/translated_docs/fr/Admin/licenses.md index bd4f6f0010e648..1b734fe7a246a4 100644 --- a/website/translated_docs/fr/Admin/licenses.md +++ b/website/translated_docs/fr/Admin/licenses.md @@ -3,146 +3,146 @@ id: licenses title: Gestion des licences 4D --- -Une fois installés sur votre disque, les produits 4D doivent être activés pour que vous puissiez les utiliser. Habituellement, l'activation est automatique si vous [vous connectez à l'aide de votre compte 4D](GettingStarted/Installation.md) dans l'assistant de bienvenue. +Once installed on your disk, you must activate your 4D products in order to be able to use them. Usually, the activation is automatic if you [sign in using your 4D account](GettingStarted/Installation.md) in the Welcome Wizard. -Cependant, dans des cas spécifiques, vous pourriez avoir besoin d'activer vos licences manuellement, si par exemple : +However, in specific cases you could need to activate your licenses manually, for example if: -- votre configuration ne permet pas l'activation automatique, -- vous avez acheté des licences supplémentaires. +- your configuration does not allow the automatic activation, +- you have purchased additional licenses. -Aucune activation n’est requise pour les usages suivants : +No activation is required for the following uses: -- 4D utilisé en mode distant (connexion à un 4D Server) -- 4D utilisé en mode local avec un projet d'application interprété sans accès au mode Développement. +- 4D used in remote mode (connection to a 4D Server) +- 4D used in local mode with an interpreted application project with no access to the Design environment. -## Première activation +## First activation -Pour activer 4D, sélectionnez la commande **Gestionnaire de licences...** du menu **Aide**. Pour activer 4D Server, lancez l'application 4D Server. La boîte de dialogue de choix du [mode d'activation](#activation-mode) apparaît. +With 4D, select the **License Manager...** command from the **Help** menu of the application. With 4D Server, just launch the 4D Server application. The dialog box for choosing the [activation mode](#activation-mode) appears. ![](assets/en/getStart/server1.png) -4D vous propose trois modes d’activation. **L'activation immédiate** est recommandée. +4D offers three activation modes. We recommend **Instant Activation**. -### Activation immédiate +### Instant Activation -Saisissez votre identifiant utilisateur (e-mail ou compte 4D) ainsi que votre mot de passe. Si vous n'avez pas encore de compte client chez 4D, vous devez en créer un à l'adresse suivante : +Enter your user ID (email or 4D account) as well as your password. If you do not have an existing user account, you will need to create it at the following address: [https://account.4d.com/us/login.shtml](https://account.4d.com/us/login.shtml) ![](assets/en/getStart/activ1.png) -Entrez ensuite le numéro de licence du produit à activer. Ce numéro se trouve dans l'e-mail de livraison ou le certificat d'authenticité reçu par courrier. +Then enter the license number of the product you want to activate. This number is provided by email or by mail after a product is purchased. ![](assets/en/getStart/activ2.png) -### Activation différée +### Deferred Activation -Si vous ne pouvez pas utiliser [l'activation immédiate](#instant-activation) parce que votre ordinateur n'a pas d'accès Internet, vous pouvez effectuer une activation différée comme décrit dans les étapes suivantes. +If you are unable to use [instant activation](#instant-activation) because your computer does not have internet access, please proceed to deferred activation using the following steps. -1. Dans la fenêtre du Gestionnaire de licences de 4D accessible depuis le menu Aide, sélectionnez l'onglet **Activation différée**. -2. Entrez votre Numéro de licence ainsi que votre adresse E-mail, puis cliquez sur **Générer le fichier...** afin de créer le fichier d'ID (*reg.txt*). +1. In the License Manager window, select the **Deferred Activation** tab. +2. Enter the License Number and your e-mail address, then click **Generate file** to create the ID file (*reg.txt*). ![](assets/en/getStart/activ3.png) -3. Enregistrez le fichier *reg.txt* sur un support USB puis connectez ce support à un ordinateur qui a un accès Internet. -4. Depuis la machine qui a un accès Internet, connectez-vous sur [https://activation.4d.com](https://activation.4d.com). -5. Dans la page Web, cliquez sur le bouton **Parcourir...** et sélectionnez le fichier *reg.txt* généré lors des étapes 3 et 4 ; puis cliquez sur le bouton **Activer**. -6. Téléchargez le(s) fichier(s) de licence. +3. Save the *reg.txt* file to a USB drive and take it to a computer that has internet access. +4. On the machine with internet access, login to [https://activation.4d.com](https://activation.4d.com). +5. On the Web page, click on the **Choose File...** button and select the *reg.txt* file from steps 3 and 4; then click on the **Activate** button. +6. Download the serial file(s). ![](assets/en/getStart/activ4.png) -7. Enregistrez le ou les fichier(s) *license4d* sur un support partagé et transférez-le(s) sur la machine 4D utilisée lors de l'étape 1. -8. De retour sur la machine avec 4D, toujours dans l'écran **Activation différée**, cliquez sur le bouton **Suivant** ; puis cliquez sur le bouton **Charger...** et sélectionnez un fichier *license4d* depuis le media partagé utilisé à l'étape 7. +7. Save the *license4d* file(s) on a shared media and transfer them back to the 4D machine from step 1. +8. Now back on the machine with 4D, still on the **Deferred Activation** page, click **Next**; then click the **Load...** button and select a *license4d* file from the shared media from step 7. ![](assets/en/getStart/activ5.png) -Une fois le fichier de licence chargé, cliquez sur le bouton **Suivant**. +With the license file loaded, click on **Next**. ![](assets/en/getStart/activ6.png) -9. Cliquez sur le bouton **Ajouter N°** pour ajouter une autre licence. Répétez ces étapes jusqu'à ce que toutes les licences téléchargées à l'étape 6 aient été intégrées. +9. Click on the **Add N°** button to add another license. Repeat these steps until all licenses from step 6 have been integrated. -Votre application 4D est désormais activée. +Your 4D application is now activated. -### Activation d’urgence +### Emergency Activation -Ce mode permet l’activation exceptionnelle et temporaire de l’application 4D (5 jours maximum) sans connexion au site Internet de 4D. Cette activation ne peut être utilisée qu’une seule fois. +This mode can be used for a special temporary activation of 4D (5 days maximum) without connecting to the 4D Web site. This activation can only be used one time. -## Ajouter des licences +## Adding licenses -Vous pouvez à tout moment ajouter de nouvelles licences, par exemple pour étendre les capacités de votre application. +You can add new licenses, for example to extend the capacities of your application, at any time. -Choisissez la commande **Gestionnaire de licences...** dans le menu **Aide** de l’application 4D ou 4D Server puis cliquez sur le bouton **Actualiser** : +Choose the **License Manager...** command from the **Help** menu of the 4D or 4D Server application, then click on the **Refresh** button: ![](assets/en/getStart/licens1.png) -Ce bouton vous connecte à notre base clients et active automatiquement toutes les licences nouvelles ou mises à jour liées à la licence courante (la licence courante est affichée en **gras** dans la liste des Licences actives). Vous devrez simplement saisir vos identifiants 4D (compte et mot de passe). Vous devrez simplement saisir vos identifiants 4D (compte et mot de passe). +This button connects you to our customer database and automatically activates any new or updated licenses related to the current license (the current license is displayed in **bold** in the "Active Licenses" list). You will just be prompted for your user account and password. -- Si vous avez acheté des expansions supplémentaires pour un 4D Server, vous n'avez pas besoin de saisir de numéro -- cliquez simplement sur **Actualiser**. -- A la première activation d'un 4D Server, vous devez uniquement saisir le numéro du serveur et toutes les licences d'expansion associées sont automatiquement affectées. +- If you purchased additional expansions for a 4D Server, you do not need to enter any license number -- just click **Refresh**. +- At the first activation of a 4D Server, you just need to enter the server number and all the purchased expansions are automatically assigned. -Vous pouvez utiliser le bouton **Actualiser** dans les contextes suivants : +You can use the **Refresh** button in the following contexts: -- Lorsque vous avez acquis une expansion supplémentaire et souhaitez l'activer, -- Lorsque vous voulez mettre à jour un numéro de licence temporaire ayant expiré (Partenaires ou évolutions). +- When you have purchased an additional expansion and want to activate it, +- When you need to update an expired temporary number (Partners or evolutions). ## 4D Online Store -Sur le site web 4D Store, vous pouvez commander, mettre à jour, étendre et gérer vos produits 4D. Vous pouvez vous connecter au store à l'adresse suivante : [https://store.4d.com/fr/](https://store.4d.com/us/) (veuillez sélectionner votre pays). +In 4D Store, you can order, upgrade, extend, and/or manage 4D products. You can reach the store at the following address: [https://store.4d.com/us/](https://store.4d.com/us/) (you will need to select your country). -Cliquez sur **Se connecter** pour vous identifier à l'aide de votre compte existant ou sur **Nouveau compte** pour en créer un nouveau, puis suivez les instructions à l'écran. +Click **Login** to sign in using your existing account or **New Account** to create a new one, then follow the on-screen instructions. -### Gestion des licences +### License Management -Après vous être identifié, vous pouvez cliquer sur le lien **Liste de mes licences** en haut de la partie droite de la fenêtre : +After you log in, you can click on **License list** at the top right of the page: ![](assets/en/getStart/licens2.png) -Vous pouvez ensuite gérer vos licences en les affectant à des projets. +Here you can manage your licenses by assigning them to projects. -Sélectionnez la licence que vous souhaitez dans la liste, puis cliquez sur **Lier à un projet:

    +Select the appropriate license from the list then click **Link to a project... >**: ![](assets/en/getStart/licens3.png) -Vous pouvez sélectionner un projet existant ou créer un nouveau : +You can either select an existing project or create a new one: ![](assets/en/getStart/licens4.png) ![](assets/en/getStart/licens5.png) -Les projets vous permettent d'organiser vos licences comme vous le souhaitez : +You can use projects to organize your licenses according to your needs: ![](assets/en/getStart/licens6.png) -## Dépannage +## Troubleshooting -En cas d’échec du processus d’installation ou d’activation, veuillez consulter le tableau suivant, présentant les causes de dysfonctionnements les plus fréquentes : +If the installation or activation process fails, please check the following table, which gives the most common causes of malfunctioning: -| Symptômes | Causes possibles | Solution(s) | -| ----------------------------------------------------------------------- | ----------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | -| Impossible de télécharger le produit depuis le site Internet de 4D | Site Internet indisponible, antivirus, firewall | 1- Réessayez ultérieurement OU 2- Désactivez temporairement votre antivirus ou votre firewall. | -| Impossible d’installer le produit sur le disque (installation refusée). | Droits d’accès utilisateur insuffisants | Ouvrez une session avec des droits d’accès permettant l’installation d’applications (accès administrateur) | -| Echec de l’activation en ligne | Antivirus, firewall, proxy | 1- Désactivez temporairement votre antivirus ou votre firewall OU 2- Utilisez l’activation différée (non disponible avec les licences des versions "R") | +| Symptoms | Possible causes | Solution(s) | +| ------------------------------------------------------------- | ---------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------- | +| Impossible to download product from 4D Internet site | Internet site unavailable, antivirus application, firewall | 1- Try again later OR 2- Temporarily disable your antivirus application or your firewall. | +| Impossible to install product on disk (installation refused). | Insufficient user access rights | Open a session with access rights allowing you to install applications (administrator access) | +| Failure of on-line activation | Antivirus application, firewall, proxy | 1- Temporarily disable your antivirus application or your firewall OR 2- Use deferred activation (not available with licenses for "R" versions) | -Si ces informations ne vous permettent pas de résoudre votre problème, veuillez contacter 4D ou votre distributeur local. +If this information does not help you resolve your problem, please contact 4D or your local distributor. ## Contacts -Pour toute question relative à l’installation ou l’activation de votre produit, veuillez contacter 4D Sas ou votre distributeur local. +For any questions about the installation or activation of your product, please contact 4D, Inc. or your local distributor. -Pour la France : +For the US: -- Web : [http://www.4d.com/fr/](https://us.4d.com/4d-technical-support) -- Téléphone : 0892 68 09 97 (0,34 Euro Ttc/Min) +- Web: [https://us.4d.com/4d-technical-support](https://us.4d.com/4d-technical-support) +- Telephone: 1-408-557-4600 -Pour le Royaume-Uni : +For the UK: - Web: [https://uk.4d.com/4d-technical-support](https://uk.4d.com/4d-technical-support) -- Téléphone : 01625 536178 +- Telephone: 01625 536178 diff --git a/website/translated_docs/fr/Backup/backup.md b/website/translated_docs/fr/Backup/backup.md index 513cd4a27cde07..c6164103771922 100644 --- a/website/translated_docs/fr/Backup/backup.md +++ b/website/translated_docs/fr/Backup/backup.md @@ -3,93 +3,93 @@ id: backup title: Sauvegarde --- -Une sauvegarde peut être déclenchée de trois manières : +A backup can be started in three ways: -- Manuellement, via la commande **Sauvegarde...** du menu **Fichier** de 4D ou le bouton **Sauvegarde** du [Centre de sécurité et de maintenance (CSM)](MSC/backup.md). -- Automatiquement, via le programmateur paramétrable dans les Propriétés, -- Par programmation, à l’aide de la commande `BACKUP`. +- Manually, using the **Backup...** item of the 4D **File** menu or the **Backup** button of the [Maintenance and Security Center](MSC/backup.md). +- Automatically, using the scheduler that can be set in the Settings, +- Programmatically, using the `BACKUP` command. -> 4D Server : Il est possible de déclencher “manuellement” une sauvegarde depuis un poste distant, via une méthode appelant la commande `BACKUP`. Dans tous les cas, la commande sera exécutée sur le serveur. +> 4D Server: A backup can be started manually from a remote machine using a method that calls the `BACKUP` command. The command will be executed, in all cases, on the server. -## Sauvegarde manuelle +## Manual backup -1. Choisissez la commande **Sauvegarde...** dans le menu **Fichier** de 4D. - La fenêtre de sauvegarde s’affiche : ![](assets/en/Backup/backup01.png) Vous pouvez visualiser l'emplacement du dossier de sauvegarde à l'aide du pop up menu associé à la zone "Destination de la sauvegarde". Cet emplacement est défini dans la Page **Sauvegarde/Configuration** des Propriétés de la base. +1. Select the **Backup...** command in the 4D **File** menu. + The backup window appears: ![](assets/en/Backup/backup01.png) You can see the location of the backup folder using the pop-up menu next to the "Backup destination" area. This location is set on the **Backup/Configuration** page of the Database Settings. -- Vous pouvez également sélectionner [Centre de sécurité et de maintenance](MSC/overview.md) de 4D et afficher la [Page Sauvegarde](MSC/backup.md). +- You can also open the [Maintenance and Security Center](MSC/overview.md) of 4D and display the [Backup page](MSC/backup.md). -Le bouton **Propriétés de la base...** provoque l’affichage de la boîte de dialogue des Propriétés de structure. +The **Database properties...** button causes the Backup/Configuration page of the Structure Settings to be displayed. - 2. Cliquez sur le bouton **Sauvegarde** pour déclencher la sauvegarde avec les paramètres courants. + 2. Click **Backup** to start the backup using current parameters. -## Sauvegarde automatique périodique +## Scheduled automatic backup -Les sauvegardes périodiques sont déclenchées automatiquement. Elles sont configurées dans la Page **Sauvegarde/Périodicité** des **Propriétés**. +Scheduled backups are started automatically. They are configured in the **Backup/Scheduler** page of the **Settings**. -Les sauvegardes s'effectuent automatiquement au moment défini, sans intervention de l’utilisateur. Pour plus d’informations sur le fonctionnement de cette boîte de dialogue, reportez-vous à la section [Définir des sauvegardes périodiques](settings.md#scheduler). +Backups are automatically performed at the times defined on this page without any type of user intervention. For more information on using this dialog box, refer to [Scheduler in backup settings](settings.md#scheduler). -## Commande BACKUP +## BACKUP command -Lorsque la commande `BACKUP` est exécutée depuis une méthode, la sauvegarde est alors déclenchée avec les paramètres courants définis dans les propriétés. Vous pouvez utiliser la Méthode base `On Backup Startup` et `On Backup Shutdown` afin de contrôler le déroulement de la sauvegarde (cf. le manuel *Langage de 4D*). +When the `BACKUP` 4D language command is executed from any method, the backup starts using the current parameters as defined in the Settings. You can use the `On Backup Startup` and `On Backup Shutdown` database methods for handling the backup process (see the *4D Language Reference* manual). -## Déroulement de la sauvegarde +## Managing the backup processing -Une fois qu’une sauvegarde a été déclenchée, 4D affiche une boîte de dialogue comportant un thermomètre indiquant la progression de l’opération : +Once a backup is started, 4D displays a dialog box with a thermometer indicating the progress of the backup: ![](assets/en/Backup/backupProgress.png) -Le thermomètre est également affiché en bas de la page [“Sauvegarde” du CSM](MSC/backup.md) si vous avez utilisé cette boîte de dialogue. +This thermometer is also displayed on the [Backup page of the MSC](MSC/backup.md) if you have used this dialog box. -Le bouton **Arrêter** permet à l’utilisateur d’interrompre la sauvegarde à tout instant (cf. paragraphe [En cas de problème au cours de la sauvegarde](backup.md#handling-backup-issues)). +The **Stop** button lets the user interrupt the backup at any time (refer to [Handling backup issues](backup.md#handling-backup-issues) below). -Le compte-rendu de la dernière sauvegarde (succès ou échec) est stocké dans la zone "Informations sur la dernière sauvegarde" dans la [Page Sauvegarde du CSM](MSC/backup.md) ou dans la **Page de maintenance** de 4D Server. Il est également enregistré dans le **Backup journal.txt**. +The status of the last backup (successful or failed) is stored in the Last Backup Information area of the [Backup page in the MSC](MSC/backup.md) or in the **Maintenance page** of 4D Server. It is also recorded in the database **Backup journal.txt**. -### Accès à l'application durant la sauvegarde +### Accessing the application during backup -Pendant la sauvegarde, les accès à l'application sont restreints par 4D en fonction du contexte. 4D verrouille les process liés aux types de fichiers inclus dans la sauvegarde : si seul le fichier de structure est sauvegardé, l’accès à la structure est impossible mais l’accès aux données est autorisé. +During a backup, access to the application is restricted by 4D according to the context. 4D locks any processes related to the types of files included in the backup: if only the project files are being backed up, access to the structure is not possible but access to the data will be allowed. -A l’inverse, si seul le fichier de données est sauvegardé, l’accès à la structure reste autorisé. Dans ce cas, les possibilités d’accès à l'application sont les suivantes : +Conversely, if only the data file is being backed up, access to the structure is still allowed. In this case, the application access possibilities are as follows: -- Avec 4D version monoposte, l'application est verrouillée en lecture et en écriture, tous les process sont gelés. Toute action est alors impossible. -- Avec 4D Server, l'application est verrouillée uniquement en écriture, les postes clients peuvent consulter les données. Si un poste client envoie une requête d’ajout, de suppression ou de modification au serveur, il obtient une fenêtre l’invitant à attendre la fin de la sauvegarde. Une fois l'application sauvegardée, la fenêtre disparaît d’elle-même et l’action est exécutée. Pour annuler la requête en cours et ne pas avoir à attendre la fin de la sauvegarde, il suffit de cliquer sur le bouton **Annuler l’opération**. Cependant, si l’action en attente provient d’une méthode lancée avant la sauvegarde, il est déconseillé de l’annuler car seules les opérations restant à effectuer seront annulées. Or, une méthode “à moitié” exécutée peut conduire à des incohérences logiques dans les données. Lorsque l’action en attente provient d’une méthode et que l’utilisateur clique sur le bouton **Annuler l’opération**, 4D Server renvoie l’erreur -9976 (Cette commande ne peut être exécutée car la base est en cours de sauvegarde). +- With the 4D single-user version, the application is locked for both read and write; all processes are frozen. No actions can be performed. +- With 4D Server, the application is only write locked; client machines can view data. If a client machine sends an add, remove or change request to the server, a window appears asking the user to wait until the end of the backup. Once the application is saved, the window disappears and the action is performed. To cancel the request in process and not wait for the end of the backup, simply click the **Cancel operation** button. However, if the action waiting to be executed comes from a method launched prior to the backup, you should not cancel it because only operations remaining to be performed are cancelled. Also, a partially executed method can cause logical inconsistencies in the data. > When the action waiting to be executed comes from a method and the user clicks the **Cancel operation** button, 4D Server returns error -9976 (This command cannot be executed because the database backup is in progress). -### En cas de problème au cours de la sauvegarde +### Handling backup issues -Il est possible qu'une sauvegarde ne s’effectue pas correctement. Les causes de l’échec peuvent être diverses : interruption par l’utilisateur, fichier joint introuvable, disque de destination défaillant, transaction non terminée, etc. 4D traite l'incident selon la cause de l'échec. +It may happen that a backup is not executed properly. There may be several causes of a failed backup: user interruption, attached file not found, destination disk problems, incomplete transaction, etc. 4D processes the incident according to the cause. -Dans tous les cas, le statut de la dernière sauvegarde (succès ou échec) est stocké dans la zone "Informations sur la dernière sauvegarde" dans la [Page Sauvegarde du CSM](MSC/backup.md) ou dans la **Page de maintenance** de 4D Server, ainsi que dans le **Backup journal.txt**. +In all cases, keep in mind that the status of the last backup (successful or failed) is stored in the Last Backup Information area of the [Backup page in the MSC](MSC/backup.md) or in the **Maintenance page** of 4D Server, as well as in the **Backup journal.txt**. -- **Interruption par l’utilisateur** : le bouton **Arrêter** de la boîte de dialogue de progression de la sauvegarde permet aux utilisateurs d’interrompre la sauvegarde à tout instant. Dans ce cas, la copie des éléments est stoppée et l'erreur 1406 est générée. Vous pouvez intercepter cette erreur dans la Méthode base `On Backup Shutdown`. -- **Fichier joint introuvable** : lorsqu’un fichier joint est introuvable, 4D effectue une sauvegarde partielle (sauvegarde des fichiers de l'application et des fichiers joints accessibles) et retourne une erreur. -- **Sauvegarde impossible** (disque plein ou protégé en écriture, disque manquant, panne du disque, transaction non terminée, projet non lancé au moment d’une sauvegarde automatique périodique, etc.) : S’il s’agit du premier échec, 4D effectuera ultérieurement une seconde tentative. Le délai d’attente entre les deux tentatives est défini dans la Page **Sauvegarde/Sauvegarde& et Restitution** des Propriétés. Si la seconde tentative échoue également, une boîte de dialogue d’alerte système est affichée et une erreur est générée. Vous pouvez intercepter cette erreur dans la Méthode base `On Backup Shutdown`. +- **User interruption**: The **Stop** button in the progress dialog box allows users to interrupt the backup at any time. In this case, the copying of elements is stopped and the error 1406 is generated. You can intercept this error in the `On Backup Shutdown` database method. +- **Attached file not found**: When an attached file cannot be found, 4D performs a partial backup (backup of application files and accessible attached files) and returns an error. +- **Backup impossible** (disk is full or write-protected, missing disk, disk failure, incomplete transaction, application not launched at time of scheduled automatic backup, etc.): If this is a first-time error, 4D will then make a second attempt to perform the backup. The wait between the two attempts is defined on the **Backup/Backup & Restore** page of the Settings. If the second attempt fails, a system alert dialog box is displayed and an error is generated. You can intercept this error in the `On Backup Shutdown` database method. -## Journal de sauvegarde (Backup Journal) +## Backup Journal -Pour faciliter le suivi et la vérification des sauvegardes, le module de sauvegarde résume chaque opération effectuée dans un fichier spécial, similaire à un journal d'activité. Comme un manuel intégré, toutes les opérations de la base de données (sauvegardes, restaurations, intégrations de fichiers d'historique) sont consignées dans ce fichier, qu’elles aient été planifiées ou exécutées manuellement. La date et l'heure auxquelles ces opérations ont eu lieu sont également notées dans le journal. +To make following up and verifying backups easier, the backup module writes a summary of each operation performed in a special file, which is similar to an activity journal. Like an on-board manual, all database operations (backups, restores, log file integrations) are logged in this file whether they were scheduled or performed manually. The date and time that these operations occurred are also noted in the journal. -Le journal de sauvegarde s'appelle "Backup Journal[001].txt" et se trouve dans le dossier "Logs" du projet. Le journal de sauvegarde peut être ouvert avec n'importe quel éditeur de texte. +The backup journal is named "Backup Journal[001].txt" and is placed in the "Logs" folder of the project. The backup journal can be opened with any text editor. -#### Gestion de la taille du journal de sauvegarde +#### Management of backup journal size -Dans certaines stratégies de sauvegarde (par exemple, dans le cas où de nombreuses pièces jointes sont sauvegardées), le journal de sauvegarde peut rapidement atteindre une taille importante. Deux mécanismes peuvent être utilisés pour gérer cette taille : +In certain backup strategies (for example, in the case where numerous attached files are being backed up), the backup journal can quickly grow to a large size. Two mechanisms can be used to control this size: -- **Sauvegarde automatique** : Avant chaque sauvegarde, l'application examine la taille du fichier backup journal courant. Si elle est supérieure à 10 Mo, le fichier courant est archivé et un nouveau fichier est créé avec le numéro [xxx] incrémenté, par exemple "Backup Journal[002] .txt”. Une fois le numéro de fichier 999 atteint, la numérotation reprend à 1 et les fichiers existants seront remplacés. -- **Possibilité de réduire la quantité d'informations enregistrées** : Pour ce faire, il suffit de modifier la valeur de la clé `VerboseMode` dans le fichier *Backup.4DSettings* du projet. Par défaut, cette clé est définie sur True. Si vous définissez la valeur de cette clé sur False, seules les informations principales sont stockées dans le journal de sauvegarde : la date et l'heure du début de l'opération et les éventuelles erreurs générées. Les clés XML concernant la configuration de la sauvegarde sont décrites dans le manuel *Sauvegarde des clés XML 4D*. +- **Automatic backup**: Before each backup, the application examines the size of the current backup journal file. If it is greater than 10 MB, the current file is archived and a new file is created with the [xxx] number incremented, for example "Backup Journal[002].txt”. Once file number 999 is reached, the numbering begins at 1 again and the existing files will be replaced. +- **Possibility of reducing the amount of information recorded**: To do this, simply modify the value of the `VerboseMode` key in the *Backup.4DSettings* file of the project. By default, this key is set to True. If you change the value of this key to False, only the main information will be stored in the backup journal: date and time of start of operation and any errors encountered. The XML keys concerning backup configuration are described in the *4D XML Keys Backup* manual. ## backupHistory.json -Toutes les informations concernant les dernières opérations de sauvegarde et de restitution sont stockées dans le fichier **backupHistory.json** de l'application. Ce dernier enregistre le chemin de chaque fichier sauvegardé (y compris les pièces jointes) ainsi que le numéro, la date, l'heure, la durée et le statut de chaque opération. Afin de limiter la taille du fichier, le nombre d'opérations enregistrées et le nombre de sauvegardes disponibles ("Keep only the last X backup files") définies dans les propriétés de sauvegarde est identique. +All information regarding the latest backup and restore operations are stored in the application's **backupHistory.json** file. It logs the path of each saved file (including attachments) as well as number, date, time, duration, and status of each operation. To limit the size of the file, the number of logged operations is the same as the number of available backups ("Keep only the last X backup files") defined in the backup settings. -Le fichier **backupHistory.json** se situe dans le dossier de destination de sauvegarde courant. Vous pouvez obtenir le chemin de ce fichier à l'aide de la déclaration suivante : +The **backupHistory.json** file is created in the current backup destination folder. You can get the actual path for this file using the following statement: ```4d $backupHistory:=Get 4D file(Backup history file) ``` -> **ATTENTION** -> La suppression ou le déplacement du fichier **backupHistory.json** entraînera la réinitialisation du prochain numéro de sauvegarde. -> Le fichier **backupHistory.json** est formaté afin d'être utilisé par l'application 4D. Si vous recherchez un état lisible sur les opérations de sauvegarde, le journal de sauvegarde sera plus précis. +> **WARNING** +> Deleting or moving the **backupHistory.json** file will cause the next backup number to be reset. +> The **backupHistory.json** file is formatted to be used by the 4D application. If you are looking for a human-readable report on backup operations, you might find the Backup journal more accurate. diff --git a/website/translated_docs/fr/Backup/log.md b/website/translated_docs/fr/Backup/log.md index 36a487885b346b..b7f1cd538d7b2e 100644 --- a/website/translated_docs/fr/Backup/log.md +++ b/website/translated_docs/fr/Backup/log.md @@ -3,17 +3,17 @@ id: log title: Fichier d'historique (.journal) --- -Une application exploitée de manière continue enregistre en permanence des modifications, des ajouts ou des suppressions d’enregistrements. Réaliser des sauvegardes régulières des données est important mais ne permet pas, en cas d’incident, de récupérer les données saisies depuis la dernière sauvegarde. Pour répondre à ce besoin, 4D dispose d’un outil particulier : le fichier d’historique. Ce fichier permet d’assurer la sécurité permanente des données. +A continuously-used application is always recording changes, additions or deletions. Réaliser des sauvegardes régulières des données est important mais ne permet pas, en cas d’incident, de récupérer les données saisies depuis la dernière sauvegarde. Pour répondre à ce besoin, 4D dispose d’un outil particulier : le fichier d’historique. This file allows ensuring permanent security of data. -En outre, 4D travaille en permanence avec un cache de données situé en mémoire. Toute modification effectuée sur les données de l'application est stockée provisoirement dans le cache avant d’être écrite sur le disque dur. Ce principe permet d’accélérer le fonctionnement des applications ; en effet, les accès mémoire sont bien plus rapides que les accès disque. Si un incident survient sur l'application avant que les données stockées dans le cache aient pu être écrites sur le disque, vous devrez intégrer le fichier d’historique courant afin de récupérer entièrement l'application. +En outre, 4D travaille en permanence avec un cache de données situé en mémoire. Any changes made to the application data are stored temporarily in the cache before being written to the hard disk. Ce principe permet d’accélérer le fonctionnement des applications ; en effet, les accès mémoire sont bien plus rapides que les accès disque. If an incident occurs in the application before the data stored in the cache could be written to the disk, you must include the current log file in order to restore the application entirely. -Enfin, 4D dispose d'une fonction d'analyse du contenu du fichier d'historique, permettant également de faire remonter en arrière les opérations exécutées sur les données de l'application. Ces fonctions sont accessibles via le CSM : reportez-vous aux sections [Page Analyse d'activités](MSC/analysis.md) et [Page Retour arrière](MSC/rollback.md). +Finally, 4D has functions that analyze the contents of the log file, making it possible to rollback the operations carried out on the application data. Ces fonctions sont accessibles via le CSM : reportez-vous aux sections [Page Analyse d'activités](MSC/analysis.md) et [Page Retour arrière](MSC/rollback.md). ## Fonctionnement du fichier d'historique -L’historique généré par 4D se présente sous la forme d’un fichier dans lequel toutes les opérations effectuées sur les données des tables journalisées de l'application viennent s’inscrire séquentiellement. Par défaut, toutes les tables sont journalisées, c'est-à-dire incluses dans l'historique, mais vous pouvez en désélectionner certaines via la propriété **Inclure dans le fichier d'historique**. +The log file generated by 4D contains a description of all operations performed on the data of journaled tables, which are logged sequentially. Par défaut, toutes les tables sont journalisées, c'est-à-dire incluses dans l'historique, mais vous pouvez en désélectionner certaines via la propriété **Inclure dans le fichier d'historique**. -Ainsi, chaque opération effectuée par un utilisateur provoque deux actions simultanées : une première sur le fichier de données (l’instruction est exécutée normalement) et une seconde dans le fichier d’historique (la description de l’opération y est enregistrée). Le fichier d’historique se construit de manière indépendante, sans gêner ni ralentir le travail de l’utilisateur. Une application ne peut travailler qu’avec un seul fichier d’historique à la fois. Le fichier d’historique enregistre les types d’opérations suivants : +As such, each operation performed by a user causes two simultaneous actions: the first one in the data file (instruction is executed normally) and the second one in the log file (the description of the operation is recorded). Le fichier d’historique se construit de manière indépendante, sans gêner ni ralentir le travail de l’utilisateur. An application can only work with one log file at a time. Le fichier d’historique enregistre les types d’opérations suivants : - Ouvertures et fermetures du fichier de données, - Ouvertures et fermetures de process (contextes), @@ -34,33 +34,33 @@ Ce schéma résume le principe général de fonctionnement du fichier d’histor Le fichier d’historique courant est automatiquement sauvegardé avec le fichier de données courant. Ce mécanisme procure deux avantages principaux : - Eviter la saturation du disque accueillant le fichier d’historique. En effet, sans sauvegarde, l’historique grossirait indéfiniment au fur et à mesure de l’exploitation de la base et finirait par saturer votre disque. A chaque sauvegarde du fichier de données, 4D ou 4D Server ferme le fichier d’historique courant et débute immédiatement un nouveau fichier vide, évitant ainsi le risque de saturation. L’ancien fichier d’historique est alors archivé puis éventuellement détruit, conformément au mécanisme des jeux de sauvegarde. -- Conserver les fichiers d’historique correspondant aux sauvegardes, afin de pouvoir analyser ou réparer a posteriori une application. En effet, l’intégration du fichier d’historique ne peut se faire que dans l'application qui lui correspond. Il est donc important, pour pouvoir intégrer correctement un fichier d’historique dans une sauvegarde, de disposer de sauvegardes et d’historiques archivés simultanément. +- It keeps log files corresponding to backups in order to be able to parse or repair an application at a later point in time. The integration of a log file can only be done in the application to which it corresponds. Il est donc important, pour pouvoir intégrer correctement un fichier d’historique dans une sauvegarde, de disposer de sauvegardes et d’historiques archivés simultanément. ## Créer le fichier d’historique -Par défaut, toute application créée avec 4D utilise un fichier d’historique (option définie dans la Page **Général** des Préférences de 4D). Le fichier d’historique est nommé par défaut *data.journal* et est placé dans le dossier Data. +By default, any application project created with 4D uses a log file (option set in the **General** page of the Preferences). Le fichier d’historique est nommé par défaut *data.journal* et est placé dans le dossier Data. -Vous pouvez à tout moment savoir si votre application utilise un fichier d’historique : l’option **Utiliser le fichier d’historique** est cochée dans la Page **Sauvegarde/Configuration** des Propriétés. Si vous avez désélectionné cette option ou si vous utilisez une application sans fichier d’historique et souhaitez mettre en place une stratégie de sauvegarde avec fichier d’historique, il vous appartient d’en créer un. +You can find out if your application uses a log file at any time: just check whether the **Use Log** option is selected on the **Backup/Configuration** page of the Settings. If you deselected this option, or if you use an application without a log file and wish to set up a backup strategy with a log file, you will have to create one. Pour créer un fichier d’historique : -1. Dans la Page **Sauvegarde/Configuration** des Propriétés de structure, cochez l’option **Utiliser le fichier d’historique**. Le programme affiche une boîte de dialogue standard de création de fichier. Par défaut, le fichier d’historique est baptisé *data.journal*. +1. On the **Backup/Configuration** page of the Structure Settings, check the **Use Log** option. Le programme affiche une boîte de dialogue standard de création de fichier. Par défaut, le fichier d’historique est baptisé *data.journal*. -2. Conservez le nom du fichier par défaut ou choisissez-en un autre et déterminez l’emplacement du fichier. Si vous disposez d’au moins deux disques durs, il est recommandé de placer le fichier d'historique sur un autre disque que celui contenant le projet d'application. Si le disque dur de l'application est perdu, vous pouvez toujours rappeler votre fichier d'historique. +2. Conservez le nom du fichier par défaut ou choisissez-en un autre et déterminez l’emplacement du fichier. If you have at least two hard drives, it is recommended that you place the log file on a disk other than the one containing the application project. If the application hard drive is lost, you can still recall your log file. 3. Cliquez sur le bouton **Enregistrer**. Le disque et le nom du fichier d’historique ouvert s’affichent alors dans la zone **“Utiliser le fichier d’historique”** de la boîte de dialogue. Vous pouvez cliquer dans cette zone afin d’afficher un pop up menu contenant l’enchaînement des dossiers à partir du disque. -4. Validez la boîte de dialogue des Propriétés. +4. Validate the Settings dialog box. -Pour que vous puissiez directement créer un fichier d’historique, les données doivent se trouver dans une des situations suivantes : +In order for you to be able to create a log file directly, the data must be in one of the following situations: - Le fichier de données est vierge, -- Vous venez d’effectuer une sauvegarde et aucune modification sur les données n’a encore été effectuée. +- You just performed a backup and no changes have yet been made to the data. -Dans tous les autres cas, au moment où vous validez la fenêtre des Propriétés, une boîte de dialogue d’alerte vous informe qu’une sauvegarde est nécessaire. Si vous cliquez sur **OK**, la sauvegarde démarre immédiatement puis l’historique est activé. Si vous cliquez sur **Annuler**, la requête est enregistrée mais la création du fichier d’historique est différée et sera créée uniquement après la prochaine sauvegarde de l'application. Cette précaution est indispensable car il vous faudra, pour restituer une application après un éventuel incident, disposer d’une copie de l'application dans laquelle pourront s’intégrer les opérations enregistrées dans le fichier d’historique. +In all other cases, when you validate the Settings dialog box, an alert dialog box will appear to inform you that it is necessary to perform a backup. Si vous cliquez sur **OK**, la sauvegarde démarre immédiatement puis l’historique est activé. If you click **Cancel**, the request is saved but the creation of the log file is postponed and it will actually be created only after the next backup of the application. This precaution is indispensable because, in order to restore an application after any incidents, you will need a copy of the application into which the operations recorded in the log file will be integrated. -Sans autre manipulation de votre part, toutes les opérations effectuées sur les données s’inscriront dans ce fichier, et il sera utilisé également lors des ouvertures ultérieures de l'application. +Without having to do anything else, all operations performed on the data are logged in this file and it will be used in the future when the application is opened. Vous devrez créer un autre fichier d’historique si vous créez un nouveau fichier de données. Vous devrez désigner ou créer un autre fichier d’historique si vous ouvrez un autre fichier de données non associé à un fichier d’historique (ou si le fichier d’historique est manquant). @@ -68,13 +68,13 @@ Vous devrez créer un autre fichier d’historique si vous créez un nouveau fic ## Fermer l’historique -Si vous souhaitez interrompre l’enregistrement du fichier d’historique courant, désélectionnez l’option **Utiliser le fichier d’historique** dans la Page **Sauvegarde/Configuration** des Propriétés. +If you would like to stop logging operations to the current log file, simply deselect the **Use Log** option on the **Backup/Configuration** page of the Settings. 4D affiche alors un message d’alerte afin d’attirer votre attention sur le fait que cette action vous prive de la sécurité apportée par le fichier d’historique : ![](assets/en/Backup/backup06.png) -Si vous cliquez sur le bouton **Fermer**, le fichier d’historique courant est immédiatement refermé (il n’est pas nécessaire que la boîte de dialogue des Propriétés soit ensuite validée). +If you click **Stop**, the current log file is immediately closed (the Settings dialog box does not need to be validated afterwards). Si vous souhaitez fermer votre fichier d’historique courant parce qu’il devient trop important, il est préférable d’effectuer une sauvegarde du fichier de données, ce qui entraînera la sauvegarde de l’historique. diff --git a/website/translated_docs/fr/Backup/overview.md b/website/translated_docs/fr/Backup/overview.md index cf1656671951e0..60209bc0d8c31f 100644 --- a/website/translated_docs/fr/Backup/overview.md +++ b/website/translated_docs/fr/Backup/overview.md @@ -3,17 +3,17 @@ id: overview title: Aperçu --- -4D inclut un module complet de sauvegarde et de récupération de l'application en cas d’incident. +4D includes a full application backup and restore module. -Ce module permet de sauvegarder une application en cours d’exploitation, sans qu’il soit nécessaire de quitter l’application. Chaque sauvegarde peut inclure le dossier du projet, le fichier de données et tout fichier ou dossier supplémentaire. Ces paramètres sont définis au préalable dans les Propriétés. +This module allows backing up an application currently in use without having to exit it. Chaque sauvegarde peut inclure le dossier du projet, le fichier de données et tout fichier ou dossier supplémentaire. These parameters are first set in the Settings. Les sauvegardes peuvent être déclenchées manuellement ou automatiquement, à intervalles réguliers et sans intervention de l’utilisateur. Des commandes de langage ainsi que des méthodes base spécifiques permettent d’intégrer les fonctions de sauvegarde à une interface personnalisée. -La restitution d’une application après incident peut s’effectuer automatiquement lors de l’ouverture d’une application endommagée. +Applications can be restored automatically when a damaged application is opened. -En outre, le module de sauvegarde intégré tire parti du fichier .journal ([ d’historique](log.md)). Ce fichier conserve une trace de chaque opération effectuée sur les données et assure ainsi une sécurité totale entre deux sauvegardes. En cas d’incident sur une application en cours d’exploitation, les opérations éventuellement manquantes dans le fichier de données sont automatiquement réintégrées lors de l’ouverture suivante de l'application. Vous pouvez visualiser à tout moment le contenu du fichier d’historique. +En outre, le module de sauvegarde intégré tire parti du fichier .journal ([ d’historique](log.md)). Ce fichier conserve une trace de chaque opération effectuée sur les données et assure ainsi une sécurité totale entre deux sauvegardes. In case of problems with an application in use, any operations missing in the data file are automatically reintegrated the next time the application is opened. Vous pouvez visualiser à tout moment le contenu du fichier d’historique. -> Vous pouvez également mettre en place des solutions alternatives de réplication et de synchronisation des données permettant de maintenir des versions identiques des applications à des fins de sauvegarde. Ces solutions peuvent être basées sur les technologies et mécanismes suivants : +> You can also implement alternative solutions for replicating and synchronizing data in order to maintain identical versions of applications for backup purposes. Ces solutions peuvent être basées sur les technologies et mécanismes suivants : > - Mise en place d'un miroir logique avec 4D Server (utilise les mécanismes du module de sauvegarde intégré) > - Synchronisation via le SQL - Synchronisation via le HTTP (/rest/url) diff --git a/website/translated_docs/fr/Backup/restore.md b/website/translated_docs/fr/Backup/restore.md index a3a0c6b59f8891..514e7ad8038938 100644 --- a/website/translated_docs/fr/Backup/restore.md +++ b/website/translated_docs/fr/Backup/restore.md @@ -3,28 +3,28 @@ id: restore title: Restitution --- -4D vous permet de récupérer l’intégralité des données d’une application en cas d’incident, quelles que soient ses causes. Deux catégories principales d’incidents peuvent se produire : +4D allows you to restore entire sets of application data in case of any incidents, regardless of the cause of the incident. Deux catégories principales d’incidents peuvent se produire : -- L’arrêt inopiné de l'application pendant son exploitation. Cet incident peut se produire à cause d’une coupure de courant, la panne d’un élément du système, etc. Dans ce cas, en fonction de l’état courant du cache de données au moment de l’incident, la récupération de l'application peut nécessiter différentes opérations : - - Si le cache était vide, l'application s’ouvre normalement. Toutes les modifications apportées à l'application ont été enregistrées. Ce cas ne nécessite aucune opération particulière. +- The unexpected stoppage of an application while in use. Cet incident peut se produire à cause d’une coupure de courant, la panne d’un élément du système, etc. In this case, depending on the current state of the data cache at the moment of the incident, the restore of the application can require different operations: + - If the cache was empty, the application opens normally. Any changes made in the application were recorded. Ce cas ne nécessite aucune opération particulière. - Si le cache contenait des opérations, le fichier de données est intact mais il est nécessaire d’intégrer le fichier d’historique courant. - Si le cache était en cours d’écriture, le fichier de données est probablement endommagé. Il est nécessaire de restituer la dernière sauvegarde et d’intégrer le fichier d’historique courant. -- La perte de fichier(s) de l'application. Cet incident peut être causé par des secteurs défectueux sur le disque contenant l'application, un virus, une erreur de manipulation, etc. Il est nécessaire de restituer la dernière sauvegarde puis d’intégrer éventuellement l’historique courant. Pour savoir si une application a été endommagée à la suite d’un incident, il suffit de la relancer avec 4D. Le programme effectue un auto-diagnostic et précise les opérations de réparation à effectuer. En mode automatique, ces opérations sont effectuées directement, sans intervention de l’utilisateur. Si une stratégie de sauvegarde régulière a été mise en place, les outils de récupération de 4D vous permettront (dans la plupart des cas) de retrouver l'application dans l’état exact où elle se trouvait avant l’incident. +- The loss of application file(s). This incident can occur because of defective sectors on the disk containing the application, a virus, manipulation error, etc. Il est nécessaire de restituer la dernière sauvegarde puis d’intégrer éventuellement l’historique courant. To find out if an application was damaged following an incident, simply relaunch the application using 4D. Le programme effectue un auto-diagnostic et précise les opérations de réparation à effectuer. En mode automatique, ces opérations sont effectuées directement, sans intervention de l’utilisateur. If a regular backup strategy was put into place, the 4D restore tools will allow you to recover (in most cases) the application in the exact state it was in before the incident. -> 4D peut lancer automatiquement des procédures de récupération des applications après incident. Ces mécanismes sont gérés à l’aide de deux options accessibles dans la Page **Sauvegarde/Sauvegarde & et Restitution** de la fenêtre des Propriétés. Pour plus d'informations, reportez-vous au paragraphe [Restitution automatique](settings.md#automatic-restore) -> . Si l'incident résulte d'une opération inappropriée sur effectuée sur les données (suppression d'un enregistrement par exemple), vous pouvez tenter de réparer le fichier de données en utilisant la fonction de "retour arrière" dans le fichier d'historique. Cette fonction est accessible dans la Page [Retour arrière](MSC/rollback.md) du CSM. +> 4D can launch procedures automatically to recover applications following incidents. These mechanisms are managed using two options available on the **Backup/Backup & Restore** page of the Settings. For more information, refer to the [Automatic Restore](settings.md#automatic-restore) paragraph. +> If the incident is the result of an inappropriate operation performed on the data (deletion of a record, for example), you can attempt to repair the data file using the "rollback" function in the log file. Cette fonction est accessible dans la Page [Retour arrière](MSC/rollback.md) du CSM. ## Restitution manuelle d’une sauvegarde (dialogue standard) Vous pouvez restituer manuellement le contenu d’une archive générée par le module de sauvegarde. Une restitution manuelle peut être nécessaire par exemple pour restituer la totalité du contenu d’une archive (fichiers de structure et/ou fichiers joints inclus) ou à des fins de recherche sur des archives. La restitution manuelle peut éventuellement s’accompagner de l’intégration de l’historique courant. -La restitution manuelle des sauvegardes peut être réalisée soit via une boîte de dialogue standard d’ouverture de document, soit via la page [“Restitution”](MSC/restore) du Centre de sécurité et de maintenance (CSM). La restitution via une boîte de dialogue standard permet de restituer n’importe quelle archive. En revanche, seules les archives associées à l'application ouverte peuvent être restituées. +La restitution manuelle des sauvegardes peut être réalisée soit via une boîte de dialogue standard d’ouverture de document, soit via la page [“Restitution”](MSC/restore) du Centre de sécurité et de maintenance (CSM). La restitution via une boîte de dialogue standard permet de restituer n’importe quelle archive. On the other hand, only archives associated with the open application can be restored. -Pour restituer manuellement une application via une boîte de dialogue standard : +To restore an application manually via a standard dialog box: -1. Lancez l’application 4D et choisissez la commande **Restituer...** dans le menu **Fichier**. Il n'est pas obligatoire qu'un projet d'application soit ouvert. OU BIEN Exécutez la commande `RESTORE` depuis une méthode de 4D. Une boîte de dialogue standard d’ouverture de fichiers apparaît. +1. Lancez l’application 4D et choisissez la commande **Restituer...** dans le menu **Fichier**. It is not mandatory that an application project be open. OR Execute the `RESTORE` command from a 4D method. Une boîte de dialogue standard d’ouverture de fichiers apparaît. 2. Désignez le fichier de sauvegarde (.4bk) ou le fichier de sauvegarde de l’historique (.4bl) à restituer et cliquez sur **Ouvrir**. Un boîte de dialogue apparaît, vous permettant de désigner l’emplacement auquel vous souhaitez que les fichiers soient restitués . Par défaut, 4D restitue les fichiers dans un dossier nommé *“Nomarchive”* (sans extension) placé à côté de l’archive. Vous pouvez afficher le chemin : ![](assets/en/Backup/backup07.png) @@ -32,22 +32,22 @@ Pour restituer manuellement une application via une boîte de dialogue standard Vous pouvez également cliquer sur le bouton **[...]** et indiquer un autre emplacement. 3. Cliquez sur le bouton **Restituer**. 4D extrait tous les fichiers de la sauvegarde à l’emplacement défini. Si le fichier d’historique courant ou un fichier de sauvegarde d’historique ayant le même numéro que le fichier de sauvegarde est stocké dans le même dossier, 4D examine son contenu. S’il contient des opérations non présentes dans le fichier de données, le programme propose de l’intégrer. L’intégration est effectuée automatiquement si l’option **d’intégration automatique de l’historique** est cochée (cf. paragraphe [Restitution automatique](settings.md#automatic-restore)). -(Facultatif) Cliquez sur **OK** pour intégrer le fichier d’historique dans l'application restituée. Si la restitution et l’intégration se sont déroulées correctement, 4D affiche une boîte de dialogue indiquant que l’opération a réussi. +4.(Optional) Click **OK** to integrate the log file into the restored application. Si la restitution et l’intégration se sont déroulées correctement, 4D affiche une boîte de dialogue indiquant que l’opération a réussi. 5. Cliquez sur **OK**. Le dossier d’arrivée est affiché. Lors de la restitution, 4D place tous les fichiers sauvegardés dans ce dossier, quelle que soit la position des fichiers originaux sur le disque au moment de la sauvegarde. De cette façon, vous retrouverez plus facilement vos fichiers. -> Tout contenu lié au fichier de données (dossier files et `Settings`) est automatiquement restauré dans un sous-dossier `Data`du dossier de destination. +> Any content related to the data file (files and `Settings` folder) are automatically restored in a `Data` subfolder within the destination folder. ## Restitution manuelle d’une sauvegarde (CSM) -La [page Restitution](MSC/restore.md) du Centre de sécurité et de maintenance (CSM) vous permet de restituer manuellement une archive de l'application courante. +You can manually restore an archive of the current application using the [Restore page](MSC/restore.md) of the Maintenance and Security Center (MSC). ## Intégration manuelle de l’historique -Si vous n’avez pas coché l’option d’intégration automatique du fichier d’historique dans la page Restitution du CSM (cf. [Intégration successive de plusieurs fichiers d’historiques](MSC/restore.md#successive-intergration-of-several-data-log-files)), une boîte de dialogue d’alerte apparaît à l’ouverture de l'application lorsque 4D constate que le fichier d’historique contient plus d’opérations qu’il n’en a été effectué dans le fichier de données. +If you have not checked the option for the automatic integration of the log file on the Restore page of the MSC (see [Successive integration of several log files](MSC/restore.md#successive-intergration-of-several-data-log-files)), a warning dialog box appears during the opening of the application when 4D notices that the log file contains more operations than have been carried out in the data file. ![](assets/en/Backup/backup08.png) diff --git a/website/translated_docs/fr/Backup/settings.md b/website/translated_docs/fr/Backup/settings.md index e3b84c8c35d39c..57361efe1abf01 100644 --- a/website/translated_docs/fr/Backup/settings.md +++ b/website/translated_docs/fr/Backup/settings.md @@ -3,7 +3,7 @@ id: settings title: Paramètres de sauvegarde --- -Les paramètres de sauvegarde sont définis sur trois pages dans la boîte de dialogue des Propriétés. Vous pouvez définir : +Backup settings are defined through three pages in the Settings dialog box. Vous pouvez définir : - la périodicité des sauvegardes automatiques - les fichiers à inclure dans chaque sauvegarde @@ -13,15 +13,15 @@ Les paramètres de sauvegarde sont définis sur trois pages dans la boîte de di ## Sauvegardes périodiques -Vous pouvez automatiser les sauvegardes de vos applications ouvertes avec 4D ou 4D Server (même lorsqu’aucun poste distant n’est connecté). Le principe consiste à définir une fréquence de sauvegarde (en heures, jours, semaines ou mois) ; à chaque échéance, 4D déclenche automatiquement une sauvegarde en tenant compte des paramètres de sauvegarde courants. +You can automate the backup of applications opened with 4D or 4D Server (even when no client machines are connected). Le principe consiste à définir une fréquence de sauvegarde (en heures, jours, semaines ou mois) ; à chaque échéance, 4D déclenche automatiquement une sauvegarde en tenant compte des paramètres de sauvegarde courants. -Si l’application n’était pas lancée au moment théorique de la sauvegarde, 4D considère au lancement suivant que la sauvegarde a échoué et applique les paramétrages adéquats, définis dans les Propriétés (cf. paragraphe [En cas de problème au cours de la sauvegarde](backup.md#handling-backup-issues)). +If this application was not launched at the theoretical moment of the backup, the next time 4D is launched, it considers the backup as having failed and proceeds as set in the Settings (refer to [Handling backup issues](backup.md#handling-backup-issues)). -Les paramètres des sauvegardes périodiques sont définis dans la Page **Sauvegarde/Périodicité** des Propriétés : +The scheduler backup settings are defined on the **Backup/Scheduler** page of the Structure Settings: ![](assets/en/Backup/backup02.png) -Les options regroupées dans cet onglet permettent de définir et de paramétrer des sauvegardes périodiques automatiques de l'application. Vous pouvez choisir un paramétrage standard rapide ou personnaliser entièrement la périodicité. Diverses options apparaissent en fonction de la valeur définie dans le menu **Sauvegarde automatique** : +The options found on this tab let you set and configure scheduled automatic backups of the application. Vous pouvez choisir un paramétrage standard rapide ou personnaliser entièrement la périodicité. Diverses options apparaissent en fonction de la valeur définie dans le menu **Sauvegarde automatique** : - **Jamais** : la fonction de sauvegarde périodique est inactivée. - **Toutes les heures** : programme une sauvegarde automatique par heure, à partir de la prochaine heure. @@ -36,7 +36,7 @@ Les options regroupées dans cet onglet permettent de définir et de paramétrer ## Configuration -La Page Sauvegarde/Configuration des Propriétés permet de désigner les fichiers à sauvegarder, l’emplacement des fichiers de sauvegarde et le fichier d’historique. Ces paramères sont spécifiques à chaque application ouverte par 4D ou 4D Server. +The Backup/Configuration page of the Structure Settings lets you set the backup files and their location, as well as that of the log file. These parameters are specific to each application opened by 4D or 4D Server. ![](assets/en/Backup/backup03.png) @@ -45,14 +45,14 @@ La Page Sauvegarde/Configuration des Propriétés permet de désigner les fichie ### Contenu Cette zone permet de désigner les fichiers et/ou dossiers à copier lors de la prochaine sauvegarde. -- **Data** : fichier de données de l'application. Lorsque cette option est cochée, les éléments suivants sont automatiquement sauvegardés en même temps que les données : - - le fichier journal courant de l'application (le cas échéant), - - le dossier `Settings` complet situé [à côté du fichier de données](Project/architecture.md#settings-folder) (le cas échéant), c'est-à-dire *les paramètres utilisateur pour les données*. -- **Structure** : fichiers et dossiers du projet d'application. Dans le cas de projets compilés, cette option permet de sauvegarder le fichier .4dz. Lorsque cette option est cochée, le dossier complet `Settings` situé [au même niveau que le dossier Project](Project/architecture.md#settings-folder-1), c'est-à-dire les *paramètres utilisateur*, est automatiquement sauvegardé. +- **Data**: Application data file. When this option is checked, the following elements are automatically backed up at the same time as the data: + - the current log file of the application (if it exists), + - the full `Settings` folder located [next to the data file](Project/architecture.md#settings-folder) (if it exists), i.e. the *user settings for data*. +- **Structure**: Application project folders and files. In cases where projects are compiled, this option allows you to backup the .4dz file. When this option is checked, the full `Settings` folder located [at the same level as the Project folder](Project/architecture.md#settings-folder-1), i.e. the *user settings*, is automatically backed up. - **Fichier de structure utilisateur (uniquement pour les bases binaires)** : *fonctionnalité obsolète*f -- **Attachments** : cette zone permet de désigner un ensemble de fichiers et/ou de dossiers à sauvegarder en même temps que l'application. Ces fichiers peuvent être de tout type (documents ou modèles de plug-ins, étiquettes, états, images, etc.). Vous pouvez désigner soit des fichiers individuels, soit des dossiers dont le contenu sera intégralement sauvegardé. Chaque élément joint est listé avec son chemin d’accès complet dans la zone “Fichiers joints”. +- **Attachments**: This area allows you to specify a set of files and/or folders to be backed up at the same time as the application. Ces fichiers peuvent être de tout type (documents ou modèles de plug-ins, étiquettes, états, images, etc.). Vous pouvez désigner soit des fichiers individuels, soit des dossiers dont le contenu sera intégralement sauvegardé. Chaque élément joint est listé avec son chemin d’accès complet dans la zone “Fichiers joints”. - **Supprimer** : retire de la liste des fichiers joints l’élément sélectionné. - - **Ajouter dossier...** : affiche une boîte de dialogue permettant de sélectionner un dossier à joindre à la sauvegarde. En cas de restitution, le dossier sera récupéré avec sa structure interne. Vous pouvez désigner tout dossier ou volume connecté au poste, à l’exception du dossier contenant les fichiers de l'application. + - **Ajouter dossier...** : affiche une boîte de dialogue permettant de sélectionner un dossier à joindre à la sauvegarde. En cas de restitution, le dossier sera récupéré avec sa structure interne. You can select any folder or volume connected to the machine, with the exception of the folder containing the application files. - **Ajouter fichier...** : affiche une boîte de dialogue permettant de sélectionner un fichier à joindre à la sauvegarde. @@ -66,11 +66,11 @@ Pour modifier l’emplacement auquel ces fichiers devront être enregistrés, cl ### Gestion du fichier d'historique -L’option **Utiliser le fichier d’historique** indique, lorsqu’elle est cochée, que l'application exploite un fichier d’historique. Son chemin d’accès est précisé au-dessous de l’option. Lorsque cette option est cochée, il n’est pas possible d’ouvrir l'application sans fichier d’historique. +The **Use Log** option, when checked, indicates that the application uses a log file. Son chemin d’accès est précisé au-dessous de l’option. When this option is checked, it is not possible to open the application without a log file. -Par défaut, tout projet créé avec 4D utilise un fichier d’historique (option cochée dans la **Page Général** des **Préférences** de 4D). Le fichier d’historique est nommé par défaut *data.journal* et est placé dans le dossier Data. +By default, any project created with 4D uses a log file (option **Use Log File** checked in the **General Page** of the **Preferences**). Le fichier d’historique est nommé par défaut *data.journal* et est placé dans le dossier Data. -> L’activation d’un nouveau fichier d’historique nécessite que les données de l'application soient préalablement sauvegardées. Lorsque vous cochez cette option, un message vous informe qu’une sauvegarde est nécessaire. La création du fichier d’historique est différée et ne sera effective qu’après la prochaine sauvegarde de l'application. +> Activating a new log file requires the data of the application to be backed up beforehand. Lorsque vous cochez cette option, un message vous informe qu’une sauvegarde est nécessaire. The creation of the log file is postponed and it will actually be created only after the next backup of the application. ## Sauvegarde et restitution @@ -82,10 +82,10 @@ La modification des options de sauvegarde et de restauration est facultative. Le ### Paramètres généraux - **Conserver uniquement les N derniers fichiers de sauvegarde** : ce paramètre permet d’activer et de configurer le mécanisme de suppression des fichiers de sauvegarde les plus anciens, afin d’éviter tout risque de saturation du volume. Le principe de fonctionnement est le suivant : après avoir terminé la sauvegarde courante, 4D efface l’archive la plus ancienne si celle-ci est localisée au même endroit que l’archive à sauvegarder et porte le même nom (vous pouvez, pour des raisons d’économie de place, demander que l’archive la plus ancienne soit effacée avant la sauvegarde). Si, par exemple, le nombre de jeux est fixé à 3, les trois premières sauvegardes créent successivement les archives MaBase-0001, MaBase-0002 et MaBase-0003. Lors de la quatrième sauvegarde, l’archive MaBase-0004 est créée alors que l’archive MaBase-0001 est supprimée. Par défaut, le mécanisme de suppression des jeux est activé et 4D conserve 3 jeux de sauvegarde. Pour ne pas activer le mécanisme, désélectionnez l’option. -> Ce paramètre concerne à la fois les sauvegardes de l'application et les sauvegardes de l’historique. +> This parameter concerns both application and log file backups. -- **Sauvegarder uniquement si le fichier de données a été modifié** : lorsque cette option est cochée, 4D déclenche les sauvegardes périodiques uniquement si des données ont été ajoutées, modifiées ou supprimées depuis la dernière sauvegarde. Dans le cas contraire, la sauvegarde prévue est annulée et reportée à l’échéance suivante. Aucune erreur n’est générée ; le report est toutefois indiqué dans le Journal des sauvegardes. Cette option permet notamment d’économiser du temps machine sur la sauvegarde d'applications principalement utilisées en consultation. A noter qu'elle ne prend pas en compte les éventuelles modifications apportées au fichier de structure ou aux fichiers joints. -> Ce paramètre concerne à la fois les sauvegardes de l'application et les sauvegardes de l’historique. +- **Backup only if the data file has been modified**: When this option is checked, 4D starts scheduled backups only if data has been added, changed or deleted since the last backup. Dans le cas contraire, la sauvegarde prévue est annulée et reportée à l’échéance suivante. Aucune erreur n’est générée ; le report est toutefois indiqué dans le Journal des sauvegardes. This option also allows saving machine time for the backup of applications principally used for viewing purposes. A noter qu'elle ne prend pas en compte les éventuelles modifications apportées au fichier de structure ou aux fichiers joints. +> This parameter concerns both application and log file backups. - **Effacer la sauvegarde la plus ancienne avant sauvegarde / après sauvegarde** : cette option n’est utilisée que si l’option “Conserver uniquement les N derniers fichiers de sauvegarde” est cochée. Elle vous permet de spécifier si 4D doit commencer par effacer l’archive la plus ancienne avant d’effectuer une sauvegarde (option **avant**) ou si l’effacement doit être effectué après la sauvegarde (option **après**). Pour que ce mécanisme fonctionne, l’archive la plus ancienne ne doit pas avoir été renommée ou déplacée. @@ -94,12 +94,12 @@ La modification des options de sauvegarde et de restauration est facultative. Le - **Réessayer dans N seconde(s), minute(s) ou heure(s)** : lorsque cette option est cochée, une nouvelle tentative de sauvegarde est effectuée à l’issue du délai défini. Ce mécanisme permet d’anticiper certaines circonstances bloquant la sauvegarde. Vous pouvez fixer un délai en secondes, minutes ou heures à l’aide du menu correspondant. Si la nouvelle tentative échoue également, une erreur est générée et l’échec est inscrit dans les zones de statut de la dernière sauvegarde et dans le Journal des sauvegardes. - **Annuler l’opération au bout de N tentatives** : ce paramètre permet de définir le nombre de fois que le module de sauvegarde réessaiera de lancer la sauvegarde en cas d’échec. Si, à l’issue du nombre d’essais défini, la sauvegarde n’a pas pu être effectuée, elle est annulée et l’erreur 1401 est générée (“Le nombre maximal de tentatives de sauvegarde est atteint, la sauvegarde automatique est temporairement désactivée”). Dans ce cas, aucune nouvelle sauvegarde automatique ne sera lancée tant que l’application n’aura pas été redémarrée ou qu’une sauvegarde manuelle n’aura été effectuée avec succès. Ce paramètre est utile notamment pour éviter qu’en cas d’impossibilité prolongée de la sauvegarde (nécessitant une intervention humaine), l’application n’effectue inutilement de nombreuses tentatives au détriment de ses performances. Par défaut, ce paramètre n’est pas coché. -> 4D considère qu’une sauvegarde a échoué si l'application n’était pas lancée au moment théorique de la sauvegarde automatique périodique. +> 4D considers a backup as failed if the application was not launched at the time when the scheduled automatic backup was set to be carried out. ### Archive Ces options s’appliquent aux fichiers de sauvegarde principaux et aux fichiers de sauvegarde de l’historique. -- **Taille du segment (Mo)** 4D vous permet de segmenter les archives, c’est-à-dire de les découper en morceaux de taille fixe. Ce fonctionnement permet par exemple de stocker une sauvegarde sur plusieurs volumes (DVDs, usb, etc.). Au moment de la restitution, 4D fusionnera automatiquement les segments. Chaque segment est appelé MonApplication[xxxx-yyyy].4BK, où xxxx représente le numéro de la sauvegarde et yyyy celui du segment. Par exemple, les trois segments de la sixième sauvegarde de la base MonApplication seront appelés MonApplication[0006-0001].4BK, MonApplication[0006-0002].4BK et MonApplication[0006-0003].4BK. Le menu **Taille du segment** est une combo box permettant de définir la taille en Mo de chaque segment de sauvegarde. Vous pouvez choisir une des tailles prédéfinies ou saisir une taille spécifique entre 0 et 2048. Si vous passez 0, aucune segmentation n’est effectuée (équivaut à la valeur **Aucune**). +- **Taille du segment (Mo)** 4D vous permet de segmenter les archives, c’est-à-dire de les découper en morceaux de taille fixe. Ce fonctionnement permet par exemple de stocker une sauvegarde sur plusieurs volumes (DVDs, usb, etc.). Au moment de la restitution, 4D fusionnera automatiquement les segments. Each segment is called MyApplication[xxxx-yyyy].4BK, where xxxx is the backup number and yyyy is the segment number. For example, the three segments of the MyApplication backup are called MyApplication[0006-0001].4BK, MyApplication[0006-0002].4BK and MyApplication[0006-0003].4BK. Le menu **Taille du segment** est une combo box permettant de définir la taille en Mo de chaque segment de sauvegarde. Vous pouvez choisir une des tailles prédéfinies ou saisir une taille spécifique entre 0 et 2048. Si vous passez 0, aucune segmentation n’est effectuée (équivaut à la valeur **Aucune**). - **Taux de compression** Par défaut, les sauvegardes sont compressées par 4D. En contrepartie, la phase de compression des fichiers peut ralentir sensiblement les sauvegardes dans le cas de la manipulation de gros volumes de données. L’option **Taux de compression** vous permet d’ajuster la compression : - **Aucun** : aucune compression n’est appliquée. La sauvegarde peut être sensiblement plus rapide mais les fichiers d’archives sont plus volumineux sur le disque. @@ -113,14 +113,14 @@ Ces options s’appliquent aux fichiers de sauvegarde principaux et aux fichiers ### Restitution automatique -- **Restituer la dernière sauvegarde si la base est endommagée** : lorsque cette option est cochée, le programme déclenche automatiquement la restitution du fichier de données de la dernière sauvegarde valide de l'application s’il détecte une anomalie (fichier corrompu par exemple) lors du lancement de l'application. Aucune intervention de l’utilisateur n’est requise ; l’opération est cependant consignée dans le Journal des sauvegardes. +- **Restore last backup if database is damaged**: When this option is checked, the program automatically starts the restore of the data file of the last valid backup of the application, if an anomaly is detected (corrupted file, for example) during application launch. Aucune intervention de l’utilisateur n’est requise ; l’opération est cependant consignée dans le Journal des sauvegardes. -- **Intégrer le dernier historique si la base est incomplète** : lorsque cette option est cochée, le programme intègre automatiquement l’historique lors de l’ouverture ou de la restitution de l'application. - - Lors de l’ouverture d'une application, l’historique courant est automatiquement intégré si 4D détecte que des opérations stockées dans l’historique ne sont pas présentes dans les données. Cette situation se produit par exemple lorsqu’une panne de courant a lieu alors que des opérations non encore écrites sur le disque se trouvaient dans le cache de données. - - Lors de la restitution de l'application, si le fichier d’historique courant ou un fichier de sauvegarde d’historique ayant le même numéro que le fichier de sauvegarde est stocké dans le même dossier, 4D examine son contenu. S’il contient des opérations non présentes dans le fichier de données, le programme l’intègre automatiquement. +- **Integrate last log file if database is incomplete**: When this option is checked, the program automatically integrates the log file when opening or restoring the application. + - When opening an application, the current log file is automatically integrated if 4D detects that there are operations stored in the log file that are not present in the data. Cette situation se produit par exemple lorsqu’une panne de courant a lieu alors que des opérations non encore écrites sur le disque se trouvaient dans le cache de données. + - When restoring an application, if the current log file or a log backup file having the same number as the backup file is stored in the same folder, 4D examines its contents. S’il contient des opérations non présentes dans le fichier de données, le programme l’intègre automatiquement. Aucune boîte de dialogue n’est présentée à l’utilisateur, l’opération est entièrement automatique. Le but est de faciliter au maximum la remise en route de l’exploitation. L’opération est consignée dans le Journal des sauvegardes. -> Dans le cas d'une restauration automatique, seuls les éléments suivants sont restaurés: - fichier .4DD - fichier .4DIndx - fichier .4DSyncData - fichier .4DSyncHeader - dossier External Data +> In the case of an automatic restore, only the following elements are restored: - .4DD file - .4DIndx file - .4DSyncData file - .4DSyncHeader file - External Data folder > -> Si vous souhaitez obtenir les fichiers joints ou les fichiers de projet, vous devez effectuer une [restauration manuelle](restore.md#manually-restoring-a-backup-standard-dialog). +> If you wish to get the attached files or the project files, you must perform a [manual restore](restore.md#manually-restoring-a-backup-standard-dialog). diff --git a/website/translated_docs/fr/Concepts/about.md b/website/translated_docs/fr/Concepts/about.md index ca317b8b3f399f..1163d11a82d5d6 100644 --- a/website/translated_docs/fr/Concepts/about.md +++ b/website/translated_docs/fr/Concepts/about.md @@ -3,60 +3,60 @@ id: about title: À propos du Langage 4D --- -Grâce à son langage 4D intégré, qui comprend plus de 1300 commandes, 4D est un outil de développement puissant pour les applications web, mobile ou desktop. Ce langage peut être utilisé pour effectuer plusieurs types de tâches allant de la réalisation de simples calculs à la création d’interfaces utilisateur personnalisées et complexes. Vous pouvez par exemple : +The 4D built-in language, consisting of more than 1300 commands, makes 4D a powerful development tool for web, mobile, or desktop applications. You can use the 4D language for many different tasks—from performing simple calculations to creating complex custom user interfaces. For example, you can: -- Accéder par programmation à tous les éditeurs de gestion des enregistrements (tris, recherches, etc.), -- Créer et imprimer des états et des étiquettes complexes avec les données de la base, -- Communiquer avec d’autres systèmes d’information, -- Envoyer des e-mails, -- Gérer des documents et des pages web, -- Importer et exporter des données entre des applications 4D et d’autres applications, -- Incorporer des procédures écrites dans d’autres langages que celui de 4D. +- Programmatically access any of the record management editors (order by, query, and so on), +- Create and print complex reports and labels with the information from the database, +- Communicate with other devices, +- Send emails, +- Manage documents and web pages, +- Import and export data between 4D applications and other applications, +- Incorporate procedures written in other languages into the 4D programming language. -La flexibilité et la puissance du langage de 4D en font l’outil idéal pour exécuter toute une gamme de fonctions de gestion de l’information. Les utilisateurs novices peuvent exécuter des calculs rapidement, les utilisateurs plus expérimentés peuvent personnaliser leurs applications sans connaissances préalables en programmation et les développeurs chevronnés peuvent utiliser ce langage puissant pour ajouter à leurs applications des fonctions sophistiquées, allant jusqu'au transfert de fichiers, aux communications et au suivi. Quant aux développeurs ayant une maîtrise de la programmation dans d’autres langages, ils peuvent ajouter leurs propres commandes au langage de 4D. +The flexibility and power of the 4D programming language make it the ideal tool for all levels of users and developers to accomplish a complete range of information management tasks. Novice users can quickly perform calculations. Experienced users without programming experience can customize their applications. Experienced developers can use this powerful programming language to add sophisticated features and capabilities to their applications, including file transfer, communications, monitoring. Developers with programming experience in other languages can add their own commands to the 4D language. -## Qu'est-ce qu'un langage ? +## What is a Language? -Le langage de 4D n’est pas très différent de celui que nous utilisons tous les jours. C’est une forme de communication qui permet d'exprimer des idées, d'informer ou de donner des instructions. Tout comme un langage parlé, celui de 4D se compose d'un vocabulaire, d’une grammaire et d’une syntaxe, que vous employez pour indiquer au programme comment gérer votre application et vos données. +The 4D language is not very different from the spoken language we use every day. It is a form of communication used to express ideas, inform, and instruct. Like a spoken language, 4D has its own vocabulary, grammar, and syntax; you use it to tell 4D how to manage your application and data. -Il n’est pas nécessaire de connaître entièrement le langage. Pour pouvoir vous exprimer en anglais, vous n’êtes pas obligé de connaître la totalité de la langue anglaise ; en réalité, un peu de vocabulaire suffit. Il en va de même pour 4D — il vous suffit de connaître un minimum du langage pour être productif, et vous en apprendrez de plus en plus au fur et à mesure de vos besoins. +You do not need to know everything in the language in order to work effectively with 4D. In order to speak, you do not need to know the entire English language; in fact, you can have a small vocabulary and still be quite eloquent. The 4D language is much the same—you only need to know a small part of the language to become productive, and you can learn the rest as the need arises. -## Pourquoi utiliser un langage ? +## Why use a Language? -À première vue, un langage de programmation dans 4D peut sembler inutile. En effet, 4D propose des outils puissants et entièrement paramétrables en mode Développement, permettant d'exécuter une grande variété de tâches de gestion des données sans programmation. Les opérations fondamentales telles que la saisie de données, les requêtes, les tris et la création d’états s'effectuent facilement. Il existe aussi de nombreuses autres possibilités, telles que les filtres de validation des données, les aides à la saisie, la représentation graphique et la génération d’étiquettes. +At first it may seem that there is little need for a programming language in 4D. In the Design environment, 4D provides flexible tools that require no programming to perform a wide variety of data management tasks. Fundamental tasks, such as data entry, queries, sorting, and reporting are handled with ease. In fact, many extra capabilities are available, such as data validation, data entry aids, graphing, and label generation. -Alors, pourquoi avons-nous besoin d'un langage 4D ? Voici quelques-uns de ses principaux rôles : +Then why do we need a 4D language? Here are some of its uses: -- Automatiser les tâches répétitives : par exemple la modification de données, la génération d’états complexes et la réalisation de longues séries d’opérations ne nécessitant pas l’intervention d’un utilisateur. -- Contrôler l’interface utilisateur : vous pouvez gérer les fenêtres et les menus, contrôler les formulaires et les objets d’interface. -- Gérer les données de manière très fine : cette gestion inclut le traitement de transactions, les systèmes de validation complexes, la gestion multi-utilisateurs, l’utilisation des ensembles et des sélections temporaires. -- Contrôler l’ordinateur : vous pouvez contrôler les communications par le port série, la gestion des documents et des erreurs. -- Créer des applications : vous pouvez créer des applications simples, personnalisées et autonomes. -- Ajouter des fonctionnalités au serveur Web 4D intégré : par exemple, vous pouvez créer et mettre à jour des pages web dynamiques contenant vos données. +- Automate repetitive tasks: These tasks include data modification, generation of complex reports, and unattended completion of long series of operations. +- Control the user interface: You can manage windows and menus, and control forms and interface objects. +- Perform sophisticated data management: These tasks include transaction processing, complex data validation, multi-user management, sets, and named selection operations. +- Control the computer: You can control serial port communications, document management, and error management. +- Create applications: You can create easy-to-use, customized applications that run stand-alone. +- Add functionality to the built-in 4D Web server: build and update dynamic web pages filled with your data. -Le langage vous permet de contrôler totalement la structure et le fonctionnement de votre application. 4D propose de puissants éditeurs “génériques”, mais le langage vous offre la possibilité de personnaliser votre application autant que vous voulez. +The language lets you take complete control over the design and operation of your application. 4D provides powerful “generic” editors, but the language lets you customize your application to whatever degree you require. -## Prendre le contrôle de vos données +## Taking Control of Your Data -Le langage de 4D vous permet de prendre le contrôle total de vos données, d’une manière à la fois puissante et élégante. Il reste d’un abord facile pour un débutant, et est suffisamment riche pour un développeur d’applications. Il permet de passer par étapes d’une simple exploitation des fonctions intégrées de 4D à une application entièrement personnalisée. +The 4D language lets you take complete control of your data in a powerful and elegant manner. The language is easy enough for a beginner, and sophisticated enough for an experienced application developer. It provides smooth transitions from built-in database functions to a completely customized application. -Les commandes du langage de 4D vous donnent la possibilité d’accéder aux éditeurs standard de gestion des enregistrements. Par exemple, lorsque vous utilisez la commande `QUERY`, vous accédez à l’Editeur de quêtes (accessible en mode Développement via la commande Chercher... dans le menu Enregistrements). Vous pouvez, si vous le voulez, indiquer explicitement à la commande Query ce qu’elle doit rechercher. Par exemple, `QUERY([People];[People]Last Name="Dupont")` trouvera toutes les personnes nommées Dupont dans votre base. +The commands in the 4D language provide access to the standard record management editors. For example, when you use the `QUERY` command, you are presented with the Query Editor (which can be accessed in the Design mode using the Query command in the Records menu. You can tell the command to search for explicitly described data. For example, `QUERY([People];[People]Last Name="Smith")` will find all the people named Smith in your database. -Le langage 4D est très puissant — une commande remplace souvent des centaines, voire des milliers de lignes de code écrites dans les langages informatiques traditionnels. Et cette puissance s’accompagne d'une réelle simplicité : les commandes sont écrites en français. Par exemple, vous utilisez la commande `QUERY` pour effectuer une recherche ; pour ajouter un nouvel enregistrement, vous appelez la commande `ADD RECORD`. +The 4D language is very powerful—one command often replaces hundreds or even thousands of lines of code written in traditional computer languages. Surprisingly enough, with this power comes simplicity—commands have plain English names. For example, to perform a query, you use the `QUERY` command; to add a new record, you use the `ADD RECORD` command. -Le langage est conçu de telle manière que vous puissiez facilement accomplir n’importe quelle tâche. L’ajout d’un enregistrement, le tri des enregistrements, la recherche de valeurs et les autres opérations de même type sont définies par des commandes simples et directes. Mais les routines peuvent également contrôler les ports série, lire des documents sur le disque, traiter des systèmes de transactions complexes, et plus encore. +The language is designed for you to easily accomplish almost any task. Adding a record, sorting records, searching for data, and similar operations are specified with simple and direct commands. But the language can also control the serial ports, read disk documents, control sophisticated transaction processing, and much more. -Même les opérations les plus compliquées se définissent de manière relativement simple. Il serait inimaginable de les réaliser sans le langage de 4D. Cependant, même à l’aide de la puissance des commandes du langage, certaines tâches peuvent se révéler complexes et difficiles. Ce n’est pas l’outil lui-même qui fait le travail ; une tâche peut représenter en soi une difficulté, l’outil ne fait que faciliter son traitement. Par exemple, un logiciel de traitement de texte permet d’écrire un livre plus rapidement et plus facilement, mais il ne l’écrira pas à votre place. Le langage de 4D vous permet de gérer plus facilement vos données et d’appréhender les tâches ardues en toute confiance. +The 4D language accomplishes even the most sophisticated tasks with relative simplicity. Performing these tasks without using the language would be unimaginable for many. Even with the language’s powerful commands, some tasks can be complex and difficult. A tool by itself does not make a task possible; the task itself may be challenging and the tool can only ease the process. For example, a word processor makes writing a book faster and easier, but it will not write the book for you. Using the 4D language will make the process of managing your data easier and will allow you to approach complicated tasks with confidence. -## Est-ce un langage informatique “traditionnel” ? +## Is it a “Traditional” Computer Language? -Si vous êtes familier avec les langages informatiques traditionnels, ce paragraphe peut vous intéresser. Si ce n’est pas le cas, vous pouvez passer directement au paragraphe suivant. +If you are familiar with traditional computer languages, this section may be of interest. If not, you may want to skip it. -Le langage 4D n’est pas un langage informatique traditionnel. C’est un des langages les plus souples et les plus innovants que l’on puisse trouver aujourd’hui sur micro-ordinateur. Le langage a été conçu pour s’adapter à vous, et non l’inverse. +The 4D language is not a traditional computer language. It is one of the most innovative and flexible languages available on a computer today. It is designed to work the way you do, and not the other way around. -Pour utiliser les langages traditionnels, vous devez avant tout réaliser des maquettes détaillées. C’est même l'une des principales phases d’un développement. 4D vous permet de commencer à utiliser le langage à tout moment et dans n’importe quelle partie de votre projet. Vous pouvez commencer par ajouter une méthode objet dans un formulaire, puis plus tard une ou deux méthodes formulaires. Comme votre projet devient plus sophistiquée, vous pouvez ajouter une méthode projet contrôlée par un menu. Vous êtes totalement libre d’utiliser une petite partie du langage ou une partie plus étendue. Ce n’est pas “tout ou rien”, comme c’est le cas dans beaucoup d’autres bases de données. +To use traditional languages, you must do extensive planning. In fact, planning is one of the major steps in development. 4D allows you to start using the language at any time and in any part of your project. You may start by adding a method to a form, then later add a few more methods. As your application becomes more sophisticated, you might add a project method controlled by a menu. You can use as little or as much of the language as you want. It is not “all or nothing,” as is the case with many other databases. -Les langages traditionnels vous obligent à définir et à pré-déclarer vos objets d'interface sous une forme syntaxique rigide. Dans 4D, créez simplement un objet, tel qu'un bouton, et utilisez-le. 4D se charge de la gestion de l'objet. Par exemple, pour utiliser un bouton, il suffit de le dessiner dans un formulaire et de lui donner un nom. Lorsque l’utilisateur clique sur le bouton, le langage déclenche automatiquement vos méthodes. +Traditional languages force you to define and pre-declare interface objects in formal syntactic terms. In 4D, you simply create an object, such as a button, and use it. 4D automatically manages the object for you. For example, to use a button, you draw it on a form and name it. When the user clicks the button, the language automatically notifies your methods. -Les langages traditionnels sont souvent rigides et inflexibles, et exigent que les commandes soient saisies dans un style très formel et contraignant. Le langage de 4D rompt avec la tradition, au grand bénéfice de l’utilisateur. \ No newline at end of file +Traditional languages are often rigid and inflexible, requiring commands to be entered in a very formal and restrictive style. The 4D language breaks with tradition, and the benefits are yours. \ No newline at end of file diff --git a/website/translated_docs/fr/Concepts/arrays.md b/website/translated_docs/fr/Concepts/arrays.md index be6596c090aa53..bd827be6e8c781 100644 --- a/website/translated_docs/fr/Concepts/arrays.md +++ b/website/translated_docs/fr/Concepts/arrays.md @@ -3,33 +3,33 @@ id: arrays title: Tableaux --- -Un **tableau** est une série ordonnée de **variables** de même type. Chaque variable est appelée un **élément** du tableau. La taille du tableau doit être définie au moment de sa création ; vous pouvez ensuite la modifier aussi souvent que nécessaire en ajoutant, insérant, ou supprimant des éléments, ou en appelant de nouveau la commande que vous avez utilisée pour créer le tableau. Les éléments sont numérotés de 1 à N, où N est la taille du tableau. Un tableau a toujours un [élément zéro](#using-the-element-zero-of-an-array). Les tableaux sont des variables 4D. Comme toute variable, un tableau a une portée et suit les règles du langage 4D, bien qu'il existe quelques différences spécifiques. -> Généralement, il est recommandé d'utiliser des **collections** plutôt que des **tableaux**. Les collections sont plus souples et fournissent un large éventail de méthodes spécifiques. Pour plus d'informations, veuillez consutler la section [Collection](Concepts/dt_collection.md). +An **array** is an ordered series of **variables** of the same type. Each variable is called an **element** of the array. An array is given its size when it is created; you can then resize it as many times as needed by adding, inserting, or deleting elements, or by resizing the array using the same command used to create it. Array elements are numbered from 1 to N, where N is the size of the array. An array always has a special [element zero](#using-the-element-zero-of-an-array). Arrays are 4D variables. Like any variable, an array has a scope and follows the rules of the 4D language, though with some unique differences. +> In most cases, it is recommended to use **collections** instead of **arrays**. Collections are more flexible and provide a wide range of dedicated methods. For more information, please refer to the [Collection](Concepts/dt_collection.md) section. -## Créer des tableaux +## Creating Arrays -Vous créez un tableau au moyen de l'une des commandes de déclaration du thème "Tableaux". Chaque commande de déclaration de tableau peut créer ou redimensionner des tableaux à une ou à deux dimensions. Pour plus d'informations sur les tableaux à deux dimensions, reportez-vous à la section [Tableaux à deux dimensions](#two-dimensional-arrays). +You create an array with one of the array declaration commands from the "Array" theme. Each array declaration command can create or resize one-dimensional or two-dimensional arrays. For more information about two-dimensional arrays, see the [two dimensional arrays](#two-dimensional-arrays) section. -Cette ligne de code crée (déclare) un tableau d'entiers de 10 éléments : +The following line of code creates (declares) an Integer array of 10 elements: ```4d ARRAY INTEGER(aiAnArray;10) ``` -Ensuite, cette ligne de code redimensionne le même tableau à 20 éléments : +Then, the following code resizes that same array to 20 elements: ```4d ARRAY INTEGER(aiAnArray;20) ``` -Enfin, cette ligne de code redimensionne le même tableau à 0 élément : +Then, the following code resizes that same array to no elements: ```4d ARRAY INTEGER(aiAnArray;0) ``` -## Affecter des valeurs dans un tableau +## Assigning values in arrays -Vous référencez les éléments d'un tableau en utilisant des accolades ({…} ). Un nombre entre accolades donne accès à l'adresse d'un élément particulier. L'exemple ci-dessous place cinq noms dans le tableau nommé atNoms et les affiche ensuite dans une fenêtre d'alerte : +You reference the elements in an array by using curly braces ({…}). A number is used within the braces to address a particular element; this number is called the element number. The following lines put five names into the array called atNames and then display them in alert windows: ```4d ARRAY TEXT(atNames;5) @@ -42,84 +42,84 @@ Vous référencez les éléments d'un tableau en utilisant des accolades ({…} ALERT("The element #"+String($vlElem)+" is equal to: "+atNames{$vlElem}) End for ``` -Notez la syntaxe atNoms{$vlElem}. Au lieu de spécifier un nombre littéral comme atNoms{3}, vous pouvez utiliser une variable numérique indiquant à quel élément d'un tableau vous accédez. Si vous utilisez les itérations permises par les structures répétitives (`For...End for`, `Repeat...Until` or `While...End while`), vous pouvez accéder à tout ou partie des éléments d'un tableau avec très peu de code. +Note the syntax atNames{$vlElem}. Rather than specifying a numeric literal such as atNames{3}, you can use a numeric variable to indicate which element of an array you are addressing. Using the iteration provided by a loop structure (`For...End for`, `Repeat...Until` or `While...End while`), compact pieces of code can address all or part of the elements in an array. -**Important :** Veillez à ne pas confondre l'opérateur d'affectation (:=) avec l'opérateur de comparaison égal (=). L'affectation et la comparaison sont deux opérations totalement différentes. +**Important:** Be careful not to confuse the assignment operator (:=) with the comparison operator, equal (=). Assignment and comparison are very different operations. -### Affecter un tableau à un autre -Contrairement à ce que vous pouvez faire avec des variables de type Texte ou Chaîne, vous ne pouvez pas affecter un tableau à un autre tableau. Pour copier (affecter) un tableau à un autre, utilisez la fonction `COPY ARRAY`. +### Assigning an array to another array +Unlike text or string variables, you cannot assign one array to another. To copy (assign) an array to another one, use `COPY ARRAY`. -## Utiliser l'élément zéro d'un tableau +## Using the element zero of an array -Un tableau a toujours un élément zéro. Même si l'élément zéro n'est pas affiché lorsqu'un tableau est utilisé pour remplir un objet de formulaire, vous pouvez l'utiliser sans réserve(*) dans le langage. +An array always has an element zero. While element zero is not shown when an array supports a form object, there is no restriction(*) in using it with the language. -Voici un autre exemple : vous souhaitez initialiser un objet de formulaire avec une valeur texte mais sans définir de valeur par défaut. Vous pouvez utiliser l'élément zéro du tableau : +Here is another example: you want to initialize a form object with a text value but without setting a default value. You can use the element zero of the array: ```4d - // // méthode pour une combo box ou une liste déroulante - // liée au tableau de variables atName + // method for a combo box or drop-down list + // bound to atName variable array Case of - : Form event code=On Load) - // Initialise le tableau (comme indiqué ci-dessus) - // Mais utilise l'élément zéro + :(Form event code=On Load) + // Initialize the array (as shown further above) + // But use the element zero ARRAY TEXT(atName;5) - atName{0}:=Veuillez sélectionner un élément" + atName{0}:=Please select an item" atName{1}:="Text1" atName{2}:="Text2" atName{3}:="Text3" atName{4}:="Text4" atName{5}:="Text5" - // Positionne le tableau sur l'élément 0 - atName: = 0 + // Position the array to element 0 + atName:=0 End case ``` (*) However, there is one exception: in an array type List Box, the zero element is used internally to store the previous value of an element being edited, so it is not possible to use it in this particular context. -## Tableaux à deux dimensions +## Two-dimensional Arrays -Chaque commande de déclaration de tableau permet de créer ou de redimensionner des tableaux à une ou à deux dimensions. Exemple : +Each of the array declaration commands can create or resize one-dimensional or two-dimensional arrays. Example: ```4d - ARRAY TEXT(atTopics;100;50) // Créer un tableau texte composé de 100 lignes de 50 colonnes + ARRAY TEXT(atTopics;100;50) // Creates a text array composed of 100 rows of 50 columns ``` -Les tableaux à deux dimensions sont essentiellement des objets de langage ; vous ne pouvez ni les afficher ni les imprimer. +Two-dimensional arrays are essentially language objects; you can neither display nor print them. -Dans l'exemple prédédent : +In the previous example: -- atTopics est un tableau à deux dimensions -- atTopics{8}{5} est le 5e élément (5e colonne...) de la 8e ligne -- atTopics{20} est la 20e ligne et est elle-même un tableau à une dimension -- `Size of array(atTopics)` retourne 100, qui est le nombre de lignes -- `Size of array(atTopics{17})` retourne 50, qui est le nombre de colonnes de la 17e ligne +- atTopics is a two-dimensional array +- atTopics{8}{5} is the 5th element (5th column...) of the 8th row +- atTopics{20} is the 20th row and is itself a one-dimensional array +- `Size of array(atTopics)` returns 100, which is the number of rows +- `Size of array(atTopics{17})` returns 50, which the number of columns for the 17th row -Dans l'exemple suivant, un pointeur vers chaque champ de chaque table de la base est stocké dans un tableau à deux dimensions : +In the following example, a pointer to each field of each table in the database is stored in a two-dimensional array: ```4d C_LONGINT($vlLastTable;$vlLastField) C_LONGINT($vlFieldNumber) - // Créer autant de lignes (vides et sans colonnes) qu'il y a de tables - $vlLastTable:=Get last table number - ARRAY POINTER(<>apFields;$vlLastTable;0) //Tableau 2D avec N lignes et zéro colonnes - // Pour chaque table + // Create as many rows (empty and without columns) as there are tables + $vlLastTable:=Get last table number + ARRAY POINTER(<>apFields;$vlLastTable;0) //2D array with X rows and zero columns + // For each table For($vlTable;1;$vlLastTable) If(Is table number valid($vlTable)) $vlLastField:=Get last field number($vlTable) - // Donner la valeur des éléments - $vlColumnNumber:=0 + // Give value of elements + $vlColumnNumber:=0 For($vlField;1;$vlLastField) If(Is field number valid($vlTable;$vlField)) $vlColumnNumber:=$vlColumnNumber+1 - // Insérer une colonne dans la ligne de la table en cours - INSERT IN ARRAY(<>apFields{$vlTable};$vlColumnNumber;1) - // Affecter la "celulle" avec le pointeur + //Insert a column in a row of the table underway + INSERT IN ARRAY(<>apFields{$vlTable};$vlColumnNumber;1) + //Assign the "cell" with the pointer <>apFields{$vlTable}{$vlColumnNumber}:=Field($vlTable;$vlField) End if End for @@ -127,13 +127,13 @@ Dans l'exemple suivant, un pointeur vers chaque champ de chaque table de la base End for ``` -Dans la mesure où le tableau à deux dimensions a été initialisé, vous pouvez obtenir ainsi les pointeurs vers les champs d'une table de votre choix : +Provided that this two-dimensional array has been initialized, you can obtain the pointers to the fields for a particular table in the following way: ```4d - // Obtenir les pointeurs vers les champs pour la table affichée à l'écran: + // Get the pointers to the fields for the table currently displayed at the screen: COPY ARRAY(◊apFields{Table(Current form table)};$apTheFieldsIamWorkingOn) - // Initialiser les champs booléens et date -For($vlElem;1;Size of array($apTheFieldsIamWorkingOn)) + // Initialize Boolean and Date fields + For($vlElem;1;Size of array($apTheFieldsIamWorkingOn)) Case of :(Type($apTheFieldsIamWorkingOn{$vlElem}->)=Is date) $apTheFieldsIamWorkingOn{$vlElem}->:=Current date @@ -143,40 +143,40 @@ For($vlElem;1;Size of array($apTheFieldsIamWorkingOn)) End for ``` -**Note :** Comme le montre cet exemple, les lignes des tableaux à deux dimensions peuvent être ou non de la même taille. +**Note:** As this example suggests, rows of a two-dimensional arrays can be the same size or different sizes. -## Tableaux et mémoire +## Arrays and Memory -A la différence des données que vous stockez sur disque lorsque vous utilisez des tables ou des enregistrements, un tableau réside toujours en mémoire dans son intégralité. +Unlike the data you store on disk using tables and records, an array is always held in memory in its entirety. -Par exemple, si tous les codes postaux américains étaient saisis dans une table [Codes Postaux], celle-ci contiendrait environ 100 000 enregistrements. De plus, cette table comporterait plusieurs champs : le code postal lui-même ainsi que la ville, le comté et l'état correspondants. Si vous ne sélectionnez que les codes postaux de Californie, 4D crée la sélection d'enregistrements correspondante à l'intérieur de la table [Codes Postaux], et ensuite ne charge les enregistrements que lorsque vous en avez besoin (par exemple, pour les afficher ou les imprimer). En d'autres termes, vous travaillez avec une série ordonnée de valeurs (du même type pour chaque champ) partiellement chargée du disque en mémoire. +For example, if all US zip codes were entered in the [Zip Codes] table, it would contain about 100,000 records. In addition, that table would include several fields: the zip code itself and the corresponding city, county, and state. If you select only the zip codes from California, the 4D database engine creates the corresponding selection of records within the [Zip Codes] table, and then loads the records only when they are needed (i.e., when they are displayed or printed). In order words, you work with an ordered series of values (of the same type for each field) that is partially loaded from the disk into the memory by the database engine of 4D. -Procéder de la même manière avec les tableaux serait laborieux, pour les raisons suivantes : +Doing the same thing with arrays would be prohibitive for the following reasons: -- Pour maintenir les quatre types d'information (code postal, ville, comté, état), vous auriez besoin de quatre grands tableaux en mémoire. -- Comme un tableau réside en mémoire dans son intégralité, vous seriez obligé de garder tous les codes postaux en mémoire pendant toute la session de travail, même si les données n'étaient pas utilisées en permanence. -- Toujours parce qu'un tableau réside en mémoire dans son intégralité, les quatre tableaux devraient être chargés ou sauvegardés sur le disque à chaque fois que vous démarreriez ou quitteriez l'application, quand bien même les données ne seraient d'aucune utilité pour la session de travail. +- In order to maintain the four information types (zip code, city, county, state), you would have to maintain four large arrays in memory. +- Because an array is always held in memory in its entirety, you would have to keep all the zip codes information in memory throughout the whole working session, even though the data is not always in use. +- Again, because an array is always held in memory in its entirety, each time the application is started and then quit, the four arrays would have to be loaded and then saved on the disk, even though the data is not used or modified during the working session. -**Conclusion :** Les tableaux ont pour rôle de manipuler une certaine quantité de données pendant une période brève. En contrepartie, comme ils résident en mémoire, ils sont d'une utilisation rapide et facile. +**Conclusion:** Arrays are intended to hold reasonable amounts of data for a short period of time. On the other hand, because arrays are held in memory, they are easy to handle and quick to manipulate. -Cependant, dans certaines circonstances, vous pouvez avoir besoin de tableaux contenant des centaines ou des milliers d'éléments. Voici les formules à appliquer pour calculer la quantité de mémoire utilisée pour chaque type de tableau : +However, in some circumstances, you may need to work with arrays holding hundreds or thousands of elements. The following table lists the formulas used to calculate the amount of memory used for each array type: -| Type de Tableau | Calcul de la quantité de mémoire en octets | -| --------------- | ----------------------------------------------------------------------- | -| Blob | (1+nombre d'éléments) * 12 + somme de la taille de chaque blob | -| Booléen | (31+nombre d'éléments)/8 | -| Date | (1+nombre d'éléments) * 6 | -| Entier long | (1+nombre d'éléments) * 2 | -| Entier long | (1+nombre d'éléments) * 4 | -| Objet | (1+nombre d'éléments) * 8 + somme de la taille de chaque objet | -| Image | (1+nombre d'éléments) * 8 + somme de la taille de chaque image | -| Pointeur | (1+nombre d'éléments) * 8 + somme de la taille de chaque pointeur | -| Réel | (1+nombre d'éléments) * 8 | -| Texte | (1+nombre d'éléments) * 20 + (somme de la taille de chaque texte) * 2 | -| Heure | (1+nombre d'éléments) * 4 | -| Deux dimensions | (1+nombre d'éléments) * 16 + somme de la taille de chaque tableau | +| Array Type | Formula for determining Memory Usage in Bytes | +| --------------- | -------------------------------------------------------------------- | +| Blob | (1+number of elements) * 12 + Sum of the size of each blob | +| Booléen | (31+number of elements)\8 | +| Date | (1+number of elements) * 6 | +| Integer | (1+number of elements) * 2 | +| Long Integer | (1+number of elements) * 4 | +| Objet | (1+number of elements) * 8 + Sum of the size of each object | +| Image | (1+number of elements) * 8 + Sum of the size of each picture | +| Pointeur | (1+number of elements) * 8 + Sum of the size of each pointer | +| Real | (1+number of elements) * 8 | +| Text | (1+number of elements) * 20 + (Sum of the length of each text) * 2 | +| Heure | (1+number of elements) * 4 | +| Two-dimensional | (1+number of elements) * 16 + Sum of the size of each array | -**Notes :** +**Notes:** -- La taille d'un texte en mémoire se calcule par la formule ((Longueur + 1) * 2) -- Quelques octets supplémentaires sont requis pour le repérage de l'élément, le nombre d'éléments et le tableau lui-même. \ No newline at end of file +- The size of a text in memory is calculated using this formula: ((Length + 1) * 2) +- A few additional bytes are required to keep track of the selected element, the number of elements, and the array itself. \ No newline at end of file diff --git a/website/translated_docs/fr/Concepts/cf_branching.md b/website/translated_docs/fr/Concepts/cf_branching.md index ca8de295448787..1839119c0ab87b 100644 --- a/website/translated_docs/fr/Concepts/cf_branching.md +++ b/website/translated_docs/fr/Concepts/cf_branching.md @@ -3,31 +3,31 @@ id: branching title: Structures conditionnelles --- -Une structure de branchement permet aux méthodes de tester une condition et d'emprunter des chemins alternatifs, en fonction du résultat. +A branching structure allows methods to test a condition and take alternative paths, depending on the result. ## If...Else...End if -La syntaxe de la structure conditionnelle `If...Else...End if` est la suivante : +The formal syntax of the `If...Else...End if` control flow structure is: ```4d If(Boolean_Expression) - instruction(s) + statement(s) Else - instruction(s) -End if + statement(s) + End if ``` -A noter que l'élément `Else` est optionnel, vous pouvez écrire : +Note that the `Else` part is optional; you can write: ```4d If(Boolean_Expression) - instruction(s) + statement(s) End if ``` -La structure `If...Else...End if` permet à votre méthode de choisir dans une alternative, en fonction du résultat, TRUE ou FALSE, d’un test (une expression booléenne). Si l’expression booléenne est TRUE, les instructions qui suivent immédiatement le test sont exécutées. Si l’expression booléenne est FALSE, les instructions suivant la ligne Else sont exécutées. Le `Else` est optionnel ; lorsqu’il est omis, c’est la première ligne d’instructions suivant le `End if` (s’il y en a une) qui est exécutée. +The `If...Else...End if` structure lets your method choose between two actions, depending on whether a test (a Boolean expression) is TRUE or FALSE. When the Boolean expression is TRUE, the statements immediately following the test are executed. If the Boolean expression is FALSE, the statements following the Else statement are executed. The `Else` statement is optional; if you omit Else, execution continues with the first statement (if any) following the `End if`. -A noter que l'expression booléenne est toujours évaluée en totalité. Examinons en particulier le test suivant : +Note that the Boolean expression is always fully evaluated. Consider in particular the following test: ```4d If(MethodA & MethodB) @@ -35,7 +35,7 @@ A noter que l'expression booléenne est toujours évaluée en totalité. Examino End if ``` -L'expression n'est TRUE que si les deux méthodes sont TRUE. Or, même si _MethodA_ retourne FALSE, 4D évaluera quand même _MethodB_, ce qui représente une perte de temps inutile. Dans ce cas, il est préférable d'utiliser une structure du type : +he expression is TRUE only if both methods are TRUE. However, even if _MethodA_ returns FALSE, 4D will still evaluate _MethodB_, which is a useless waste of time. In this case, it is more interesting to use a structure like: ```4d If(MethodA) @@ -45,189 +45,177 @@ L'expression n'est TRUE que si les deux méthodes sont TRUE. Or, même si _Metho End if ``` -Le résultat est équivalent et _MethodB_ n'est évaluée que si nécessaire. +The result is similar and _MethodB_ is evaluated only if necessary. -### Exemple +### Example ```4d - // Demander à l'utilisateur de saisir un nom + // Ask the user to enter a name $Find:=Request(Type a name) If(OK=1) QUERY([People];[People]LastName=$Find) Else ALERT("You did not enter a name.") - End if End if ``` -**Astuce :** Il n'est pas obligatoire que des instructions soient exécutées dans chaque branche de l'alternative. Lorsque vous développez un algorithme, ou lorsque vous poursuivez un but précis, rien ne vous empêche d'écrire : +**Tip:** Branching can be performed without statements to be executed in one case or the other. When developing an algorithm or a specialized application, nothing prevents you from writing: ```4d - If(Expression_booléenne) + If(Boolean_Expression) Else - instruction(s) + statement(s) End if ``` -ou : +or: ```4d - If(Expression_booléenne) - instruction(s) + If(Boolean_Expression) + statement(s) Else End if ``` -## Au cas ou...Sinon...Fin de cas +## Case of...Else...End case -La syntaxe de la structure conditionnelle `Case of...Else...End case` est la suivante : +The formal syntax of the `Case of...Else...End case` control flow structure is: ```4d Case of - :(Expression_booléenne) - instruction(s) - :(Expression_booléenne) + :(Boolean_Expression) + statement(s) + :(Boolean_Expression) statement(s) . . . - :(Expression_booléenne) - instruction(s) + :(Boolean_Expression) + statement(s) Else - instruction(s) + statement(s) End case ``` -A noter que l'élément `Else` est optionnel, vous pouvez écrire : +Note that the `Else` part is optional; you can write: ```4d Case of - :(Expression_booléenne) - instruction(s) - :(Expression_booléenne) + :(Boolean_Expression) + statement(s) + :(Boolean_Expression) statement(s) . . . - :(Expression_booléenne) - instruction(s) + :(Boolean_Expression) + statement(s) End case ``` -Tout comme la structure `If...Else...End if`, la structure `Case of...Else...End case` permet également à votre méthode de choisir parmi plusieurs séquences d’instructions. A la différence de la structure `If...Else...End`, la structure `Case of...Else...End case` peut tester un nombre illimité d’expressions booléennes et exécuter la séquence d’instructions correspondant à la valeur TRUE. +As with the `If...Else...End if` structure, the `Case of...Else...End case` structure also lets your method choose between alternative actions. Unlike the `If...Else...End` if structure, the `Case of...Else...End case` structure can test a reasonable unlimited number of Boolean expressions and take action depending on which one is TRUE. -Chaque expression booléenne débute par le caractère deux points (`:`). La combinaison de deux points et d’une expression booléenne est appelée un cas. Par exemple, la ligne suivante est un cas : +Each Boolean expression is prefaced by a colon (`:`). This combination of the colon and the Boolean expression is called a case. For example, the following line is a case: ```4d :(bValidate=1) ``` -Seules les instructions suivant le premier cas TRUE (et ce, jusqu’au cas suivant) seront exécutées. Si aucun des cas n’est TRUE, aucune instruction n’est exécutée (s'il n'y a pas d'élément `Else`). +Only the statements following the first TRUE case (and up to the next case) will be executed. If none of the cases are TRUE, none of the statements will be executed (if no `Else` part is included). -Vous pouvez placer une instruction Else après le dernier cas. Si tous les cas sont FALSE, les instructions suivant le `Else` seront exécutées. +You can include an Else statement after the last case. If all of the cases are FALSE, the statements following the `Else` will be executed. -### Exemple +### Example -Cet exemple teste une variable numérique et affiche une boîte de dialogue d’alerte comportant un simple mot : +This example tests a numeric variable and displays an alert box with a word in it: ```4d Case of - :(vResult=1) //Tester si le chiffre est 1 - ALERT("One.") //Si le chiffre est 1, afficher une alerte - :(vResult=2) //Tester si le chiffre est 2 - ALERT("Two.") //Si le chiffre est 2, afficher une alerte - :(vResult=3) //Tester si le chiffre est 3 - ALERT("Three.") //Si le chiffre est 3, afficher une alerte - Else //Si le chiffre n'est pas 1, 2 ou 3, afficher une alerte + :(vResult=1) //Test if the number is 1 + ALERT("One.") //If it is 1, display an alert + :(vResult=2) //Test if the number is 2 + ALERT("Two.") //If it is 2, display an alert + :(vResult=3) //Test if the number is 3 + ALERT("Three.") //If it is 3, display an alert + Else //If it is not 1, 2, or 3, display an alert ALERT("It was not one, two, or three.") - //déclaration(s) End case ``` -A titre de comparaison, voici la version avec `If...Else...End if` de la même méthode : +For comparison, here is the `If...Else...End if` version of the same method: ```4d - If(vResult=1) //Tester si le chiffre est 1 - ALERT("One.") //Si le chiffre est 1, afficher une alerte + If(vResult=1) //Test if the number is 1 + ALERT("One.") //If it is 1, display an alert Else - If(vResult=2) //Tester si le chiffre est 2 - ALERT("Two.") //Si le chiffre est 2, afficher une alerte + If(vResult=2) //Test if the number is 2 + ALERT("Two.") //If it is 2, display an alert Else - If(vResult=3) //Tester si le chiffre est 3 - ALERT("Three.") //Si le chiffre est 3, afficher une alerte - Else //Si le chiffre n'est pas 1, 2 ou 3, afficher une alerte - ALERT("It was not one, two, or three.") + If(vResult=3) //Test if the number is 3 + ALERT("Three.") //If it is 3, display an alert + Else //If it is not 1, 2, or 3, display an alert + ALERT("It was not one, two, or three.") End if End if End if ``` -Rappelez-vous qu’avec une structure de type `Case of...Else...End case`, seul le premier cas TRUE rencontré est exécuté. Même si d’autres cas sont TRUE, seules les instructions suivant le premier cas TRUE seront prises en compte. +Remember that with a `Case of...Else...End case` structure, only the first TRUE case is executed. Even if two or more cases are TRUE, only the statements following the first TRUE case will be executed. -Par conséquent, lorsque vous testez dans la même méthode des cas simples et des cas complexes, vous devez placer les cas complexes avant les cas simples, sinon ils ne seront jamais exécutés. Par exemple, si vous souhaitez traiter le cas simple (vResult=1) et le cas complexe (vResult=1) & (vCondition#2) et que vous structurez la méthode de la manière suivante : +Consequently, when you want to implement hierarchical tests, you should make sure the condition statements that are lower in the hierarchical scheme appear first in the test sequence. For example, the test for the presence of condition1 covers the test for the presence of condition1&condition2 and should therefore be located last in the test sequence. For example, the following code will never see its last condition detected: ```4d Case of - :(vResult=1) //Tester si le chiffre est 1 - ALERT("One.") //Si le chiffre est 1, afficher une alerte - :(vResult=2) //Tester si le chiffre est 2 - ALERT("Two.") //Si le chiffre est 2, afficher une alerte - :(vResult=3) //Tester si le chiffre est 3 - ALERT("Three.") //Si le chiffre est 3, afficher une alerte - Else //Si le chiffre n'est pas 1, 2 ou 3, afficher une alerte - ALERT("It was not one, two, or three.") + :(vResult=1) + ... //statement(s) + :((vResult=1) & (vCondition#2)) //this case will never be detected + ... //statement(s) End case ``` -... les instructions associées au cas complexe ne seront jamais exécutées. En effet, pour que ce cas soit TRUE, ses deux conditions booléennes doivent l’être. Or, la première condition est celle du cas simple situé précédemment. Lorsqu'elle est TRUE, le cas simple est exécuté et 4D sort de la structure conditionnelle, sans évaluer le cas complexe. Pour que ce type de méthode fonctionne, vous devez écrire : +In the code above, the presence of the second condition is not detected since the test "vResult=1" branches off the code before any further testing. For the code to operate properly, you can write it as follows: ```4d - If(vResult=1) //Tester si le chiffre est 1 - ALERT("One.") //Si le chiffre est 1, afficher une alerte - Else - If(vResult=2) //Tester si le chiffre est 2 - ALERT("Two.") //Si le chiffre est 2, afficher une alerte - Else - If(vResult=3) //Tester si le chiffre est 3 - ALERT("Three.") //Si le chiffre est 3, afficher une alerte - Else //Si le chiffre n'est pas 1, 2 ou 3, afficher une alerte - ALERT("It was not one, two, or three.") - End if - End if - End if + Case of + :((vResult=1) & (vCondition#2)) //this case will be detected first + ... //statement(s) + :(vResult=1) + ... //statement(s) + End case ``` -**Astuce :** Il n'est pas obligatoire que des instructions soient exécutées dans toutes les alternatives. Lorsque vous développez un algorithme, ou lorsque vous poursuivez un but précis, rien ne vous empêche d'écrire : +Also, if you want to implement hierarchical testing, you may consider using hierarchical code. + +**Tip:** Branching can be performed without statements to be executed in one case or another. When developing an algorithm or a specialized application, nothing prevents you from writing: ```4d Case of - :(Expression_booléenne) - :(Expression_booléenne) - instruction(s) - ... + :(Boolean_Expression) + :(Boolean_Expression) + ... - :(Expression_booléenne) - instruction(s) + :(Boolean_Expression) + statement(s) Else - instruction(s) + statement(s) End case ``` -ou : +or: ```4d Case of - :(Expression_booléenne) - :(Expression_booléenne) - ... + :(Boolean_Expression) + :(Boolean_Expression) + statement(s) + ... - :(Expression_booléenne) - instruction(s) + :(Boolean_Expression) + statement(s) Else - instruction(s) End case ``` -ou : +or: ```4d Case of Else - instruction(s) + statement(s) End case ``` diff --git a/website/translated_docs/fr/Concepts/cf_looping.md b/website/translated_docs/fr/Concepts/cf_looping.md index 614ad913831f2f..f21e851cc43af7 100644 --- a/website/translated_docs/fr/Concepts/cf_looping.md +++ b/website/translated_docs/fr/Concepts/cf_looping.md @@ -3,56 +3,56 @@ id: looping title: Structures répétitives (ou "boucles") --- -Les structures en boucle répètent une séquence d'instructions jusqu'à ce qu'une condition soit remplie ou qu'un certain nombre de fois est atteint. +Looping structures repeat a sequence of statements until a condition is met or a number of times is reached. ## While...End while -La syntaxe de la structure répétitive (ou boucle) `While...End while` est la suivante : +The formal syntax of the `While...End while` control flow structure is: ```4d - While(Expression_booléenne) - instruction(s) + While(Boolean_Expression) + statement(s) End while ``` -Une boucle `While...End while` exécute les instructions comprises entre `While` et `End while` aussi longtemps que l’expression booléenne est TRUE. Elle teste l’expression booléenne initiale et n’entre pas dans la boucle (et donc n'exécute aucune instruction) si l’expression est à FALSE. +A `While...End while` loop executes the statements inside the loop as long as the Boolean expression is TRUE. It tests the Boolean expression at the beginning of the loop and does not enter the loop at all if the expression is FALSE. -Il est utile d’initialiser la valeur testée dans l’expression booléenne juste avant d’entrer dans la boucle `While...End while`. Initialiser la valeur signifie lui affecter un contenu approprié, généralement pour que l’expression booléenne soit TRUE et que le programme entre dans la boucle. +It is common to initialize the value tested in the Boolean expression immediately before entering the `While...End while` loop. Initializing the value means setting it to something appropriate, usually so that the Boolean expression will be TRUE and `While...End while` executes the loop. -La valeur de l'expression booléenne doit pouvoir être modifiée par un élément situé à l'intérieur de la boucle, sinon elle s'exécutera indéfiniment. La boucle suivante est sans fin car _NeverStop_ est toujours TRUE : +The Boolean expression must be set by something inside the loop or else the loop will continue forever. The following loop continues forever because _NeverStop_ is always TRUE: ```4d NeverStop:=True While(NeverStop) End while ``` -Si vous vous retrouvez dans une telle situation (où une méthode s'exécute de manière incontrôlée), vous pouvez utiliser les fonctions de débogage de 4D et remonter à la source du problème. Pour plus d'informations sur ce point, reportez-vous à la section [Débogueur](error-handling.md). +If you find yourself in such a situation, where a method is executing uncontrolled, you can use the trace facilities to stop the loop and track down the problem. For more information about tracing a method, see the [Error handling](error-handling.md) page. -### Exemple +### Example ```4d - CONFIRM("Add a new record?") //L'utilisateur souhaite-t-il ajouter un enregistrement ? //L'utilisateur souhaite-t-il ajouter un enregistrement ? - While(OK=1) // Tant que l'utilisateur accepte - ADD RECORD([aTable]) // Ajouter un nouvel enregistrement -End while // Une boucle While se termine toujours par End while + CONFIRM("Add a new record?") //The user wants to add a record? + While(OK=1) //Loop as long as the user wants to + ADD RECORD([aTable]) //Add a new record + End while //The loop always ends with End while ``` -Dans cet exemple, la valeur de la variable système `OK` est définie par la commande `CONFIRM` avant que le programme n’entre dans la boucle. Si l’utilisateur clique sur le bouton **OK** dans la boîte de dialogue de confirmation, la variable `OK` prend la valeur 1 et la boucle est exécutée. Dans le cas contraire, la variable `OK` prend la valeur 0 et la boucle est ignorée. Une fois que le programme entre dans la boucle, la commande `ADD RECORD` permet de continuer à l’exécuter car elle met la variable système `OK` à 1 lorsque l’utilisateur sauvegarde l’enregistrement. Lorsque l’utilisateur annule (ne valide pas) le dernier enregistrement, la variable système `OK` prend la valeur 0 et la boucle s’arrête. +In this example, the `OK` system variable is set by the `CONFIRM` command before the loop starts. If the user clicks the **OK** button in the confirmation dialog box, the `OK` system variable is set to 1 and the loop starts. Otherwise, the `OK` system variable is set to 0 and the loop is skipped. Once the loop starts, the `ADD RECORD` command keeps the loop going because it sets the `OK` system variable to 1 when the user saves the record. When the user cancels (does not save) the last record, the `OK` system variable is set to 0 and the loop stops. ## Repeat...Until -La syntaxe de la structure répétitive (ou boucle) `Repeat...Until` est la suivante : +The formal syntax of the `Repeat...Until` control flow structure is: ```4d Repeat - instruction(s) + statement(s) Until(Boolean_Expression) ``` -La boucle `Repeat...Until` est semblable à la boucle [While...End while](flow-control#whileend-while), à la différence qu’elle teste la valeur de l’expression booléenne après l’exécution de la boucle et non avant. Ainsi, la boucle est toujours exécutée au moins une fois, tandis que si l’expression booléenne est initialement à Faux, la boucle `While...End while` ne s’exécute pas du tout. +A `Repeat...Until` loop is similar to a [While...End while](flow-control#whileend-while) loop, except that it tests the Boolean expression after the loop rather than before. Thus, a `Repeat...Until` loop always executes the loop once, whereas if the Boolean expression is initially False, a `While...End while` loop does not execute the loop at all. -L'autre particularité de la boucle `Repeat...Until` est qu’elle se poursuit jusqu’à ce que l’expression booléenne soit à TRUE. +The other difference with a `Repeat...Until` loop is that the loop continues until the Boolean expression is TRUE. -### Exemple +### Example -Comparez l’exemple suivant avec celui de la boucle `While...End while`. Vous constatez qu’il n’est pas nécessaire d’initialiser l’expression booléenne — il n’y a pas de commande `CONFIRM` pour initialiser la variable `OK`. +Compare the following example with the example for the `While...End while` loop. Note that the Boolean expression does not need to be initialized—there is no `CONFIRM` command to initialize the `OK` variable. ```4d Repeat @@ -62,194 +62,194 @@ Comparez l’exemple suivant avec celui de la boucle `While...End while`. Vous c ## For...End for -La syntaxe de la structure répétitive `For...End for` est la suivante : +The formal syntax of the `For...End for` control flow structure is: ```4d For(Counter_Variable;Start_Expression;End_Expression{;Increment_Expression}) - instruction(s) + statement(s) End for ``` -La structure `For...End for` est une boucle contrôlée par un compteur : +The `For...End for` loop is a loop controlled by a counter variable: -- La variable compteur *Counter_Variable* est une variable numérique (Réel ou Entier long) initialisée par `For...End for` à la valeur spécifiée par *Start_Expression*. -- La variable Variable_Compteur est incrémentée de la valeur spécifiée par le paramètre optionnel *Increment_Expression* à chaque fois que la boucle est exécutée. Si vous ne passez pas de valeur dans *Increment_Expression*, la variable compteur est incrémentée par défaut de un (1). -- Lorsque le compteur atteint la valeur définie par *End_Expression*, la boucle s'arrête. +- The counter variable *Counter_Variable* is a numeric variable (Real or Long Integer) that the `For...End for` loop initializes to the value specified by *Start_Expression*. +- Each time the loop is executed, the counter variable is incremented by the value specified in the optional value *Increment_Expression*. If you do not specify *Increment_Expression*, the counter variable is incremented by one (1), which is the default. +- When the counter variable passes the *End_Expression* value, the loop stops. -**Important :** Les expressions numériques *Start_Expression*, *End_Expression* et *Increment_Expression* sont évaluées une seule fois, au début de la boucle. Si ces expressions sont des variables, leur modification depuis l'intérieur de la boucle n'affectera pas l'exécution de la boucle. +**Important:** The numeric expressions *Start_Expression*, *End_Expression* and *Increment_Expression* are evaluated once at the beginning of the loop. If these expressions are variables, changing one of these variables within the loop will not affect the loop. -**Astuce :** En revanche, vous pouvez, si vous le souhaitez, modifier la valeur de la variable *Counter_Variable* depuis l'intérieur de la boucle et cela affectera l'exécution de la boucle. +**Tip:** However, for special purposes, you can change the value of the counter variable *Counter_Variable* within the loop; this will affect the loop. -- Généralement, *Start_Expression* est inférieure à *End_Expression*. -- Si les deux expressions sont égales, la boucle ne sera exécutée qu'une fois. -- Si *Start_Expression* est supérieure à *End_Expression*, la boucle ne s'exécutera pas du tout, à moins que vous ne spécifiiez une *Increment_Expression* négative. Reportez-vous ci-dessous au paragraphe décrivant ce point. +- Usually *Start_Expression* is less than *End_Expression*. +- If *Start_Expression* and *End_Expression* are equal, the loop will execute only once. +- If *Start_Expression* is greater than *End_Expression*, the loop will not execute at all unless you specify a negative *Increment_Expression*. See the examples. -### Exemples élémentaires +### Basic examples -1. La boucle suivante s'exécute 100 fois : +1. The following example executes 100 iterations: ```4d For(vCounter;1;100) - //Faire quelque chose + //Do something End for ``` -2. L'exemple suivant permet de traiter tous les éléments du tableau anArray : +2. The following example goes through all elements of the array anArray: ```4d For($vlElem;1;Size of array(anArray)) - //Faire quelque chose avec l'élément + //Do something with the element anArray{$vlElem}:=... End for ``` -3. L'exemple suivant permet d'examiner chaque caractère du texte vtSomeText : +3. The following example goes through all the characters of the text vtSomeText: ```4d For($vlChar;1;Length(vtSomeText)) - //Faire quelque chose avec le caractère si c'est une tabulation + //Do something with the character if it is a TAB If(Character code(vtSomeText[[$vlChar]])=Tab) //... End if End for ``` -4. L'exemple suivant permet de traiter tous les enregistrements de la sélection de la table [aTable] : +4. The following example goes through the selected records for the table [aTable]: ```4d FIRST RECORD([aTable]) For($vlRecord;1;Records in selection([aTable])) - //Faire quelque chose avec chaque enregistrement + //Do something with the record SEND RECORD([aTable]) //... - // Passer à l'enregistrement suivant + //Go to the next record NEXT RECORD([aTable]) End for ``` -La plupart des structures `For...End for` que vous écrirez dans vos projets ressembleront à celles présentées ci-dessus. +Most of the `For...End for` loops you will write in your projects will look like the ones listed in these examples. -### Décrémenter la variable Compteur +### Decrementing variable counter -Dans certains cas, vous pouvez souhaiter disposer d'une boucle dont la valeur de la variable compteur décroît au lieu de croître. Pour cela, *Start_Expression* doit être supérieure à *End_Expression* et *Increment_Expression* doit être négative. Les exemples suivants effectuent les mêmes tâches que les précédents, mais en sens inverse : +In some cases, you may want to have a loop whose counter variable is decreasing rather than increasing. To do so, you must specify *Start_Expression* greater than *End_Expression* and a negative *Increment_Expression*. The following examples do the same thing as the previous examples, but in reverse order: -5. La boucle suivante s'exécute 100 fois : +5. The following example executes 100 iterations: ```4d For(vCounter;100;1;-1) - //Faire quelque chose + //Do something End for ``` -6. L'exemple suivant permet de traiter tous les éléments du tableau anArray : +6. The following example goes through all elements of the array anArray: ```4d For($vlElem;Size of array(anArray);1;-1) - //Faire quelque chose avec l'élément + //Do something with the element anArray{$vlElem}:=... End for ``` -7. L'exemple suivant permet d'examiner chaque caractère du texte vtSomeText : +7. The following example goes through all the characters of the text vtSomeText: ```4d For($vlChar;Length(vtSomeText);1;-1) - //Faire quelque chose avec le caractère si c'est une tabulation + //Do something with the character if it is a TAB If(Character code(vtSomeText[[$vlChar]])=Tab) //... End if End for ``` -8. L'exemple suivant permet de traiter tous les enregistrements de la sélection de la table [aTable] : +8. The following example goes through the selected records for the table [aTable]: ```4d LAST RECORD([aTable]) For($vlRecord;Records in selection([aTable]);1;-1) - //Faire quelque chose avec chaque enregistrement + //Do something with the record SEND RECORD([aTable]) //... - //Passer à l'enregistrement précédent + //Go to the previous record PREVIOUS RECORD([aTable]) End for ``` -### Incrementer la variable compteur de plus de 1 +### Incrementing the counter variable by more than one -Si vous le souhaitez, vous pouvez passer dans *Increment_Expression* une valeur (positive ou négative) dont la valeur absolue est supérieure à un. +If you need to, you can use an *Increment_Expression* (positive or negative) whose absolute value is greater than one. -9. La boucle suivante ne traite que les éléments pairs du tableau anArray : +9. The following loop addresses only the even elements of the array anArray: ```4d For($vlElem;2;Size of array(anArray);2) - //Faire quelque chose avec l'élément 2,4...2n + //Do something with the element #2,#4...#2n anArray{$vlElem}:=... End for ``` -### Comparaison des structures répétitives +### Comparing looping structures -Revenons au premier exemple `For...End for`. La boucle suivante s'exécute 100 fois : +Let's go back to the first `For...End for` example. The following example executes 100 iterations: ```4d For(vCounter;1;100) - //Faire quelque chose + //Do something End for ``` -Il est intéressant d'examiner la manière dont les boucles `While...End while` et `Repeat...Until` effectuent la même action. Voici la boucle `While...End while` équivalente : +It is interesting to see how the `While...End while` loop and `Repeat...Until` loop would perform the same action. Here is the equivalent `While...End while` loop: ```4d - $i :=1 // Initialisation du compteur -While ($i<=100) // Boucle 100 fois - // Faire quelque chose - $i :=$i +1 // Il faut incrémenter le compteur + $i:=1 //Initialize the counter + While($i<=100) //Loop 100 times + //Do something + $i:=$i+1 //Need to increment the counter End while ``` -Voici la boucle `Repeat...Until` équivalente : +Here is the equivalent `Repeat...Until` loop: ```4d - $i :=1 // Initialisation du compteur + $i:=1 //Initialize the counter Repeat - // Faire quelque chose - $i :=$i +1 // Il faut incrémenter le compteur -Until($i=100) // Boucle 100 fois + //Do something + $i:=$i+1 //Need to increment the counter + Until($i=100) //Loop 100 times ``` -**Astuce :** La boucle `For...End for` est généralement plus rapide que les boucles `While...End while` et `Repeat...Until` car 4D teste la condition en interne pour chaque cycle de la boucle et incrémente lui-même le compteur. Par conséquent, nous vous conseillons de préférer à chaque fois que c'est possible la structure `For...End for`. +**Tip:** The `For...End for` loop is usually faster than the `While...End while` and `Repeat...Until` loops, because 4D tests the condition internally for each cycle of the loop and increments the counter. Therefore, use the `For...End for` loop whenever possible. -### Optimiser l'exécution de For...End for +### Optimizing the execution of the For...End for loops -Vous pouvez utiliser comme compteur une variable interprocess, process ou locale, et lui attribuer le type Réel, Entier ou Entier long. Pour des boucles longues, et particulièrement en mode compilé, nous vous conseillons d'employer des variables locales de type Entier long. +You can use Real and Long Integer variables as well as interprocess, process, and local variable counters. For lengthy repetitive loops, especially in compiled mode, use local Long Integer variables. -10. Voici un exemple : +10. Here is an example: ```4d - C_LONGINT($vlCounter) // Utilisons une variable locale de type Entier long -For($vlCounter;1;10000) - // Faire quelque chose - End for + C_LONGINT($vlCounter) //use local Long Integer variables + For($vlCounter;1;10000) + //Do something + End for ``` -### Structures For...End emboîtées +### Nested For...End for looping structures -Vous pouvez emboîter autant de structures répétitives que vous voulez (dans les limites du raisonnable). Cela s'applique aux structures de type `For...End for`. Il y a dans ce cas une erreur courante à éviter : assurez-vous d'utiliser une variable compteur différente par structure de boucle. +You can nest as many control structures as you (reasonably) need. This includes nesting `For...End for` loops. To avoid mistakes, make sure to use different counter variables for each looping structure. -Voici deux exemples : +Here are two examples: -11. L'exemple suivant permet de traiter tous les éléments d'un tableau à deux dimensions : +11. The following example goes through all the elements of a two-dimensional array: ```4d For($vlElem;1;Size of array(anArray)) //... - // Faire quelque chose avec la ligne - // ... + //Do something with the row + //... For($vlSubElem;1;Size of array(anArray{$vlElem})) - //Faire quelque chose avec l'élément + //Do something with the element anArray{$vlElem}{$vlSubElem}:=... End for End for ``` -12. L'exemple suivant construit un tableau de pointeurs vers tous les champs de type Date présents dans la base : +12. The following example builds an array of pointers to all the date fields present in the database: ```4d ARRAY POINTER($apDateFields;0) @@ -272,51 +272,51 @@ Voici deux exemples : ## For each...End for each -La syntaxe de la structure répétitive (ou boucle) `For each...End for each` est la suivante : +The formal syntax of the `For each...End for each` control flow structure is: ```4d - For each(Element_courant;Expression{;debut{;fin}}){Until|While}(Expression_booléenne)} - instruction(s) + For each(Current_Item;Expression{;begin{;end}}){Until|While}(Boolean_Expression)} + statement(s) End for each ``` -La structure `For each...End for each` exécute le cycle d'instructions définies pour chaque *Elément_courant* de *Expression*. Le type de *Elément_courant* dépend du type de *Expression*. La boucle `For each...End for each` peut itérer parmi trois types d'*Expression* : +The `For each...End for each` structure iterates a specified *Current_item* over all values of the *Expression*. The *Current_item* type depends on the *Expression* type. The `For each...End for each` loop can iterate through three *Expression* types: -- collections : boucle sur chaque élément de la collection, -- entity selections : boucle sur chaque entity, -- objets : boucle sur chaque propriété d'objet. +- collections: loop through each element of the collection, +- entity selections: loop through each entity, +- objects: loop through each object property. -Le tableau suivant compare les trois types de `Pour chaque...Fin de chaque` : +The following table compares the three types of `For each...End for each`: -| | Boucle sur collections | Boucle sur entity selections | Boucle sur objets | -| ----------------------------------------- | ------------------------------------------------------- | ---------------------------------- | ----------------------------- | -| Type Elément_courant | Variable du même type que les éléments de la collection | Entity | Variable texte | -| Types d’expressions | Collection (avec des éléments du même type) | Entity selection | Objet | -| Nombre de boucles (par défaut) | Nombre d'éléments de la collection | Nombre d'entités dans la sélection | Nombre de propriétés d'objets | -| Prise en charge de Paramètres début / fin | Oui | Oui | Non | +| | Loop through collections | Loop through entity selections | Loop through objects | +| --------------------------------- | ------------------------------------------------ | ----------------------------------- | --------------------------- | +| Current_Item type | Variable of the same type as collection elements | Entity | Text variable | +| Expression type | Collection (with elements of the same type) | Entity selection | Objet | +| Number of loops (by default) | Number of collection elements | Number of entities in the selection | Number of object properties | +| Support of begin / end parameters | Yes | Yes | No | -- Le nombre de boucles est évalué au démarrage et ne changera pas en cours de traitement. L'ajout ou la suppression d'éléments pendant la boucle est donc déconseillé car il pourra en résulter une redondance ou un manque d'itérations. -- Par défaut, les _instructions_ incluses sont exécutées pour chaque valeur de *Expression*. Il est toutefois possible de sortir de la boucle en testant une condition soit au début de chaque itération (`While`) ou à la fin de chaque itération (`Until`). -- Les paramètres optionnels *début* et *fin* peuvent être utilisés avec les collections et les entity selections afin de définir des bornes pour la boucle. -- La boucle `For each...End for each` peut être utilisée sur une **collection partagée** ou un **objet partagé**. Si vous souhaitez modifier un ou plusieurs éléments des propriétés d'objets ou de la collection dans le code, vous devez utiliser les mots-clés `Use...End use`. Vous pouvez, si vous le souhaitez, appeler les mots-clés `Use...End use` : - - avant de saisir la boucle, si les éléments doivent être modifiés ensemble pour des raisons d'intégrité, ou bien - - dans la boucle, lorsque quelques éléments/propriétés seulement doivent être modifiés et qu'aucune gestion de l'intégrité n'est requise. +- The number of loops is evaluated at startup and will not change during the processing. Adding or removing items during the loop is usually not recommended since it may result in missing or redundant iterations. +- By default, the enclosed _statement(s)_ are executed for each value in *Expression*. It is, however, possible to exit the loop by testing a condition either at the begining of the loop (`While`) or at the end of the loop (`Until`). +- The *begin* and *end* optional parameters can be used with collections and entity selections to define boundaries for the loop. +- The `For each...End for each` loop can be used on a **shared collection** or a **shared object**. If your code needs to modify one or more element(s) of the collection or object properties, you need to use the `Use...End use` keywords. Depending on your needs, you can call the `Use...End use` keywords: + - before entering the loop, if items should be modified together for integrity reasons, or + - within the loop when only some elements/properties need to be modified and no integrity management is required. -### Boucle sur collections +### Loop through collections -Lorsque `For each...End for each` est utilisée avec une _Expression_ de type _Collection_, le paramètre _Elément_courant_ est une variable du même type que les éléments de la collection. Par défaut, le nombre de boucles est basé sur le nombre d'éléments de la collection. +When `For each...End for each` is used with an _Expression_ of the _Collection_ type, the _Current_Item_ parameter is a variable of the same type as the collection elements. By default, the number of loops is based on the number of items of the collection. -La collection doit contenir uniquement des éléments du même type. Dans le cas contraire, une erreur sera retournée dès que la première valeur de type différent sera assignée à la variable _Elément_courant_. +The collection must contain only elements of the same type, otherwise an error will be returned as soon as the _Current_Item_ variable is assigned the first mismatched value type. -A chaque itération de la boucle, la variable _Elément_courant_ reçoit automatiquement l'élément correspondant de la collection. Vous devez tenir compte des points suivants : +At each loop iteration, the _Current_Item_ variable is automatically filled with the matching element of the collection. The following points must be taken into account: -- La variable _Elément_courant_ doit être du même type que les éléments de la collection. Si un seul élément de la collection n'est pas du même type que la variable, une erreur est générée et la boucle s'arrête. -- Si la variable _Elément_courant_ est de type objet ou collection (i.e. Si un seul élément de la collection n'est pas du même type que la variable, une erreur est générée et la boucle s'arrête. -- Si la collection contient des éléments de valeur **Null**, une erreur sera générée si le type de la variable _Elément_courant_ ne prend pas en charge la valeur **Null** (comme par exemple les variables entier long). +- If the _Current_Item_ variable is of the object type or collection type (i.e. if _Expression_ is a collection of objects or of collections), modifying this variable will automatically modify the matching element of the collection (because objects and collections share the same references). If the variable is of a scalar type, only the variable will be modified. +- The _Current_Item_ variable must be of the same type as the collection elements. If any collection item is not of the same type as the variable, an error is generated and the loop stops. +- If the collection contains elements with a **Null** value, an error will be generated if the _Current_Item_ variable type does not support **Null** values (such as longint variables). -#### Exemple +#### Example -Vous souhaitez calculer quelques statistiques sur une collection de nombres : +You want to compute some statistics for a collection of numbers: ```4d C_COLLECTION($nums) $nums:=New collection(10;5001;6665;33;1;42;7850) @@ -338,19 +338,19 @@ Vous souhaitez calculer quelques statistiques sur une collection de nombres : //$vUnder=4,$vOver=2 ``` -### Boucle sur entity selections +### Loop through entity selections -Lorsque `For each...End for each` est utilisée avec une _Expression_ de type _Entity selection_, le paramètre _Elément_courant_ contient l'entity en cours de traitement. +When `For each...End for each` is used with an _Expression_ of the _Entity selection_ type, the _Current_Item_ parameter is the entity that is currently processed. -Le nombre de boucles est basé sur le nombre d'entities présentes dans l'entity selection. A chaque itération de la boucle, le paramètre *Elément_courant* reçoit automatiquement l'entity qui est en cours de traitement. +The number of loops is based on the number of entities in the entity selection. On each loop iteration, the *Current_Item* parameter is automatically filled with the entity of the entity selection that is currently processed. -**Note :** Si l'entity selection contient une entity qui a été supprimée entre-temps par un autre process, elle est automatiquement ignorée durant la boucle. +**Note:** If the entity selection contains an entity that was removed meanwhile by another process, it is automatically skipped during the loop. -N'oubliez pas que toute modification effectuée sur l'entity en cours de traitement doit être explicitement sauvegardée (si nécessaire) à l'aide de la méthode `entity.save( )`. +Keep in mind that any modifications applied on the current entity must be saved explicitly using `entity.save( )`. -#### Exemple +#### Example -Vous souhaitez augmenter le salaire de tous les employés britanniques dans une entity selection : +You want to raise the salary of all British employees in an entity selection: ```4d C_OBJECT(emp) For each(emp;ds.Employees.query("country='UK'")) @@ -359,15 +359,15 @@ Vous souhaitez augmenter le salaire de tous les employés britanniques dans une End for each ``` -### Boucles sur des propriétés d'objets +### Loop through object properties -Lorsque `For each...End for each` est utilisée avec une *Expression* de type Objet, le paramètre *Elément_courant* est une variable texte qui reçoit automatiquement le nom de la propriété en cours de traitement. +When `For each...End for each` is used with an *Expression* of the Object type, the *Current_Item* parameter is a text variable automatically filled with the name of the currently processed property. -Les propriétés de l'objet sont itérées en fonction de leur ordre de création. Pendant la boucle, il est possible d'ajouter ou de supprimer des propriétés dans l'objet, sans pour autant modifier le nombre de boucles qui reste basé sur le nombre de propriétés initial de l'objet. +The properties of the object are processed according to their order of creation. During the loop, properties can be added to or removed from the object, without modifying the number of loops that will remain based on the original number of properties of the object. -#### Exemple +#### Example -Vous souhaitez passer en majuscules les propriétés contenant des noms dans l'objet suivant : +You want to switch the names to uppercase in the following object: ```4d { "firstname": "gregory", @@ -375,7 +375,7 @@ Vous souhaitez passer en majuscules les propriétés contenant des noms dans l'o "age": 20 } ``` -Vous pouvez écrire : +You can write: ```4d For each(property;vObject) If(Value type(vObject[property])=Is text) @@ -390,23 +390,23 @@ Vous pouvez écrire : "age": 20 } ``` -### Paramètres début / fin +### begin / end parameters -Vous pouvez définir des bornes pour l'itération à l'aide des paramètres optionnels début et fin. +You can define bounds to the iteration using the optional begin and end parameters. -**Note :** Les paramètres *début* et *fin* sont utilisables uniquement avec les boucles sur des collections et des entity selections (ils sont ignorés avec les boucles sur des propriétés d'objets). +**Note:** The *begin* and *end* parameters can only be used in iterations through collections and entity selections (they are ignored on object properties). -- Dans le paramètre *début*, passez la position de l'élément de *Expression* auquel démarrer l'itération (*début* est inclus). -- Dans le paramètre *fin*, vous pouvez passer la position de l'élément de *Expression* auquel stopper l'itération (*fin* est exclus). +- In the *begin* parameter, pass the element position in *Expression* at which to start the iteration (*begin* is included). +- In the *end* parameter, you can also pass the element position in *Expression* at which to stop the iteration (*end* is excluded). -Si *fin* est omis ou si *fin* est plus grand que le nombre d'éléments de *Expression*, les éléments sont itérés depuis *début* jusqu'au dernier inclus. Si les paramètres *début* et *fin* sont des valeurs positives, ils représentent des positions d'éléments dans *Expression*. Si *begin* est une valeur négative, elle est recalculée comme `begin:=begin+Taille expression` (elle est considérée comme un décalage à partir de la fin de *Expression*). Si la valeur calculée est négative, *begin* prend la valeur 0. **Note :** Même si début est une valeur négative, l'itération est toujours effectuée dans le même ordre. Si *fin* est une valeur négative, elle est recalculée comme `fin:=fin+Taille expression` +If *end* is omitted or if *end* is greater than the number of elements in *Expression*, elements are iterated from *begin* until the last one (included). If the *begin* and *end* parameters are positive values, they represent actual positions of elements in *Expression*. If *begin* is a negative value, it is recalculed as `begin:=begin+Expression size` (it is considered as the offset from the end of *Expression*). If the calculated value is negative, *begin* is set to 0. **Note:** Even if begin is negative, the iteration is still performed in the standard order. If *end* is a negative value, it is recalculed as `end:=end+Expression size` -Par exemple: -- une collection contient 10 éléments (numérotés de 0 à 9) -- début=-4 > début=-4+10=6 > l'itération démarre au 6e élément (numéro 5) -- fin=-2 > fin=-2+10=8 > l'itération stoppe avant le 8e élément (numéro 7), i.e. +For example: +- a collection contains 10 elements (numbered from 0 to 9) +- begin=-4 -> begin=-4+10=6 -> iteration starts at the 6th element (#5) +- end=-2 -> end=-2+10=8 -> iteration stops before the 8th element (#7), i.e. at the 7th element. -#### Exemple +#### Example ```4d C_COLLECTION($col;$col2) @@ -423,28 +423,28 @@ Par exemple: //$col2=[1,2,3,"a","b","c","d"] ``` -### Conditions Until et While +### Until and While conditions -Vous pouvez contrôler l'exécution de `For each...End for each` en ajoutant une condition `Jusque` ou `Tant que` à la boucle. When an `Until(condition)` statement is associated to the loop, the iteration will stop as soon as the condition is evaluated to `True`, whereas when is case of a `While(condition)` statement, the iteration will stop when the condition is first evaluated to `False`. +You can control the `For each...End for each` execution by adding an `Until` or a `While` condition to the loop. When an `Until(condition)` statement is associated to the loop, the iteration will stop as soon as the condition is evaluated to `True`, whereas when is case of a `While(condition)` statement, the iteration will stop when the condition is first evaluated to `False`. -Vous pouvez passer un mot-clé ou l'autre en fonction de vos besoins : +You can pass either keyword depending on your needs: -- La condition `Until` est testée à la fin de chaque itération, donc si *Expression* n'est ni vide ni Null, la boucle sera exécutée au moins une fois. -- La condition `While` est testée au début de chaque itération, donc en fonction du résultat de la condition, la boucle peut ne pas être exécutée du tout. +- The `Until` condition is tested at the end of each iteration, so if the *Expression* is not empty or null, the loop will be executed at least once. +- The `While` condition is tested at the beginning of each iteration, so according to the condition result, the loop may not be executed at all. -#### Exemple +#### Example ```4d $colNum:=New collection(1;2;3;4;5;6;7;8;9;10) $total:=0 - For each($num;$colNum)While($total<30) //testé au début + For each($num;$colNum)While($total<30) //tested at the beginning $total:=$total+$num End for each ALERT(String($total)) //$total = 36 (1+2+3+4+5+6+7+8) $total:=1000 - For each($num;$colNum)Until($total>30) //testé à la fin + For each($num;$colNum)Until($total>30) //tested at the end $total:=$total+$num End for each ALERT(String($total)) //$total = 1001 (1000+1) diff --git a/website/translated_docs/fr/Concepts/classes.md b/website/translated_docs/fr/Concepts/classes.md index f18184247e33f5..214a362017f31a 100644 --- a/website/translated_docs/fr/Concepts/classes.md +++ b/website/translated_docs/fr/Concepts/classes.md @@ -6,13 +6,13 @@ title: Classes ## Aperçu -Le langage 4D prend en charge le concept de **classes**. Dans un langage de programmation, l'utilisation d'une classe vous permet de définir le comportement d'un objet avec des propriétés et des fonctions associées. +The 4D language supports the concept of **classes**. In a programming language, using a class allows you to define an object behaviour with associated properties and functions. -Une fois qu'une classe utilisateur (user class) est définie, vous pouvez **instancier** des objets de cette classe n'importe où dans votre code. Chaque objet est une instance de sa classe. Une classe peut s'étendre à une autre classe avec le mot-clé [`extend`](#class-extends-classname), puis hériter de ses fonctions. +Once a user class is defined, you can **instantiate** objects of this class anywhere in your code. Each object is an instance of its class. A class can [`extend`](#class-extends-classname) another class, and then inherits from its [functions](#function). -> Les modèles de classe 4D et de classe JavaScript sont similaires, et sont basés sur une chaîne de prototypes. +> The class model in 4D is similar to classes in JavaScript, and based on a chain of prototypes. -Par exemple, vous pouvez créer une classe `Person` avec la définition suivante : +For example, you could create a `Person` class with the following definition: ```4d //Class: Person.4dm @@ -21,7 +21,7 @@ Class constructor($firstname : Text; $lastname : Text) This.lastName:=$lastname ``` -Dans une méthode, créons une "Personne" : +In a method, creating a "Person": ``` var $o : cs.Person //object of Person class @@ -31,86 +31,86 @@ $o:=cs.Person.new("John";"Doe") -## Gestion des classes +## Managing classes -### Définition d'une classe +### Class definition -Une classe utilisateur dans 4D est définie par un fichier de méthode spécifique (.4dm), stocké dans le dossier `/Project/Sources/Classes/`. Le nom du fichier est le nom de la classe. +A user class in 4D is defined by a specific method file (.4dm), stored in the `/Project/Sources/Classes/` folder. The name of the file is the class name. -Lorsque vous nommez des classes, gardez à l'esprit les règles suivantes : +When naming classes, you should keep in mind the following rules: -- Le nom d'une classe doit être conforme aux [règles de nommage des propriétés](Concepts/dt_object.md#object-property-identifiers). -- Les noms de classe sont sensibles à la casse. -- Il n'est pas recommandé de donner le même nom à une classe et à une table de base de données, afin d'éviter tout conflit. +- A class name must be compliant with [property naming rules](Concepts/dt_object.md#object-property-identifiers). +- Class names are case sensitive. +- Giving the same name to a class and a database table is not recommended, in order to prevent any conflict. -Par exemple, si vous souhaitez définir une classe nommée "Polygon", vous devez créer le fichier suivant : +For example, if you want to define a class named "Polygon", you need to create the following file: -- Dossier Project +- Project folder + Project * Sources - Classes + Polygon.4dm -### Supprimer une classe +### Deleting a class -Pour supprimer une classe existante, vous pouvez : +To delete an existing class, you can: -- sur votre disque, supprimer le fichier de classe .4dm du dossier "Classes", -- dans l'Explorateur 4D, sélectionner la classe et cliquer sur ![](assets/en/Users/MinussNew.png) ou choisir **Déplacer vers la corbeille** dans le menu contextuel. +- on your disk, remove the .4dm class file from the "Classes" folder, +- in the 4D Explorer, select the class and click ![](assets/en/Users/MinussNew.png) or choose **Move to Trash** from the contextual menu. -### Utiliser l'interface 4D +### Using 4D interface -Les fichiers de classe sont automatiquement stockés à l'emplacement approprié lorsqu'ils sont créés via l'interface de 4D, soit via le menu **Fichier**, soit via l'Explorateur. +Class files are automatically stored at the appropriate location when created through the 4D interface, either via the **File** menu or the Explorer. -#### Menu Fichier et barre d'outils +#### File menu and toolbar -Vous pouvez créer un nouveau fichier de classe pour le projet en sélectionnant **Nouveau> Classe...** dans le menu **Fichier** de 4D Developer ou dans la barre d'outils. +You can create a new class file for the project by selecting **New > Class...** in the 4D Developer **File** menu or from the toolbar. -Vous pouvez également utiliser le raccourci **Ctrl+Maj+Alt+k**. +You can also use the **Ctrl+Shift+Alt+k** shortcut. -#### Explorateur +#### Explorer -Dans la page **Méthodes** de l'Explorateur, les classes sont regroupées dans la catégorie **Classes**. +In the **Methods** page of the Explorer, classes are grouped in the **Classes** category. -Pour créer une nouvelle classe, vous pouvez : +To create a new class, you can: -- sélectionnez la catégorie **Classes** et cliquez sur le bouton ![](assets/en/Users/PlussNew.png). -- sélectionnez **Nouvelle classe...** dans le menu d'actions en bas de la fenêtre de l'Explorateur ou dans le menu contextuel du groupe Classes. ![](assets/en/Concepts/newClass.png) -- sélectionnez **Nouveau> Classe...** dans le menu contextuel de la page d'accueil de l'Explorateur. +- select the **Classes** category and click on the ![](assets/en/Users/PlussNew.png) button. +- select **New Class...** from the action menu at the bottom of the Explorer window, or from the contexual menu of the Classes group. ![](assets/en/Concepts/newClass.png) +- select **New > Class...** from the contexual menu of the Explorer's Home page. -#### Prise en charge du code de classe +#### Class code support -Dans les différentes fenêtres de 4D Developer (éditeur de code, compilateur, débogueur, explorateur d'exécution), le code de classe est essentiellement géré comme une méthode projet avec quelques spécificités : +In the various 4D Developer windows (code editor, compiler, debugger, runtime explorer), class code is basically handled like a project method with some specificities: -- Dans l'éditeur de code : - - une classe ne peut pas être exécutée - - une fonction de classe est un bloc de code - - **Goto definition** sur un objet membre recherche des déclarations de fonction de classe; par exemple, "$o.f()" donnera comme résultat de recherche "Fonction f". - - **Search references** sur la déclaration de fonction de classe recherche la fonction utilisée comme membre d'objet; par exemple, "Fonction f" donnera comme résultat "$o.f()". -- Dans l'explorateur d'exécution et le Débogueur, les fonctions de classe sont affichées avec le format \ constructor ou \. \ . +- In the code editor: + - a class cannot be run + - a class function is a code block + - **Goto definition** on an object member searches for class Function declarations; for example, "$o.f()" will find "Function f". + - **Search references** on class function declaration searches for the function used as object member; for example, "Function f" will find "$o.f()". +- In the Runtime explorer and Debugger, class functions are displayed with the \ constructor or \.\ format. ## Class stores -Les classes disponibles sont accessibles depuis leurs class stores. Deux class stores sont disponibles : +Available classes are accessible from their class stores. Two class stores are available: -- `cs` pour le class store utilisateur -- `cs` pour le class store intégré +- `cs` for user class store +- `4D` for built-in class store ### cs #### cs -> classStore -| Paramètres | Type | | Description | -| ---------- | ------ | -- | ------------------------------------------------------------------- | -| classStore | object | <- | Class store utilisateur utilisateurs pour le projet ou le composant | +| Parameter | Type | | Description | +| ---------- | ------ | -- | --------------------------------------------- | +| classStore | object | <- | User class store for the project or component | -La commande `cs` retourne le class store utilisateur pour le projet ou le composant courant. La commande `cs` retourne le class store utilisateur pour le projet ou le composant courant. Par défaut, seules les [classes ORDA](ORDA/ordaClasses.md) du projet sont disponibles. +The `cs` command returns the user class store for the current project or component. It returns all user classes [defined](#class-definition) in the opened project or component. By default, only project [ORDA classes](ORDA/ordaClasses.md) are available. -#### Exemple +#### Example -Vous souhaitez créer une nouvelle instance d'un objet de `myClass` : +You want to create a new instance of an object of `myClass`: ```4d $instance:=cs.myClass.new() @@ -120,15 +120,15 @@ $instance:=cs.myClass.new() #### 4D -> classStore -| Paramètres | Type | | Description | +| Parameter | Type | | Description | | ---------- | ------ | -- | -------------- | -| classStore | object | <- | Class store 4D | +| classStore | object | <- | 4D class store | -La commande `4D` retourne le class store des classes 4D intégrées disponibles. Elle donne accès à des API spécifiques telles que [CryptoKey](API/cryptoKeyClass.md). +The `4D` command returns the class store for available built-in 4D classes. It provides access to specific APIs such as [CryptoKey](API/cryptoKeyClass.md). -#### Exemple +#### Example -Vous souhaitez créer une nouvelle clé dans la classe `CryptoKey` : +You want to create a new key in the `CryptoKey` class: ```4d $key:=4D.CryptoKey.new(New object("type";"ECDSA";"curve";"prime256v1")) @@ -136,31 +136,31 @@ $key:=4D.CryptoKey.new(New object("type";"ECDSA";"curve";"prime256v1")) -## Utiliser des classes dans votre code +## Using classes in your code -### L'objet classe +### Class object -Lorsqu'une classe est [définie](#class-definition) dans le projet, elle est chargée dans l'environnement de langage 4D. Une classe est un objet lui-même de la [classe "Class"](API/classClass.md). Un objet class possède les propriétés et fonctions suivantes : +When a class is [defined](#class-definition) in the project, it is loaded in the 4D language environment. A class is an object itself, of ["Class" class](API/classClass.md). A class object has the following properties and function: -- chaîne [`name`](API/classClass.md#name) -- objet [`superclass`](API/classClass.md#superclass) (nul si aucun) -- fonction [`new()`](API/classClass.md#new), permettant d'instancier des objets de classe. +- [`name`](API/classClass.md#name) string +- [`superclass`](API/classClass.md#superclass) object (null if none) +- [`new()`](API/classClass.md#new) function, allowing to instantiate class objects. -De plus, un objet de classe peut référencer : +In addition, a class object can reference: -- un objet [`constructor`](#class-constructor) (facultatif), -- un objet `prototype`, contenant des objets de [fonction](#function) nommés (facultatif). +- a [`constructor`](#class-constructor) object (optional), +- a `prototype` object, containing named [function](#function) objects (optional). -Un objet de classe est un [objet partagé](shared.md) et est donc accessible simultanément à partir de différents processus 4D. +A class object is a [shared object](shared.md) and can therefore be accessed from different 4D processes simultaneously. -### Recherche et prototype des propriétés +### Property lookup and prototype -Tous les objets de 4D sont liés en interne à un objet de classe. Lorsque 4D ne trouve pas de propriété dans un objet, il effectue un recherche dans l'objet prototype de sa classe; s'il ne la trouve pas, 4D poursuit sa recherche dans l'objet prototype de sa classe mère (superclass), et ainsi de suite jusqu'à ce qu'il n'y ait plus de superclass. +All objects in 4D are internally linked to a class object. When 4D does not find a property in an object, it searches in the prototype object of its class; if not found, 4D continues searching in the prototype object of its superclass, and so on until there is no more superclass. -Tous les objets héritent de la classe "Object" comme classe supérieure d'arbre d'héritage. +All objects inherit from the class "Object" as their inheritance tree top class. ```4d //Class: Polygon @@ -172,46 +172,46 @@ Class constructor($width : Integer; $height : Integer) $poly:=cs.Polygon.new(4;3) $instance:=OB Instance of($poly;cs.Polygon) - // vrai + // true $instance:=OB Instance of($poly;4D.Object) - // vrai + // true ``` -Lors de l'énumération des propriétés d'un objet, son prototype de classe n'est pas énuméré. Par conséquent, l'instruction `For each` et la commande `JSON Stringify` ne retournent pas les propriétés de l'objet du prototype de classe. La propriété d'objet prototype d'une classe est une propriété cachée interne. +When enumerating properties of an object, its class prototype is not enumerated. As a consequence, `For each` statement and `JSON Stringify` command do not return properties of the class prototype object. The prototype object property of a class is an internal hidden property. -## Mots-clés de classe +## Class keywords -Des mots-clés 4D spécifiques peuvent être utilisés dans les définitions de classe : +Specific 4D keywords can be used in class definitions: -- `Fonction ` pour définir les méthodes membres des objets. -- `Class constructor` (constructeur de classe) pour définir les propriétés des objets (c'est-à-dire le prototype). -- `Class extends ` pour définir l'héritage. +- `Function ` to define member methods of the objects. +- `Class constructor` to define the properties of the objects (i.e. the prototype). +- `Class extends ` to define inheritance. ### Function -#### Syntaxe +#### Syntax ```4d Function ({$parameterName : type; ...}){->$parameterName : type} // code ``` -Les fonctions de classe sont des propriétés de l'objet prototype de la classe propriétaire. Ce sont des objets de la classe "Function". +Class functions are properties of the prototype object of the owner class. They are objects of the "Function" class. -Dans le fichier de définition de classe, les déclarations de fonction utilisent le mot-clé `Function`, et le nom de la fonction. Le nom de la fonction doit être conforme aux [règles de nommage des propriétés](Concepts/dt_object.md#object-property-identifiers). +In the class definition file, function declarations use the `Function` keyword, and the name of the function. The function name must be compliant with [property naming rules](Concepts/dt_object.md#object-property-identifiers). -> **Astuce :** préfixer le nom de la fonction par un trait de soulignement ("_") exclura la fonction des fonctionnalités d'auto-complétion dans l'éditeur de code 4D. Par exemple, si vous déclarez `Function _myPrivateFunction` dans `MyClass`, elle ne sera pas proposée dans l'éditeur de code lorsque vous tapez `"cs.MyClass. "`. +> **Tip:** Starting the function name with an underscore character ("_") will exclude the function from the autocompletion features in the 4D code editor. For example, if you declare `Function _myPrivateFunction` in `MyClass`, it will not be proposed in the code editor when you type in `"cs.MyClass. "`. -Immédiatement après le nom de la fonction, les [paramètres](#parameters) de la fonction peuvent être déclarés avec un nom et un type de données affectés, y compris le paramètre de retour (facultatif). Par exemple: +Immediately following the function name, [parameters](#parameters) for the function can be declared with an assigned name and data type, including the return parameter (optional). For example: ```4d Function computeArea($width : Integer; $height : Integer)->$area : Integer ``` -Dans une fonction de classe, la commande `This` est utilisée comme instance d'objet. Par exemple: +Within a class function, the `This` command is used as the object instance. For example: ```4d Function setFullname($firstname : Text; $lastname : Text) @@ -222,42 +222,42 @@ Function getFullname()->$fullname : Text $fullname:=This.firstName+" "+Uppercase(This.lastName) ``` -Pour une fonction de classe, la commande `Current method name` retourne: "*\.\*", par exemple "MyClass.myMethod". +For a class function, the `Current method name` command returns: "*\.\*", for example "MyClass.myMethod". -Dans le code de l'application, les fonctions de classe sont appelées en tant que méthodes membres de l'instance d'objet et peuvent recevoir des [paramètres](#class-function-parameters) le cas échéant. Les syntaxes suivantes sont prises en charge : +In the application code, class functions are called as member methods of the object instance and can receive [parameters](#class-function-parameters) if any. The following syntaxes are supported: -- utilisation de l'opérateur `()`. Par exemple, `myObject.methodName("hello")` -- utilisations d'une méthode membre de la classe "Function" : +- use of the `()` operator. For example, `myObject.methodName("hello")` +- use of a "Function" class member method: - `apply()` - `call()` -> **Avertissement de sécurité des threads :** Si une fonction de classe n'est pas thread-safe et est appelée par une méthode avec l'attribut "Peut être exécuté en processus préemptif" : - le compilateur ne génère aucune erreur (ce qui est différent des méthodes classiques), - une erreur n'est générée par 4D qu'au moment de l'exécution. +> **Thread-safety warning:** If a class function is not thread-safe and called by a method with the "Can be run in preemptive process" attribute: - the compiler does not generate any error (which is different compared to regular methods), - an error is thrown by 4D only at runtime. -#### Paramètres +#### Parameters -Les paramètres de fonction sont déclarés à l'aide du nom et du type de paramètre, séparés par deux points. Le nom du paramètre doit être conforme aux [règles de nommage des propriétés](Concepts/dt_object.md#object-property-identifiers). Plusieurs paramètres (et types) sont séparés par des points-virgules (;). +Function parameters are declared using the parameter name and the parameter type, separated by a colon. The parameter name must be compliant with [property naming rules](Concepts/dt_object.md#object-property-identifiers). Multiple parameters (and types) are separated by semicolons (;). ```4d Function add($x; $y : Variant; $z : Integer; $xy : Object) ``` -> Si le type n'est pas indiqué, le paramètre sera défini comme `Variant`. +> If the type is not stated, the parameter will be defined as `Variant`. -Déclarez le paramètre de retour (optionnel) en ajoutant une flèche (->) et la définition du paramètre de retour après la liste de paramètre(s) d'entrée. Par exemple : +You declare the return parameter (optional) by adding an arrow (->) and the return parameter definition after the input parameter(s) list. For example: ```4d -Function add ($x : Variant; $y : Integer)->$result : Integer +Function add($x : Variant; $y : Integer)->$result : Integer ``` -Vous pouvez également déclarer le paramètre de retour uniquement en ajoutant `: type`, auquel cas il sera automatiquement disponible via $0. Par exemple : +You can also declare the return parameter only by adding `: type`, in which case it will automatically be available through $0. For example: ```4d -Function add ($x : Variant; $y : Integer): Integer - $0:=$x+$y +Function add($x : Variant; $y : Integer): Integer + $0:=$x+$y ``` -> La [syntaxe 4D classique](parameters.md#sequential-parameters) des paramètres de méthode peut être utilisée pour déclarer les paramètres des fonctions de classe. Les deux syntaxes peuvent être mélangées. Par exemple : +> The [classic 4D syntax](parameters.md#sequential-parameters) for method parameters can be used to declare class function parameters. Both syntaxes can be mixed. For example: > > ```4d Function add($x : Integer) @@ -269,7 +269,7 @@ Function add($x : Integer) -#### Exemple +#### Example ```4d // Class: Rectangle @@ -284,7 +284,7 @@ Function getArea()->$result : Integer ``` ```4d -// Dans une méthode projet +// In a project method var $rect : cs.Rectangle var $area : Real @@ -296,7 +296,7 @@ $area:=$rect.getArea() //5000 ### Class constructor -#### Syntaxe +#### Syntax ```4d // Class: MyClass @@ -306,13 +306,9 @@ Class Constructor({$parameterName : type; ...}) A class constructor function, which can accept [parameters](#parameters), can be used to define a user class. -Dans ce cas, lorsque vous appelez la méthode membre `new()` de la classe, le "class constructor" est appelé avec les paramètres éventuellement passés à la fonction `new()`. - -Pour une fonction "class constructor", la commande `Current method name` retourne : "*\.constructor*", par exemple "MyClass.constructor". +In that case, when you call the `new()` class member method, the class constructor is called with the parameters optionally passed to the `new()` function. - - -#### Exemple : +For a class constructor function, the `Current method name` command returns: "*\.constructor*", for example "MyClass.constructor". @@ -320,14 +316,14 @@ Pour une fonction "class constructor", la commande `Current method name` retourn ```4d // Class: MyClass -// Class constructor de MyClass +// Class constructor of MyClass Class Constructor ($name : Text) This.name:=$name ``` ```4d -// Dans une méthode projet -// Vous pouvez instancier un objet +// In a project method +// You can instantiate an object var $o : cs.MyClass $o:=cs.MyClass.new("HelloWorld") // $o = {"name":"HelloWorld"} @@ -338,14 +334,14 @@ $o:=cs.MyClass.new("HelloWorld") ### Class extends \ -#### Syntaxe +#### Syntax ```4d -// Class : ChildClass +// Class: ChildClass Class extends ``` -Le mot-clé `Class extends` est utilisé dans une déclaration de classe pour créer une classe utilisateur qui est elle-même enfant d'une autre classe utilisateur. The child class inherits all functions of the parent class. +The `Class extends` keyword is used in class declaration to create a user class which is a child of another user class. The child class inherits all functions of the parent class. Class extension must respect the following rules: @@ -497,76 +493,39 @@ $message:=$square.description() //I have 4 sides which are all equal | --------- | ------ | -- | -------------- | | Result | object | <- | Current object | -The `This` keyword returns a reference to the currently processed object. You created the `Rectangle` class with a function: - -```4d - //Class: Rectangle - - Function nbSides - C_TEXT($0) - $0:="I have 4 sides" -``` - -You also created the `Square` class with a function calling the superclass function: - -```4d - //Class: Square - - Class extends Rectangle - - Function description - C_TEXT($0) - $0:=Super.nbSides()+" which are all equal" -``` - -Then you can write in a project method: - -```4d - C_OBJECT($square) - C_TEXT($message) - $square:=cs.Square.new() - $message:=$square.description() //I have 4 sides which are all equal -``` - -### This - -#### This -> Object - -| Parameter | Type | | Description | -| --------- | ------ | -- | -------------- | -| Result | object | <- | Current object | - The `This` keyword returns a reference to the currently processed object. In 4D, it can be used in [different contexts](https://doc.4d.com/4Dv18/4D/18/This.301-4504875.en.html). -In most cases, the value of `This` is determined by how a function is called. It can't be set by assignment during execution, and it may be different each time the function is called. Par exemple : +In most cases, the value of `This` is determined by how a function is called. It can't be set by assignment during execution, and it may be different each time the function is called. + +When a formula is called as a member method of an object, its `This` is set to the object the method is called on. For example: ```4d $o:=New object("prop";42;"f";Formula(This.prop)) $val:=$o.f() //42 ``` -Lorsqu'une fonction de [class constructor](#class-constructor) est utilisée (avec le mot clé `new()`), son `This` est lié au nouvel objet en cours de construction. +When a [class constructor](#class-constructor) function is used (with the `new()` keyword), its `This` is bound to the new object being constructed. ```4d //Class: ob Class Constructor - // Créer des propriétés sur This, tel que - // souhaité en leur affectant + // Create properties on This as + // desired by assigning to them This.a:=42 ``` ```4d -// dans une méthode 4D +// in a 4D method $o:=cs.ob.new() $val:=$o.a //42 ``` -> Lorsque vous appelez le constructeur de superclasse dans un constructeur à l'aide du mot clé [Super](#super), gardez à l'esprit que `This` ne doit pas être appelé avant le constructeur de superclasse, sinon une erreur est générée. Prenons [cet exemple](#example-1). +> When calling the superclass constructor in a constructor using the [Super](#super) keyword, keep in mind that `This` must not be called before the superclass constructor, otherwise an error is generated. See [this example](#example-1). -Dans tous les cas, `This` fait référence à l'objet sur lequel la méthode a été appelée, comme si la méthode était sur l'objet. +In any cases, `This` refers to the object the method was called on, as if the method were on the object. ```4d //Class: ob @@ -575,26 +534,6 @@ Function f() $0:=This.a+This.b ``` -Vous pouvez donc écrire, dans une méthode projet : - -```4d -$o:=cs.ob.new() -$o.a:=5 -$o.b:=3 -$val:=$o.f() //8 -``` -Dans cet exemple, l'objet assigné à la variable $o n'a pas sa propre propriété *f*, il l'hérite de sa classe. See [this example](#example-1). - - -In any cases, `This` refers to the object the method was called on, as if the method were on the object. - -```4d - //Class: ob - - Function f - $0:=This.a+This.b -``` - Then you can write in a project method: ```4d @@ -618,13 +557,6 @@ Several commands of the 4D language allows you to handle class features. `OB Class` returns the class of the object passed in parameter. -### OB Instance of - -#### OB Instance of ( object ; class ) -> Boolean - -`OB Instance of` returns `true` if `object` belongs to `class` or to one of its inherited classes, and `false` otherwise. - - ### OB Instance of #### OB Instance of ( object ; class ) -> Boolean diff --git a/website/translated_docs/fr/Concepts/components.md b/website/translated_docs/fr/Concepts/components.md index 87b4ef7f46c16c..0a3759b6d453ae 100644 --- a/website/translated_docs/fr/Concepts/components.md +++ b/website/translated_docs/fr/Concepts/components.md @@ -5,52 +5,52 @@ title: Composants A 4D component is a set of 4D methods and forms representing one or more functionalities that can be installed in different applications. For example, you can develop a 4D e-mail component that manages every aspect of sending, receiving and storing e-mails in 4D applications. -La création et l’installation des composants 4D s’effectuent directement depuis 4D. Schématiquement, les composants sont gérés comme des [plug-ins](Concepts/plug-ins.md). Les principes sont les suivants : +Creating and installing 4D components is carried out directly from 4D. Basically, components are managed like [plug-ins](Concepts/plug-ins.md) according to the following principles: -- Un composant est un simple fichier de structure (compilé ou non compilé) d’architecture standard ou sous forme de package (cf. paragraphe Extension .4dbase). +- A component consists of a regular structure file (compiled or not) having the standard architecture or in the form of a package (see .4dbase Extension). - To install a component in an application project, you simply need to copy it into the "Components" folder of the project, at the same level as the Project folder. -- Un composant peut appeler la plupart des éléments 4D : des méthodes projet, des formulaires projet, des barres de menus, des listes à choix multiples, des images issues de la bibliothèque, etc. Il ne peut pas appeler des méthodes base et des triggers. -- Il n’est pas possible d’exploiter des tables standard ou des fichiers de données dans les composants 4D. En revanche, un composant peut créer et/ou utiliser des tables, des champs et des fichiers de données via les mécanismes des bases externes. Les bases externes sont des bases 4D indépendantes manipulées via les commandes SQL. +- A component can call on most of the 4D elements: project methods, project forms, menu bars, choice lists, pictures from the library, and so on. It cannot call database methods and triggers. +- You cannot use standard tables or data files in 4D components. However, a component can create and/or use tables, fields and data files using mechanisms of external databases. These are separate 4D databases that you work with using SQL commands. -## Définitions +## Definitions -Les mécanismes de gestion des composants dans 4D nécessitent la mise en oeuvre des concepts et de la terminologie suivants : +The component management mechanisms in 4D require the implementation of the following terms and concepts: - **Matrix Project**: 4D project used for developing the component. The matrix project is a standard project with no specific attributes. A matrix project forms a single component. The matrix project is intended to be copied, compiled or not, into the Components folder of the project that will be using the component (host application project). - **Host Project**: Application project in which a component is installed and used. - **Component**: Matrix project, compiled or not, copied into the Components folder of the host application and whose contents are used in the host applications. -It should be noted that a project can be both a “matrix” and a “host,” in other words, a matrix project can itself use one or more components. En revanche, une base utilisée comme composant ne peut pas elle-même utiliser un composant : un seul niveau de composant est chargé. +It should be noted that a project can be both a “matrix” and a “host,” in other words, a matrix project can itself use one or more components. However, a component cannot use “sub-components” itself. -### Protection des composants : la compilation +### Protection of components: compilation -By default, all the project methods of a matrix project installed as a component are potentially visible from the host project. En particulier : +By default, all the project methods of a matrix project installed as a component are potentially visible from the host project. In particular: -- The shared project methods are found on the Methods Page of the Explorer and can be called in the methods of the host project. Leur contenu peut être sélectionné et copié dans la zone de prévisualisation de l’Explorateur. Elles peuvent également être visualisées dans le débogueur. Il n’est toutefois pas possible de les ouvrir dans l’éditeur de méthodes ni de les modifier. +- The shared project methods are found on the Methods Page of the Explorer and can be called in the methods of the host project. Their contents can be selected and copied in the preview area of the Explorer. They can also be viewed in the debugger. However, it is not possible to open them in the Method editor nor to modify them. - The other project methods of the matrix project do not appear in the Explorer but they too can be viewed in the debugger of the host project. To protect the project methods of a component effectively, simply compile the matrix project and provide it in the form of a .4dz file. When a compiled matrix project is installed as a component: -- The shared project methods are shown on the Methods Page of the Explorer and can be called in the methods of the host project. En revanche, leur contenu n’apparaît pas dans la zone de prévisualisation ni dans le débogueur. +- The shared project methods are shown on the Methods Page of the Explorer and can be called in the methods of the host project. However, their contents will not appear in the preview area nor in the debugger. - The other project methods of the matrix project will never appear. -## Partage des méthodes projet +## Sharing of project methods All the project methods of a matrix project are by definition included in the component (the project is the component), which means that they can be called and executed by the component. -On the other hand, by default these project methods will not be visible, nor can they be called in the host projects. In the matrix project, you must explicitly designate the methods that you want to share with the host project. These project methods can be called in the code of the host project (but they cannot be modified in the Method editor of the host database). Ces méthodes constituent les **points d’entrée** dans le composant. +On the other hand, by default these project methods will not be visible, nor can they be called in the host projects. In the matrix project, you must explicitly designate the methods that you want to share with the host project. These project methods can be called in the code of the host project (but they cannot be modified in the Method editor of the host database). These methods form **entry points** in the component. **Note:** Conversely, for security reasons, by default a component cannot execute project methods belonging to the host project. In certain cases, you may need to allow a component to access the project methods of your host project. To do this, you must explicitly designate the project methods of the host project that you want to make accessible to the components. ![](assets/en/Concepts/pict516563.en.png) -## Passage de variables +## Passing variables The local, process and interprocess variables are not shared between components and host projects. The only way to access component variables from the host project and vice versa is using pointers. -Exemple utilisant un tableau : +Example using an array: ```4d //In the host project: @@ -61,7 +61,7 @@ Exemple utilisant un tableau : APPEND TO ARRAY($1->;2) ``` -Exemples utilisant des variables : +Examples using variables: ```4d C_TEXT(myvariable) @@ -75,33 +75,33 @@ When you use pointers to allow components and the host project to communicate, y - The `Get pointer` command will not return a pointer to a variable of the host project if it is called from a component and vice versa. -- The component architecture allows the coexistence, within the same interpreted project, of both interpreted and compiled components (conversely, only compiled components can be used in a compiled project). L’usage de pointeurs dans ce cas doit respecter le principe suivant : l’interpréteur peut dépointer un pointeur construit en mode compilé mais à l’inverse, en mode compilé, il n’est pas possible de dépointer un pointeur construit en mode interprété. Let’s illustrate this principle with the following example: given two components, C (compiled) and I (interpreted), installed in the same host project. - - Si le composant C définit la variable `mavarC`, le composant I peut accéder à la valeur de cette variable en utilisant le pointeur `->mavarC`. - - Si le composant I définit la variable `mavarI`, le composant C ne peut pas accéder à cette variable en utilisant le pointeur `->mavarI`. Cette syntaxe provoque une erreur d’exécution. +- The component architecture allows the coexistence, within the same interpreted project, of both interpreted and compiled components (conversely, only compiled components can be used in a compiled project). In order to use pointers in this case, you must respect the following principle: the interpreter can unpoint a pointer built in compiled mode; however, in compiled mode, you cannot unpoint a pointer built in interpreted mode. Let’s illustrate this principle with the following example: given two components, C (compiled) and I (interpreted), installed in the same host project. + - If component C defines the `myCvar` variable, component I can access the value of this variable by using the pointer `->myCvar`. + - If component I defines the `myIvar` variable, component C cannot access this variable by using the pointer `->myIvar`. This syntax causes an execution error. -- The comparison of pointers using the `RESOLVE POINTER` command is not recommended with components since the principle of partitioning variables allows the coexistence of variables having the same name but with radically different contents in a component and the host project (or another component). Le type de la variable peut même être différent dans les deux contextes. Si les pointeurs `monptr1` et `monptr2` pointent chacun sur une variable, la comparaison suivante produira un résultat erroné : +- The comparison of pointers using the `RESOLVE POINTER` command is not recommended with components since the principle of partitioning variables allows the coexistence of variables having the same name but with radically different contents in a component and the host project (or another component). The type of the variable can even be different in both contexts. If the `myptr1` and `myptr2` pointers each point to a variable, the following comparison will produce an incorrect result: ```4d - RESOLVE POINTER(monptr1;vNomVar1;vnumtable1;vnumchamp1) - RESOLVE POINTER(monptr2;vNomVar2;vnumtable2;vnumchamp2) - If(vNomVar1=vNomVar2) - //Ce test retourne Vrai alors que les variables sont différentes + RESOLVE POINTER(myptr1;vVarName1;vtablenum1;vfieldnum1) + RESOLVE POINTER(myptr2;vVarName2;vtablenum2;vfieldnum2) + If(vVarName1=vVarName2) + //This test returns True even though the variables are different ``` -Dans ce cas, il est nécessaire d’utiliser la comparaison de pointeurs : +In this case, it is necessary to use the comparison of pointers: ```4d - If(monptr1=monptr2) //Ce test retourne Faux + If(myptr1=myptr2) //This test returns False ``` ## Access to tables of the host project -Although components cannot use tables, pointers can permit host projects and components to communicate with each other. Par exemple, voici une méthode pouvant être appelée depuis un composant : +Although components cannot use tables, pointers can permit host projects and components to communicate with each other. For example, here is a method that could be called from a component: ```4d -// appeler une méthode composant -methCreateRec(->[PERSONNES];->[PERSONNES]Nom;"Julie Andrews") +// calling a component method +methCreateRec(->[PEOPLE];->[PEOPLE]Name;"Julie Andrews") ``` -Dans le composant, le code de la méthode `methCreateRec` : +Within the component, the code of the `methCreateRec` method: ```4d C_POINTER($1) //Pointer on a table in host project @@ -116,22 +116,22 @@ $fieldpointer->:=$3 SAVE RECORD($tablepointer->) ``` -## Portée des commandes du langage +## Scope of language commands -Hormis les [Commandes non utilisables](#unusable-commands), un composant peut utiliser toute commande du langage 4D. +Except for [Unusable commands](#unusable-commands), a component can use any command of the 4D language. -Lorsqu’elles sont appelées depuis un composant, les commandes s’exécutent dans le contexte du composant, à l’exception de la commande `EXECUTE METHOD` qui utilise le contexte de la méthode désignée par la commande. Also note that the read commands of the “Users and Groups” theme can be used from a component but will read the users and groups of the host project (a component does not have its own users and groups). +When commands are called from a component, they are executed in the context of the component, except for the `EXECUTE METHOD` command that uses the context of the method specified by the command. Also note that the read commands of the “Users and Groups” theme can be used from a component but will read the users and groups of the host project (a component does not have its own users and groups). The `SET DATABASE PARAMETER` and `Get database parameter` commands are an exception: their scope is global to the application. When these commands are called from a component, they are applied to the host application project. -Par ailleurs, des dispositions spécifiques sont définies pour les commandes `Structure file` et `Get 4D folder` lorsqu’elles sont utilisées dans le cadre des composants. +Furthermore, specific measures have been specified for the `Structure file` and `Get 4D folder` commands when they are used in the framework of components. The `COMPONENT LIST` command can be used to obtain the list of components that are loaded by the host project. -### Commandes non utilisables +### Unusable commands -Les commandes suivantes ne sont pas compatibles avec une utilisation dans le cadre d’un composant car elles modifient le fichier de structure — ouvert en lecture. Leur exécution dans un composant provoque l’erreur -10511, “La commande NomCommande ne peut pas être appelée depuis un composant” : +The following commands are not compatible for use within a component because they modify the structure file — which is open in read-only. Their execution in a component will generate the error -10511, “The CommandName command cannot be called from a component”: - `ON EVENT CALL` - `Method called on event` @@ -151,40 +151,40 @@ Les commandes suivantes ne sont pas compatibles avec une utilisation dans le cad - `BLOB TO USERS` - `SET PLUGIN ACCESS` -**Notes :** +**Notes:** -- La commande `Table du formulaire courant` retourne `Nil` lorsqu’elle est appelée dans le contexte d’un formulaire projet. Par conséquent, elle ne peut pas être utilisée dans un composant. +- The `Current form table` command returns `Nil` when it is called in the context of a project form. Consequently, it cannot be used in a component. - SQL data definition language commands (`CREATE TABLE`, `DROP TABLE`, etc.) cannot be used on the component project. However, they are supported with external databases (see `CREATE DATABASE` SQL command). ## Gestion des erreurs An [error-handling method](Concepts/error-handling.md) installed by the `ON ERR CALL` command only applies to the running application. In the case of an error generated by a component, the `ON ERR CALL` error-handling method of the host project is not called, and vice versa. -## Utilisation de formulaires +## Use of forms -- Seuls les "formulaires projet" (formulaires non associés à une table en particulier) peuvent être exploités directement dans un composant. Any project forms present in the matrix project can be used by the component. -- A component can call table forms of the host project. A noter qu’il est nécessaire dans ce cas d’utiliser des pointeurs plutôt que des noms de table entre [] pour désigner les formulaires dans le code du composant. +- Only “project forms” (forms that are not associated with any specific table) can be used in a component. Any project forms present in the matrix project can be used by the component. +- A component can call table forms of the host project. Note that in this case it is necessary to use pointers rather than table names between brackets [] to specify the forms in the code of the component. -**Note:** If a component uses the `ADD RECORD` command, the current Input form of the host project will be displayed, in the context of the host project. Par conséquent, si le formulaire comporte des variables, le composant n’y aura pas accès. +**Note:** If a component uses the `ADD RECORD` command, the current Input form of the host project will be displayed, in the context of the host project. Consequently, if the form includes variables, the component will not have access to it. -- You can publish component forms as subforms in the host projects. Avec ce principe, vous pouvez notamment développer des composants proposant des objets graphiques. Par exemple, les Widgets proposés par 4D sont basés sur l’emploi de sous-formulaires en composants. +- You can publish component forms as subforms in the host projects. This means that you can, more particularly, develop components offering graphic objects. For example, Widgets provided by 4D are based on the use of subforms in components. -## Utilisation de tables et de champs +## Use of tables and fields -A component cannot use the tables and fields defined in the 4D structure of the matrix project. En revanche, il peut créer et utiliser des bases externes, et donc utiliser des tables et des champs en fonction de ses besoins. Les bases externes sont créées et gérées via le langage SQL. An external database is a 4D project that is independent from the main 4D project, but that you can work with from the main 4D project. Utiliser une base externe signifie désigner temporairement cette base comme base courante, c’est-à-dire comme base cible des requêtes SQL exécutées par 4D. Les bases externes sont créées à l'aide de la commande SQL `CREATE DATABASE`. +A component cannot use the tables and fields defined in the 4D structure of the matrix project. However, you can create and use external databases, and then use their tables and fields according to your needs. You can create and manage external databases using SQL. An external database is a 4D project that is independent from the main 4D project, but that you can work with from the main 4D project. Using an external database means temporarily designating this database as the current database, in other words, as the target database for the SQL queries executed by 4D. You create external databases using the SQL `CREATE DATABASE` command. -### Exemple +### Example -Le code suivant est inclus dans un composant et effectue trois actions élémentaires avec une base de données externe : +The following code is included in a component and performs three basic actions with an external database: -- création de la base de données externe si elle n'existe pas déjà, -- ajout de données dans la base de données externe, -- lecture de données depuis la base de données externe. +- creates the external database if it does not already exist, +- adds data to the external database, +- reads data from the external database. -Création de la base de données externe : +Creating the external database: ```4d -<>MyDatabase:=Get 4D folder+"\MyDB" // (Windows) stocke les données dans un répertoire autorisé +<>MyDatabase:=Get 4D folder+"\MyDB" // (Windows) stores the data in an authorized directory Begin SQL CREATE DATABASE IF NOT EXISTS DATAFILE :[<>MyDatabase]; USE DATABASE DATAFILE :[<>MyDatabase]; @@ -204,7 +204,7 @@ Création de la base de données externe : End SQL ``` -Ecriture dans la base de données externe : +Writing in the external database: ```4d $Ptr_1:=$2 // retrieves data from the host project through pointers @@ -226,7 +226,7 @@ Ecriture dans la base de données externe : End SQL ``` -Lecture dans une base de données externe : +Reading from an external database: ```4d $Ptr_1:=$2 // accesses data of the host project through pointers @@ -248,17 +248,17 @@ Lecture dans une base de données externe : End SQL ``` -## Utilisation de ressources +## Use of resources -Les composants peuvent utiliser des ressources. Si le composant est d’architecture .4dbase (architecture conseillée), le dossier Resources doit être placé à l’intérieur de ce dossier. +Components can use resources. In conformity with the resource management principle, if the component is of the .4dbase architecture (recommended architecture), the Resources folder must be placed inside this folder. -Les mécanismes automatiques sont opérationnels : les fichiers XLIFF présents dans le dossier Resources d’un composant seront chargés par ce composant. +Automatic mechanisms are operational: the XLIFF files found in the Resources folder of a component will be loaded by this component. In a host project containing one or more components, each component as well as the host projects has its own “resources string.” Resources are partitioned between the different projects: it is not possible to access the resources of component A from component B or the host project. -## Aide en ligne des composants -Un mécanisme spécifique a été mis en place afin de permettre aux développeurs d’ajouter des aides en ligne à leurs composants. The principle is the same as that provided for 4D projects: +## On-line help for components +A specific mechanism has been implemented in order to allow developers to add on-line help to their components. The principle is the same as that provided for 4D projects: -- L’aide du composant doit être fournie sous le forme d’un fichier suffixé .htm, .html ou (Windows uniquement) .chm, -- Le fichier d’aide doit être placé à côté du fichier de structure du composant et porter le même nom que le fichier de structure, -- L’aide est alors automatiquement chargée dans le menu Aide de l’application avec le libellé “Aide de...” suivi du nom du fichier d’aide. \ No newline at end of file +- The component help must be provided as a file suffixed .htm, .html or (Windows only) .chm, +- The help file must be put next to the structure file of the component and have the same name as the structure file, +- This file is then automatically loaded into the Help menu of the application with the title “Help for...” followed by the name of the help file. \ No newline at end of file diff --git a/website/translated_docs/fr/Concepts/data-types.md b/website/translated_docs/fr/Concepts/data-types.md index 6c5f2bbfe38568..0c01445da49138 100644 --- a/website/translated_docs/fr/Concepts/data-types.md +++ b/website/translated_docs/fr/Concepts/data-types.md @@ -3,82 +3,82 @@ id: data-types title: Types de données --- -Dans 4D, les données sont gérées selon leur type à deux endroits : dans les champs de la base et dans le langage 4D. - -Bien qu'ils soient généralement équivalents, certains types de données de la base ne sont pas disponibles dans le langage et sont automatiquement convertis. A l'inverse, certains types de données sont gérés uniquement par le langage. Le tableau suivant liste tous les types de données disponibles, leur prise en charge et leur déclaration : - -| Types de données | Pris en charge par la base(1) | Pris en charge par le langage | [déclaration `var`](variables.md#using-the-var-keyword) | [déclaration `C_` ou `ARRAY`](variables.md#using-a-c_-directive) | -| -------------------------------------------- | ----------------------------- | ----------------------------- | ------------------------------------------------------- | ---------------------------------------------------------------- | -| [Alphanumérique](dt_string.md) | Oui | Converti en texte | - | - | -| [Texte](Concepts/dt_string.md) | Oui | Oui | Texte | `C_TEXT`, `ARRAY TEXT` | -| [Date](Concepts/dt_date.md) | Oui | Oui | Date | `C_DATE`, `ARRAY DATE` | -| [Heure](Concepts/dt_time.md) | Oui | Oui | Heure | `C_TIME`, `ARRAY TIME` | -| [Booléen](Concepts/dt_boolean.md) | Oui | Oui | Booléen | `C_BOOLEAN`, `ARRAY BOOLEAN` | -| [Entier long](Concepts/dt_number.md) | Oui | Converti en entier long | Entier long | `ARRAY INTEGER` | -| [Entier long](Concepts/dt_number.md) | Oui | Oui | Entier long | `C_LONGINT`, `ARRAY LONGINT` | -| [Entier long 64 bits](Concepts/dt_number.md) | Oui (SQL) | Converti en réel | - | - | -| [Réel](Concepts/dt_number.md) | Oui | Oui | Réel | `C_REAL`, `ARRAY REAL` | -| [Indéfini](Concepts/dt_null_undefined.md) | - | Oui | - | - | -| [Null](Concepts/dt_null_undefined.md) | - | Oui | - | - | -| [Pointeur](Concepts/dt_pointer.md) | - | Oui | Pointeur | `C_POINTER`, `ARRAY POINTER` | -| [Image](Concepts/dt_picture.md) | Oui | Oui | Image | `C_PICTURE`, `ARRAY PICTURE` | -| [BLOB](Concepts/dt_blob.md) | Oui | Oui | Blob | `C_BLOB`, `ARRAY BLOB` | -| [Objet](Concepts/dt_object.md) | Oui | Oui | Objet | `C_OBJECT`, `ARRAY OBJECT` | -| [Collection](Concepts/dt_collection.md) | - | Oui | Collection | `C_COLLECTION` | -| [Variant](Concepts/dt_variant.md)(2) | - | Oui | Variant | `C_VARIANT` | - -(1) A noter que ORDA gère les champs de la base via des objets (entités). Par conséquent, seuls les types de données disponibles pour ces objets sont pris en charge. Pour plus d'informations, veuillez vous reporter à la description du type [Objet](Concepts/dt_object.md). - -(2) Le variant n'est pas un type de *données* un type de *variable* qui peut contenir une valeur de n'importe quel autre type. - -## Valeurs par défaut - -Au moment de leur typage via une directive de compilation, les variables reçoivent une valeur par défaut, qu'elles conserveront au cours de la session tant qu'elles n'auront pas été affectées. - -La valeur par défaut dépend du type et de la catégorie de la variable, du contexte d'exécution (interprété ou compilé), ainsi que, pour le mode compilé, des options de compilation définies dans la Page Compilateur des Propriétés de la base : - -- Les variables process et interprocess sont toujours positionnées "à zéro" (qui signifie selon les cas 0, chaîne vide, blob vide, pointeur nil, date 00-00-00…) -- Les variables locales sont positionnées : - - en mode interprété : à zéro - - en mode compilé, dépendant de l'option **Initialiser les variables locales** des Propriétés de la base : - - à zéro lorsque "à zéro" est sélectionné, - - à une valeur arbitraire fixe lorsque "à une valeur aberrante" est sélectionné (0x72677267 pour les numériques et les heures, toujours vrai pour les booléens), équivalent de "à zéro" pour les autres, - - à "non" : pas d'initialisation, c'est-à-dire que tout ce qui est dans la RAM est utilisé pour les variables; c'est le cas des valeurs déjà utilisées pour les autres variables. **Note :** Il est recommandé d'utiliser "à zéro". - -Le tableau suivant illustre ces valeurs par défaut : - -| Type | Interprocess/Process (interprété/compilé), Local (interprété/compilé "à zéro") | Local compilé "aberrant" | Local compilé "non" | -| ----------- | ------------------------------------------------------------------------------ | ------------------------ | --------------------------- | -| Booléen | Faux | Vrai | True (varie) | -| Date | 00-00-00 | 00-00-00 | 00-00-00 | -| Entier long | 0 | 1919382119 | 909540880 (varie) | -| Heure | 00:00:00 | 533161:41:59 | 249345:34:24 (varie) | -| Image | picture size=0 | picture size=0 | picture size=0 | -| Réel | 0 | 1.250753659382e+243 | 1.972748538022e-217 (varie) | -| Pointeur | Nil=true | Nil=true | Nil=true | -| Texte | "" | "" | "" | -| Blob | Blob size=0 | Blob size=0 | Blob size=0 | -| Objet | null | null | null | -| Collection | null | null | null | -| Variant | indéfini | indéfini | indéfini | - - -## Convertir les types de données - -Le langage de 4D comporte des fonctions et des opérateurs vous permettant de convertir des types de données en d’autres types, dans la mesure où de telles conversions ont un sens. 4D assure la vérification des types de données. Ainsi, vous ne pouvez pas écrire : "abc"+0.5+!25/12/96!-?00:30:45?, car cette opération génère une erreur de syntaxe. - -Le tableau ci-dessous liste les types de données pouvant être convertis, le type dans lequel ils peuvent être convertis, ainsi que les fonctions 4D à utiliser : - -| Types à convertir | en Chaîne | en Numérique | en Date | en Heure | en Booléen | -| ----------------- | --------- | ------------ | ------- | -------- | ---------- | -| Chaîne (1) | | Num | Date | Heure | Bool | -| Numérique (2) | Chaine | | | | Bool | -| Date | Chaine | | | | Bool | -| Heure | Chaine | | | | Bool | -| Booléen | | Num | | | | - -(1) Les chaînes formatées en JSON peuvent être converties en données scalaires, objets ou collections à l'aide de la commande `JSON Parse`. - -(2) Les valeurs de type Heure peuvent être utilisées en tant que numériques. - -**Note :** Ce tableau ne traite pas les conversions de données plus complexes obtenues à l'aide d'une combinaison d'opérateurs et d'autres commandes. +In 4D, data are handled according to their type in two places: database fields and the 4D language. + +Although they are usually equivalent, some data types available at the database level are not directly available in the language and are automatically converted. Conversely, some data types can only be handled through the language. The following table lists all available data types and how they are supported/declared: + +| Data Types | Database support(1) | Language support | [`var` declaration](variables.md#using-the-var-keyword) | [`C_` or `ARRAY` declaration](variables.md#using-a-c_-directive) | +| ------------------------------------------ | ------------------- | -------------------- | ------------------------------------------------------- | ---------------------------------------------------------------- | +| [Alphanumeric](dt_string.md) | Yes | Converted to text | - | - | +| [Text](Concepts/dt_string.md) | Yes | Yes | Text | `C_TEXT`, `ARRAY TEXT` | +| [Date](Concepts/dt_date.md) | Yes | Yes | Date | `C_DATE`, `ARRAY DATE` | +| [Heure](Concepts/dt_time.md) | Yes | Yes | Heure | `C_TIME`, `ARRAY TIME` | +| [Booléen](Concepts/dt_boolean.md) | Yes | Yes | Booléen | `C_BOOLEAN`, `ARRAY BOOLEAN` | +| [Integer](Concepts/dt_number.md) | Yes | Converted to longint | Integer | `ARRAY INTEGER` | +| [Longint](Concepts/dt_number.md) | Yes | Yes | Integer | `C_LONGINT`, `ARRAY LONGINT` | +| [Longint 64 bits](Concepts/dt_number.md) | Yes (SQL) | Converted to real | - | - | +| [Real](Concepts/dt_number.md) | Yes | Yes | Real | `C_REAL`, `ARRAY REAL` | +| [Undefined](Concepts/dt_null_undefined.md) | - | Yes | - | - | +| [Null](Concepts/dt_null_undefined.md) | - | Yes | - | - | +| [Pointeur](Concepts/dt_pointer.md) | - | Yes | Pointeur | `C_POINTER`, `ARRAY POINTER` | +| [Image](Concepts/dt_picture.md) | Yes | Yes | Image | `C_PICTURE`, `ARRAY PICTURE` | +| [BLOB](Concepts/dt_blob.md) | Yes | Yes | Blob | `C_BLOB`, `ARRAY BLOB` | +| [Objet](Concepts/dt_object.md) | Yes | Yes | Objet | `C_OBJECT`, `ARRAY OBJECT` | +| [Collection](Concepts/dt_collection.md) | - | Yes | Collection | `C_COLLECTION` | +| [Variant](Concepts/dt_variant.md)(2) | - | Yes | Variant | `C_VARIANT` | + +(1) Note that ORDA handles database fields through objects (entities) and thus, only supports data types available to these objects. For more information, see the [Object](Concepts/dt_object.md) data type description. + +(2) Variant is actually not a *data* type but a *variable* type that can contain a value of any other data type. + +## Default values + +When variables are typed by means of a compiler directive, they receive a default value, which they will keep during the session as long as they have not been assigned. + +The default value depends on the variable type and category, its execution context (interpreted or compiled), as well as, for compiled mode, the compilation options defined on the Compiler page of the Database settings: + +- Process and interprocess variables are always set "to zero" (which means, depending on the case, "0", an empty string, an empty Blob, a Nil pointer, a blank date (00-00-00), etc.) +- Local variables are set: + - in interpreted mode: to zero + - in compiled mode, depending on the **Initialize local variables** option of the Database settings: + - "to zero": to zero (see above), + - "to a random value": 0x72677267 for numbers and times, always True for Booleans, the same as "to zero" for the others, + - "no": no initialization, meaning whatever is in RAM is used for the variables, like values used before for other variables. **Note:** 4D recommends to use "to zero". + +The following table illustrates these default values: + +| Type | Interprocess/Process (interpreted/compiled), Local (interpreted/compiled "to zero") | Local compiled "random" | Local compiled "no" | +| ---------- | ----------------------------------------------------------------------------------- | ----------------------- | ---------------------------- | +| Booleen | False | True | True (varies) | +| Date | 00-00-00 | 00-00-00 | 00-00-00 | +| Longint | 0 | 1919382119 | 909540880 (varies) | +| Heure | 00:00:00 | 533161:41:59 | 249345:34:24 (varies) | +| Image | picture size=0 | picture size=0 | picture size=0 | +| Real | 0 | 1.250753659382e+243 | 1.972748538022e-217 (varies) | +| Pointeur | Nil=true | Nil=true | Nil=true | +| Text | "" | "" | "" | +| Blob | Blob size=0 | Blob size=0 | Blob size=0 | +| Objet | null | null | null | +| Collection | null | null | null | +| Variant | undefined | undefined | undefined | + + +## Converting data types + +The 4D language contains operators and commands to convert between data types, where such conversions are meaningful. The 4D language enforces data type checking. For example, you cannot write: "abc"+0.5+!12/25/96!-?00:30:45?. This will generate syntax errors. + +The following table lists the basic data types, the data types to which they can be converted, and the commands used to do so: + +| Data Type to Convert | to String | to Number | to Date | to Time | to Boolean | +| -------------------- | --------- | --------- | ------- | ------- | ---------- | +| String (1) | | Num | Date | Heure | Bool | +| Number (2) | Chaine | | | | Bool | +| Date | Chaine | | | | Bool | +| Heure | Chaine | | | | Bool | +| Booléen | | Num | | | | + +(1) Strings formatted in JSON can be converted into scalar data, objects, or collections, using the `JSON Parse` command. + +(2) Time values can be treated as numbers. + +**Note:** In addition to the data conversions listed in this table, more sophisticated data conversions can be obtained by combining operators and other commands. diff --git a/website/translated_docs/fr/Concepts/dt_blob.md b/website/translated_docs/fr/Concepts/dt_blob.md index 110a4ee4a77a65..37a7c3940c0df2 100644 --- a/website/translated_docs/fr/Concepts/dt_blob.md +++ b/website/translated_docs/fr/Concepts/dt_blob.md @@ -3,61 +3,61 @@ id: blob title: BLOB --- -Un champ, une variable ou une expression de type BLOB (Binary Large OBjects) est une série contiguë d'octets qui peut être traitée comme un seul objet ou dont les octets peuvent être adressés individuellement. Un BLOB peut être vide (longueur nulle) ou contenir jusqu'à 2147483647 octets (2 Go). +A BLOB (Binary Large OBjects) field, variable or expression is a contiguous series of bytes which can be treated as one whole object or whose bytes can be addressed individually. A BLOB can be empty (null length) or can contain up to 2147483647 bytes (2 GB). -Lorsque vous travaillez avec un BLOB, il est stocké entièrement en mémoire. Si vous travaillez avec une variable, le BLOB n'existe qu'en mémoire. Si vous travaillez avec un champ de type BLOB, il est chargé en mémoire à partir du disque, comme le reste de l'enregistrement auquel il appartient. +A BLOB is loaded into memory in its entirety. A BLOB variable is held and exists in memory only. A BLOB field is loaded into memory from the disk, like the rest of the record to which it belongs. -A l'instar des autres types de champs pouvant contenir une grande quantité de données (comme les champs de type Image), les champs de type BLOB ne sont pas dupliqués en mémoire lorsque vous modifiez un enregistrement. Par conséquent, les résultats renvoyés par `Ancien` et `Modifie` ne sont pas significatifs lorsque ces fonctions sont appliquées à des champs de type BLOB. +Like the other field types that can retain a large amount of data (such as the Picture field type), BLOB fields are not duplicated in memory when you modify a record. Consequently, the result returned by the `Old` and `Modified` commands is not significant when applied to a BLOB field. -## Passage des paramètres, pointeurs et résultats de fonctions +## Parameter passing, Pointers and function results -Les BLOBs dans 4D peuvent être passés comme paramètres aux commandes 4D ou aux routines des plug-ins qui attendent un paramètre de type BLOB. Les BLOBs peuvent également être passés aux méthodes que vous créez ou être retournés comme résultats de fonctions. +4D BLOBs can be passed as parameters to 4D commands or plug-in routines that expect BLOB parameters. BLOBS can also be passed as parameters to a user method or be returned as a function result. -Pour passer un BLOB à une de vos méthodes, vous pouvez aussi définir un pointeur vers le BLOB et passer le pointeur comme paramètre. +To pass a BLOB to your own methods, you can also define a pointer to the BLOB and pass the pointer as parameter. -**Voici quelques exemples :** +**Examples:** ```4d - // Déclarer une variable de type BLOB - C_BLOB(touteVarBLOB) - // Le BLOB est passé comme paramètre à une commande 4D - SET BLOB SIZE(touteVarBLOB;1024*1024) - // Le BLOB est passé comme paramètre à une routine externe - $CodeErr:=Faites_Quelque_chose_avec_ce_BLOB(touteVarBLOB) - // Le BLOB est passé comme paramètre à une méthode qui retourne un BLOB - C_BLOB(recupBlob) - recupBlob:=Remplir_Blob(touteVarBLOB) - // Un pointeur vers le BLOB est passé comme paramètre à une de vos méthodes - COMPUTE BLOB(->touteVarBLOB) + ` Declare a variable of type BLOB + C_BLOB(anyBlobVar) + ` The BLOB is passed as parameter to a 4D command + SET BLOB SIZE(anyBlobVar;1024*1024) + ` The BLOB is passed as parameter to an external routine + $errCode:=Do Something With This BLOB(anyBlobVar) + ` The BLOB is passed as a parameter to a method that returns a BLOB + C_BLOB(retrieveBlob) + retrieveBlob:=Fill_Blob(anyBlobVar) + ` A pointer to the BLOB is passed as parameter to a user method + COMPUTE BLOB(->anyBlobVar) ``` -**Note pour les développeurs de plug ins 4D :** Un paramètre de type BLOB se déclare “&O” (la lettre “O” et non le chiffre “0”). +**Note for Plug-in developers:** A BLOB parameter is declared as “&O” (the letter “O”, not the digit “0”). -## Assignation +## Assignment operator -Vous pouvez assigner la valeur d'un BLOB à d'autres BLOBs, comme dans l'exemple suivant. +You can assign BLOBs to each other. -**Exemple :** +**Example:** ```4d - // Déclarer deux variables de type BLOB + ` Declare two variables of type BLOB C_BLOB(vBlobA;vBlobB) - // Fixer la taille du premier BLOB à 10Ko + ` Set the size of the first BLOB to 10K SET BLOB SIZE(vBlobA;10*1024) - // Assigner le premier BLOB au second + ` Assign the first BLOB to the second one vBlobB:=vBlobA ``` -En revanche, il n'existe pas d'opérateur pouvant être utilisé avec des BLOB. +However, no operator can be applied to BLOBs. -## Adresser le contenu d'un BLOB +## Addressing BLOB contents -Chaque octet d'un BLOB peut être adressé individuellement, à l'aide des accolades {...}. Dans un BLOB, les octets sont numérotés de 0 à N-1, N étant la taille du BLOB. Exemple : +You can address each byte of a BLOB individually using the curly brackets symbols {...}. Within a BLOB, bytes are numbered from 0 to N-1, where N is the size of the BLOB. Example: ```4d - // Déclarer une variable de type BLOB + ` Declare a variable of type BLOB C_BLOB(vBlob) - // Fixer la taille du BLOB à 256 octets + ` Set the size of the BLOB to 256 bytes SET BLOB SIZE(vBlob;256) - // La boucle suivante initialise les 256 octets du BLOB à zéro - Boucle(vOctet;0;Taille BLOB(vBlob)-1) - vBlob{vOctet}:=0 - Fin de boucle + ` The loop below initializes the 256 bytes of the BLOB to zero + For(vByte;0;BLOB size(vBlob)-1) + vBlob{vByte}:=0 + End for ``` -Comme vous pouvez adresser individuellement tous les octets d'un BLOB, vous pouvez littéralement stocker tout ce que vous voulez dans une variable ou un champ de type BLOB. +Because you can address all the bytes of a BLOB individually, you can actually store whatever you want in a BLOB field or variable. diff --git a/website/translated_docs/fr/Concepts/dt_boolean.md b/website/translated_docs/fr/Concepts/dt_boolean.md index 9786533bfe5194..33aa818a241718 100644 --- a/website/translated_docs/fr/Concepts/dt_boolean.md +++ b/website/translated_docs/fr/Concepts/dt_boolean.md @@ -3,62 +3,62 @@ id: boolean title: Booléen --- -Un champ, une variable ou une expression de type booléen peut être soit VRAI soit FAUX. +A boolean field, variable or expression can be either TRUE or FALSE. -## Fonctions booléennes +## Boolean functions -Les fonctions booléennes de 4D traitent des valeurs telles que `Vrai`, `Faux` et `Non` dans le thème **Booléens** consacré. Pour plus d'informations, veuillez vous reporter à la description de ces commandes. +4D provides the Boolean functions `True`, `False`, and `Not` in the dedicated **Boolean** theme. For more information, see the descriptions of these commands -### Exemple +### Example -L'exemple suivant retourne Vrai dans la variable monBooléen si l'utilisateur a cliqué sur le bouton monBouton et Faux s'il n'a pas cliqué dessus. . Lorsqu'un bouton reçoit un clic, la variable du bouton prend la valeur 1. +This example sets a Boolean variable based on the value of a button. It returns True in myBoolean if the myButton button was clicked and False if the button was not clicked. When a button is clicked, the button variable is set to 1. ```4d - If(monBouton=1) // Si le bouton a reçu un clic - monBooléen:=True// monBooléen prend la valeur True - Else // Si le bouton n'a pas reçu de clic, - monBooléen:=False //monBooléen prend la valeur False + If(myButton=1) //If the button was clicked + myBoolean:=True //myBoolean is set to True + Else //If the button was not clicked, + myBoolean:=False //myBoolean is set to False End if ``` -L'exemple ci-dessus peut être simplifié et écrit en une seule ligne . +The previous example can be simplified into one line. ```4d -monBooléen:=(monBouton=1) +myBoolean:=(myButton=1) ``` -## Opérateurs logiques +## Logical operators -4D supporte deux opérateurs logiques : l'opérateur d'intersection (AND) et l'opérateur de réunion inclusive (OR). Le AND logique retourne TRUE si les deux expressions sont VRAIES. Le OR logique retourne TRUE si au moins une des expressions est VRAIE. Le tableau suivant décrit les opérateurs logiques : +4D supports two logical operators that work on Boolean expressions: conjunction (AND) and inclusive disjunction (OR). A logical AND returns TRUE if both expressions are TRUE. A logical OR returns TRUE if at least one of the expressions is TRUE. The following table shows the logical operators: -| Opération | Syntaxe | Retourne | Expression | Valeur | -| --------- | ----------------- | -------- | ---------------------------- | ------ | -| AND | Booléen & Booléen | Booléen | ("A" = "A") & (15 # 3) | Vrai | -| | | | ("A" = "B") & (15 # 3) | Faux | -| | | | ("A" = "B") & (15 = 3) | Faux | -| OU | Booléen & Booléen | Booléen | ("A" = "A") | (15 # 3) | Vrai | -| | | | ("A" = "B") | (15 # 3) | Vrai | -| | | | ("A" = "B") | (15 = 3) | Faux | +| Operation | Syntax | Returns | Expression | Value | +| --------- | ----------------------- | ------- | ---------------------------- | ----- | +| AND | Boolean & Boolean | Booléen | ("A" = "A") & (15 # 3) | True | +| | | | ("A" = "B") & (15 # 3) | False | +| | | | ("A" = "B") & (15 = 3) | False | +| OR | Boolean | Boolean | Booléen | ("A" = "A") | (15 # 3) | True | +| | | | ("A" = "B") | (15 # 3) | True | +| | | | ("A" = "B") | (15 = 3) | False | -Voici la "table de vérité" pour l'opérateur logique "AND" : +The following is the truth table for the AND logical operator: | Expr1 | Expr2 | Expr1 & Expr2 | | ----- | ----- | ------------- | -| Vrai | Vrai | Vrai | -| Vrai | Faux | Faux | -| Faux | Vrai | Faux | -| Faux | Faux | Faux | +| True | True | True | +| True | False | False | +| False | True | False | +| False | False | False | -Voici la "table de vérité" pour l'opérateur logique "OR" : +The following is the truth table for the OR logical operator: | Expr1 | Expr2 | Expr1 | Expr2 | | ----- | ----- | ------------------ | -| Vrai | Vrai | Vrai | -| Vrai | Faux | Vrai | -| Faux | Vrai | Vrai | -| Faux | Faux | Faux | +| True | True | True | +| True | False | True | +| False | True | True | +| False | False | False | -**Astuce :** Si vous devez calculer une réunion exclusive (le "Ou" exclusif) entre Expr1 et Expr2, écrivez : +**Tip:** If you need to calculate the exclusive disjunction between Expr1 and Expr2, evaluate: ```4d (Expr1|Expr2) & Not(Expr1 & Expr2) diff --git a/website/translated_docs/fr/Concepts/dt_collection.md b/website/translated_docs/fr/Concepts/dt_collection.md index 354655b09e7d40..38d7c194d5b9cb 100644 --- a/website/translated_docs/fr/Concepts/dt_collection.md +++ b/website/translated_docs/fr/Concepts/dt_collection.md @@ -3,33 +3,33 @@ id: collection title: Collection --- -Les collections sont des listes ordonnées de valeurs de types similaires ou différents (texte, nombre, date, objet, booléen, collection ou null). +Collections are ordered lists of values of similar or mixed types (text, number, date, object, boolean, collection, or null). -Pour manipuler les variables de type Collection, vous devez utiliser la notation objet (voir [Les bases de la syntaxe](Concepts/dt_object.md#syntax-basics)). +Collection type variables are managed using object notation (see [Syntax basics](Concepts/dt_object.md#syntax-basics)). -Pour des informations complémentaires sur les collections 4D, passez le numéro (l'indice) de l'élément entre crochets : +To access a collection element, you need to pass the element number inside square brackets: ```4d collectionRef[expression] ``` -Vous pouvez passer toute expression 4D valide qui retourne un nombre entier positif dans *expression*. Voici quelques exemples : +You can pass any valid 4D expression which returns a positive integer in *expression*. Examples: ```4d - myCollection[5] //accès au 6e élément de la collection + myCollection[5] //access to 6th element of the collection myCollection[$var] ``` -**Attention :** N'oubliez pas que la numérotation des éléments de collection débute à 0. +**Warning:** Collection elements are numbered from 0. -Vous pouvez assigner une valeur à un élément de collection ou lire une valeur d'élément de collection : +You can assign a value to a collection element or get a collection element value: ```4d - myCol[10]:="Mon nouvel élément" + myCol[10]:="My new element" $myVar:=myCol[0] ``` -Si vous assignez un numéro d'élément plus grand que celui du dernier élément existant dans la collection, la collection est automatiquement redimensionnée et les nouveaux éléments intermédiaires prennent la valeur null : +If you assign an element's index that surpasses the last existing element of the collection, the collection is automatically resized and all new intermediary elements are assigned a null value: ```4d var myCol : Collection @@ -40,37 +40,38 @@ Si vous assignez un numéro d'élément plus grand que celui du dernier élémen //myCol[4]=null ``` -## Initialisation +## Initialization -Les collections doivent être initialisées à l'aide, par exemple, de la commande `Creer collection`, sinon une erreur de syntaxe sera générée à la suite d'une lecture ou d'une modification d'un ou plusieurs élements de la collection. +Collections must have been initialized, for example using the `New collection` command, otherwise trying to read or modify their elements will generate a syntax error. -Exemple : +Example: ```4d - var $colVar : Collection //création d'une variable 4D de type collection. $colVar:=New $colVar:=New collection //initialisation de la collection et assignation à la variable 4D + var $colVar : Collection //creation of collection type 4D variable + $colVar:=New collection //initialization of the collection and assignment to the 4D variable ``` -### Collection standard ou collection partagée +### Regular or shared collection -Vous pouvez créer deux types de collections : +You can create two types of collections: -- standard (non partagées), à l'aide de la commande [`New collection`](API/collectionClass.md#new-collection). Ces collections peuvent être modifiées sans contrôle d'accès spécifique mais ne peuvent pas être partagées entre les process. -- partagées, à l'aide de la commande [`New shared collection`](API/collectionClass.md#new-shared-collection). Le contenu de ces collections peut être partagé entre les process, y compris des process (thread) préemptifs. L'accès à ces collections doit être contrôlé via des structures [`Use...End use`](Concepts/shared.md#useend-use). +- regular (non-shared) collections, using the [`New collection`](API/collectionClass.md#new-collection) command. These collections can be edited without any specific access control but cannot be shared between processes. +- shared collections, using the [`New shared collection`](API/collectionClass.md#new-shared-collection) command. These collections can be shared between processes, including preemptive threads. Access to these collections is controlled by [`Use...End use`](Concepts/shared.md#useend-use) structures. -Pour plus d'informations, veuillez vous reporter à la page [Objets partagés et collections partagées](Concepts/shared.md). +For more information, refer to the [Shared objects and collections](Concepts/shared.md) section. -## Fonctions de collection +## Collection functions -Les références de collections 4D bénéficient de fonctions de classe spécifiques (souvent appelées *fonctions méthodes*). Les fonctions de collection sont répertoriées dans la section [Class API Reference](API/collectionClass.md). +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. -Par exemple: +For example: ```4d -$newCol:=$col.copy() //copie de $col vers $newCol - $col.push(10;100) //ajout de 10 et 100 à la collection +$newCol:=$col.copy() //deep copy of $col to $newCol +$col.push(10;100) //add 10 and 100 to the collection ``` -Certaines fonctions retournent la collection d'origine après modification, de manière à ce que vous puissiez enchaîner les appels dans une même séquence : +Some functions return the original collection after modification, so that you can run the calls in a sequence: ```4d $col:=New collection(5;20) @@ -78,17 +79,17 @@ Certaines fonctions retournent la collection d'origine après modification, de m ``` -### paramètre cheminPropriété +### propertyPath parameter -Plusieurs fonctions admettent un paramètre nommé _cheminPropriété_. Ce paramètre peut contenir : +Several functions accept a _propertyPath_ as parameter. This parameter stands for: -- soit un nom de propriété d'objet, par exemple "nomComplet" -- soit un chemin de propriété d'objet, c'est-à-dire une séquence hiérarchique de sous-propriétés reliées par des points, par exemple "employé.enfant.prénom". +- either an object property name, for example "lastName" +- or an object property path, i.e. a hierarchical sequence of sub-properties linked with dot characters, for example "employee.children.firstName". -**Attention :** Lorsque des fonctions ou un paramètre cheminPropriété sont attendus, l'utilisation de noms de propriétés contenant ".", "[ ]", ou des espaces n'est pas prise en charge car cela empêcherait 4D d'analyser correctement le chemin : +**Warning:** When using functions and propertyPath parameters, you cannot use ".", "[ ]", or spaces in property names since it will prevent 4D from correctly parsing the path: ```4d - $vmin:=$col.min("My.special.property") //indéfini - $vmin:=$col.min(["My.special.property"]) //erreur + $vmin:=$col.min("My.special.property") //undefined + $vmin:=$col.min(["My.special.property"]) //error ``` \ No newline at end of file diff --git a/website/translated_docs/fr/Concepts/dt_date.md b/website/translated_docs/fr/Concepts/dt_date.md index aa61545205952f..e575fe71595ddb 100644 --- a/website/translated_docs/fr/Concepts/dt_date.md +++ b/website/translated_docs/fr/Concepts/dt_date.md @@ -3,15 +3,15 @@ id: date title: Date --- -Les variables, champs ou expressions de type Date peuvent être compris entre 1/1/100 et 31/12/32767. +A Date field, variable or expression can be in the range of 1/1/100 to 12/31/32,767. -Bien que le mode de représentation des dates par C_DATE permette de manipuler des dates allant jusqu'à l'année 32 767, certaines opérations passant par le système imposent une limite plus basse. +Although the representation mode for dates by can work with dates up to the year 32 767, certain operations passing through the system impose a lower limit. -**Note :** Dans ce manuel de référence du langage 4D, les paramètres de type Date dans les descriptions des commandes sont appelés Date, sauf spécification explicite. +**Note:** In the 4D Language Reference manual, Date parameters in command descriptions are denoted as Date, except when marked otherwise. -## Constantes littérales de type date +## Date literals -Une constante littérale de type date est comprise entre deux points d'exclamation (!…!). Une date doit être structurée avec le format ISO (!YYYY-MM-DD!). Voici quelques exemples de constantes dates : +A date literal constant is enclosed by exclamation marks (!…!). A date must be structured using the ISO format (!YYYY-MM-DD!). Here are some examples of date constants: ```4d !1976-01-01! @@ -19,31 +19,31 @@ Une constante littérale de type date est comprise entre deux points d'exclamati !2015-12-31! ``` -Une date nulle s’écrit _!00-00-00!_. - -**Astuce :** L'éditeur de méthodes dispose d'un raccourci pour entrer une date nulle. Pour cela, tapez un point d’exclamation (!) et appuyez sur la touche Entrée. - -**Notes :** - -- Pour des raisons de compatibilité, 4D accepte que l'année soit saisie sur deux chiffres. Dans ce cas, le programme considère qu’elle appartient au XXe ou au XXIe siècle selon qu'elle est supérieure ou inférieure à 30, sauf si ce fonctionnement par défaut a été modifié à l'aide de la commande `SET DEFAULT CENTURY`. -- Si vous avez coché l'option "Utiliser langage français et paramètres régionaux système" (cf. Page Méthodes), vous devez utiliser le format de date défini dans votre système. Généralement dans un environnement français, une date est saisie sous la forme jour/mois/année, une barre oblique "/" séparant les valeurs. - -## Opérateurs sur les dates - -| Opération | Syntaxe | Retourne | Expression | Valeur | -| ------------------- | ---------------- | -------- | ---------------------------- | ------------ | -| Différence | Date - Date | Nombre | !2017-01-20! - !2017-01-01! | 19 | -| Addition | Date + Numérique | Date | !2017-01-20! !2017-01-20! | !2017-01-29! | -| Soustraction | Date - Numérique | Date | !2017-01-20! !2017-01-01! | !2017-01-11! | -| Egalité | Date = Date | Booléen | !2017-01-20! = !2017-01-01! | Vrai | -| | | | !2017-01-20! !2017-01-20! | Faux | -| Inégalité | Date # Date | Booléen | !2017-01-20! !2017-01-01! | Vrai | -| | | | !2017-01-20! !2017-01-20! | Faux | -| Supérieur à | Date > Date | Booléen | !2017-01-20! !2017-01-20! | Vrai | -| | | | !2017-01-20! !2017-01-20! | Faux | -| Inférieur à | Date < Date | Booléen | !2017-01-20! !2017-01-20! | Vrai | -| | | | !2017-01-20! !2017-01-20! | Faux | -| Supérieur ou égal à | Date >= Date | Booléen | !2017-01-20! !2017-01-20! | Vrai | -| | | | !2017-01-01!>=!2017-01-20! | Faux | -| Inférieur ou égal à | Date \<= Date | Booléen | !2017-01-01!\<=!2017-01-20! | Vrai | -| | | | !2017-01-20!\<=!2017-01-01! | Faux | +A null date is specified by _!00-00-00!_. + +**Tip:** The Method Editor includes a shortcut for entering a null date. To type a null date, enter the exclamation (!) character and press Enter. + +**Notes:** + +- For compatibility reasons, 4D accepts two-digit years to be entered. A two-digit year is assumed to be in the 20th or 21st century based on whether it is greater or less than 30, unless this default setting has been changed using the `SET DEFAULT CENTURY` command. +- If you have checked the "Use regional system settings" option (see Methods Page), you must use the date format defined in your system. Generally, in a US environment, dates are entered in the form month/day/year, with a slash "/" separating the values. + +## Date operators + +| Operation | Syntax | Returns | Expression | Value | +| ------------------------ | -------------- | ------- | ---------------------------- | ------------ | +| Date difference | Date – Date | Number | !2017-01-20! - !2017-01-01! | 19 | +| Day addition | Date + Number | Date | !2017-01-20! + 9 | !2017-01-29! | +| Day subtraction | Date – Number | Date | !2017-01-20! - 9 | !2017-01-11! | +| Equality | Date = Date | Booléen | !2017-01-01! =!2017-01-01! | True | +| | | | !2017-01-20! = !2017-01-01! | False | +| Inequality | Date # Date | Booléen | !2017-01-20! # !2017-01-01! | True | +| | | | !2017-01-20! # !2017-01-20! | False | +| Greater than | Date > Date | Booléen | !2017-01-20! > !2017-01-01! | True | +| | | | !2017-01-20! > !2017-01-20! | False | +| Less than | Date < Date | Booléen | !2017-01-01! < !2017-01-20! | True | +| | | | !2017-01-20! < !2017-01-20! | False | +| Greater than or equal to | Date >= Date | Booléen | !2017-01-20! >=!2017-01-01! | True | +| | | | !2017-01-01!>=!2017-01-20! | False | +| Less than or equal to | Date \<= Date | Booléen | !2017-01-01!\<=!2017-01-20! | True | +| | | | !2017-01-20!\<=!2017-01-01! | False | diff --git a/website/translated_docs/fr/Concepts/dt_null_undefined.md b/website/translated_docs/fr/Concepts/dt_null_undefined.md index 9647c28135fad6..2267003da0ddb8 100644 --- a/website/translated_docs/fr/Concepts/dt_null_undefined.md +++ b/website/translated_docs/fr/Concepts/dt_null_undefined.md @@ -3,25 +3,25 @@ id: null-undefined title: Null et Indefinie --- -Null et Undefined sont des types de données qui gèrent les cas où la valeur d'une expression n'est pas connue. +Null and Undefined are data types that handle cases where the value of an expression is not known. ## Null -Null est un type de données particulier avec une seule valeur possible : **null**. Cette valeur est retournée par une expression qui ne contient aucune valeur. +Null is a special data type with only one possible value: **null**. This value is returned by an expression that does not contain any value. -Dans le langage de 4D et pour les attributs des champs objets, les valeurs null sont gérées via la commande `Null`. Cette commande peut être utilisée avec les expressions suivantes pour fixer ou comparer la valeur null : +In the 4D language and for object field attributes, null values are managed through the `Null` function. This function can be used with the following expressions for setting or comparing the null value: -- attributs d'objets -- éléments de collections -- variables de type objet, collection, pointeur, image ou variant. +- object attributes +- collection elements +- variables of the object, collection, pointer, picture, or variant type. -## Indéfini +## Undefined -Indéfinie n'est pas véritablement un type de données. Une variable dite "indéfinie" est une variable n'ayant pas encore été définie. Une fonction utilisateur (c'est-à-dire une méthode projet qui retourne une valeur) peut retourner une valeur indéfinie si, à l'intérieur de la méthode, le résultat de la fonction ($0) est assigné à une expression indéfinie (une expression issue d'un calcul effectué avec au moins une variable indéfinie). Un champ ne peut pas être indéfini (la commande `Indefinie` retourne toujours Faux pour un champ). Une variable variant porte la valeur par défaut **indéfini**. +Undefined is not actually a data type. It denotes a variable that has not yet been defined. A function (a project method that returns a result) can return an undefined value if, within the method, the function result ($0) is assigned an undefined expression (an expression calculated with at least one undefined variable). A field cannot be undefined (the `Undefined` command always returns False for a field). A variant variable has **undefined** as default value. -## Exemples +## Examples -Cet exemple compare les différents résultats de la commande `Indefinie` et de la commande `Null` appliquées aux propriétés d'objets, en fonction du contexte : +Here are the different results of the `Undefined` command as well as the `Null` command with object properties, depending on the context: ```4d C_OBJECT($vEmp) @@ -29,12 +29,12 @@ $vEmp:=New object $vEmp.name:="Smith" $vEmp.children:=Null -$undefined:=Undefined($vEmp.name) // Faux -$null:=($vEmp.name=Null) //Faux +$undefined:=Undefined($vEmp.name) // False +$null:=($vEmp.name=Null) //False -$undefined:=Undefined($vEmp.children) // Faux -$null:=($vEmp.children=Null) //Vrai +$undefined:=Undefined($vEmp.children) // False +$null:=($vEmp.children=Null) //True -$undefined:=Undefined($vEmp.parent) // Vrai -$null:=($vEmp.parent=Null) //Vrai +$undefined:=Undefined($vEmp.parent) // True +$null:=($vEmp.parent=Null) //True ``` diff --git a/website/translated_docs/fr/Concepts/dt_number.md b/website/translated_docs/fr/Concepts/dt_number.md index fbc3d9fe16b6b3..55932e04b34aff 100644 --- a/website/translated_docs/fr/Concepts/dt_number.md +++ b/website/translated_docs/fr/Concepts/dt_number.md @@ -3,22 +3,22 @@ id: number title: Numérique (Réel, Entier, Entier long) --- -Numérique est un terme générique utilisé pour : +Number is a generic term that stands for: -- Les champs, variables ou expression de type Réel. Les nombres de type Réel sont compris dans l'intervalle ±1.7e±308 (13 chiffres significatifs). -- Les champs, variables ou expression de type Entier long. Les nombres de type Entier long (4 octets) sont compris dans l'intervalle -2^31..(2^31)-1. -- Les champs, variables ou expression de type Entier. Les nombres de type Entier (2 octets) sont compris dans l'intervalle -32 768..32 767. +- Real field, variable or expression. The range for the Real data type is ±1.7e±308 (13 significant digits). +- Long Integer field, variable or expression. The range for the Long Integer data type (4-byte Integer) is -2^31..(2^31)-1. +- Integer field, array or expression. The range for the Integer data type (2-byte Integer) is -32,768..32,767 (2^15..(2^15)-1). -**Note :** Lorsqu'elles sont utilisées dans le langage 4D, les valeurs des champs de type Entier sont automatiquement converties en Entier long. +**Note:** Integer field values are automatically converted in Long integers when used in the 4D Language. -Vous pouvez assigner tout nombre d'un type numérique à un nombre d'un autre type numérique, 4D effectue automatiquement la conversion, en tronquant ou en arrondissant les valeurs si nécessaire. Notez cependant que lorsqu'une valeur est située en-dehors de l'intervalle du type de destination, 4D ne pourra la convertir. Vous pouvez mélanger tous les types de numériques au sein d'une même expression. +You can assign any Number data type to another; 4D does the conversion, truncating or rounding if necessary. However, when values are out of range, the conversion will not return a valid value. You can mix Number data types in expressions. -**Note :** Dans ce manuel de référence du langage 4D, quel que soit le type précis des données, les paramètres de type Réel, Entier et Entier long dans les descriptions des commandes sont appelés numériques, sauf spécification explicite. +**Note:** In the 4D Language Reference manual, no matter the actual data type, the Real, Integer, and Long Integer parameters in command descriptions are denoted as number, except when marked otherwise. -## Constantes littérales numériques +## Number literals -Une constante littérale numérique s’écrit comme un nombre réel. Voici quelques exemples de constantes numériques : +A numeric literal constant is written as a real number. Here are some examples of numeric constants: ```4d 27 @@ -26,9 +26,9 @@ Une constante littérale numérique s’écrit comme un nombre réel. Voici quel 0.0076 ``` -> Le séparateur décimal est par défaut le point (.), quelle que soit la langue du système. Si vous avez coché l'option "Utiliser langage français et paramètres régionaux système" dans la Page Méthodes des Préférences, vous devez utiliser le séparateur défini dans votre système. +> The default decimal separator is a period (.), regardless of the system language. If you have checked the "Use regional system settings" option in the Methods Page of the Preferences, you must use the separator defined in your system. -Les nombres négatifs s’écrivent précédés du signe moins (-). Par exemple: +Negative numbers are specified with the minus sign (-). For example: ```4d -27 @@ -36,113 +36,113 @@ Les nombres négatifs s’écrivent précédés du signe moins (-). Par exemple: -0.0076 ``` -## Opérateurs sur les nombres - -| Opération | Syntaxe | Retourne | Expression | Valeur | -| ------------------- | ---------------- | -------- | ---------- | ------ | -| Addition | Nombre + Nombre | Nombre | 2 + 3 | 5 | -| Soustraction | Nombre - Nombre | Nombre | 3 – 2 | 1 | -| Multiplication | Number * Number | Nombre | 5 * 2 | 10 | -| Division | Number / Number | Nombre | 5 / 2 | 2.5 | -| Division entière | Nombre \ Nombre | Nombre | 5 \ 2 | 2 | -| Modulo | Nombre % Nombre | Nombre | 5 % 2 | 1 | -| Exponentiation | Nombre ^ Nombre | Nombre | 2 ^ 3 | 8 | -| Egalité | Nombre = Nombre | Booléen | 10 = 10 | Vrai | -| | | | 10 = 11 | Faux | -| Inégalité | Nombre # Nombre | Booléen | 10 #11 | Vrai | -| | | | 10 # 10 | Faux | -| Supérieur à | Nombre > Nombre | Booléen | 11 > 10 | Vrai | -| | | | 10 > 11 | Faux | -| Inférieur à | Nombre < Nombre | Booléen | 10 < 11 | Vrai | -| | | | 11 < 10 | Faux | -| Supérieur ou égal à | Nombre >= Nombre | Booléen | 11 >= 10 | Vrai | -| | | | 10 >= 11 | Faux | -| Inférieur ou égal à | Nombre <= Nombre | Booléen | 10 <= 11 | Vrai | -| | | | 11 <= 10 | Faux | - -L'opérateur modulo % divise le premier nombre par le second et retourne le reste de la division entière. Voici quelques exemples : - -- 10 % 2 retourne 0 car la division de 10 par 2 ne donne pas de reste. -- 10 % 3 retourne 1 car le reste est 1. -- 10,5 % 2 retourne 0 car le reste n'est pas un nombre entier. - -**ATTENTION :** -- L'opérateur modulo % retourne des valeurs significatives avec des nombres appartenant à la catégorie des entiers longs (de –2^31 à +2^31 moins 1). Pour calculer le modulo de nombres qui ne sont pas dans cet intervalle, utilisez la fonction `Modulo`. -- L'opérateur division entière \ retourne des valeurs significatives avec des nombres entiers uniquement. - -### Priorité - -L'ordre dans lequel une expression est évaluée s'appelle la priorité. 4D applique strictement une règle de priorité de gauche à droite. L'ordre algébrique n'est pas appliqué. Par exemple: +## Number operators + +| Operation | Syntax | Returns | Expression | Value | +| ------------------------ | ---------------- | ------- | ---------- | ----- | +| Addition | Number + Number | Number | 2 + 3 | 5 | +| Subtraction | Number - Number | Number | 3 – 2 | 1 | +| Multiplication | Number * Number | Number | 5 * 2 | 10 | +| Division | Number / Number | Number | 5 / 2 | 2.5 | +| Longint division | Number \ Number | Number | 5 \ 2 | 2 | +| Modulo | Number % Number | Number | 5 % 2 | 1 | +| Exponentiation | Number ^ Number | Number | 2 ^ 3 | 8 | +| Equality | Number = Number | Booléen | 10 = 10 | True | +| | | | 10 = 11 | False | +| Inequality | Number # Number | Booléen | 10 #11 | True | +| | | | 10 # 10 | False | +| Greater than | Number > Number | Booléen | 11 > 10 | True | +| | | | 10 > 11 | False | +| Less than | Number < Number | Booléen | 10 < 11 | True | +| | | | 11 < 10 | False | +| Greater than or equal to | Number >= Number | Booléen | 11 >= 10 | True | +| | | | 10 >= 11 | False | +| Less than or equal to | Number <= Number | Booléen | 10 <= 11 | True | +| | | | 11 <= 10 | False | + +The modulo operator % divides the first number by the second number and returns a whole number remainder. Here are some examples: + +- 10 % 2 returns 0 because 10 is evenly divided by 2. +- 10 % 3 returns 1 because the remainder is 1. +- 10.5 % 2 returns 0 because the remainder is not a whole number. + +**WARNING:** +- The modulo operator % returns significant values with numbers that are in the Long Integer range (from minus 2^31 to 2^31 minus one). To calculate the modulo with numbers outside of this range, use the `Mod` command. +- The longint division operator \ returns significant values with integer numbers only. + +### Precedence + +The order in which an expression is evaluated is called precedence. 4D has a strict left-to-right precedence, in which algebraic order is not observed. For example: ```4d 3+4*5 ``` -retourne 35 car l'expression est évaluée comme 3 + 4, qui donne 7, multiplié par 5, ce qui donne 35. +returns 35, because the expression is evaluated as 3 + 4, yielding 7, which is then multiplied by 5, with the final result of 35. -Les parenthèses doivent être utilisées pour forcer l'ordre de calcul en fonction de vos besoins. Par exemple: +To override the left-to-right precedence, you MUST use parentheses. For example: ```4d 3+(4*5) ``` -retourne 23 car l'expression (4 * 5) est évaluée en premier lieu. Le résultat (20) est alors ajouté à 3, ce qui donne le résultat final 23. +returns 23 because the expression (4 * 5) is evaluated first, because of the parentheses. The result is 20, which is then added to 3 for the final result of 23. -Des parenthèses peuvent être incluses dans d'autres parenthèses. Assurez-vous qu'il y ait une parenthèse fermante pour chaque parenthèse ouverte. Une parenthèse manquante ou placée à un mauvais endroit peut soit donner un résultat erroné, soit renvoyer une expression invalide. De plus, si vous avez l'intention de compiler vos applications, vous devez vous assurer d'une bonne utilisation des parenthèses. Le compilateur interprètera toute parenthèse manquante ou superflue comme une erreur de syntaxe. +Parentheses can be nested inside other sets of parentheses. Be sure that each left parenthesis has a matching right parenthesis to ensure proper evaluation of expressions. Lack of, or incorrect use of parentheses can cause unexpected results or invalid expressions. Furthermore, if you intend to compile your applications, you must have matching parentheses—the compiler detects a missing parenthesis as a syntax error. -## Opérateurs sur les bits +## Bitwise operators -Les opérateurs sur les bits s'appliquent à des expressions ou valeurs de type **Entier long**. +The bitwise operators operates on **Long Integer** expressions or values. -> Si vous passez une valeur de type Entier ou Réel à un opérateur sur les bits, 4D la convertit en Entier long avant de calculer le résultat de l'expression. +> If you pass an Integer or a Real value to a bitwise operator, 4D evaluates the value as a Long Integer value before calculating the expression that uses the bitwise operator. -Lorsque vous employez des opérateurs sur les bits, vous devez considérer une valeur de type Entier long comme un tableau de 32 bits. Les bits sont numérotés de 0 à 31, de droite à gauche. +While using the bitwise operators, you must think about a Long Integer value as an array of 32 bits. The bits are numbered from 0 to 31, from right to left. -Comme un bit peut valoir 0 (zéro) ou 1, vous pouvez également considérer une valeur de type Entier long comme une expression dans laquelle vous pouvez stocker 32 valeurs de type Booléen. Lorsque le bit vaut 1, la valeur est **Vrai** et lorsque le bit vaut 0, la valeur est **Faux**. +Because each bit can equal 0 or 1, you can also think about a Long Integer value as a value where you can store 32 Boolean values. A bit equal to 1 means **True** and a bit equal to 0 means **False**. -Une expression utilisant un opérateur sur les bits retourne une valeur de type Entier long, à l'exception de l'opérateur Tester bit avec lequel l'expression retournée est du type Booléen. Le tableau suivant fournit la liste des opérateurs sur les bits et leur syntaxe : +An expression that uses a bitwise operator returns a Long Integer value, except for the Bit Test operator, where the expression returns a Boolean value. The following table lists the bitwise operators and their syntax: -| Opération | Opérateur | Syntaxe | Retourne | -| --------------------- | --------- | ---------------------- | ----------------------- | -| ET | & | long & E. long | E. long | -| OU (inclusif) | | | long | E. long | E. long | -| OU (exclusif) | \^| | long \^| E. long | E. long | -| Décaler bits à gauche | << | E. Long << E. Long | long (voir note n°1) | -| Décaler bits à droite | >> | E. Long >> E. Long | long (voir note n°1) | -| Mettre bit à 1 | ?+ | long ?+ E. long | long (voir note n°2) | -| Mettre bit à 0 | ?- | long ?? | long (voir note n°2) | -| Tester bit | ?? | E. E. long | Booléen (voir note n°2) | +| Operation | Operator | Syntax | Returns | +| ---------------------- | --------- | ------------------- | -------------------- | +| Bitwise AND | & | Long & Long | Long | +| Bitwise OR (inclusive) | | | Long | Long | Long | +| Bitwise OR (exclusive) | \^| | Long \^| Long | Long | +| Left Bit Shift | << | Long << Long | Long (see note 1) | +| Right Bit Shift | >> | Long >> Long | Long (see note 1) | +| Bit Set | ?+ | Long ?+ Long | Long (see note 2) | +| Bit Clear | ?- | Long ?- Long | Long (see note 2) | +| Bit Test | ?? | Long ?? Long | Boolean (see note 2) | #### Notes -1. Dans les opérations utilisant `Décaler bits à gauche` et `Décaler bits à droite`, le second opérande indique le nombre de décalages de bits du premier opérande à effectuer dans la valeur retournée. Par conséquent, ce second opérande doit être compris entre 0 et 31. Notez qu'un décalage de 0 retourne une valeur inchangée et qu'un décalage de plus de 31 bits retourne 0x00000000 car tous les bits sont perdus. Si vous passez une autre valeur en tant que second opérande, le résultat sera non significatif. -2. Dans les opérations utilisant `Mettre bit à 1`, `Mettre bit à 0` et `Tester bit`, le second opérande indique le numéro du bit sur lequel agir. Par conséquent, ce second opérande doit être compris entre 0 et 31, sinon le résultat de l'expression sera non significatif. +1. For the `Left Bit Shift` and `Right Bit Shift` operations, the second operand indicates the number of positions by which the bits of the first operand will be shifted in the resulting value. Therefore, this second operand should be between 0 and 31. Note however, that shifting by 0 returns an unchanged value and shifting by more than 31 bits returns 0x00000000 because all the bits are lost. If you pass another value as second operand, the result is non-significant. +2. For the `Bit Set`, `Bit Clear` and `Bit Test` operations , the second operand indicates the number of the bit on which to act. Therefore, this second operand must be between 0 and 31; otherwise, the result of the expression is non-significant. -Le tableau suivant dresse la liste des opérateurs sur les bits et de leurs effets : +The following table lists the bitwise operators and their effects: -| Opération | Description | -| --------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| ET | Chaque bit retourné est le résultat de l'opération ET logique appliquée aux deux bits opérandes.

    Voici la table du ET logique :

  • 1 & 1 --> 1
  • 0 & 1 --> 0
  • 1 & 0 --> 0
  • 0 & 0 --> 0

    En d'autres termes, le bit résultant est 1 si les deux bits d'opérande sont 1; sinon, le bit résultant est 0. | -| OU (inclusif) | Chaque bit retourné est le résultat de l'opération OU logique appliquée aux deux bits opérandes.

    Voici la table du OU inclusif logique :

  • 1 | 1 --> 1
  • 0 | 1 --> 1
  • 1 | 0 --> 1
  • 0 | 0 --> 0

    En d'autres termes, le bit résultant est 1 si au moins l'un des deux bits d'opérande est 1; sinon, le bit résultant est 0. | -| OU (exclusif) | Chaque bit retourné est le résultat de l'opération OU logique appliquée aux deux bits opérandes.

    Voici la table du OU exclusif logique :

  • 1 \^| 1 --> 0
  • 0 \^| 1 --> 1
  • 1 \^| 0 --> 1
  • 0 \^| 0 --> 0

    En d'autres termes, le bit résultant est 1 si seul l'un des deux bits d'opérande est 1; sinon, le bit résultant est 0. | -| Décaler bits à gauche | La valeur résultante est définie sur la première valeur d'opérande, puis les bits résultants sont décalés vers la gauche du nombre de positions indiqué par le deuxième opérande. Les bits auparavant situés à gauche sont perdus et les nouveaux bits situés à droite ont la valeur 0.

    **Note:** en ne tenant compte que des valeurs positives, le décalage vers la gauche de N bits équivaut à multiplier par 2 ^ N. | -| Décaler bits à droite | La valeur résultante est définie sur la première valeur d'opérande, puis les bits résultants sont décalés vers la droite du nombre de positions indiqué par le deuxième opérande. Les bits auparavant situés à droite sont perdus et les nouveaux bits situés à gauche ont la valeur 0.

    **Note:** en ne tenant compte que des valeurs positives, le décalage vers la droite de N bits équivaut à diviser par 2^N. | -| Mettre bit à 1 | La valeur retournée est la valeur du premier opérande dans lequel le bit dont le numéro est spécifié par le second opérande est positionné à 0. Les autres bits demeurent inchangés. | -| Mettre bit à 0 | La valeur retournée est la valeur du premier opérande dans lequel le bit dont le numéro est spécifié par le second opérande est positionné à 0. Les autres bits demeurent inchangés. | -| Tester bit | Retourne Vrai si, dans le premier opérande, le bit dont le numéro est indiqué par le second opérande vaut 1. Retourne Faux si, dans le premier opérande, le bit dont le numéro est indiqué par le second opérande vaut 0. | +| Operation | Description | +| ---------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| Bitwise AND | Each resulting bit is the logical AND of the bits in the two operands.

    Here is the logical AND table:

  • 1 & 1 --> 1
  • 0 & 1 --> 0
  • 1 & 0 --> 0
  • 0 & 0 --> 0

    In other words, the resulting bit is 1 if the two operand bits are 1; otherwise the resulting bit is 0. | +| Bitwise OR (inclusive) | Each resulting bit is the logical OR of the bits in the two operands.

    Here is the logical OR table:

  • 1 | 1 --> 1
  • 0 | 1 --> 1
  • 1 | 0 --> 1
  • 0 | 0 --> 0

    In other words, the resulting bit is 1 if at least one of the two operand bits is 1; otherwise the resulting bit is 0. | +| Bitwise OR (exclusive) | Each resulting bit is the logical XOR of the bits in the two operands.

    Here is the logical XOR table:

  • 1 \^| 1 --> 0
  • 0 \^| 1 --> 1
  • 1 \^| 0 --> 1
  • 0 \^| 0 --> 0

    In other words, the resulting bit is 1 if only one of the two operand bits is 1; otherwise the resulting bit is 0. | +| Left Bit Shift | The resulting value is set to the first operand value, then the resulting bits are shifted to the left by the number of positions indicated by the second operand. The bits on the left are lost and the new bits on the right are set to 0.

    **Note:** Taking into account only positive values, shifting to the left by N bits is the same as multiplying by 2^N. | +| Right Bit Shift | The resulting value is set to the first operand value, then the resulting bits are shifted to the right by the number of position indicated by the second operand. The bits on the right are lost and the new bits on the left are set to 0.

    **Note:** Taking into account only positive values, shifting to the right by N bits is the same as dividing by 2^N. | +| Bit Set | The resulting value is set to the first operand value, then the resulting bit, whose number is indicated by the second operand, is set to 1. The other bits are left unchanged. | +| Bit Clear | The resulting value is set to the first operand value, then the resulting bit, whose number is indicated by the second operand, is set to 0. The other bits are left unchanged. | +| Bit Test | Returns True if, in the first operand, the bit whose number is indicated by the second operand is equal to 1. Returns False if, in the first operand, the bit whose number is indicated by the second operand is equal to 0. | -### Exemples +### Examples -| Opération | Exemple | Résultat | -| --------------------- | ------------------------------- | ---------- | -| ET | 0x0000FFFF & 0xFF00FF00 | 0x0000FF00 | -| OU (inclusif) | 0x0000FFFF | 0xFF00FF00 | 0xFF00FFFF | -| OU (exclusif) | 0x0000FFFF \^| 0xFF00FF00 | 0xFF0000FF | -| Décaler bits à gauche | 0x0000FFFF << 8 | 0x00FFFF00 | -| Décaler bits à droite | 0x0000FFFF >> 8 | 0x000000FF | -| Mettre bit à 1 | 0x00000000 ?+ 16 | 0x00010000 | -| Mettre bit à 0 | 0x00010000 ?- 16 | 0x00000000 | -| Tester bit | 0x00010000 ?? 16 | Vrai | +| Operation | Example | Result | +| ---------------------- | ------------------------------- | ---------- | +| Bitwise AND | 0x0000FFFF & 0xFF00FF00 | 0x0000FF00 | +| Bitwise OR (inclusive) | 0x0000FFFF | 0xFF00FF00 | 0xFF00FFFF | +| Bitwise OR (exclusive) | 0x0000FFFF \^| 0xFF00FF00 | 0xFF0000FF | +| Left Bit Shift | 0x0000FFFF << 8 | 0x00FFFF00 | +| Right Bit Shift | 0x0000FFFF >> 8 | 0x000000FF | +| Bit Set | 0x00000000 ?+ 16 | 0x00010000 | +| Bit Clear | 0x00010000 ?- 16 | 0x00000000 | +| Bit Test | 0x00010000 ?? 16 | True | diff --git a/website/translated_docs/fr/Concepts/dt_object.md b/website/translated_docs/fr/Concepts/dt_object.md index f02240d75c091f..8ed017d2858f4f 100644 --- a/website/translated_docs/fr/Concepts/dt_object.md +++ b/website/translated_docs/fr/Concepts/dt_object.md @@ -3,98 +3,99 @@ id: object title: Objet --- -Les variables, champs ou expressions de type objet peuvent contenir des données de divers types. La structure des objets "natifs" 4D est basée sur le principe classique des paires "propriété/valeur" (aussi appelées "attribut/valeur). La syntaxe de ces objets s’inspire du JSON : +Variables, fields or expressions of the Object type can contain various types of data. The structure of "native" 4D objects is based on the classic principle of "property/value" pairs. The syntax of these objects is based on JSON notation: -- Un nom de propriété est toujours un texte, par exemple "Nom". +- A property name is always a text, for example "Name". -- Une valeur de propriété peut être du type suivant : - - Nombre (réel, entier long, etc.) - - Texte +- A property value can be of the following type: + - number (Real, Integer, etc.) + - text - null - Booléen - - Pointeur (stocké tel quel, évalué à l’aide de la commande `JSON Stringify` ou lors d’une copie), - - Date (type date ou chaîne au format date ISO) - - Objet (les objets peuvent être imbriqués sur plusieurs niveaux) - - Image(*) + - pointer (stored as such, evaluated using the `JSON Stringify` command or when copying), + - date (date type or ISO date format string) + - object (objects can be nested on several levels) + - picture(*) - collection -(*)Lorsqu'elles sont exposées sous forme de texte dans le débogueur ou exportées en JSON, les propriétés d'objet de type image indiquent "[objet Image]". +(*)When exposed as text in the debugger or exported to JSON, picture object properties print "[object Picture]". -**Attention :** N'oubliez pas que les noms d'attributs tiennent compte des majuscules/minuscules. +**Warning:** Keep in mind that attribute names differentiate between upper and lower case. -Pour gérer les variables, champs ou expressions de type objet, vous pouvez utiliser la notation objet (cf. [Utiliser la notation objet](Concepts/dt_object.md#syntax-basics)) ou les commandes 4D du thème **Objets (Langage)**. A noter que des commandes spécifiques du thème Requêtes, telles que `CHERCHER PAR ATTRIBUT`, `CHERCHER PAR ATTRIBUT DANS SELECTION` ou `TRIER PAR ATTRIBUT` peuvent être utilisées pour traiter des champs objets. +You manage Object type variables, fields or expressions using the commands available in the **Objects (Language)** theme or through the object notation (see [Syntax basics](Concepts/dt_object.md#syntax-basics)). 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. -Chaque valeur de propriété accessible par la notation objet est considérée comme une expression. You can use such values wherever 4D expressions are expected: +Each property value accessed through the object notation is considered an expression. You can use such values wherever 4D expressions are expected: -- Dans le code 4D, soit écrites dans les méthodes (éditeur de méthodes) soit externalisées (formules, fichiers d'étiquettes traités par la commande PROCESS 4D TAGS ou le Serveur Web, fichiers d'export, documents 4D Write Pro, etc.), -- Dans les zones d'expressions du débogueur et l'explorateur d'exécution, -- Dans la liste de propriétés de l'éditeur de formulaires pour les objets formulaires : champ Variable ou Expression et plusieurs expressions de list box et colonnes (source de données, couleur de fond, style ou couleur de police). +- in 4D code, either written in the methods (Method editor) or externalized (formulas, 4D tags files processed by PROCESS 4D TAGS or the Web Server, export files, 4D Write Pro documents...), +- 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). -## Initialisation +## Initialization -Les objets doivent être initialisés à l'aide, par exemple, de la commande `New object`, sinon une erreur de syntaxe sera générée à la suite d'une lecture ou d'une modification de leurs propriétés. +Objects must have been initialized, for example using the `New object` command, otherwise trying to read or modify their properties will generate a syntax error. -Exemple : +Example: ```4d - C_OBJET($obVar) //création d'une variable 4D de type objet. $obVar:=Creer objet//initialisation de l'objet et assignation à la variable 4D + C_OBJECT($obVar) //creation of an object type 4D variable + $obVar:=New object //initialization of the object and assignment to the 4D variable ``` -### Objet standard ou partagé +### Regular or shared object -Vous pouvez créer deux types d'objets : +You can create two types of objects: -- standard (non partagés), à l'aide de la commande `Creer objet`. Ces objets peuvent être modifiés sans contrôle d'accès spécifique mais ne peuvent pas être partagés entre les process. -- partagés, à l'aide de la commande `New shared object`. Le contenu de ces objets peut être partagé entre les process, y compris des process (thread) préemptifs. L'accès à ces objets doit être contrôlé via des structures `Use...End use`. Pour plus d'informations, veuillez vous reporter à la page [Objets partagés et collections partagées](Concepts/shared.md). +- regular (non-shared) objects, using the `New object` command. These objects can be edited without any specific access control but cannot be shared between processes. +- shared objects, using the `New shared object` command. These objects can be shared between processes, including preemptive threads. Access to these objects is controlled by `Use...End use` structures. For more information, refer to the [Shared objects and collections](Concepts/shared.md) section. -## Principes de syntaxe +## Syntax basics -La notation objet est utilisée pour accéder aux valeurs de propriétés d'objets via des séquences de symboles et de propriétés référencées (tokens). +Object notation can be used to access object property values through a chain of tokens. -### Propriétés des objets +### Object properties -Avec la notation objet, il est possible d'accéder aux propriétés d'objets (aussi appelées attributs d'objets) de deux façons : +With object notation, object properties can be accessed in two ways: -- à l'aide du symbole "point" : > objet.NomPropriété +- using a "dot" symbol: > object.propertyName -Exemple : +Example: ```4d employee.name:="Smith" ``` -- à l'aide d'une chaîne entre crochets : > objet["NomPropriété"] +- using a string within square brackets: > object["propertyName"] -Voici quelques exemples : +Examples: ```4d $vName:=employee["name"] - //ou : + //or also: $property:="name" $vName:=employee[$property] ``` -Comme la valeur d'une propriété d'objet peut elle-même être un objet ou une collection, la notation objet requiert une séquence de symboles pour accéder aux sous-propriétés, par exemple : +Since an object property value can be an object or a collection, object notation accepts a sequence of symbols to access sub-properties, for example: ```4d $vAge:=employee.children[2].age ``` -La notation objet est utilisable avec tout élément de langage qui contient ou retourne un objet, c'est-à-dire : +Object notation is available on any language element that can contains or returns an object, i.e: -- avec les **objets** eux-mêmes (stockés dans des variables, champs, propriétés d'objets, tableaux d'objets ou éléments de collections). Voici quelques exemples : +- **Objects** themselves (stored in variables, fields, object properties, object arrays, or collection elements). Examples: ```4d $age:=$myObjVar.employee.age //variable - $addr:=[Emp]data_obj.address //champ - $city:=$addr.city //propriété d'un objet - $pop:=$aObjCountries{2}.population //tableau d'objets - $val:=$myCollection[3].subvalue //élément de collection + $addr:=[Emp]data_obj.address //field + $city:=$addr.city //property of an object + $pop:=$aObjCountries{2}.population //object array + $val:=$myCollection[3].subvalue //collection element ``` -- avec les **commandes 4D** qui retournent des objets. Exemple : +- **4D commands** that return objects. Example: ```4d - $measures:=Lire mesures base.DB.tables + $measures:=Get database measures.DB.tables ``` -- avec les **méthodes projet** qui retournent des objets. Exemple : +- **Project methods** that return objects. Example: ```4d // MyMethod1 @@ -105,25 +106,25 @@ La notation objet est utilisable avec tout élément de langage qui contient ou $result:=MyMethod1.a //10 ``` -- **Collections** Exemple : +- **Collections** Example: ```4d - myColl.length //taille de la collection + myColl.length //size of the collection ``` -### Pointeurs +### Pointers -**Note :** Les objets étant toujours passés par référence, l'utilisation de pointeurs n'est généralement pas nécessaire. En passant un objet, 4D utilise automatiquement, en interne, un mécanisme similaire à un pointeur pour minimiser la mémoire nécessaire, pour vous permettre de modifier le paramètre et de retourner les modifications. Par conséquent, vous n'aurez pas besoin d'utiliser des pointeurs. Cependant, si vous souhaitez utiliser des pointeurs, il est possible d'accéder aux valeurs de propriétés via des pointeurs. +**Preliminary Note:** Since objects are always passed by reference, there is usually no need to use pointers. While just passing the object, internally 4D automatically uses a mechanism similar to a pointer, minimizing memory need and allowing you to modify the parameter and to return modifications. As a result, you should not need to use pointers. However, in case you want to use pointers, property values can be accessed through pointers. -La notation objet pour les pointeurs est semblable à la notation objet standard, à la seule différence que le symbole "point" doit être omis. +Using object notation with pointers is very similar to using object notation directly with objects, except that the "dot" symbol must be omitted. -- Accès direct : -> pointeurObjet->nomPropriété +- Direct access: +> pointerOnObject->propertyName -- Accès par le nom : -> pointeurObjet-> nomPropriété"] +- Access by name: +> pointerOnObject->["propertyName"] -Exemple : +Example: ```4d C_OBJECT(vObj) @@ -134,149 +135,149 @@ Exemple : x:=vPtr->a //x=10 ``` -### Valeur Null +### Null value -Lorsque la notation objet est utilisée, la valeur **null** est prise en charge via la commande **Null**. Cette commande peut être utilisée pour affecter ou comparer la valeur null aux propriétés d'objets ou aux éléments de collections, par exemple : +When using the object notation, the **null** value is supported though the **Null** command. This command can be used to assign or compare the null value to object properties or collection elements, for example: ```4d myObject.address.zip:=Null If(myColl[2]=Null) ``` -Pour plus d'informations, veuillez vous reporter à la description de la commande `Null`. +For more information, please refer to the `Null` command description. -### Valeur Indéfinie +### Undefined value -L'évaluation d'une propriété d'objet peut parfois produire une valeur indéfinie (undefined). En règle générale, lorsque le code tente de lire ou d'affecter des expressions indéfinies, 4D génère des erreurs, hormis dans les cas décrits ci-dessous : +Evaluating an object property can sometimes produce an undefined value. Typically when trying to read or assign undefined expressions, 4D will generate errors. This does not happen in the following cases: -- La lecture d'une propriété d'un objet ou d'une valeur indéfini(e) retourne Indéfini ; l'affectation d'une valeur indéfinie à des variables (hors tableaux) a le même effet qu'appeler `CLEAR VARIABLE` avec elles : +- Reading a property of an undefined object or value returns undefined; assigning an undefined value to variables (except arrays) has the same effect as calling `CLEAR VARIABLE` with them: ```4d - C_OBJET($o) - C_ENTIER Long($val) - $val:=10 //$val=10 - $val:=$o.a //$o.a est indéfini (pas d'erreur), et affecter cette valeur efface la variable - //$val=0 + C_OBJECT($o) + C_LONGINT($val) + $val:=10 //$val=10 + $val:=$o.a //$o.a is undefined (no error), and assigning this value clears the variable + //$val=0 ``` -- La lecture de la propriété **length** d'une collection indéfinie renvoie 0 : +- Reading the **length** property of an undefined collection produces 0: ```4d - C_COLLECTION($c) //variable créée mais pas de collection définie - $size:=$c.length //$size = 0 + C_COLLECTION($c) //variable created but no collection is defined + $size:=$c.length //$size = 0 ``` -- Une valeur indéfinie passée en paramètre à une méthode projet est automatiquement convertie en 0 ou en "" en fonction de la déclaration du type du paramètre. +- An undefined value passed as parameter to a project method is automatically converted to 0 or "" according to the declared parameter type. ```4d C_OBJECT($o) - mymethod($o.a) //passage d'un paramètre indéfini + mymethod($o.a) //pass an undefined parameter - //Dans la méthode mymethod - C_TEXT($1) //Paramètre de type texte - // $1 contient "" + //In mymethod method + C_TEXT($1) //parameter type is text + // $1 contains "" ``` -- Une expression de condition est automatiquement convertie à Faux lorsque son évaluation donne Indéfinie avec les mots-clés Si et Au cas ou : +- A condition expression is automatically converted to false when evaluating to undefined with the If and Case of keywords: ```4d C_OBJECT($o) - If($o.a) // faux + If($o.a) // false End if Case of - :($o.a) // faux + :($o.a) // false End case ``` -- L'affectation d'une valeur indéfinie à une propriété d'objet existante réinitialise ou efface sa valeur, selon son type : - - Objet, collection, pointeur : Null - - Image : image vide - - Booléen : False - - Chaîne : "" - - Numérique : 0 - - Date : !00-00-00! si la base utilise le type date pour les objets, sinon "" - - Heure : 0 (nombre de ms) - - Indéfini, Null : pas de changement +- Assigning an undefined value to an existing object property reinitializes or clears its value, depending on its type: + - Object, collection, pointer: Null + - Picture: Empty picture + - Boolean: False + - String: "" + - Number: 0 + - Date: !00-00-00! if "Use date type instead of ISO date format in objects" setting is enabled, otherwise "" + - Time: 0 (number of ms) + - Undefined, Null: no change ```4d C_OBJECT($o) - $o:=New object("a";2) - $o.a:=$o.b //$o.a=0 + $o:=New object("a";2) + $o.a:=$o.b //$o.a=0 ``` -- L'affectation d'une valeur indéfinie à une propriété d'objet inexistante ne fait rien. +- Assigning an undefined value to a non existing object property does nothing. -Lorsque des expressions d'un type donné sont attendues dans votre code 4D, vous pouvez vous assurer qu'elles auront le type souhaité même en cas de valeur Indéfinie en les encadrant avec la commande de transtypage 4D appropriée : `String`, `Num`, `Time`, `Date`, `Bool`. Ces commandes retournent une valeur vide du type spécifié lorsque l'expression est évaluée à Indéfinie. Par exemple: +When expressions of a given type are expected in your 4D code, you can make sure they have the correct type even when evaluated to undefined by surrounding them with the appropriate 4D cast command: `String`, `Num`, `Date`, `Time`, `Bool`. These commands return an empty value of the specified type when the expression evaluates to undefined. For example: ```4d - $myString:=Lowercase(String($o.a.b)) //pour être sûr d'obtenir une valeur texte même si indéfinie - //afin d'éviter des erreurs dans le code + $myString:=Lowercase(String($o.a.b)) //make sure you get a string value even if undefined + //to avoid errors in the code ``` -## Identifiants de propriétés d'objets +## Object property identifiers -Les règles de nommage des tokens (noms des propriétés d'objets auxquelles on accède via la notation objet) sont plus restrictives que celles qui s'appliquent aux [noms d'objets 4D standard](identifiers.md). Ils doivent se conformer à la grammaire des identificateurs JavaScript (voir [la norme ECMA Script](https://www.ecma-international.org/ecma-262/5.1/#sec-7.6)): +Token member names (i.e., object property names accessed using the object notation) are more restrictive than [standard 4D object names](identifiers.md). They must comply with JavaScript Identifier Grammar (see [ECMA Script standard](https://www.ecma-international.org/ecma-262/5.1/#sec-7.6)): -- le premier caractère doit être une lettre, un trait de soulignement (_) ou le symbole dollar ($), -- les autres caractères peuvent être des lettres, des chiffres, des traits de soulignement ou des symboles dollar (les espaces sont proscrits), -- ils différencient les caractères majuscules/minuscules. +- the first character must be a letter, an underscore (_), or a dollar sign ($), +- subsequent characters may be any letter, digit, an underscore or dollar sign (space characters are NOT allowed), +- they are case sensitive. -**Notes :** +**Note:** -- L'utilisation d'un champ comme indice de collection, par exemple a.b[[Table1]Id], n'est pas autorisé. Vous devez utiliser une variable intermédiaire. -- La création d'attributs d'objets à l'aide d'une chaîne entre crochets permet de s'affranchir des règles d'ECMA Script. Par exemple, l'attribut `$o["My Att"]` est valide dans 4D, malgré l'espace. Dans ce cas cependant, il ne sera pas possible d'utiliser la notation à points et l'autocomplétion avec cet attribut. +- Using a table field as a collection index, for example a.b[[Table1]Id], is not allowed. You must use an intermediary variable. +- Creating object attributes using a string in square brackets allows you to override the ECMA Script rules. For example, the `$o["My Att"]` attribute is valid in 4D, despite the space. In this case, however, it will not be possible to use dot notation and autocomplete features with this attribute. -## Exemples +## Examples -L'utilisation de la notation objet simplifie grandement le code 4D de manipulation des objets. A noter toutefois que la notation utilisant les commandes "OB" reste entièrement prise en charge. +Using object notation simplifies the 4D code while handling objects. Note however that the command-based notation is still fully supported. -- Ecriture et lecture de propriétés d'objets (cet exemple compare la notation objet et la syntaxe avec commandes) : +- Writing and reading objects (this example compares object notation and command notation): ```4d - // Utilisation de la notation objet - C_OBJECT($myObj) //déclaration d'une variable objet 4D - $myObj:=New object //création d'un objet et affectation à la variable + // Using the object notation + C_OBJECT($myObj) //declares a 4D variable object + $myObj:=New object //creates an object and assigns to the variable $myObj.age:=56 $age:=$myObj.age //56 - // Utilisation de la syntaxe par commande - C_OBJECT($myObj2) //déclaration d'une variable objet 4D - OB SET($myObj2;"age";42) //création d'un objet et création de la propriété age + // Using the command notation + C_OBJECT($myObj2) //declares a 4D variable object + OB SET($myObj2;"age";42) //creates an object and adds the age property $age:=OB Get($myObj2;"age") //42 - // Bien entendu, les deux notations peuvent être utilisées simultanément + // Of course, both notations can be mixed C_OBJECT($myObj3) OB SET($myObj3;"age";10) $age:=$myObj3.age //10 ``` -- Création de propriétés et affectation de valeurs, y compris d'autres objets : +- Create a property and assign values, including objects: ```4d C_OBJECT($Emp) $Emp:=New object - $Emp.city:="London" //crée la propriété city avec la valeur "London" - $Emp.city:="Paris" //modifie la propriété city + $Emp.city:="London" //creates the city property and sets its value to "London" + $Emp.city:="Paris" //modifies the city property $Emp.phone:=New object("office";"123456789";"home";"0011223344") - //crée la propriété phone avec un autre objet comme valeur + //creates the phone property and sets its value to an object ``` -- Lire une valeur dans un sous-objet est très simple avec la notation objet : +- Get a value in a sub-object is very simple using the object notation: ```4d $vCity:=$Emp.city //"Paris" $vPhone:=$Emp.phone.home //"0011223344" ``` -- Vous pouvez accéder aux propriétés d'objets via des chaînes grâce à l'opérateur [ ] +- You can access properties as strings using the [ ] operator ```4d - $Emp["city"]:="Berlin" //modification de la propriété city - //cette syntaxe est utile pour créer des propriétés à l'aide de variables + $Emp["city"]:="Berlin" //modifies the city property + //this can be useful for creating properties through variables C_TEXT($addr) $addr:="address" For($i;1;4) - $Emp[$addr+Chaine($i)]:="" -End for - // crée 4 propriétés vides "address1...address4" dans l'objet $Emp + $Emp[$addr+String($i)]:="" + End for + // creates 4 empty properties "address1...address4" in the $Emp object ``` diff --git a/website/translated_docs/fr/Concepts/dt_picture.md b/website/translated_docs/fr/Concepts/dt_picture.md index 2f64925569e2aa..fec043511c0b84 100644 --- a/website/translated_docs/fr/Concepts/dt_picture.md +++ b/website/translated_docs/fr/Concepts/dt_picture.md @@ -3,117 +3,117 @@ id: picture title: Image --- -Un champ, une variable ou expression de type image peut constituer une image Windows ou Macintosh. En règle générale, n'importe quelle image peut être mise sur le conteneur de données ou lue à partir du disque, à l'aide des commandes 4D telles que `READ PICTURE FILE`. +A Picture field, variable or expression can be any Windows or Macintosh picture. In general, this includes any picture that can be put on the pasteboard or read from the disk using 4D commands such as `READ PICTURE FILE`. -4D utilise des API natives pour encoder (écrire) et décoder (lire) les champs et les variables des images sous Windows et macOS. Ces implémentations donnent accès à de nombreux formats natifs, dont le format RAW, couramment utilisé par les appareils photo numériques. +4D uses native APIs to encode (write) and decode (read) picture fields and variables under both Windows and macOS. These implementations provide access to numerous native formats, including the RAW format, currently used by digital cameras. -* sous Windows, 4D utilise WIC (Windows Imaging Component). -* sous macOS, 4D utilise ImageIO. +* on Windows, 4D uses WIC (Windows Imaging Component). +* on macOS, 4D uses ImageIO. -WIC et ImageIO permettent l’utilisation de métadonnées dans les images. Deux commandes, `SET PICTURE METADATA` et `GET PICTURE METADATA`, vous permettent d'en bénéficier dans vos développements. +WIC and ImageIO permit the use of metadata in pictures. Two commands, `SET PICTURE METADATA` and `GET PICTURE METADATA`, let you benefit from metadata in your developments. -## Identifiants de codecs d'images +## Picture Codec IDs 4D supports natively a wide set of [picture formats](FormEditor/pictures.md#native-formats-supported), such as .jpeg, .png, or .svg. -Les formats d'images reconnus par 4D sont retournés par la commande `PICTURE CODEC LIST` sous forme d'identifiants de codecs d'images. Ces identifiants peuvent être : +Picture formats recognized by 4D are returned by the `PICTURE CODEC LIST` command as picture Codec IDs. They can be returned in the following forms: -* une extension (par exemple “.gif”) -* Un type Mime (par exemple “image/jpg”) +* As an extension (for example “.gif”) +* As a MIME type (for example “image/jpeg”) -La forme utilisée pour chaque format dépend du mode de déclaration du codec au niveau du système d’exploitation. Notez que les listes de codecs disponibles pour la lecture et pour l'écriture peuvent différer, étant donné que les codecs d'encodage peuvent nécessiter des licences spécifiques. +The form returned for each format will depend on the way the Codec is recorded at the operating system level. Note that the list of available codecs for reading and writing can be different since encoding codecs may require specific licenses. -Most of the [4D picture management commands](https://doc.4d.com/4Dv18/4D/18/Pictures.201-4504337.en.html) can receive a Codec ID as a parameter. Il est donc impératif d'utiliser l'identifiant système retourné par la commande `PICTURE CODEC LIST`. Les formats d'images reconnus par 4D sont retournés par la commande `PICTURE CODEC LIST`. +Most of the [4D picture management commands](https://doc.4d.com/4Dv18/4D/18/Pictures.201-4504337.en.html) can receive a Codec ID as a parameter. It is therefore imperative to use the system ID returned by the `PICTURE CODEC LIST` command. Picture formats recognized by 4D are returned by the `PICTURE CODEC LIST` command. -## Opérateurs sur les images +## Picture operators -| Opération | Syntaxe | Retourne | Action | -| ------------------------- | --------------- | -------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| Concaténation horizontale | Image1 + Image2 | Image | Place Image2 à la droite d'Image1 | -| Concaténation verticale | Image1 / Image2 | Image | Place Image2 au-dessous d'Image1 | -| Superposition exclusive | Image1 & Image2 | Image | Superpose Image2 à Image1 (Image2 est au premier plan). Donne le même résultat que `COMBINE PICTURES(pict3;pict1;Superposition;pict2)` | -| Superposition inclusive | Image1 | Image | Image | Superpose Image2 à Image1 et retourne le masque résultant si les deux images sont de même taille. Donne le même résultat que `$equal:=Equal pictures(Pict1;Pict2;Pict3)` | -| Déplacement horizontal | Image + Nombre | Image | Déplace l'image horizontalement d'un nombre de pixels égal à Nombre | -| Déplacement vertical | Image / Nombre | Image | Déplace l'image verticalement d'un nombre de pixels égal à Nombre | -| Redimensionnement | Image * Nombre | Image | Redimensionne l'image au pourcentage Nombre | -| Extension horizontale | Image *+ Nombre | Image | Redimensionne l'image horizontalement au pourcentage Nombre | -| Extension verticale | Image * | Image | Image | Redimensionne l'image verticalement au pourcentage Nombre | +| Operation | Syntax | Returns | Action | +| ------------------------- | ---------------------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| Horizontal concatenation | Pict1 + Pict2 | Image | Add Pict2 to the right of Pict1 | +| Vertical concatenation | Pict1 / Pict2 | Image | Add Pict2 to the bottom of Pict1 | +| Exclusive superimposition | Pict1 & Pict2 | Image | Superimposes Pict2 on top of Pict1 (Pict2 in foreground). Produces the same result as `COMBINE PICTURES(pict3;pict1;Superimposition;pict2)` | +| Inclusive superimposition | Pict1 | Pict2 | Image | Superimposes Pict2 on Pict1 and returns resulting mask if both pictures are the same size. Produces the same result as `$equal:=Equal pictures(Pict1;Pict2;Pict3)` | +| Horizontal move | Picture + Number | Image | Move Picture horizontally Number pixels | +| Vertical move | Picture / Number | Image | Move Picture vertically Number pixels | +| Resizing | Picture * Number | Image | Resize Picture by Number ratio | +| Horizontal scaling | Picture *+ Number | Image | Resize Picture horizontally by Number ratio | +| Vertical scaling | Picture *| Number | Image | Resize Picture vertically by Number ratio | **Notes :** -- A noter que pour que l'opérateur | puisse être utilisé, Image1 et Image2 doivent être strictement de la même dimension. Si les deux images sont de taille différente, l’opération Image1 | Image2 produit une image vide. -- La commande `COMBINE PICTURES` permet d'effectuer des superpositions en conservant les caractéristiques de chaque image source dans l'image résultante. -- Des opération supplémentaires peuvent être réalisées sur des images à l'aide de la commande `TRANSFORM PICTURE`. -- Il n'existe pas d'opérateurs de comparaison pour les images; en revanche 4D propose d'utiliser la commande `Images egales` pour comparer deux images. +- In order to use the | operator, Pict1 and Pict2 must have exactly the same dimension. If both pictures are a different size, the operation Pict1 | Pict2 produces a blank picture. +- The `COMBINE PICTURES` command can be used to superimpose pictures while keeping the characteristics of each source picture in the resulting picture. +- Additional operations can be performed on pictures using the `TRANSFORM PICTURE` command. +- There is no comparison operators on pictures, however 4D proposes the `Equal picture` command to compare two pictures. -### Exemples +### Examples -Concaténation horizontale +Horizontal concatenation ```4d - cercle+rectangle // Place le rectangle à droite du cercle -rectangle+cercle // Place le cercle à droite du rectangle + circle+rectangle //Place the rectangle to the right of the circle + rectangle+circle //Place the circle to the right of the rectangle ``` ![](assets/en/Concepts/concatHor.en.png) ![](assets/en/Concepts/concatHor2.en.png) -Concaténation verticale +Vertical concatenation ```4d circle/rectangle //Place the rectangle under the circle rectangle/circle //Place the circle under the rectangle ``` ![](assets/en/Concepts/concatVer.en.png) ![](assets/en/Concepts/concatVer2.en.png) -Superposition exclusive +Exclusive superimposition ```4d -Pict3:=Pict1 & Pict2 // Superposer Pict2 à Pict1 +Pict3:=Pict1 & Pict2 // Superimposes Pict2 on top of Pict1 ``` ![](assets/en/Concepts/superimpoExc.fr.png) -Superposition inclusive +Inclusive superimposition ```4d -Pict3:=Pict1|Pict2 // Récupérer le masque résultant de la superposition de deux images de même taille +Pict3:=Pict1|Pict2 // Recovers resulting mask from superimposing two pictures of the same size ``` ![](assets/en/Concepts/superimpoInc.fr.png) -Déplacement horizontal +Horizontal move ```4d -rectangle+50 // Déplace le rectangle 50 pixels vers la droite -rectangle-50 // Déplace le rectangle 50 pixels vers la gauche +rectangle+50 //Move the rectangle 50 pixels to the right +rectangle-50 //Move the rectangle 50 pixels to the left ``` ![](assets/en/Concepts/hormove.en.png) -Déplacement vertical +Vertical move ```4d -rectangle/50 // Déplace le rectangle 50 pixels vers le bas -rectangle/-20 // Déplace le rectangle 20 pixels vers le haut +rectangle/50 //Move the rectangle down by 50 pixels +rectangle/-20 //Move the rectangle up by 20 pixels ``` ![](assets/en/Concepts/vertmove.en.png)![](assets/en/Concepts/vertmove2.en.png) -Redimensionnement +Resize ```4d -rectangle*1.5 // Augmente la taille du rectangle de 50% - rectangle*0.5 // Réduit la taille du rectangle de 50% +rectangle*1.5 //The rectangle becomes 50% bigger +rectangle*0.5 //The rectangle becomes 50% smaller ``` ![](assets/en/Concepts/resize.en.png)![](assets/en/Concepts/resisze2.en.png) -Extension horizontale +Horizontal scaling ```4d -cercle*+3 // Multiplie par 3 la largeur du cercle - cercle*+0,25 // La largeur du cercle est réduite à un quart de sa taille originale +circle*+3 //The circle becomes 3 times wider +circle*+0.25 //The circle's width becomes a quarter of what it was ``` ![](assets/en/Concepts/Horscaling.en.png)![](assets/en/Concepts/Horscaling2.en.png) -Extension verticale +Vertical scaling ```4d -cercle*/2 // Double la hauteur du cercle - cercle*/0.25 // La hauteur du cercle est réduite à un quart de sa taille originale +circle*|2 //The circle becomes twice as tall +circle*|0.25 //The circle's height becomes a quarter of what it was ``` ![](assets/en/Concepts/vertscaling.en.png)![](assets/en/Concepts/veticalscaling2.en.png) diff --git a/website/translated_docs/fr/Concepts/dt_pointer.md b/website/translated_docs/fr/Concepts/dt_pointer.md index 882ef996e806e5..50a303c7183563 100644 --- a/website/translated_docs/fr/Concepts/dt_pointer.md +++ b/website/translated_docs/fr/Concepts/dt_pointer.md @@ -3,211 +3,211 @@ id: pointer title: Pointeur --- -Les variables ou expressions de type Pointeur sont des références à d'autres variables (y compris des tableaux et des éléments de tableaux), à des tables, des champs ou des objets. Il n'existe pas de champ de type Pointeur. +A Pointer variable or expression is a reference to another variable (including arrays and array elements), table, field, or object. There is no field of type Pointer. -Les pointeurs sont des outils de programmation avancée. Lorsque vous utilisez le langage de 4D, vous vous référez aux différents objets par l’intermédiaire de leur nom — en particulier les tables, champs, variables et tableaux. Pour appeler l’un d’entre eux, vous écrivez simplement son nom. Cependant, il est parfois utile de pouvoir appeler ou référencer ces éléments sans nécessairement connaître leur nom. C’est ce que permettent les pointeurs. +Pointers provide an advanced way (in programming) to refer to data. When you use the language, you access various objects—in particular, tables, fields, variables, objects, and arrays—by simply using their names. However, it is often useful to refer to these elements and access them without knowing their names. This is what pointers let you do. -Le concept de pointeur n’est pas tellement éloigné de la vie courante. Vous vous référez souvent à des choses sans connaître leur identité exacte. Par exemple, vous pourriez dire à un ami : «Allons faire un tour en voiture» au lieu de «Allons faire un tour en voiture avec la plaque d’immatriculation 123ABD» Dans ce cas, vous faites référence à la voiture avec la plaque d'immatriculation 123ABD en utilisant l'expression «votre voiture» L'expression «voiture avec plaque d'immatriculation 123ABD» est comme le nom d'un objet, et l'utilisation de l'expression «votre voiture» revient à utiliser un pointeur pour référencer l'objet. Dans ce cas, vous faites référence à la voiture avec la plaque d'immatriculation 123ABD en utilisant l'expression «votre voiture» L'expression «voiture avec plaque d'immatriculation 123ABD» est comme le nom d'un objet, et l'utilisation de l'expression «votre voiture» revient à utiliser un pointeur pour référencer l'objet. +The concept behind pointers is not that uncommon in everyday life. You often refer to something without knowing its exact identity. For example, you might say to a friend, “Let’s go for a ride in your car” instead of “Let’s go for a ride in the car with license plate 123ABD.” In this case, you are referencing the car with license plate 123ABD by using the phrase “your car.” The phrase “car with license plate 123ABD” is like the name of an object, and using the phrase “your car” is like using a pointer to reference the object. -La capacité de se référer à quelque chose sans connaître son identité exacte est très utile. Si votre ami s’achetait une nouvelle voiture, l’expression “ta voiture” serait toujours exacte — ce serait toujours une voiture et vous pourriez toujours aller quelque part avec. Les pointeurs fonctionnent de la même manière. Par exemple, un pointeur peut pointer à un moment donné vers un champ numérique appelé Age, et plus tard vers une variable numérique appelée Ancien âge. Dans les deux cas, le pointeur référence des données numériques pouvant être utilisée dans des calculs. +Being able to refer to something without knowing its exact identity is very useful. In fact, your friend could get a new car, and the phrase “your car” would still be accurate—it would still be a car and you could still take a ride in it. Pointers work the same way. For example, a pointer could at one time refer to a numeric field called Age, and later refer to a numeric variable called Old Age. In both cases, the pointer references numeric data that could be used in a calculation. -Vous pouvez utiliser des pointeurs pour référencer des tables, des champs, des variables, des tableaux et des éléments de tableaux. Le tableau suivant vous fournit un exemple de chaque type : +You can use pointers to reference tables, fields, variables, arrays, array elements, and objects. The following table gives an example of each data type: -| Type | Référencement | Référencement | Affectation | -| ----------- | ----------------------- | ------------------------ | ------------------------ | -| Table | vpTable:=->[Table] | DEFAULT TABLE(vpTable->) | n/a | -| Champ | vpField:=->[Table]Field | ALERT(vpField->) | vpField->:="John" | -| Variable | vpVar:=->Variable | ALERT(vpVar->) | vpVar->:="John" | -| Tableau | vpArr:=->Array | SORT ARRAY(vpArr->;>) | COPY ARRAY (Arr;vpArr->) | -| Elém. tabl. | vpElem:=->Array{1} | ALERT (vpElem->) | vpElem->:="John" | -| Objet | vpObj:=->myObject | ALERT (vpObj->myProp) | vpObj->myProp:="John" | +| Type | To Reference | To Use | To Assign | +| ------------- | ----------------------- | ------------------------ | ------------------------ | +| Table | vpTable:=->[Table] | DEFAULT TABLE(vpTable->) | n/a | +| Field | vpField:=->[Table]Field | ALERT(vpField->) | vpField->:="John" | +| Variable | vpVar:=->Variable | ALERT(vpVar->) | vpVar->:="John" | +| Array | vpArr:=->Array | SORT ARRAY(vpArr->;>) | COPY ARRAY (Arr;vpArr->) | +| Array element | vpElem:=->Array{1} | ALERT (vpElem->) | vpElem->:="John" | +| Objet | vpObj:=->myObject | ALERT (vpObj->myProp) | vpObj->myProp:="John" | -## Utiliser des pointeurs : un exemple +## Using a pointer: Basic example -Il est plus facile d’expliquer l’utilisation des pointeurs au travers d’un exemple. Cet exemple vous montre comment accéder à une variable par l’intermédiaire d’un pointeur. Nous commençons par créer la variable : +It is easiest to explain the use of pointers through an example. This example shows how to access a variable through a pointer. We start by creating a variable: ```4d -MaVar:="Bonjour" +$MyVar:="Hello" ``` -$MyVar is now a variable containing the string “Hello.” We can now create a pointer to $MyVar: We can now create a pointer to $MyVar: +$MyVar is now a variable containing the string “Hello.” We can now create a pointer to $MyVar: ```4d -C_POINTER($MonPointeur) -$MonPointeur:=->MaVar +C_POINTER($MyPointer) +$MyPointer:=->$MyVar ``` -The -> symbol means “get a pointer to.” The -> symbol means “get a pointer to.” This symbol is formed by a dash followed by a “greater than” sign. Dans ce cas, il crée un pointeur qui référence ou “pointe vers” $MaVar. Ce pointeur est assigné à MonPointeur via l’opérateur d’assignation. +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. -$MonPointeur est désormais une variable qui contient un pointeur vers $MaVar. $MonPointeur ne contient pas “Bonjour”, la valeur de $MaVar, mais vous pouvez utiliser $MonPointeur pour obtenir cette valeur. L’expression suivante retourne la valeur de $MaVar : +$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 -$MonPointeur-> +$MyPointer-> ``` -Dans ce cas, la chaîne “Bonjour” est retournée. Lorsque le symbole -> est placé derrière un pointeur, la valeur de l’objet vers lequel pointe le pointeur est récupérée. On dit alors qu’on dépointe le pointeur. +In this case, it returns the string “Hello”. The -> symbol, when it follows a pointer, references the object pointed to. This is called dereferencing. -Il est important de comprendre que vous pouvez utiliser un pointeur suivi du symbole -> partout où vous auriez pu utiliser l’objet pointé lui-même. Vous pouvez placer l’expression $MonPointeur-> partout où vous pourriez utiliser la variable originale $MaVar. Par exemple, l'instruction suivante affiche une boîte de dialogue d’alerte comportant le mot Bonjour : +It is important to understand that you can use a pointer followed by the -> symbol anywhere that you could have used the object that the pointer points to. This means that you could use the expression $MyPointer-> anywhere that you could use the original $MyVar variable. For example, the following line displays an alert box with the word Hello in it: ```4d -ALERTE($MonPointeur->) +ALERT($MyPointer->) ``` -Vous pouvez également utiliser $MonPointeur pour modifier la valeur de $MaVar. Par exemple, l’instruction suivante stocke la chaîne “Au revoir” dans la variable $MaVar : +You can also use $MyPointer to change the data in $MyVar. For example, the following statement stores the string "Goodbye" in the variable $MyVar: ```4d -$MonPointeur->:="Au revoir" +$MyPointer->:="Goodbye" ``` -Si vous examinez les deux utilisations de l’expression $MonPointeur-> ci-dessus, vous constatez que cette expression se comporte exactement comme si vous aviez utilisé $MaVar à sa place. En résumé : les deux lignes suivantes effectuent la même opération — elles affichent une boîte de dialogue d’alerte contenant la valeur courante de la variable $MaVar : +If you examine the two uses of the expression $MyPointer->, you will see that it acts just as if you had used $MyVar instead. In summary, the following two lines perform the same action—both display an alert box containing the current value in the variable $MyVar: ```4d -ALERT($MonPointeur->) - ALERT($MaVar) +ALERT($MyPointer->) +ALERT($MyVar) ``` -Les deux lignes suivantes effectuent la même opération ; elles assignent la chaîne "Au revoir" à $MaVar : +The following two lines perform the same action— both assign the string "Goodbye" to $MyVar: ```4d -$MonPointeur->:="Au revoir" -$MaVar:="Au revoir" +$MyPointer->:="Goodbye" +$MyVar:="Goodbye" ``` -## Opérateurs sur les pointeurs +## Pointer operators -Avec : +With: ```4d - // vPtrA et vPtrB pointent sur le même objet - vPtrA:=->unObjet - vPtrB:=->unObjet - // vPtrC pointe sur un autre objet - vPtrC:=->autreObjet + ` vPtrA and vPtrB point to the same object + vPtrA:=->anObject + vPtrB:=->anObject + ` vPtrC points to another object + vPtrC:=->anotherObject ``` -| Opération | Syntaxe | Retourne | Expression | Valeur | -| --------- | ------------------- | -------- | ------------- | ------ | -| Egalité | Pointeur = Pointeur | Booléen | vPtrA = vPtrB | Vrai | -| | | | vPtrA = vPtrB | Faux | -| Inégalité | Pointeur # Pointeur | Booléen | vPtrA # vPtrC | Vrai | -| | | | vPtrA # vPtrB | Faux | +| Operation | Syntax | Returns | Expression | Value | +| ---------- | ----------------- | ------- | ------------- | ----- | +| Equality | Pointer = Pointer | Booléen | vPtrA = vPtrB | True | +| | | | vPtrA = vPtrC | False | +| Inequality | Pointer # Pointer | Booléen | vPtrA # vPtrC | True | +| | | | vPtrA # vPtrB | False | -## Principales utilisations -### Utiliser des pointeurs vers des tables -Partout où le langage requiert un nom de table, vous pouvez utiliser un pointeur dépointé vers une table. Pour créer un pointeur vers une table, écrivez une instruction du type : +## 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:=->[touteTable] +$TablePtr:=->[anyTable] ``` -Vous pouvez également récupérer un pointeur vers une table à l’aide de la fonction Table. Par exemple : +You can also get a pointer to a table by using the `Table` command: ```4d $TablePtr:=Table(20) ``` -Vous pouvez utiliser le pointeur dépointé dans vos commandes, comme ceci : +You can use the dereferenced pointer in commands, like this: ```4d DEFAULT TABLE($TablePtr->) ``` -### Utiliser des pointeurs vers des champs -Partout où le langage requiert un nom de champ, vous pouvez utiliser un pointeur dépointé vers un champ. Pour créer un pointeur vers un champ, écrivez une ligne d'instruction du type : +### Pointers to fields +Anywhere that the language expects to see a field, you can use a dereferenced pointer to reference the field. You create a pointer to a field by using a line like this: ```4d -$ChampPtr:=->[uneTable]CeChamp +$FieldPtr:=->[aTable]ThisField ``` -Vous pouvez également récupérer un pointeur vers un champ à l’aide de la fonction `Champ`. Par exemple : +You can also get a pointer to a field by using the `Field` command, for example: ```4d -$ChampPtr:=Champ(1;2) +$FieldPtr:=Field(1;2) ``` -Vous pouvez utiliser le pointeur dépointé dans vos commandes, comme ceci : +You can use the dereferenced pointer in commands, like this: ```4d OBJECT SET FONT($FieldPtr->;"Arial") ``` -### Utiliser des pointeurs vers des variables +### Pointers to local variables -Lorsque vous utilisez des pointeurs vers des variables locales ou des variables process, vous devez veiller à ce que la variable pointée soit bien définie au moment de l’utilisation du pointeur. Rappelons que les variables locales sont supprimées à la fin de l’exécution de la méthode qui les a créées et les variables process à la fin du process dans lequel elles ont été créées. L’appel d’un pointeur vers une variable qui n’existe plus provoque une erreur de syntaxe en mode interprété (variable indéfinie) mais peut générer une erreur plus conséquente en mode compilé. +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. -Les pointeurs vers des variables locales permettent dans de nombreux cas d’économiser des variables process. Les pointeurs vers des variables locales peuvent être utilisés uniquement à l’intérieur d’un même process. Dans le débogueur, lorsque vous affichez un pointeur vers une variable locale déclarée dans une autre méthode, le nom de la méthode d’origine est indiquée entre parenthèses, derrière le pointeur. Par exemple, si vous écrivez dans Méthode1 : +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 - $MaVar:="Bonjour" - Méthode2(->$MaVar) + $MyVar:="Hello world" + Method2(->$MyVar) ``` -Dans Méthode2, le débogueur affichera $1 de la façon suivante : +In Method2, the debugger will display $1 as follows: -| $1 | ->$MaVar (Méthode1) | -| -- | ------------------- | -| | | +| $1 | ->$MyVar (Method1) | +| -- | ------------------ | +| | | -La valeur de $1 sera : +The value of $1 will be: -| $MaVar(Méthode1) | "Bonjour" | -| ---------------- | --------- | -| | | +| $MyVar (Method1) | "Hello world" | +| ---------------- | ------------- | +| | | -### Utiliser des pointeurs vers des éléments de tableau -Vous pouvez créer un pointeur vers un élément de tableau. Par exemple, les lignes d'instruction suivantes créent un tableau et assignent à une variable appelée $ElémPtr un pointeur vers le premier élément : +### Pointers to array elements +You can create a pointer to an array element. For example, the following lines create an array and assign a pointer to the first array element to a variable called $ElemPtr: ```4d -ARRAY REAL($unTableau;10) // Créer un tableau - $ElémPtr:=->$unTableau{1} // Créer un pointeur vers l’élément de tableau +ARRAY REAL($anArray;10) //Create an array +$ElemPtr:=->$anArray{1} //Create a pointer to the array element ``` -Vous pouvez alors utiliser le pointeur dépointé pour assigner une valeur à l’élément, comme ceci : +You could use the dereferenced pointer to assign a value to the element, like this: ```4d -$ElémPtr->:=8 +$ElemPtr->:=8 ``` -### Utiliser des pointeurs vers des tableaux -Vous pouvez créer un pointeur vers un tableau. Par exemple, les lignes d'instruction suivantes créent un tableau et assignent à la variable nommée $TabPtr un pointeur vers le tableau : +### Pointers to arrays +You can create a pointer to an array. For example, the following lines create an array and assign a pointer to the array to a variable called $ArrPtr: ```4d -ARRAY REAL($unTableau;10) // Créer un tableau -$TabPtr:=->$unTableau // Créer un pointeur vers le tableau +ARRAY REAL($anArray;10) //Create an array +$ArrPtr:=->$anArray //Create a pointer to the array ``` -Il est important de comprendre que ce pointeur pointe vers le tableau, et non vers un élément du tableau. Par exemple, vous pourriez utiliser le pointeur dépointé de la manière suivante : +It is important to understand that the pointer points to the array; it does not point to an element of the array. For example, you can use the dereferenced pointer from the preceding lines like this: ```4d -SORT ARRAY(TabPtr->;>) // Tri du tableau +SORT ARRAY($ArrPtr->;>) //Sort the array ``` -Si vous devez vous référer au quatrième élément du tableau à l’aide du pointeur, vous pouvez écrire : +If you need to refer to the fourth element in the array by using the pointer, you do this: ```4d - TabPtr->{4}:=84 + ArrPtr->{4}:=84 ``` -### Passer des pointeurs aux méthodes -Vous pouvez passer un pointeur en tant que paramètre d’une méthode. A l’intérieur de la méthode, vous pouvez modifier l’objet référencé par le pointeur. Par exemple, la méthode suivante, `Recoit Deux`, reçoit deux paramètres qui sont des pointeurs. Elle passe l’objet référencé par le premier paramètre en caractères majuscules, et l’objet référencé par le second paramètre en caractères minuscules. +### 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 - // Méthode projet Recoit Deux - // $1 – Pointeur vers un champ ou une variable de type Chaîne. Passe la chaîne en majuscules. - // $2 – Pointeur vers un champ ou une variable de type Chaîne. Passe la chaîne en minuscules. + //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->) ``` -L'instruction suivante emploie la méthode `Recoit Deux` pour passer un champ en caractères majuscules et une variable en caractères minuscules : +The following line uses the `takeTwo` method to change a field to uppercase characters and to change a variable to lowercase characters: ``` -takeTwo(->[MaTable]MonChamp;->$MaVar) +takeTwo(->[myTable]myField;->$MyVar) ``` -Si le champ, [MaTable]MonChamp, contenait la chaîne "dupont", celle-ci deviendrait "DUPONT". Si la variable $MaVar contenait la chaîne "BONJOUR", celle-ci deviendrait "bonjour". +If the field [myTable]myField contained the string "jones", it would be changed to the string "JONES". If the variable $MyVar contained the string "HELLO", it would be changed to the string "hello". -Dans la méthode Recoit Deux (et, en fait, à chaque fois que vous utilisez des pointeurs), il est important que les types de données des objets référencés soient corrects. Dans l’exemple précédent, les pointeurs doivent pointer vers des objets contenant une chaîne ou un texte. +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. -### Pointeurs vers des pointeurs -Si vous aimez compliquer les choses à l'extrême (bien que cela ne soit pas nécessaire dans 4D), vous pouvez utiliser des pointeurs pour référencer d'autres pointeurs. Examinons l’exemple suivant : +### Pointers to pointers +If you really like to complicate things, you can use pointers to reference other pointers. Consider this example: ```4d - $MaVar:="Bonjour" -$PointeurUn:=->$MaVar -$PointeurDeux:=->$PointeurUn -($PointeurDeux->)->:="Au revoir" -ALERT(($PointeurDeux->)->) + $MyVar:="Hello" + $PointerOne:=->$MyVar + $PointerTwo:=->$PointerOne + ($PointerTwo->)->:="Goodbye" + ALERT(($PointerTwo->)->) ``` -Cet exemple affiche une boîte de dialogue d’alerte contenant “Au revoir”. +It displays an alert box with the word “Goodbye” in it. -Voici la description de chaque ligne de l’exemple : +Here is an explanation of each line of the example: -- $MaVar := "Bonjour" --> Cette ligne place simplement la chaîne "Bonjour" dans la variable $MaVar. -- $PointeurUn := ->$MaVar --> $PointeurUn contient désormais un pointeur vers $MaVar. -- $PointeurDeux :=->$PointeurUn --> $PointeurDeux (une nouvelle variable) contient un pointeur vers $PointeurUn, qui, elle, pointe vers $MaVar. -- ($PointeurDeux->)-> := "Au revoir" --> $PointeurDeux-> référence le contenu de $PointeurUn, qui elle-même référence $MaVar. Par conséquent, ($PointeurDeux->)-> référence le contenu de $MaVar. Donc, dans ce cas, la valeur "Au revoir" est assignée à la $MaVar. -- ALERT (($PointeurDeux->)->) --> C'est ici la même chose que précédemment : $PointeurDeux-> référence le contenu de $PointeurUn, qui elle-même référence $MaVar. Par conséquent, ($PointeurDeux->)-> référence le contenu de $MaVar. Donc, dans ce cas, la boîte de dialogue d'alerte affiche le contenu de $MaVar. +- $MyVar:="Hello" --> This line puts the string "Hello" into the variable $MyVar. +- $PointerOne:=->$MyVar --> $PointerOne now contains a pointer to $MyVar. +- $PointerTwo:=->$PointerOne --> $PointerTwo (a new variable) contains a pointer to $PointerOne, which in turn points to $MyVar. +- ($PointerTwo->)->:="Goodbye" --> $PointerTwo-> references the contents of $PointerOne, which in turn references $MyVar. Therefore ($PointerTwo->)-> references the contents of $MyVar. So in this case, $MyVar is assigned "Goodbye". +- ALERT (($PointerTwo->)->) --> Same thing: $PointerTwo-> references the contents of $PointerOne, which in turn references $MyVar. Therefore ($PointerTwo->)-> references the contents of $MyVar. So in this case, the alert box displays the contents of $MyVar. -La ligne suivante place la valeur "Bonjour" dans $MaVar : +The following line puts "Hello" into $MyVar: ```4d -($PointeurDeux->)->:="Bonjour" +($PointerTwo->)->:="Hello" ``` -La ligne suivante récupère "Bonjour" à partir de $MaVar et la place dans $NouvelleVar : +The following line gets "Hello" from $MyVar and puts it into $NewVar: ``` -$NouvelleVar:=($PointeurDeux->)-> +$NewVar:=($PointerTwo->)-> ``` -**Important :** Vous devez utiliser des parenthèses lors des déréférencements multiples. +**Important:** Multiple dereferencing requires parentheses. diff --git a/website/translated_docs/fr/Concepts/dt_string.md b/website/translated_docs/fr/Concepts/dt_string.md index c641a1028ae41f..7d767710b708f5 100644 --- a/website/translated_docs/fr/Concepts/dt_string.md +++ b/website/translated_docs/fr/Concepts/dt_string.md @@ -3,94 +3,94 @@ id: string title: Chaine --- -Chaîne est un terme générique utilisé pour : +String is a generic term that stands for: -- Les variables ou champs de type Texte : un champ, une variable ou une expression de type Texte peut contenir de 0 à 2 Go de texte. -- Les variables ou champs de type alphanumérique : un champ alphanumérique peut contenir de 0 à 255 caractères (la limite est fixée lors de la définition du champ). +- Text fields or variables: a Text field, variable, or expression may contain from 0 to 2 GB of text. +- Alphanumeric fields: an Alphanumeric field may contain from 0 to 255 characters (limit set when field is defined). -## Constantes littérales de type chaîne +## String literals -Une constante littérale de type chaîne est incluse entre des guillemets droits ("…"). En voici quelques exemples : +A string literal is enclosed in double, straight quotation marks ("..."). Here are some examples of string literals: ```4d -"Ajouter Enregistrements" -"Aucun enregistrement trouvé." -"Facture" -``` - -Une chaîne vide est spécifiée par la succession de deux guillemets (""). - -### Séquences d’échappement -Les séquences d’échappement suivantes peuvent être utilisées dans les chaînes : - -| Séquence d’échappement | Caractère remplacé | -| ---------------------- | --------------------------- | -| \n | LF (Retour ligne) | -| \t | HT (Tabulation) | -| \r | CR (Retour chariot) | -| \\\ | \ (Barre oblique inversée) | -| \\" | " (Guillemets) | - -**Note:** Le caractère \ est utilisé comme séparateur dans les chemins d’accès sous Windows. Vous devez donc saisir un double \\ lorsque vous souhaitez insérer une barre oblique inversée devant un caractère utilisé dans une des séquences d’échappement reconnues par 4D (ex : “C:\\MesDocuments\\Nouveaux.txt”). - -## Opérateurs sur les chaînes - -| Opération | Syntaxe | Retourne | Expression | Valeur | -| ------------------- | ---------------- | -------- | ----------------------- | -------- | -| Concaténation | Chaîne + Chaîne | Chaine | "abc" + "def" | "abcdef" | -| Répétition | Chaîne * Nombre | Chaine | "ab" * 3 | "ababab" | -| Egalité | Chaîne = Chaîne | Booléen | "abc" = "abc" | Vrai | -| | | | "abc" = "abd" | Faux | -| Inégalité | Chaîne # Chaîne | Booléen | "abc" # "abd" | Vrai | -| | | | "abc" # "abc" | Faux | -| Supérieur à | Chaîne > Chaîne | Booléen | "abd" > "abc" | Vrai | -| | | | "abc" > "abc" | Faux | -| Inférieur à | Chaîne < Chaîne | Booléen | "abc" < "abd" | Vrai | -| | | | "abc" < "abc" | Faux | -| Supérieur ou égal à | Chaîne >= Chaîne | Booléen | "abd" >= "abc" | Vrai | -| | | | "abc" >= "abd" | Faux | -| Inférieur ou égal à | Chaîne <= Chaîne | Booléen | "abc" <= "abd" | Vrai | -| | | | "abd" <= "abc" | Faux | -| Contient mot-clé | Chaîne % Chaîne | Booléen | "Alpha Bravo" % "Bravo" | Vrai | -| | | | "Alpha Bravo" % "ravo" | Faux | -| | Image % Chaîne | Booléen | Expr_image % "Mer" | True (*) | - -(*) Si le mot-clé "Mer" a été associé à l'image stockée dans l'expression image (champ ou variable). - -## Comparaisons de chaînes - -- Les chaînes sont toujours comparées caractère par caractère (hormis en cas de recherche par [mot-clé](dt_string.md#keywords), cf. ci-dessous). -- Lors d'une comparaison de chaînes, 4D ne tient pas compte de la casse des caractères ; par exemple, "a"="A" retourne `VRAI`. Pour savoir si des caractères sont en majuscules ou en minuscules, vous devez comparer leurs codes de caractères. Par exemple, l'expression suivante retourne `FAUX` : +"Add Records" +"No records found." +"Invoice" +``` + +An empty string is specified by two quotation marks with nothing between them (""). + +### Escape sequences +The following escape sequences can be used within strings: + +| Escape sequence | Character replaced | +| --------------- | -------------------- | +| \n | LF (Line feed) | +| \t | HT (Tab) | +| \r | CR (Carriage return) | +| \\\ | \ (Backslash) | +| \\" | " (Quotation marks) | + +**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"). + +## String operators + +| Operation | Syntax | Returns | Expression | Value | +| ------------------------ | ---------------- | ------- | ----------------------- | -------- | +| Concatenation | String + String | Chaine | "abc" + "def" | "abcdef" | +| Repetition | String * Number | Chaine | "ab" * 3 | "ababab" | +| Equality | String = String | Booléen | "abc" = "abc" | True | +| | | | "abc" = "abd" | False | +| Inequality | String # String | Booléen | "abc" # "abd" | True | +| | | | "abc" # "abc" | False | +| Greater than | String > String | Booléen | "abd" > "abc" | True | +| | | | "abc" > "abc" | False | +| Less than | String < String | Booléen | "abc" < "abd" | True | +| | | | "abc" < "abc" | False | +| Greater than or equal to | String >= String | Booléen | "abd" >= "abc" | True | +| | | | "abc" >= "abd" | False | +| Less than or equal to | String <= String | Booléen | "abc" <= "abd" | True | +| | | | "abd" <= "abc" | False | +| Contains keyword | String % String | Booléen | "Alpha Bravo" % "Bravo" | True | +| | | | "Alpha Bravo" % "ravo" | False | +| | Picture % String | Booléen | Picture_expr % "Mer" | True (*) | + +(*) If the keyword "Mer" is associated with the picture stored in the picture expression (field or variable). + +## String comparisons + +- Strings are compared on a character-by-character basis (except in the case of searching by [keywords](dt_string.md#keywords), see below). +- When strings are compared, the case of the characters is ignored; thus, "a"="A" returns `TRUE`. To test if the case of two characters is different, compare their character codes. For example, the following expression returns `FALSE`: ```4d -Code de caractere("A")=Code de caractere("a") // 65 n'est pas égal à 97 +Character code("A")=Character code("a") // because 65 is not equal to 97 ``` -- Lors d'une comparaison de chaînes, les caractères diacritiques sont comparés à l'aide de la table de comparaison des caractères de votre machine. Par exemple, les expressions suivantes retournent `VRAI` : +- When strings are compared, diacritical characters are taken into account. For example, the following expressions return `TRUE`: ```4d "n"="ñ" "n"="Ñ" "A"="å" - // etc + // and so on ``` -**Note :** Les comparaisons de chaîne tiennent compte des spécificités du langage **défini pour le fichier de données 4D** (qui n'est pas toujours identique au langage défini pour le système). +**Note:** String comparison takes into account specificities of the language **defined for the 4D data file** (which is not always the same as the language defined for the system). -### Le joker (@) +### Wilcard character (@) -Le langage 4D prend en charge **@** en tant que joker. Ce caractère peut être utilisé dans toute comparaison de chaînes. Ainsi, par exemple, l'expression suivante est évaluée à `TRUE` : +The 4D language supports **@** as a wildcard character. This character can be used in any string comparison to match any number of characters. For example, the following expression is `TRUE`: ```4d "abcdefghij"="abc@" ``` -Le joker doit être utilisé dans le second opérande (la chaîne qui se trouve à droite de l'opérateur). L'expression suivante est évaluée à `FAUX` car le joker est alors considéré en tant que caractère : +The wildcard character must be used within the second operand (the string on the right side) in order to match any number of characters. The following expression is `FALSE`, because the @ is considered only as a one character in the first operand: ```4d "abc@"="abcdefghij" ``` -Le joker signifie “un ou plusieurs caractères sinon rien”. Les expressions suivantes sont évaluées à `VRAI` : +The wildcard means "one or more characters or nothing". The following expressions are `TRUE`: ```4d "abcdefghij"="abcdefghij@" @@ -100,69 +100,69 @@ Le joker signifie “un ou plusieurs caractères sinon rien”. Les expressions "abcdefghij"="@abcde@fghij@" ``` -En revanche, dans tous les cas, lorsque deux jokers consécutifs sont placés dans une comparaison de chaînes, celle-ci sera évaluée à `FAUX`. L'expression suivante est à `FAUX` : +On the other hand, whatever the case, a string comparison with two consecutive wildcards will always return `FALSE`. The following expression is `FALSE`: ```4d "abcdefghij"="abc@@fg" ``` -Lorsque l'opérateur de comparaison est ou contient un symbole < ou >, seule la comparaison avec un seul joker situé en fin d'opérande est prise en charge : +When the comparison operator is or contains a < or > symbol, only comparison with a single wildcard located at the end of the operand is supported: ```4d - "abcd"<="abc@" //Comparaison valide - "abcd"<="abc@ef" //Comparaison non valide + "abcd"<="abc@" // Valid comparison + "abcd"<="abc@ef" //Not a valid comparison ``` -Si vous souhaitez effectuer des comparaisons ou des recherches utilisant @ en tant que caractère (et non en tant que joker), vous devez utiliser l'instruction `Code de caractere(Arobase)`. Imaginons par exemple que vous souhaitiez savoir si une chaîne se termine par le caractère @. L’expression suivante (si $vaValeur n'est pas vide) retourne toujours `VRAI` : +If you want to execute comparisons or queries using @ as a character (and not as a wildcard), you need to use the `Character code(At sign)` instruction. Imagine, for example, that you want to know if a string ends with the @ character. The following expression (if $vsValue is not empty) is always `TRUE`: ```4d -($vaValeur[[Longueur($vaValeur)]]="@") +($vsValue[[Length($vsValue)]]="@") ``` -L'expression suivante sera correctement évaluée : +The following expression will be evaluated correctly: ```4d -(Code de caractere($vaValeur[[Longueur($vaValeur)]])#64) +(Character code($vsValue[[Length($vsValue)]])#64) ``` -**Note :** Une option 4D du mode Développement vous permet de paramétrer le mode d’interprétation du caractère @ lorsque celui-ci est inclus dans une chaîne de caractères. +**Note:** A 4D option in the Design environment allows you to define how the @ character is interpreted when it is included in a character string. -### Mots-clés +### Keywords -A la différence des autres comparaisons de chaîne, les recherches par mots-clés recherchent des “mots” dans des “textes” : les mots sont évalués individuellement et dans leur globalité. L’opérateur **%** retournera toujours `Faux` si la recherche porte sur plusieurs mots ou une partie de mot (par exemple une syllabe). Les “mots” sont des chaînes de caractères encadrées par des “séparateurs”, qui sont les espaces, les caractères de ponctuation et les tirets. Une apostrophe, comme dans “aujourd'hui”, est généralement considérée comme partie du mot, mais sera ignorée dans certains cas (cf. règles ci-dessous). Les nombres peuvent être recherchés car ils sont évalués dans leur ensemble (incluant les symboles décimaux). Les autres symboles (monnaie, température, etc.) seront ignorés. +Unlike other string comparisons, searching by keywords looks for "words" in "texts": words are considered both individually and as a whole. The **%** operator always returns `False` if the query concerns several words or only part of a word (for example, a syllable). The “words” are character strings surrounded by “separators,” which are spaces and punctuation characters and dashes. An apostrophe, like in “Today's”, is usually considered as part of the word, but will be ignored in certain cases (see the rules below). Numbers can be searched for because they are evaluated as a whole (including decimal symbols). Other symbols (currency, temperature, and so on) will be ignored. ```4d - "Alpha Bravo Charlie"%"Bravo" // Retourne Vrai - "Alpha Bravo Charlie"%"vo" // Retourne Faux - "Alpha Bravo Charlie"%"Alpha Bravo" // Retourne Faux - "Alpha,Bravo,Charlie"%"Alpha" // Retourne Vrai - "Software and Computers"%"comput@" // Retourne Vrai + "Alpha Bravo Charlie"%"Bravo" // Returns True + "Alpha Bravo Charlie"%"vo" // Returns False + "Alpha Bravo Charlie"%"Alpha Bravo" // Returns False + "Alpha,Bravo,Charlie"%"Alpha" // Returns True + "Software and Computers"%"comput@" // Returns True ``` -> **Notes :** - 4D utilise la librairie ICU pour la comparaison des chaînes (à l'aide des opérateurs <>=#) et la détection des mots-clés. Pour plus d'informations sur les règles mises en oeuvre, reportez-vous à l'adresse http://www.unicode.org/unicode/reports/tr29/#Word_Boundaries. En version japonaise, 4D utilise par défaut la librairie Mecab en lieu et place de ICU pour la détection des mots-clés. +> **Notes:** - 4D uses the ICU library for comparing strings (using <>=# operators) and detecting keywords. For more information about the rules implemented, please refer to the following address: http://www.unicode.org/unicode/reports/tr29/#Word_Boundaries. - In the Japanese version, instead of ICU, 4D uses Mecab by default for detecting keywords. -## Symboles d'indice de chaîne -Les symboles d'indice de chaîne sont les suivants : [[...]] +## Character Reference Symbols +The character reference symbols: [[...]] -Ces symboles sont utilisés pour désigner un caractère particulier dans une chaîne. Cette syntaxe vous permet de référencer un caractère dans un champ ou une variable de type Alpha ou Texte. +These symbols are used to refer to a single character within a string. This syntax allows you to individually address the characters of a text variable, string variable, or field. -Lorsque les symboles d'indice de chaîne sont placés à gauche de l'opérateur d'affectation (:=), un caractère est affecté à la position référencée dans la chaîne. Par exemple, en postulant que la chaîne vsNom n'est pas une chaîne vide, le code suivant passe le premier caractère de la chaîne vsNom en majuscule : +If the character reference symbols appear on the left side of the assignment operator (:=), a character is assigned to the referenced position in the string. For example, if vsName is not an empty string, the following line sets the first character of vsName to uppercase: ```4d -If(vsNom#"") - vsNom[[1]]:=Uppercase(vsNom[[1]]) +If(vsName#"") + vsName[[1]]:=Uppercase(vsName[[1]]) End if ``` -Lorsque les symboles d'indice de chaîne apparaissent dans une expression, ils retournent le caractère auquel ils font référence sous la forme d'une chaîne d'un caractère. Par exemple: +Otherwise, if the character reference symbols appear within an expression, they return the character (to which they refer) as a 1-character string. For example: ```4d -//L'exemple suivant teste si le dernier caractère de vtText est le caractère "@" +//The following example tests if the last character of vtText is an At sign "@" If(vtText#"") If(Character code(Substring(vtText;Length(vtText);1))=At sign) //... End if End if - //En utilisant la syntaxe des caractères d'indice de chaîne, vous écririez plus simplement : + //Using the character reference syntax, you would write in a simpler manner: If(vtText#"") If(Character code(vtText[[Length(vtText)]])=At sign) // ... @@ -170,33 +170,33 @@ Lorsque les symboles d'indice de chaîne apparaissent dans une expression, ils r End if ``` -### Note avancée sur la référence à des caractères invalides +### Advanced note about invalid character reference -Lorsque vous utilisez les symboles d'indice de chaîne, il est de votre responsabilité de vous référer à des caractères existant dans la chaîne, de la même manière que pour les éléments d'un tableau. Si, par exemple, vous référencez le 20e caractère d'une chaîne, cette chaîne doit contenir au moins 20 caractères. +When you use the character reference symbols, you must address existing characters in the string in the same way you address existing elements of an array. For example if you address the 20th character of a string variable, this variable MUST contain at least 20 characters. -- Ne pas respecter cette condition en mode interprété n'est pas signalé comme une erreur par 4D. -- Ne pas respecter cette condition en mode compilé (sans options) peut entraîner une "corruption" de la mémoire, si, par exemple, vous écrivez un caractère au-delà de la fin d'une chaîne ou d'un texte. -- Ne pas respecter cette condition en mode compilé est signalé lorsque le contrôle d'exécution est activé. Si, par exemple, vous exécutez le code suivant : +- Failing to do so, in interpreted mode, does not cause a syntax error. +- Failing to do so, in compiled mode (with no options), may lead to memory corruption, if, for instance, you write a character beyond the end of a string or a text. +- Failing to do so, in compiled mode, causes an error with the option Range Checking On. For example, executing the following code: ``` -//Ne pas faire ça ! +//Very bad and nasty thing to do, boo! vsAnyText:="" vsAnyText[[1]]:="A" ``` -L'alerte suivante s'affichera en mode compilé : +will trigger the Runtime Error shown here: ![alt-text](assets/en/Concepts/Syntax_Error.en.png) -### Exemple +### Example -La méthode projet suivante ajoute une lettre capitale à tous les mots du texte passé en paramètre et retourne le texte modifié : +The following project method capitalizes the first character of each word of the text received as parameter and returns the resulting capitalized text: ```4d - // Méthode projet de passage en capitale - // PasserEnCap ( Texte ) -> Texte - // PasserEnCap ( Texte source ) -> Texte avec des lettres capitales + //Capitalize_text project method + //Capitalize_text ( Text ) -> Text + //Capitalize_text ( Source text ) -> Capitalized text $0:=$1 $vlLen:=Length($0) @@ -210,12 +210,12 @@ La méthode projet suivante ajoute une lettre capitale à tous les mots du texte End if ``` -Une fois cette méthode placée dans la base, la ligne : +For example, the line: ```4d -ALERT(Capitalize_text("Bonjour, mon nom est Jean Bon et je me présente aux présidentielles !")) +ALERT(Capitalize_text("hello, my name is jane doe and i'm running for president!")) ``` -affiche l'alerte suivante : +displays the alert shown here: ![alt-text](assets/en/Concepts/Jane_doe.en.png) diff --git a/website/translated_docs/fr/Concepts/dt_time.md b/website/translated_docs/fr/Concepts/dt_time.md index 5b2a79f71e970f..e1a2e0018f84e2 100644 --- a/website/translated_docs/fr/Concepts/dt_time.md +++ b/website/translated_docs/fr/Concepts/dt_time.md @@ -3,86 +3,87 @@ id: time title: Heure --- -Les variables, champs ou expressions de type Heure peuvent être compris entre 00:00:00 et 596,000:00:00. +A Time field, variable or expression can be in the range of 00:00:00 to 596,000:00:00. -Les heures sont stockées dans un format de 24 heures. +Times are in 24-hour format. -Une valeur de type Heure peut être utilisée en tant que numérique. Le nombre correspondant est le nombre de secondes que cette valeur représente à partir de minuit (00:00:00). +A time value can be treated as a number. The number returned from a time is the number of seconds since midnight (00:00:00) that time represents. -**Note :** Dans le manuel de *référence du langage 4D*, les paramètres de type Heure dans les descriptions des commandes sont appelés Heure, sauf spécification explicite. +**Note:** In the *4D Language Reference* manual, Time parameters in command descriptions are denoted as Time, except when marked otherwise. -## Constantes littérales de type heure +## Time literals -Une constante heure est incluse entre deux points d’interrogation (?...?). +A time literal constant is enclosed by question marks (?...?). -Avec une version française de 4D, une heure est structurée sous la forme heure:minute:seconde, deux points (:) séparant les valeurs. Les heures sont stockées dans un format de 24 heures. +A time literal constant is ordered hour:minute:second, with a colon (:) setting off each part. Times are specified in 24-hour format. -Voici quelques exemples de constantes littérales de type heure : +Here are some examples of time literals: ```4d -?00:00:00? // minuit -?09:30:00? // 9:30 du matin -?13:01:59? // 13 heures, 1 minute et 59 secondes +?00:00:00? ` midnight +?09:30:00? ` 9:30 am +?13:01:59? ` 1 pm, 1 minute, and 59 seconds ``` -Une heure nulle s’écrit ?00:00:00? - -**Astuce :** L'éditeur de méthodes dispose d'un raccourci pour saisir une heure nulle. Pour cela, tapez un point d'interrogation (?) et appuyez sur la touche Entrée. - -## Opérateurs sur les heures - -| Opération | Syntaxe | Retourne | Expression | Valeur | -| ------------------- | --------------- | -------- | ----------------------- | ---------- | -| Addition | Heure + Heure | Heure | ?02:03:04? + ?01:02:03? | ?03:05:07? | -| Soustraction | Heure – Heure | Heure | ?02:03:04? ?01:02:03? | ?01:01:01? | -| Addition | Heure + Nombre | Nombre | ?02:03:04? ?01:02:03? | 7449 | -| Soustraction | Heure – Nombre | Nombre | ?02:03:04? ?01:02:03? | 7319 | -| Multiplication | Heure * Nombre | Nombre | ?02:03:04? ?01:02:03? | 14768 | -| Division | Heure / Nombre | Nombre | ?02:03:04? ?02:03:04? | 3692 | -| Division entière | Heure \ Nombre | Nombre | ?02:03:04? ?01:02:03? | 3692 | -| Modulo | Heure % Heure | Heure | ?20:10:00? % ?04:20:00? | ?02:50:00? | -| Modulo | Heure % Nombre | Nombre | ?02:03:04? % 2 | 0 | -| Egalité | Heure = Heure | Booléen | ?01:02:03? >=?01:02:03? | Vrai | -| | | | ?01:02:03? ?01:02:04? | Faux | -| Inégalité | Heure # Heure | Booléen | ?01:02:03? ?01:02:03? | Vrai | -| | | | ?01:02:03? ?01:02:03? | Faux | -| Supérieur à | Heure > Heure | Booléen | ?01:02:03? < ?01:02:04? | Vrai | -| | | | ?01:02:03? < ?01:02:04? | Faux | -| Inférieur à | Heure < Heure | Booléen | ?01:02:03? ?01:02:04? | Vrai | -| | | | ?01:02:03? ?01:02:03? | Faux | -| Supérieur ou égal à | Heure >= Heure | Booléen | ?01:02:03? >=?01:02:03? | Vrai | -| | | | ?01:02:03? >=?01:02:04? | Faux | -| Inférieur ou égal à | Heure <= Heure | Booléen | ?01:02:03? <=?01:02:03? | Vrai | -| | | | ?01:02:03? <=?01:02:03? | Faux | - -### Exemple 1 - -Vous pouvez combiner des expressions de type heure et de type numérique à l'aide des fonctions `Time` et `Time string`. - -Vous pouvez combiner des expressions Time et Number à l'aide des fonctions `Time` ou `Current time`: +A null time is specified by ?00:00:00? + +**Tip:** The Method Editor includes a shortcut for entering a null time. To type a null time, enter the question mark (?) character and press Enter. + +## Time operators + +| Operation | Syntax | Returns | Expression | Value | +| ------------------------ | -------------- | ------- | ----------------------- | ---------- | +| Addition | Time + Time | Heure | ?02:03:04? + ?01:02:03? | ?03:05:07? | +| Subtraction | Time – Time | Heure | ?02:03:04? – ?01:02:03? | ?01:01:01? | +| Addition | Time + Number | Number | ?02:03:04? + 65 | 7449 | +| Subtraction | Time – Number | Number | ?02:03:04? – 65 | 7319 | +| Multiplication | Time * Number | Number | ?02:03:04? * 2 | 14768 | +| Division | Time / Number | Number | ?02:03:04? / 2 | 3692 | +| Longint division | Time \ Number | Number | ?02:03:04? \ 2 | 3692 | +| Modulo | Time % Time | Heure | ?20:10:00? % ?04:20:00? | ?02:50:00? | +| Modulo | Time % Number | Number | ?02:03:04? % 2 | 0 | +| Equality | Time = Time | Booléen | ?01:02:03? = ?01:02:03? | True | +| | | | ?01:02:03? = ?01:02:04? | False | +| Inequality | Time # Time | Booléen | ?01:02:03? # ?01:02:04? | True | +| | | | ?01:02:03? # ?01:02:03? | False | +| Greater than | Time > Time | Booléen | ?01:02:04? > ?01:02:03? | True | +| | | | ?01:02:03? > ?01:02:03? | False | +| Less than | Time < Time | Booléen | ?01:02:03? < ?01:02:04? | True | +| | | | ?01:02:03? < ?01:02:03? | False | +| Greater than or equal to | Time >= Time | Booléen | ?01:02:03? >=?01:02:03? | True | +| | | | ?01:02:03? >=?01:02:04? | False | +| Less than or equal to | Time <= Time | Booléen | ?01:02:03? <=?01:02:03? | True | +| | | | ?01:02:04? <=?01:02:03? | False | + +### Example 1 + +To obtain a time expression from an expression that combines a time expression with a number, use the commands `Time` and `Time string`. + +You can combine expressions of the time and number types using the `Time` or `Current time` functions: ```4d - // La ligne suivante assigne à la variable $vlSecondes le nombre de secondes qui, dans une heure à partir de maintenant, se seront écoulées depuis minuit - $vlSeconds:=Current time+3600 - // La ligne suivante assigne à la variable $vhBientôt l'heure qu'il sera dans une heure - $vhSoon:=Time(Current time+3600) + //The following line assigns to $vlSeconds the number of seconds + //that will be elapsed between midnight and one hour from now +$vlSeconds:=Current time+3600 + //The following line assigns to $vHSoon the time it will be in one hour +$vhSoon:=Time(Current time+3600) ``` -La seconde ligne peut également être écrite de la façon suivante : +The second line could be written in a simpler way: ```4d - // La ligne suivante assigne à la variable $vhBientôt l'heure qu'il sera dans une heure + // The following line assigns to $vHSoon the time it will be in one hour $vhSoon:=Current time+?01:00:00? ``` -### Exemple 2 +### Example 2 -L'opérateur Modulo permet notamment d'ajouter des heures en tenant compte du format sur 24 heures d'une journée : +The Modulo operator can be used, more specifically, to add times that take the 24-hour format into account: ```4d -$t1:=?23:00:00? // Il est 23 heures. - //On souhaite ajouter 2 heures 30 - $t2:=$t1 +?02:30:00? // avec une addition simple, $t2 vaut ?25:30:00? -$t2:=($t1 +?02:30:00?)%?24:00:00? // $t2 vaut ?01:30:00? et il est 1h 30 du matin le matin suivant le matin suivant +$t1:=?23:00:00? // It is 23:00 p.m. + // We want to add 2 and a half hours +$t2:=$t1 +?02:30:00? // With a simple addition, $t2 is ?25:30:00? +$t2:=($t1 +?02:30:00?)%?24:00:00? // $t2 is ?01:30:00? and it is 1:30 a.m. the next morning ``` diff --git a/website/translated_docs/fr/Concepts/dt_variant.md b/website/translated_docs/fr/Concepts/dt_variant.md index 228f918b86d9ae..4f26667396cb4e 100644 --- a/website/translated_docs/fr/Concepts/dt_variant.md +++ b/website/translated_docs/fr/Concepts/dt_variant.md @@ -3,27 +3,27 @@ id: variant title: Variant --- -Variant est un type de variable qui permet d'encapsuler des données de type valide et standard dans une variable. En règle générale, ce type de variable peut être utilisé pour écrire du code générique qui retourne ou reçoit des valeurs dont le type n'est pas connu. C'est le cas par exemple du code traitant des attributs d'objet. +Variant is a variable type which allows encapsulating data of any valid regular type in a variable. Typically, this variable type can be used to write generic code returning or receiving values for which the type is not known. This is the case for example for code handling object attributes. -Une variable de type variant peut contenir une valeur des types de données suivants : +A variant type variable can contain a value of the following data types: - BLOB - boolean - collection - date -- entier long +- longint - object - picture - pointer -- réel -- Texte +- real +- text - time - null -- indéfini +- undefined -> Les tableaux ne peuvent pas être stockés dans des variables de type variant. +> Arrays cannot be stored in variant variables. -En modes interprété et compilé, le même contenu peut être affecté à une même variable variant. Contrairement aux types de variable standard, le type de contenu des variable de type variant est différent du type de variable variant lui-même. Par exemple: +In both interpreted and in compiled modes, a same variant variable can be assigned contents of different types. Unlike regular variable types, the variant variable content type is different from the variant variable type itself. For example: ```4d C_VARIANT($variant) @@ -37,7 +37,7 @@ $vtype:=Type($variant) // 12 (Is variant) $vtypeVal:=Value type($variant) // 1 (Is real) ``` -Vous pouvez utiliser des variables variant chaque fois qu'elles sont attendues. Vous devez simplement vous assurer que le type de données du contenu de la variable est du type attendu. Lorsque vous accédez à des variables de type variant, seule leur valeur courante est prise en compte. Par exemple: +You can use variant variables wherever variables are expected, you only need to make sure than the variable content data type is of the expected type. When accessing variant variables, only their current value is taken into account. For example: ```4d C_VARIANT($v) @@ -48,7 +48,7 @@ $t:=Type($v) // 12 (Is variant) $t2:=Type($v2) // 2 (Is text) ``` -Variant peut être utilisé pour déclarer des paramètres de méthode ($0, $1, etc.) pouvant être de différents types. Dans ce cas, vous pouvez générer votre code en testant le type de valeur du paramètre, par exemple : +Variant can be used to declare method parameters ($0, $1,...) that can be of various types. In this case, you can build your code by testing the parameter value type, for example: ```4d C_VARIANT($1) @@ -57,8 +57,7 @@ Case of ... : (Value type($1)=Is text) ... -//déclaration(s) - End case +End case ``` -> Lorsque des variables variant ne sont pas nécessaires (c'est-à-dire lorsque le type de données est connu), il est recommandé d'utiliser des variables typées standard. Les variables typées standard fournissent de meilleures performances, un code plus clair et permettent au compilateur d'éviter les bugs liés à des types de données passés qui sont inattendus. \ No newline at end of file +> When variant variables are not necessary (i.e. when the data type is known), it is recommended to use regular typed variables. Regular typed variables provide better performance, make code more clear and are helpful for the compiler to prevent bugs related to passing unexpected data types. \ No newline at end of file diff --git a/website/translated_docs/fr/Concepts/error-handling.md b/website/translated_docs/fr/Concepts/error-handling.md index 04c7e2e1d273a1..51898ee5ce64ed 100644 --- a/website/translated_docs/fr/Concepts/error-handling.md +++ b/website/translated_docs/fr/Concepts/error-handling.md @@ -3,104 +3,102 @@ id: error-handling title: Gestion des erreurs --- -Le traitement des erreurs consiste à anticiper les erreurs pouvant survenir dans votre application et à y répondre. 4D fournit un support complet pour la détection et la signalisation des erreurs lors de l'exécution, ainsi que pour l'analyse de leurs conditions. +Error handling is the process of anticipating and responding to errors that might occur in your application. 4D provides a comprehensive support for catching and reporting errors at runtime, as well as for investigating their conditions. -La gestion des erreurs répond à deux besoins principaux : +Error handling meets two main needs: -- rechercher et corriger les éventuels bugs et erreurs dans votre code pendant la phase de développement, -- détecter et récupérer des erreurs inattendues dans les applications déployées; vous pouvez notamment remplacer les boîtes de dialogue d'erreur système (disque plein, fichier manquant, etc.) par votre propre interface. -> > Il est fortement recommandé d'installer une méthode de gestion des erreurs sur 4D Server, pour tout le code exécuté sur le serveur. Cette méthode éviterait d'afficher des boîtes de dialogue inattendues sur le serveur et pourrait consigner les erreurs dans un fichier consacré en vue d'analyses ultérieures. +- finding out and fixing potential errors and bugs in your code during the development phase, +- catching and recovering from unexpected errors in deployed applications; in particular, you can replace system error dialogs (disk full, missing file, etc.) with you own interface. +> It is highly recommended to install an error-handling method on 4D Server, for all code running on the server. This method would avoid unexpected dialog boxes to be displayed on the server machine, and could log errors in a dedicated file for further analyses. -## Erreur ou statut +## Error or status -De nombreuses fonctions de classe 4D, telles que `entity.save()` ou `transporter.send()`, retournent un objet *status*. Cet objet permet de stocker les erreurs "prévisibles" dans le contexte d'exécution, telles qu'un mot de passe invalide, une entité verrouillée, etc., qui ne stoppe pas l'exécution du programme. Cette catégorie d'erreurs peut être gérée par du code habituel. +Many 4D class functions, such as `entity.save()` or `transporter.send()`, return a *status* object. This object is used to store "predictable" errors in the runtime context, e.g. invalid password, locked entity, etc., that do not stop program execution. This category of errors can be handled by regular code. -D'autres erreurs "imprévisibles" peuvent inclure une erreur en écriture sur le disque, une panne de réseau ou toute interruption inattendue. Cette catégorie d'erreurs génère des exceptions et doit être traitée par une méthode de gestion des erreurs. +Other "unpredictable" errors include disk write error, network failure, or in general any unexpected interruption. This category of errors generates exceptions and needs to be handled through an error-handling method. -## Installer une méthode de gestion des erreurs +## Installing an error-handling method -Dans 4D, toutes les erreurs peuvent être capturées et traitées dans une méthode projet spécifique, la méthode de **gestion des erreurs** (ou méthode de **capture d'erreurs**). +In 4D, all errors can be catched and handled in a specific project method, the **error-handling** (or **error-catching**) method. -Cette méthode projet est installée pour le process en cours et sera automatiquement appelée pour toute erreur survenant dans le process, en mode interprété ou compilé. Pour *installer* cette méthode projet, il vous suffit d’appeler la commande `APPELER SUR ERREUR` avec le nom de la méthode projet en paramètre. Par exemple: +This project method is installed for the current process and will be automatically called for any error that occurs in the process, in interpreted or compiled mode. To *install* this project method, you just need to call the `ON ERR CALL` command with the project method name as parameter. For example: ```4d -APPELER SUR ERREUR("IO_ERRORS") //Installe la méthode de gestion des erreurs +ON ERR CALL("IO_ERRORS") //Installs the error-handling method ``` -Pour ne plus détecter d'erreurs et redonner le contrôle à 4D, appelez la méthode `ON ERR CALL` à l'aide d'une chaîne vide : +To stop catching errors and give back hand to 4D, call `ON ERR CALL` with an empty string: ```4d -ON ERR CALL("") //redonne le contrôle à 4D +ON ERR CALL("") //gives back control to 4D ``` -La commande `Method called on error` permet de connaître le nom de la méthode installée par `ON ERR CALL` pour le processus en cours. Cela est particulièrement utile dans le contexte du code générique car il vous permet de modifier temporairement puis de restaurer la méthode de capture d'erreur : +The `Method called on error` command allows to know the name of the method installed by `ON ERR CALL` for the current process. It is particularly useful in the context of generic code because it enables you to temporarily change and then restore the error-catching method: ```4d $methCurrent:=Method called on error ON ERR CALL("NewMethod") - //Si le document ne peut pas être ouvert, une erreur est générée + //If the document cannot be opened, an error is generated $ref:=Open document("MyDocument") - //Répéter la méthode précédente + //Reinstallation of previous method ON ERR CALL($methCurrent) ``` -### Portée et composants +### Scope and components -Vous pouvez définir une seule méthode d'erreur pour l'ensemble de l'application ou différentes méthodes par module d'application. Cependant, une seule méthode peut être installée par processus. +You can define a single error-catching method for the whole application or different methods per application module. However, only one method can be installed per process. -Une méthode de gestion des erreurs installée par la commande `APPELER SUR ERREUR` s'applique uniquement à l'application en cours d'exécution. En cas d'erreur générée par un **composant**, la méthode `APPELER SUR ERREUR` de l'application hôte n'est pas appelée, et inversement. +An error-handling method installed by the `ON ERR CALL` command only applies to the running application. In the case of an error generated by a **component**, the `ON ERR CALL` error-handling method of the host application is not called, and vice versa. -### Gérer les erreurs dans une méthode +### Handling errors within the method -Dans la méthode d'erreur personnalisée, vous pouvez accéder à plusieurs informations qui vous aideront à identifier l'erreur : +Within the custom error method, you have access to several information that will help you identifying the error: -- Variables système (*) : +- dedicated system variables(*): - - `Error` (entier long): Code d'erreur - - `Error method` (texte) : nom de la méthode ayant engendré l'erreur - - `Error line` (entier long) : Numéro de ligne de la méthode ayant généré l'erreur - - `Error formula` (texte) : formule du code 4D (texte brut) à l'origine de l'erreur. + - `Error` (longint): error code + - `Error method` (text): name of the method that triggered the error + - `Error line` (longint): line number in the method that triggered the error + - `Error formula` (text): formula of the 4D code (raw text) which is at the origin of the error. -(*) 4D conserve automatiquement le nombre de variables appelées **variables système**, qui répondent à différents besoins. Consultez le manuel Language de 4D*. +(*) 4D automatically maintains a number of variables called **system variables**, meeting different needs. See the *4D Language Reference manual*. -- La commande `GET LAST ERROR STACK` qui retourne les informations sur la pile d'erreur courant de l'application 4D. -- la commande `Get call chain` qui retourne une collection d'objets décrivant chaque étape de la chaîne d'appel de la méthode dans le process courant. +- the `GET LAST ERROR STACK` command that returns information about the current stack of errors of the 4D application. +- the `Get call chain` command that returns a collection of objects describing each step of the method call chain within the current process. -#### Exemple +#### Example -Voici un système de gestion des erreurs simple : +Here is a simple error-handling system: ```4d -//installer la méthode de gestion d'erreur -ON ERR CALL("errorMethod") - //... exécuter le code - ON ERR CALL("") //redonner le contrôle à 4D +//installing the error handling method + ON ERR CALL("errorMethod") + //... executing code + ON ERR CALL("") //giving control back to 4D ``` ```4d -// méthode projet errorMethod - If(Error#1006) //ceci n'est pas une interruption générée par l'utilisateur - ALERT("L'erreur "+String(Error)+" s'est produite". Le code en question est : \""+Error formula+"\"") +// errorMethod project method + If(Error#1006) //this is not a user interruption + ALERT("The error "+String(Error)+" occurred". The code in question is: \""+Error formula+"\"") End if ``` -### Utiliser une méthode de gestion des erreurs vide +### Using an empty error-handling method -Si vous souhaitez cacher la boite de dialogue d'erreur standard, vous pouvez installer une méthode de gestion d'erreurs vide. La variable système `Error` peut être testée dans n'importe quelle méthode, c'est-à-dire en dehors de la méthode de gestion d'erreurs : +If you mainly want the standard error dialog box to be hidden, you can install an empty error-handling method. The `Error` system variable can be tested in any method, i.e. outside of the error-handling method: ```4d -ON ERR CALL("emptyMethod") //emptyMethod existe mais elle est vide +ON ERR CALL("emptyMethod") //emptyMethod exists but is empty $doc:=Open document( "myFile.txt") If (Error=-43) ALERT("File not found.") End if -ON ERR CALL.("") -End if -ON ERR CALL.("") +ON ERR CALL("") ``` diff --git a/website/translated_docs/fr/Concepts/flow-control.md b/website/translated_docs/fr/Concepts/flow-control.md index 63bdf7ae9df3f8..54f94676a53898 100644 --- a/website/translated_docs/fr/Concepts/flow-control.md +++ b/website/translated_docs/fr/Concepts/flow-control.md @@ -3,14 +3,14 @@ id: control-flow title: Conditions et boucles --- -Quelle que soit la simplicité ou la complexité d’une méthode, vous utiliserez toujours un ou plusieurs types de structure de programmation. Les structures de programmation déterminent si et dans quel ordre les lignes d’instructions sont exécutées à l’intérieur d’une méthode. Il existe trois types de structures : +Regardless of the simplicity or complexity of a method, you will always use one or more of three types of programming structures. Programming structures control the flow of execution, whether and in what order statements are executed within a method. There are three types of structures: -- **Séquentielle** : une structure séquentielle est une structure simple, linéaire. Une séquence est une série d’instructions que 4D exécute les unes après les autres, de la première à la dernière. Une instruction d'une ligne, fréquemment utilisée pour les méthodes objet, est le cas le plus simple de structure séquentielle. Par exemple : `[Personnes]Nom:=Uppercase([Personnes]Nom)` -- **[Conditionnelle](Concepts/cf_branching.md)** : une structure conditionnelle permet aux méthodes de tester une condition et d’exécuter des séquences d’instructions différentes en fonction du résultat. La condition est une expression booléenne, c’est-à-dire pouvant retourner VRAI ou FAUX. L’une des structures conditionnelles est la structure `If...Else...End if`, qui aiguille le déroulement du programme vers une séquence ou une autre. L’autre structure conditionnelle est la structure `Case of...Else...End case`, qui aiguille le programme vers une séquence parmi une ou plusieurs alternatives. -- **[Répétitive](Concepts/cf_looping.md)** : il est très courant, lorsque vous écrivez des méthodes, de rencontrer des cas où vous devez répéter une séquence d’instructions un certain nombre de fois. Pour traiter ces besoins, le langage 4D vous propose plusieurs structures répétitives : +- **Sequential**: a sequential structure is a simple, linear structure. A sequence is a series of statements that 4D executes one after the other, from first to last. A one-line routine, frequently used for object methods, is the simplest case of a sequential structure. For example: `[People]lastName:=Uppercase([People]lastName)` +- **[Branching](Concepts/cf_branching.md)**: A branching structure allows methods to test a condition and take alternative paths, depending on the result. The condition is a Boolean expression, an expression that evaluates TRUE or FALSE. One branching structure is the `If...Else...End if` structure, which directs program flow along one of two paths. The other branching structure is the `Case of...Else...End case` structure, which directs program flow to one of many paths. +- **[Looping](Concepts/cf_looping.md)**: When writing methods, it is very common to find that you need a sequence of statements to repeat a number of times. To deal with this need, the 4D language provides the following looping structures: - `While...End while` - `Repeat...Until` - `For...End for` - - `For each...End for each`
    Les boucles sont contrôlées de deux manières : soit elles se répètent jusqu’à ce qu’une condition soit remplie, soit elles se répètent un nombre fixé de fois. Chaque structure répétitive peut être utilisée de l’une ou l’autre manière, mais les boucles `While` et `Repeat` sont mieux adaptées à la répétition jusqu’à ce qu’une condition soit remplie, alors que les boucles `For` sont mieux adaptées à la répétition un certain nombre de fois. `For each...End for each`, destinée à effectuer des boucles dans les objets et les collections, permet de combiner les deux manières. + - `For each...End for each`
    The loops are controlled in two ways: either they loop until a condition is met, or they loop a specified number of times. Each looping structure can be used in either way, but `While` loops and `Repeat` loops are more appropriate for repeating until a condition is met, and `For` loops are more appropriate for looping a specified number of times. `For each...End for each` allows mixing both ways and is designed to loop within objects and collections. -**Note :** 4D vous permet d’imbriquer des structures de programmation jusqu’à une “profondeur” de 512 niveaux. +**Note:** 4D allows you to embed programming structures up to a "depth" of 512 levels. diff --git a/website/translated_docs/fr/Concepts/identifiers.md b/website/translated_docs/fr/Concepts/identifiers.md index b8dc0dc14c8266..c724210b3a94e1 100644 --- a/website/translated_docs/fr/Concepts/identifiers.md +++ b/website/translated_docs/fr/Concepts/identifiers.md @@ -3,70 +3,70 @@ id: identifiers title: Identifiants --- -Cette section détaille les règles d'écriture et de nommage appliquées aux divers identifiants utilisés dans le langage de 4D (variables, tableaux, objets, formulaires, etc.). +This section describes the conventions and rules for naming various elements in the 4D language (variables, tables, objects, forms, etc.). -## Règles de base +## Basic Rules -Les règles suivantes s'appliquent à toutes les structures de 4D. +The following rules apply for all 4D frameworks. - A name must begin with an alphabetic character, an underscore, or a dollar ("$") (note that a dollar sign can denote a local element, see below). -- Le nom peut ensuite contenir des caractères alphabétiques, des caractères numériques, des espaces et des tirets bas (_). -- Les points (".") Les points (".") et les crochets ("[ ]") sont interdits dans les noms de tables, champs, méthodes ou variables. -- Les virgules, barres de fraction, guillemets et deux points (:) sont interdits. -- Les caractères réservés car utilisés comme opérateurs, comme l’astérisque (*) ou le +, sont interdits. -- Les noms réservés, c'est-à-dire les noms de commandes 4D (`Date`, `Time`, etc), les mots-clés (If, For, etc.) et les constantes. -- 4D ignore les espaces superflus. +- Thereafter, the name can include alphabetic characters, numeric characters, the space character, and the underscore character ("_"). +- Periods (".") and brackets ("[ ]") are not allowed in table, field, method, or variable names. +- Commas, slashes, quotation marks, and colons are not allowed. +- Characters reserved for use as operators, such as * and +, are not allowed. +- Do not use reserved names, i.e. 4D command names (`Date`, `Time`, etc), keywords (If, For, etc.), and constants. +- Any trailing spaces are ignored. -### Règles supplémentaires pour les propriétés d'objet et les noms ORDA +### Additional rules for object property and ORDA names -- Les espaces sont interdits. -- Les points (".") Les points (".") et les crochets ("[ ]") sont interdits. -- Les noms sont sensibles à la casse. +- Space characters are not allowed. +- Periods (".") and brackets ("[ ]") are not allowed. +- Names are case sensitive. -### Règles supplémentaires pour SQL +### Additional rules for SQL -- Seuls les caractères _0123456789abcdefghijklmnopqrstuvwxyz sont acceptés -- Les noms ne doivent pas comporter de mot-clé SQL (commande, attribut, etc.). +- Only the characters _0123456789abcdefghijklmnopqrstuvwxyz are accepted +- Names must not include any SQL keywords (command, attribute, etc.). -**Note :** La zone "SQL" de l'inspecteur de l'éditeur de Structure signale automatiquement les caractères non autorisés dans un nom de table ou de champ. +**Note:** The "SQL" area of the Inspector in the Structure editor automatically indicates any unauthorized characters in the name of a table or field. ## Tableaux -Vous désignez un tableau en écrivant simplement son nom, qui est celui que vous passez à une commande de déclaration de tableau (par exemple ARRAY LONGINT) lorsque vous créez le tableau. Les tableaux sont des variables, et tout comme les variables, le nom d'un tableau peut comporter jusqu'à 31 caractères, sans compter les symboles de portée, et il existe trois types de tableaux différents : +You designate an array by using its name, which is the name you pass to an array declaration (such as ARRAY LONGINT) when you create the array. Arrays are variables, and like variables, the name of an array can be up to 31 characters, not including the scope symbols, and there are three different types of arrays: -- Le nom d'un tableau **local** est précédé du symbole dollar ($). -- Le nom d'un tableau **process** ne peut pas commencer par les symboles <> ni par le symbole dollar $). -- Le nom d’un tableau **interprocess** est précédé des symboles (<>), -- les caractères “inférieur à” suivi de “supérieur à”. +- The name of a **local** array is preceded by the dollar sign ($). +- The name of a **process** array cannot start with the <> symbols nor the dollar sign $). +- The name of an **interprocess** array is preceded by the symbols (<>) — a “less than” sign followed by a “greater than” sign. -Voici quelques exemples : +Examples: ```4d -ARRAY TEXT($atSubjects;Records in table([Topics])) //tableau local -SORT ARRAY(asKeywords;>) //tableau process -ARRAY BOOLEAN(<>settings;Records in table([MySettings])) //tableau interprocess +ARRAY TEXT($atSubjects;Records in table([Topics])) //local array +SORT ARRAY(asKeywords;>) //process array +ARRAY BOOLEAN(<>settings;Records in table([MySettings])) //interprocess array ``` -### Eléments de tableaux -Vous désignez un élément d’un tableau local, process ou interprocess à l’aide d’accolades ({…}). L’élément référencé (l’indice) est indiqué par une expression numérique. +### Elements of arrays +You reference an element of an interprocess, process or local array by using the curly braces("{ }"). The element referenced is denoted by a numeric expression. -Voici quelques exemples : +Examples: ```4d - //Traiter un élément d'un tableau local + //Addressing an element of a local array If($asKeywords{1}="Stop") $atSubjects{$vlElem}:=[Topics]Subject $viNextValue:=$aiBigArray{Size of array($aiBigArray)} ``` -### Eléments de tableaux à deux dimensions -Vous désignez un élément d’un tableau à deux dimensions à l’aide d'une double paire d’accolades ({…}) Vous désignez un élément d’un tableau à deux dimensions à l’aide d'une double paire d’accolades ({…}) L’élément référencé (l’indice) est indiqué par deux expressions numériques dans deux paires d’accolades. +### Elements of two-dimensional arrays +You reference an element of a two-dimensional array by using the curly braces ({…}) twice. The element referenced is denoted by two numeric expressions in two sets of curly braces. -Voici quelques exemples : +Examples: ```4d - //Traiter un élément d'un tableau process bidimensionnel + //Addressing an element of a two-dimensional process array If(asKeywords{$vlNextRow}{1}="Stop") atSubjects{10}{$vlElem}:=[Topics]Subject $viNextValue:=aiBigArray{$vlSet}{Size of array(aiBigArray{$vlSet})} @@ -77,78 +77,78 @@ $viNextValue:=aiBigArray{$vlSet}{Size of array(aiBigArray{$vlSet})} A class name must be compliant with standard [property naming rules](#additional-rules-for-object-property-and-orda-names). They are case sensitive. Giving the same name to a class and a [database table](#tables) is not recommended, in order to prevent any conflict. -## Champs +## Fields -Vous désignez un champ en spécifiant d’abord la table à laquelle il appartient. Le nom du champ se place immédiatement derrière celui de la table. Un nom de champ peut contenir jusqu’à 31 caractères. +You designate a field by first specifying the table to which it belongs. The field name immediately follows the table name. A field name can contain up to 31 characters. -Voici quelques exemples : +Examples: ```4d -[Commandes]Total:=Sum([Ligne]Montant) - QUERY([Clients];[Clients]Nom="Dupont") - [Lettres]Text:=Capitalize text([Lettres]Texte) +[Orders]Total:=Sum([Line]Amount) +QUERY([Clients];[Clients]Name="Smith") +[Letters]Text:=Capitalize text([Letters]Text) ``` -## Objets de formulaires +## Form objects -Vous désignez un objet de formulaire en passant son nom sous forme de chaîne, précédée du paramètre *. Un nom d'objet peut contenir jusqu'à 255 octets. +You designate a form object by passing its name as a string, preceded by the * parameter. A form object name can contain up to 255 characters. -Exemple : +Example: ```4d OBJECT SET FONT(*;"Binfo";"Times") ``` -**Note :** Ne confondez pas les objets de formulaire (boutons, list box, variables saisissables...) et les objets du langage 4D. Les objets du langage de 4D sont créés et manipulés via la notation objet ou des commandes dédiées. +**Note:** Do not confuse form objects (buttons, list boxes, variables that can be entered, etc.) and objects in the 4D language. 4D language objects are created and manipulated via object notation or dedicated commands. -## Formulaires +## Forms -Vous désignez un formulaire en utilisant une expression de type chaîne alphanumérique qui représente son nom. Le nom d’un formulaire peut contenir jusqu’à 31 caractères. +You designate a form by using a string expression that represents its name. A form name can contain up to 31 characters. -Voici quelques exemples : +Examples: ```4d -FORM SET INPUT([Personnes];"Entrée") -FORM SET OUTPUT([Personnes];"Sortie") - DIALOG([Stock];"Boîte de note"+String($vlStage)) +FORM SET INPUT([People];"Input") +FORM SET OUTPUT([People];"Output") +DIALOG([Storage];"Note box"+String($vlStage)) ``` -## Fonctions +## Functions Function names must be compliant with standard [property naming rules](#additional-rules-for-object-property-and-orda-names). > Tip: Starting the function name with an underscore character ("_") will exclude the function from the autocompletion features in the 4D code editor. -## Sélections temporaires +## Named Selections -Le nom d'une sélection temporaire peut contenir jusqu’à 255 caractères, symbole <> non compris). +A named selection name can contain up to 255 characters, not including scope character(s). -- Déclarez une sélection temporaire **process** en passant une expression de type chaîne qui représente son nom (et qui ne doit pas débuter par les symboles <> ou $). -- Désignez une sélection temporaire **interprocess** si son nom est précédé des caractères (<>) -- un symbole “inférieur à” suivi de “supérieur à”. +- You denote a **process** named selection by using a string expression that represents its name (which cannot start with the <> symbols nor the dollar sign $). +- You denote an **interprocess** named selection if its name is preceded by the symbols (<>) — a “less than” sign followed by a “greater than” sign. -Voici quelques exemples : +Examples: ```4d -USE NAMED SELECTION([Customers];"Closed")//Sélection temporaire process -USE NAMED SELECTION([Customers];"<>ByZipcode") //Sélection temporaire interprocess +USE NAMED SELECTION([Customers];"Closed")//Process Named Selection +USE NAMED SELECTION([Customers];"<>ByZipcode") //Interprocess Named Selection ``` -## Propriétés (attributs) d'objets +## Object attributes -Désignez un attribut d'objet (également appelé propriété d'objet) en plaçant un point (".") entre le nom de l'objet et le nom de l'attribut. Un nom d'attribut peut contenir jusqu'à 255 caractères et est sensible à la casse. +You designate an object attribute (also called object property) by placing a point (".") between the name of the object and the name of the attribute. An attribute name can contain up to 255 characters and is case sensitive. -Voici quelques exemples : +Examples: ```4d -monObjet.monAttribut:="10" - $valeur:=$clientObj.data.address.city +myObject.myAttribute:="10" +$value:=$clientObj.data.address.city ``` -**Note :** Des règles supplémentaires s'appliquent aux noms des attributs d'objets (ils doivent être conformes à la spécification ECMA Script). For more information, see [additional rules above](#additional-rules-for-object-property-and-orda-names) and [Object property identifiers](Concepts/dt_object.md#object-property-identifiers). +**Note:** Additional rules apply to object attribute names (they must comply with the ECMAScript specification). For more information, see [additional rules above](#additional-rules-for-object-property-and-orda-names) and [Object property identifiers](Concepts/dt_object.md#object-property-identifiers). ## Paramètres Parameter names must start with a `$` character and be compliant with [property naming rules](#additional-rules-for-object-property-and-orda-names). -Voici quelques exemples : +Examples: ```4d Function getArea($width : Integer; $height : Integer)-> $area : Integer @@ -156,94 +156,94 @@ Function getArea($width : Integer; $height : Integer)-> $area : Integer #DECLARE ($i : Integer ; $param : Date) -> $myResult : Object ``` -## Commandes de plug-ins +## Plug-In Commands -Vous désignez une commande de plug-in en écrivant son nom tel qu'il est défini dans le plug-in. Le nom d'une commande de plug-in peut contenir jusqu'à 31 caractères. +You designate a plug-in command by using its name as defined by the plug-in. A plug-in command name can contain up to 31 characters. -Exemple : +Example: ```4d -$erreur:=SMTP_From($smtp_id;"henry@gmail.com") +$error:=SMTP_From($smtp_id;"henry@gmail.com") ``` -## Process +## Processes -Le nom d'un process peut contenir jusqu’à 255 caractères, symbole <> non compris. +A process name can contain up to 255 characters, not including scope character. In the single-user version, or in Client/Server on the Client side, there are two process scopes: **global** or **local**. -- Déclarez un process **global** en passant une expression de type chaîne qui représente son nom (qui ne doit pas commencer par le symbole $). -- Déclarez un process **local** lorsque son nom est précédé du symbole dollar ($). +- You denote a **global** process by using a string expression that represents its name (which cannot start with the dollar sign $). +- You denote a **local** process if the name of the process is preceded by a dollar ($) sign. -Voici quelques exemples : +Examples: ```4d - // Lancer le process global "Ajouter Clients" - $vlProcessID:=New process("P_AJOUT_CLIENTS";48*1024;"Ajouter Clients") - // Lancer le process local "$Suivre Souris" - $vlProcessID:=New process("P_SUIVRE_SOURIS";16*1024;"$Suivre Souris") + //Starting the global process "Add Customers" +$vlProcessID:=New process("P_ADD_CUSTOMERS";48*1024;"Add Customers") + //Starting the local process "$Follow Mouse Moves" +$vlProcessID:=New process("P_MOUSE_SNIFFER";16*1024;"$Follow Mouse Moves") ``` -## Méthodes +## Project methods -Vous désignez une méthode (procédure ou fonction utilisateur) en saisissant son nom. Ce nom peut contenir jusqu’à 31 caractères. +You designate a project method (procedure or function) by using its name. A method name can contain up to 31 characters. -**Note :** Une méthode qui ne retourne pas de résultat est appelée une procédure. Une méthode qui retourne un résultat est appelée une fonction utilisateur. +**Note:** A project method that does not return a result is also called a procedure. A project method that returns a result is also called a function. -Voici quelques exemples : +Examples: ```4d -If(Nouveau client) +If(New client) DELETE DUPLICATED VALUES -APPLY TO SELECTION([Employés];AUGMENTER SALARIES) +APPLY TO SELECTION([Employees];INCREASE SALARIES) ``` -**Conseil :** Nous vous recommandons d'adopter, pour nommer vos méthodes, la même convention que celle utilisée dans le langage de 4D : écrivez les noms de vos procédures en caractères majuscules, et vos fonctions en minuscules avec la première lettre en majuscule. écrivez les noms de vos procédures en caractères majuscules, et vos fonctions en minuscules avec la première lettre en majuscule. Ainsi, lorsque vous rouvrirez un projet au bout de plusieurs mois, vous identifierez immédiatement si une méthode retourne ou non un résultat, en regardant son nom dans la fenêtre de l'Explorateur. +**Tip:** It is a good programming technique to adopt the same naming convention as the one used by 4D for built-in methods. Use uppercase characters for naming your methods; however if a method is a function, capitalize the first character of its name. By doing so, when you reopen a project for maintenance after a few months, you will already know if a method returns a result by simply looking at its name in the Explorer window. -**Note :** Lorsque vous souhaitez appeler une méthode, vous saisissez simplement son nom. Toutefois, certaines commandes intégrées telles que `APPELER SUR EVENEMENT`, ainsi que les commandes des plug-ins, nécessitent que vous passiez le nom d'une méthode en tant que chaîne lorsqu'un paramètre de type méthode est requis. Voici quelques exemples : +**Note:** When you call a method, you just type its name. However, some 4D built-in commands, such as `ON EVENT CALL`, as well as all the Plug-In commands, expect the name of a method as a string when a method parameter is passed. Examples: ```4d - // Cette commande attend une méthode (fonction) ou une formule - QUERY BY FORMULA([aTable];Recherche Spéciale) - // Cette commande attend une méthode (procédure) ou une formule - APPLY TO SELECTION([Employés];AUGMENTER SALARIES) - // Mais cette commande attend un nom de méthode -ON EVENT CALL("GERER EVENEMENTS") + //This command expects a method (function) or formula +QUERY BY FORMULA([aTable];Special query) + //This command expects a method (procedure) or statement +APPLY TO SELECTION([Employees];INCREASE SALARIES) + //But this command expects a method name +ON EVENT CALL("HANDLE EVENTS") ``` -Les méthodes peuvent accepter des paramètres (ou arguments). Les paramètres sont passés à la méthode entre parenthèses, à la suite du nom de la méthode. Chaque paramètre est séparé par des points virgule (;). Les paramètres sont passés à la méthode appelée en tant que variables locales numérotées séquentiellement : $1, $2,…, $n. De plus, plusieurs paramètres consécutifs (s'ils sont les derniers) peuvent être adressés à l'aide de la syntaxe ${n}où n, expression numérique, est le numéro du paramètre. +Project methods can accept parameters (arguments). The parameters are passed to the method in parentheses, following the name of the method. Each parameter is separated from the next by a semicolon (;). The parameters are available within the called method as consecutively numbered local variables: $1, $2,…, $n. In addition, multiple consecutive (and last) parameters can be addressed with the syntax ${n}where n, numeric expression, is the number of the parameter. -A l’intérieur d'une fonction, la variable locale $0 contient la valeur à retourner. +Inside a function, the $0 local variable contains the value to be returned. -Voici quelques exemples : +Examples: ```4d - // Dans DROP SPACES, $1 est pointeur sur le champ [Personnes]Nom - DROP SPACES(->[Personnes]Nom) - - // Dans Créateur tableau : - // - $1 est un numérique qui vaut 1 - // - $2 est un numérique qui vaut 5 - // - $3 est un texte ou un alpha qui vaut "Super" - // - La valeur résultante est assignée à $0 - $vsRésultat:=Calc creator(1;5;"Super") - - // Dans Poubelle : - // - Les trois paramètres sont de type Texte ou Alpha - // - Vous pouvez y accéder par $1, $2 ou $3 - // - Vous pouvez y accéder en écrivant, par exemple, ${$vlParam} où $vlParam vaut 1, 2 ou 3 - // - La valeur résultante est assignée à $0 - vtClone:=Dump("est";"le";"il") + //Within DROP SPACES $1 is a pointer to the field [People]Name +DROP SPACES(->[People]Name) + + //Within Calc creator: + //- $1 is numeric and equal to 1 + //- $2 is numeric and equal to 5 + //- $3 is text or string and equal to "Nice" + //- The result value is assigned to $0 +$vsResult:=Calc creator(1;5;"Nice") + + //Within Dump: + //- The three parameters are text or string + //- They can be addressed as $1, $2 or $3 + //- They can also be addressed as, for instance, ${$vlParam} where $vlParam is 1, 2 or 3 + //- The result value is assigned to $0 +vtClone:=Dump("is";"the";"it") ``` -## Ensembles +## Sets -Un nom d'ensemble peut contenir jusqu’à 255 caractères, symbole(s) <> non compri(s). +A set name can contain up to 255 characters, not including scope character()s). -- Déclarez un ensemble **process** en passant une expression de type chaîne qui représente son nom (et qui ne doit pas débuter par les symboles <> ou $). -- Désignez un ensemble temporaire **interprocess** si son nom est précédé des caractères (<>) -- un symbole “inférieur à” suivi de “supérieur à”. -- Sur 4D Server, le nom d'un ensemble **client** est précédé du symbole dollar ($). Ce nom peut comporter jusqu'à 255 caractères, symbole dollar non compris. +- You denote a **process** set by using a string expression that represents its name (which cannot start with the <> symbols or the dollar sign $). +- You denote an **interprocess** set if the name of the set is preceded by the symbols (<>) — a “less than” sign followed by a “greater than” sign. +- On 4D Server, the name of a **client** set is preceded by the dollar sign ($). A client set name can contain up to 255 characters, not including the dollar sign. -> Sets are maintained on the Server machine. Dans certains cas, pour des raisons particulières ou d'optimisation, vous pourrez avoir besoin d'utiliser des ensembles localement, sur les postes clients. To do so, you use client sets. +> Sets are maintained on the Server machine. In certain cases, for efficiency or special purposes, you may need to work with sets locally on the Client machine. To do so, you use client sets. -Voici quelques exemples : +Examples: ```4d CREATE SET([Customers];"Customer Orders")//Process set USE SET("<>Deleted Records") //Interprocess set @@ -255,24 +255,24 @@ If(Records in set("$Selection"+String($i))>0) //Client set ## Tables -You designate a table by placing its name between brackets: \[...]. Un nom de table peut contenir jusqu’à 31 caractères. Giving the same name to a table and a [class](#classes) is not recommended, in order to prevent any conflict. +You designate a table by placing its name between brackets: \[...]. A table name can contain up to 31 characters. Giving the same name to a table and a [class](#classes) is not recommended, in order to prevent any conflict. -Voici quelques exemples : +Examples: ```4d -DEFAULT TABLE([Commandes]) -FORM SET INPUT([Clients];"Entrée") -ADD RECORD([Lettres]) +DEFAULT TABLE([Orders]) +FORM SET INPUT([Clients];"Entry") +ADD RECORD([Letters]) ``` ## Variables -Le nom d’une variable peut contenir jusqu’à 31 caractères, symbole de portée non compris. +The name of a variable can be up to 31 characters, not including the scope symbols. -- Désignez une variable **locale** en faisant précéder son nom du symbole dollar ($). +- You designate a **local** variable by placing a dollar sign ($) before the variable name. - You designate a **process** variable by using its name (which cannot start with the <> symbols nor the dollar sign $) - You designate an **interprocess** variable by preceding the name of the variable with the symbols (<>) — a “less than” sign followed by a “greater than” sign. -Voici quelques exemples : +Examples: ```4d For($vlRecord;1;100) //local variable @@ -285,43 +285,43 @@ If(bValidate=1) //process variable ## Summary of Identifiers -Le tableau suivant résume les principes de nommage des identifiants dans les méthodes. - -| Identifiant | Longueur Longueur max. | Exemple | -| --------------------------------- | ---------------------- | ------------------------------ | -| Table | 31 | [Factures] | -| Champ | 31 | [Employés]Nom | -| Variable/Tableau interprocess | <> + 31 | <>vlProcessSuivantID | -| Variable/Tableau process | 31 | vsNomCourant | -| Variable/Tableau local(e) | $ + 31 | $vlCompteurLocal | -| Propriétés d'objets | 255 | $o.monAttribut | -| Formulaire | 31 | "Formulaire Web perso" | -| Objet de formulaire | 255 | "MonBouton" | -| Méthode | 31 | M_AJOUTER_CLIENTS | -| Commande de plug-in | 31 | WR INSERER TEXTE | -| Ensemble interprocess | <> + 255 | "<>Enregistrements à archiver" | -| Ensemble process | 255 | "Enregistrements actuels" | -| Ensemble client | $ + 255 | "$Sujets précédents" | -| Sélection temporaire | 255 | "Employés de A à Z" | -| Sélection temporaire interprocess | <> + 255 | "<>Employés de Z à A" | -| Process local | $ + 255 | "$SuivreEvénements" | -| Process global | 255 | "*P_MODULE_FACTURES*" | -| Sémaphore | 255 | "monsémaphore" | - -**Note :** En cas d'utilisation de caractères non romans dans les noms des identifiants, leur taille maximum peut être inférieure. - -## Résoudre les conflits de noms - -Veillez à utiliser des noms uniques pour les différents éléments de votre projet. Si un élément particulier porte le même nom qu’un autre élément d’un autre type (par exemple, si un champ est nommé Personnes et qu’une variable est également nommée Personnes), 4D utilise un système de priorité. - -4D identifie les noms utilisés dans les méthodes en fonction de l’ordre de priorité suivant : - -1. Champs -2. Commandes +The following table summarizes 4D naming conventions. + +| Identifier | Max. Length | Example | +| ---------------------------- | ----------- | -------------------------- | +| Table | 31 | [Invoices] | +| Field | 31 | [Employees]Last Name | +| Interprocess Variable/Array | <> + 31 | <>vlNextProcessID | +| Process Variable/Array | 31 | vsCurrentName | +| Local Variable/Array | $ + 31 | $vlLocalCounter | +| Object attribute | 255 | $o.myAttribute | +| Form | 31 | "My Custom Web Input" | +| Form object | 255 | "MyButton" | +| Project method | 31 | M_ADD_CUSTOMERS | +| Plug-in Routine | 31 | PDF SET ROTATION | +| Interprocess Set | <> + 255 | "<>Records to be Archived" | +| Process Set | 255 | "Current selected records" | +| Client Set | $ + 255 | "$Previous Subjects" | +| Named Selection | 255 | "Employees A to Z" | +| Interprocess Named Selection | <> + 255 | "<>Employees Z to A" | +| Local Process | $ + 255 | "$Follow Events" | +| Global Process | 255 | "*P_INVOICES_MODULE*" | +| Semaphore | 255 | "mysemaphore" | + +**Note:** If non-Roman characters are used in the names of the identifiers, their maximum length may be smaller. + +## Resolving Naming Conflicts + +Be sure to use unique names for the different elements in your project. If a particular element has the same name as another element of a different type (for example, if a field is named Person and a variable is also named Person), 4D uses a priority system. + +4D identifies names used in procedures in the following order: + +1. Fields +2. Commands 3. Méthodes -4. Commandes de plug-in -5. Constantes prédéfinies +4. Plug-in routines +5. Predefined constants 6. Variables. -Par exemple, 4D dispose d’une fonction interne appelée `Date`. Si vous appelez *Date* une de vos méthodes, 4D considérera `Date` comme étant la fonction interne et non votre méthode. Vous ne pourrez pas appeler votre méthode. En revanche, si vous nommez un champ “Date”, 4D considérera que vous souhaitez appeler votre champ et non la fonction intégrée. +For example, 4D has a built-in command called `Date`. If you named a method *Date*, 4D would recognize it as the built-in `Date` command, and not as your method. This would prevent you from calling your method. If, however, you named a field “Date”, 4D would try to use your field instead of the `Date` command. diff --git a/website/translated_docs/fr/Concepts/interpreted.md b/website/translated_docs/fr/Concepts/interpreted.md index 248a2ee3602d1b..fba630f4e2d740 100644 --- a/website/translated_docs/fr/Concepts/interpreted.md +++ b/website/translated_docs/fr/Concepts/interpreted.md @@ -3,60 +3,60 @@ id: interpreted-compiled title: Modes interprété et compilé --- -Les applications 4D fonctionnent en mode **interprété** ou en mode **compilé** : +4D applications can work in **interpreted** or **compiled** mode: -- En mode interprété, les déclarations sont lues et traduites en langage machine lorsqu'elles sont exécutées. Vous pouvez ajouter ou modifier le code là où vous le souhaitez, l'application se met à jour automatiquement. -- En mode compilé, toutes les méthodes sont lues et traduites une seule fois, lors de la compilation. Par la suite, l'application contient uniquement des instructions au niveau de l'assemblage, il n'est donc plus possible de modifier le code. +- in interpreted mode, statements are read and translated in machine language at the moment of their execution. You can add or modify the code whenever you need to, the application is automatically updated. +- in compiled mode, all methods are read and translated once, at the compilation step. Afterwards, the application only contains assembly level instructions are available, it is no longer possible to edit the code. -Les avantages procurés par le compilateur sont les suivants : +The advantages of the compilation are: -- **Vitesse :** votre application s'exécute de 3 à 1000 fois plus vite. -- **Vérification du code** : la cohérence interne du code de votre application est entièrement contrôlée. Les conflits de logique et de syntaxe sont détectés. -- **Protection :** une fois votre application compilée, vous pouvez en supprimer le code interprété. Alors, l'application compilée dispose des mêmes fonctionnalités que la base originale, à la différence près que la structure et les méthodes ne peuvent plus être visualisées ni modifiées délibérément ou par inadvertance. -- **Application indépendantes "double-cliquables"** : une application compilée peut également être transformée en application indépendante (sous Windows, des fichiers ".EXE") comportant sa propre icône. -- **Exécution en mode préemptif** : seul le code compilé peut être exécuté dans un process préemptif. +- **Speed**: Your application can run from 3 to 1,000 times faster. +- **Code checking**: Your application is scanned for the consistency of code. Both logical and syntactical conflicts are detected. +- **Protection**: Once your application is compiled, you can delete the interpreted code. Then, the compiled application is functionally identical to the original, except that the structure and methods cannot be viewed or modified, deliberately or inadvertently. +- **Stand-alone double-clickable applications**: compiled applications can also be transformed into stand-alone applications (.EXE files) with their own icon. +- **Preemptive mode**: only compiled code can be executed in preemptive processes. -## Différences entre le code interprété et le code compilé -Bien que l'application fonctionnera de la même manière en modes interprété et compilé, il est important de connaitre les différences que l'on peut rencontrer pendant la saisie du code qui sera compilé. L'interpréteur de 4D est généralement plus souple que le compilateur. +## Differences between interpreted and compiled code +Although application will work the same way in interpreted and compiled modes, there are some differences to know when you write code that will be compiled. The 4D interpreter is usually more flexible than the compiler. -| Compilé | Interprété | -| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------ | -| Vous ne devez pas avoir une méthode qui aurait le même nom qu’une variable. | Aucune erreur n'est générée, mais la méthode est prioritaire | -| Toutes les variables doivent être typées, soit via une directive de compilateur (ex : `C_ENTIER LONG`), soit via le compilateur au moment de la compilation. | Les variables peuvent être typées à la volée (non recommandé) | -| Vous ne pouvez pas modifier le type d'une variable ou d'un tableau. | La modification du type d'une variable ou d'un tableau est possible (non recommandé) | -| Vous ne pouvez pas convertir un tableau simple en tableau à deux dimensions, et vice-versa. | Possible | -| Bien que le compilateur déduise le type des variables si nécessaire, il est conseillé de déclarer le type des variables à l'aide des directives de compilation lorsque le type de données est ambigu, en particulier dans un formulaire. | | -| La fonction `Indefinie` retournera toujours Faux. Les variables sont toujours définies. | | -| Si vous avez coché la propriété "Peut être exécutée dans un process préemptif" pour la méthode, le code ne doit pas appeler de commandes thread-unsafe ou d'autres méthodes thread-unsafe. | Les propriétés du process préemptif sont ignorées | -| La commande `APPELER 4D` est nécessaire pour appeler des boucles spécifiques | Il est toujours possible d'interrompre 4D | +| Compiled | Interpreted | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------ | +| You cannot have a method with the same name as a variable. | No error is generated, but priority is given to the method | +| All variables must by typed, either through a compiler directive (ex: `C_LONGINT`), or by the compiler at compilation time. | Variables can be typed on-the-fly (not recommended) | +| You cannot change the data type of any variable or array. | Changing the data type of a variable or an array is possible (not recommended) | +| You cannot change a one-dimensional array to a two-dimensional array, or change a two-dimensional array to a one-dimensional array. | Possible | +| Although the compiler will type the variable for you, you should specify the data type of a variable by using compiler directives where the data type is ambiguous, such as in a form. | | +| The `Undefined` function always returns False for variables. Variables are always defined. | | +| If you have checked the "Can be run in preemptive processes" property for the method, the code must not call any thread-unsafe commands or other thread-unsafe methods. | Preemptive process properties are ignored | +| The `IDLE` command is necessary to call 4D in specific loops | It is always possible to interrupt 4D | -## Utiliser les directives du compilateur avec l'interpréteur +## Using Compiler Directives with the Interpreter -Les directives de compilateur ne sont pas requises pour les applications non compilées. L'interpréteur type automatiquement chaque variable selon son utilisation dans la déclaration, et une variable peut être retypée librement dans le projet d'application. +Compiler directives are not required for uncompiled applications. The interpreter automatically types each variable according to how it is used in each statement, and a variable can be freely retyped throughout the application project. -Grâce à cet aspect flexible, il est possible qu'une application agisse différemment en modes interprété et compilé. +Because of this flexibility, it is possible that an application can perform differently in interpreted and compiled modes. -Par exemple, si vous écrivez : +For example, if you write: ```4d -C_ENTIER LONG(MyInt) +C_LONGINT(MyInt) ``` -et ailleurs dans l'application, vous écrivez : +and elsewhere in the project, you write: ```4d MyInt:=3.1416 ``` -Dans cet exemple, `MyInt` se voit assigner la même valeur (3) dans les modes interprété et compilé, étant donné que la directive du compilateur est interprétée *avant* la déclaration d'affectation. +In this example, `MyInt` is assigned the same value (3) in both the interpreted and compiled modes, provided the compiler directive is interpreted *prior* to the assignment statement. -L'interpréteur 4D utilise des directives de compilateur pour typer les variables. Lorsque l'interpréteur rencontre une directive de compilateur, il type la variable en fonction de la directive. Si une déclaration ultérieure tente d'affecter une valeur incorrecte (ex : affecter une valeur alphanumérique à une variable numérique), l'affectation n'aura pas lieu et générera une erreur. +The 4D interpreter uses compiler directives to type variables. When the interpreter encounters a compiler directive, it types the variable according to the directive. If a subsequent statement tries to assign an incorrect value (e.g., assigning an alphanumeric value to a numeric variable) the assignment will not take place and will generate an error. -L'ordre d'apparition des deux déclarations importe peu au compilateur, car il scanne d'abord le projet dans son intégralité pour les directives du compilateur. En revanche, l'interpréteur n'est pas systématique. Il interprète les déclarations dans leur ordre d'exécution. Cet ordre peut évidemment changer d'une session à l'autre, en fonction de ce que fait l'utilisateur. C'est pourquoi il est important de concevoir votre projet afin que vos directives de compilateur s'exécutent avant n'importe quelle déclaration contenant des variables déclarées. +The order in which the two statements appear is irrelevant to the compiler, because it first scans the entire project for compiler directives. The interpreter, however, is not systematic. It interprets statements in the order in which they are executed. That order, of course, can change from session to session, depending on what the user does. For this reason, it is important to design your project so that your compiler directives are executed prior to any statements containing declared variables. -## Utiliser des pointeurs pour éviter les retypages +## Using pointers to avoid retyping -Il n’est pas possible de retyper une variable. Il est, en revanche, tout à fait possible de faire pointer un pointeur successivement sur des variables de type différent. Par exemple, le code suivant s'applique aussi bien dans le mode interprété que dans le mode compilé : +A variable cannot be retyped. However, it is possible to use a pointer to refer to variables of different data types. For example, the following code is allowed in both interpreted and compiled modes: ```4d C_POINTER($p) @@ -66,19 +66,19 @@ C_LONGINT($age) $name:="Smith" $age:=50 -$p:=->$name //texte cible pour le pointeur -$p->:="Wesson" //assigne une valeur texte +$p:=->$name //text target for the pointer +$p->:="Wesson" //assigns a text value $p:=->$age -// nouvelle cible de type différent pour le pointeur -$p->:=55 //assigne une valeur numérique +// new target of different type for the pointer +$p->:=55 //assigns a number value ``` -Imaginez une fonction qui retourne la longueur (nombre de caractères) de valeurs de tout type. +Imagine a function that returns the length (number of charaters) of values that can be of any type. ```4d - // Calc_Length (combien de caractères) - // $1 = pointeur vers un type de variable flexible, numérique, text, heure, booléen + // Calc_Length (how many characters) + // $1 = pointer to flexible variable type, numeric, text, time, boolean C_POINTER($1) C_TEXT($result) @@ -87,14 +87,14 @@ $result:=String($1->) $0:=Length($result) ``` -La méthode peut alors être appelée : +Then this method can be called: ```4d $var1:="my text" $var2:=5.3 $var3:=?10:02:24? $var4:=True -$vLength:=Calc_Length(->$var1)+Calc_Length(->$var2)+Calc_Length(->$var3)+Calc_Length(->$var4) +$vLength:=Calc_Length(->$var1)+Calc_Length(->$var2)+Calc_Length (->$var3)+Calc_Length(->$var4) ALERT("Total length: "+String($vLength)) ``` diff --git a/website/translated_docs/fr/Concepts/methods.md b/website/translated_docs/fr/Concepts/methods.md index 7b28a8f9b0198e..613babe3a77664 100644 --- a/website/translated_docs/fr/Concepts/methods.md +++ b/website/translated_docs/fr/Concepts/methods.md @@ -4,143 +4,143 @@ title: Méthodes --- -Une méthode est un morceau de code qui exécute une ou plusieurs actions. Une méthode est composée de plusieurs lignes d’instructions. Une ligne d’instructions effectue une action. Cette ligne d’instruction peut être simple ou complexe. Cette ligne peut être aussi longue que vous voulez (elle peut comporter jusqu’à 32 000 caractères, ce qui est normalement suffisant pour la plupart des instructions). +A method is basically a piece of code that executes one or several actions. A method is composed of statements; each statement consists of one line in the method. A statement performs an action, and may be simple or complex. Although a statement is always one line, that one line can be as long as needed (up to 32,000 characters, which is probably enough for most tasks). -La taille maximale d’une méthode est limitée à 2 Go de texte ou 32 000 lignes de code. +The maximum size of a method is limited to 2 GB of text or 32,000 lines of code. -## Types de méthodes +## Method Types -Dans le langage 4D, il existe plusieurs catégories de méthodes : La catégorie dépend de la façon dont elle a été appelée : La catégorie dépend de la façon dont elle a été appelée : La catégorie dépend de la façon dont elle a été appelée : +In the 4D Language, there are several categories of methods. The category depends on how they can be called: -| Type | Contexte d'appel | Accepte les paramètres | Description | -| -------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | ---------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| **Méthode** | À la demande, lorsque le nom de la méthode projet est appelé (voir [Appel de méthodes de projet](#calling-project-methods)) | Oui | Peut contenir du code pour exécuter des actions personnalisées. Une fois que votre méthode projet est créée, elle devient partie intégrante du langage du projet. | -| **Méthode objet (widget)** | Automatique, lorsqu'un événement implique l'objet auquel la méthode est associée | Non | Propriété d'un objet formulaire (également appelé widget) | -| **Méthode formulaire** | Automatique, lorsqu'un événement implique le formulaire auquel la méthode est associée | Non | Propriété d'un formulaire. Vous pouvez utiliser une méthode formulaire pour gérer les données et les objets, mais il est généralement plus simple et plus efficace d'utiliser une méthode objet dans ces cas de figure. | -| **Trigger** (ou *méthode table*) | Automatique, chaque fois que vous manipulez les enregistrements d'une table (Ajouter, Supprimer, Modifier) | Non | Propriété d'une table. Les triggers sont des méthodes qui peuvent éviter les opérations 'illégales' effectuées avec les enregistrements de votre base. | -| **Méthode base** | Automatique, lorsqu'un événement se produit sur la session de travail | Oui (prédéfini) | Il existe 16 méthodes base dans 4D. Voir la section Méthodes bases | +| Type | Calling context | Accepts parameters | Description | +| -------------------------------- | ----------------------------------------------------------------------------------------------------------- | ------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| **Project method** | On demand, when the project method name is called (see [Calling project methods](#calling-project-methods)) | Yes | Can contain any code to execute any custom actions. Once a project method is created, it becomes part of the language of the project. | +| **Object (widget) method** | Automatic, when an event involves the object to which the method is attached | No | Property of a form object (also called widget) | +| **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. See Database methods section | > The 4D Language also supports **Class functions**, that can be called in the context of an object instance. Class functions can be built-in (*e.g.* `collection.orderBy()` or `entity.save()`), or [created by the 4D developer](classes.md#class-function). -## Méthodes projet +## Calling Project Methods -Une méthode projet peut tenir les rôles suivants, en fonction de la manière dont elle est exécutée et utilisée : +A project method can have one of the following roles, depending on how it is executed and used: -- Sous-routine -- Objet formule -- Méthode de menu -- Méthode de gestion de process -- Méthode de gestion d’événements et d'erreurs +- Subroutine +- Object formula +- Menu method +- Process method +- Event or Error catching method -### Sous-routines +### Subroutines -Une sous-routine est une méthode projet qui peut être considérée comme une méthode asservie. D’autres méthodes lui demandent d’effectuer des tâches. Une sous-routine qui retourne une valeur est appelée une fonction. +A subroutine is a project method that can be thought of as a servant. It performs those tasks that other methods request it to perform. A function is a subroutine that returns a value to the method that called it. -Lorsque vous créez une méthode projet, elle devient partie intégrante du langage du prjoet dans lequel elle a été créée. Vous pouvez alors l'appeler à partir d'autres méthodes (méthode projet, méthode objet, etc.) de la même manière que vous appelez les commandes intégrées de 4D. Une méthode projet utilisée de cette manière est appelée une sous-routine. +When you create a project method, it becomes part of the language of the project in which you create it. You can then call the project method from another method (project method, object method...) in the same way that you call 4D’s built-in commands. A project method used in this way is called a subroutine. -L'utilisation de sous-routines procure les avantages suivants : +You use subroutines to: -- Réduction du code répétitif, -- Clarification des méthodes, -- Modification plus facile des méthodes, -- Création de code modulaire +- Reduce repetitive coding +- Clarify your methods +- Facilitate changes to your methods +- Modularize your code -Imaginons par exemple que vous travaillez sur un projet de clients. A mesure que vous construisez le projet, vous vous apercevez que vous répétez souvent certaines tâches, telles que la recherche d’un client et la modification de son enregistrement. Le code nécessaire à l’accomplissement de cette opération pourrait être : +For example, let’s say you have a project of customers. As you customize the project, you find that there are some tasks that you perform repeatedly, such as finding a customer and modifying his or her record. The code to do this might look like this: ```4d - // Recherche d'un client - QUERY BY EXAMPLE([Clients]) - // Sélection du formulaire entrée - FORM SET INPUT([Clients];"Saisie de données") - // Modification de l'enregistrement du client - MODIFY RECORD([Clients]) + // Look for a customer + QUERY BY EXAMPLE([Customers]) + // Select the input form + FORM SET INPUT([Customers];"Data Entry") + // Modify the customer's record + MODIFY RECORD([Customers]) ``` -Si vous n’utilisez pas de sous-routines, vous devrez écrire ce code à chaque fois que vous voudrez modifier l’enregistrement d’un client. Si cette opération peut être réalisée dans dix endroits différents de votre projet, vous devrez la réécrire dix fois. Grâce aux sous-routines, vous ne l’écrirez qu’une seule fois en tout. C’est le premier avantage des sous-routines : réduire la quantité de code à écrire. +If you do not use subroutines, you will have to write the code each time you want to modify a customer’s record. If there are ten places in your project where you need to do this, you will have to write the code ten times. If you use subroutines, you will only have to write it once. This is the first advantage of subroutines—to reduce the amount of code. -Si le code ci-dessus était une méthode projet appelée `MODIFY_CUSTOMER`, vous l’exécuteriez simplement en inscrivant son nom dans une autre méthode. Par exemple, pour modifier l’enregistrement d’un client puis l’imprimer, vous n’auriez qu’à écrire : +If the previously described code was a method called `MODIFY_CUSTOMER`, you would execute it simply by using the name of the method in another method. For example, to modify a customer’s record and then print the record, you would write this method: ```4d MODIFY_CUSTOMER PRINT SELECTION([Customers]) ``` -Cette possibilité simplifie énormément vos méthodes. Dans l’exemple ci-dessus, il n’est pas nécessaire de savoir comment fonctionne la méthode `MODIFY_CUSTOMER`, mais uniquement ce qu’elle fait. C’est le deuxième avantage que vous pouvez tirer de l’utilisation de sous-routines : la clarification de votre code. Ainsi, ces méthodes deviennent en quelque sorte des extensions du langage de 4D. +This capability simplifies your methods dramatically. In the example, you do not need to know how the `MODIFY_CUSTOMER` method works, just what it does. This is the second reason for using subroutines—to clarify your methods. In this way, your methods become extensions to the 4D language. -Si vous devez modifier votre mode de recherche des clients, comme dans notre exemple, il vous suffit de modifier une seule méthode, et non dix. C’est un autre avantage des sous-routines : faciliter les modifications de votre code. +If you need to change your method of finding customers in this example project, you will need to change only one method, not ten. This is the next reason to use subroutines—to facilitate changes to your methods. -Avec les sous-routines, vous rendez votre code modulaire. Cela signifie simplement que vous dissociez votre code en modules (sous-routines), chacun d’entre eux effectuant une tâche logique. Examinez le code suivant, tiré d’un projet de gestion de compte courant : +Using subroutines, you make your code modular. This simply means dividing your code into modules (subroutines), each of which performs a logical task. Consider the following code from a checking account project: ```4d - FIND_CLEARED _CHECKS // Rechercher les chèques émis - RECONCILE_ACCOUNT // Rapprocher le compte -PRINT_CHECK_BOOK_REPORT // Imprimer un relevé + FIND_CLEARED_CHECKS //Find the cleared checks + RECONCILE_ACCOUNT //Reconcile the account + PRINT_CHECK_BOOK_REPORT //Print a checkbook report ``` -Même pour quelqu’un qui ne connaît pas le projet, le code est clair. Il n’est pas nécessaire d’examiner chaque sous-routine. Elles peuvent contenir de nombreuses lignes d’instructions et effectuer des opérations complexes, mais l’important est ce qu’elles font. Nous vous conseillons de découper votre code en tâches logiques, ou modules, à chaque fois que c’est possible. +Even for someone who doesn’t know the project, it is clear what this code does. It is not necessary to examine each subroutine. Each subroutine might be many lines long and perform some complex operations, but here it is only important that it performs its task. We recommend that you divide your code into logical tasks, or modules, whenever possible. -### Objet formule +### Object formulas -Vous pouvez encapsuler vos méthodes projets dans les objets **formule** et les appeler à partir de vos objets. +You can encapsulate your project methods in **formula** objects and call them from your objects. -The `Formula` or `Formula from string` commands allow you to create native formula objects that you can encapsulate in object properties. Vous pouvez ainsi appliquer vos méthodes objets personnalisées. +The `Formula` or `Formula from string` commands allow you to create native formula objects that you can encapsulate in object properties. It allows you to implement custom object methods. -To execute a method stored in an object property, use the **( )** operator after the property name. Par exemple: +To execute a method stored in an object property, use the **( )** operator after the property name. For example: ```4d //myAlert ALERT("Hello world!") ``` -`myAlert` peut ensuite être encapsulé dans n'importe quel objet et peut être appelé : +Then `myAlert` can be encapsulated in any object and called: ```4d C_OBJECT($o) $o:=New object("custom_Alert";Formula(myAlert)) -$o.custom_Alert() //affiche "Hello world!" +$o.custom_Alert() //displays "Hello world!" ``` -La syntaxe avec des crochets est également prise en charge : +Syntax with brackets is also supported: ```4d -$o["custom_Alert"]() //affiche "Hello world!" +$o["custom_Alert"]() //displays "Hello world!" ``` -Vous pouvez appeler votre formule en lui [passant des paramètres](Concepts/parameters.md) $1, $2, etc., tout comme pour les méthodes projet de 4D : +You can also [pass parameters](Concepts/parameters.md) to your formula when you call it by using $1, $2… just like with 4D project methods: ```4d -//méthode fullName +//fullName method C_TEXT($0;$1;$2) $0:=$1+" "+$2 ``` -Vous pouvez encapsuler `fullName` dans un objet : +You can encapsulate `fullName` in an object: ```4d C_OBJECT($o) $o:=New object("full_name";Formula(fullName)) $result:=$o.full_name("John";"Smith") //$result = "John Smith" -// équivalent à $result:=fullName("param1";"param2") +// equivalent to $result:=fullName("param1";"param2") ``` -Lorsqu'elles sont associées à la fonction `This`, ces méthodes objets vous permettent d'écrire du code générique très puissant. Par exemple: +Combined with the `This`function, such object methods allow writing powerful generic code. For example: ```4d -//méthode fullName2 +//fullName2 method C_TEXT($0) $0:=This.firstName+" "+This.lastName ``` -La méthode agit ensuite comme un nouvel attribut calculé qui peut être ajoutée aux autres attributs : +Then the method acts like a new, calculated attribute that can be added to other attributes: ```4d C_OBJECT($o) $o:=New object("firstName";"Jim";"lastName";"Wesson") -$o.fullName:=Formula(fullName2) //ajouter la méthode +$o.fullName:=Formula(fullName2) //add the method $result:=$o.fullName() //$result = "Jim Wesson" @@ -148,103 +148,101 @@ $result:=$o.fullName() -A note que même si elle n'a pas de paramètres, une méthode objet devant être exécutée doit être appelée avec des parenthèses ( ). En appelant uniquement une seule propriété, une nouvelle référence à la formule sera retournée (et ne sera pas exécutée) : +Note that, even if it does not have parameters, an object method to be executed must be called with ( ) parenthesis. Calling only the object property will return a new reference to the formula (and will not execute it): ```4d -$o:=$f.message //retourne l'objet formule en $o +$o:=$f.message //returns the formula object in $o ``` -### Méthodes de menu -Une méthode de menu est appelée lorsque la commande de menu personnalisé à laquelle elle est associée est sélectionnée. Vous assignez la méthode à la commande de menu dans l’éditeur de menus de 4D. Lorsque l’utilisateur sélectionne la commande de menu, la méthode est exécutée. En créant des menus personnalisés qui appellent des méthodes de menu qui exécutent des actions spécifiques, vous créez des interfaces personnalisées pour vos applications de bureau. +### Menu Methods +A menu method is invoked when you select the custom menu command to which it is attached. You assign the method to the menu command using the Menu editor or a command of the "Menus" theme. The method executes when the menu command is chosen. By creating custom menus with menu methods that perform specific actions, you create custom interfaces for your desktop applications. -Les commandes de menus personnalisés peuvent déclencher une ou plusieurs actions. Par exemple, une commande de menu de saisie d’enregistrements peut appeler une méthode effectuant deux actions : afficher le formulaire entrée approprié et appeler la commande `AJOUTER ENREGISTREMENT` jusqu’à ce que l’utilisateur annule la saisie de nouveaux enregistrements. +Custom menu commands can cause one or more activities to take place. For example, a menu command for entering records might call a method that performs two tasks: displaying the appropriate input form, and calling the `ADD RECORD` command until the user cancels the data entry activity. -L’automatisation de séquences d’actions est une possibilité très puissante du langage de programmation de 4D. A l’aide des menus personnalisés, vous pouvez automatiser des séquences de tâches, vous permettez aux utilisateurs de naviguer plus facilement dans votre application. +Automating sequences of activities is a very powerful capability of the programming language. Using custom menus, you can automate task sequences and thus provide more guidance to users of the application. -### Méthodes de gestion de process +### Process Methods -Une **méthode projet** est une méthode projet appelée lorsqu’un process est démarré. Le process existera tant que la méthode sera en cours d'exécution. A noter qu'une méthode de menu associée à une commande de menu pour laquelle la propriété *Démarrer un nouveau process* est sélectionnée, est aussi la méthode de gestion de process pour le process créé. +A **process method** is a project method that is called when a process is started. The process lasts only as long as the process method continues to execute, except if it is a Worker process. Note that a menu method attached to a menu command with *Start a New Process* property is also the process method for the newly started process. -### Méthodes de gestion d’événements et d'erreurs -Une **méthode de gestion d’événements** est une méthode dédiée à la gestion des événements, qui s'exécute dans un process différent de celui de la méthode de gestion des process. Généralement, pour la gestion des événements, vous pouvez laisser 4D faire le gros du travail. Par exemple, lors de la saisie de données, 4D détecte les clics souris et les touches enfoncées, puis appelle les méthodes objet et formulaire correspondantes, vous permettant ainsi de prévoir dans ces méthodes les traitements appropriés aux événements. Pour plus d'informations, reportez-vous à la description de la commande `APPELER SUR EVENEMENT`. +### Event and Error catching Methods +An **event catching method** runs in a separate process as the process method for catching events. Usually, you let 4D do most of the event handling for you. For example, during data entry, 4D detects keystrokes and clicks, then calls the correct object and form methods so you can respond appropriately to the events from within these methods. For more information, see the description of the command `ON EVENT CALL`. -Une **méthode de gestion d’erreurs** est une méthode projet d'interruption. Elle s'exécute à l'intérieur du process dans lequel elle a été installée à chaque fois qu'une erreur se produit. Pour plus d'informations, reportez-vous à la description de la commande `APPELER SUR ERREUR`. +An **error catching method** is an interrupt-based project method. Each time an error or an exception occurs, it executes within the process in which it was installed. For more information, see the description of the command `ON ERR CALL`. -## Méthode projet récursives +## Recursive Project Methods -Des méthodes projet peuvent s'appeler les unes les autres. Par exemple: +Project methods can call themselves. For example: -- Une méthode A peut appeler une méthode B, qui appelle A, donc A appelle B de nouveau, etc. -- Une méthode peut s'appeler elle-même. +- The method A may call the method B which may call A, so A will call B again and so on. +- A method can call itself. -Cela s'appelle la récursivité. Le langage de 4D supporte pleinement la récursivité. +This is called recursion. The 4D language fully supports recursion. -Examinons l'exemple suivant : Examinons l'exemple suivant : vous disposez d'une table `[Amis et relations]` composée de l'ensemble de champs suivant (très simplifié) : -- `[Amis et parents]Nom` -- `[Amis et parents]Enfant'Nom` +Here is an example. Let’s say you have a `[Friends and Relatives]` table composed of this extremely simplified set of fields: +- `[Friends and Relatives]Name` +- `[Friends and Relatives]ChildrensName` -Pour cet exemple, nous supposons que les valeurs des champs sont uniques (il n'existe pas deux personnes avec le même nom). A partir d'un nom, vous voulez écrire la phrase “Un de mes amis, Pierre, qui est le rejeton de Paul qui est le rejeton de Martine qui est le rejeton de Robert qui est le rejeton de Gertrude, fait cela pour gagner sa vie !” : +For this example, we assume the values in the fields are unique (there are no two persons with the same name). Given a name, you want to build the sentence “A friend of mine, John who is the child of Paul who is the child of Jane who is the child of Robert who is the child of Eleanor, does this for a living!”: -1. Vous pouvez procéder de la manière suivante : +1. You can build the sentence in this way: ```4d - $vsName:=Request("Saisissez le nom :";"Pierre") - Si(OK=1) - QUERY([Amis et parents];[Amis et parents]Nom=$vsNom) - If(Records in selection([Amis et parents])>0) - $vtHistoireComplète:="Un de mes amis, "+$vsNom + $vsName:=Request("Enter the name:";"John") + If(OK=1) + QUERY([Friends and Relatives];[Friends and Relatives]Name=$vsName) + If(Records in selection([Friends and Relatives])>0) + $vtTheWholeStory:="A friend of mine, "+$vsName Repeat - QUERY([Amis et parents];[Amis et parents]Enfant'Nom=$vsNom) - $vlResultRecherche:=Records in selection([Amis et parents]) - If($vlResultRecherche>0) - $vtHistoireComplète:=$vtHistoireComplète+" qui est le rejeton de "+[Amis et parents]Nom - $vsNom:=[Amis et parents]Nom + QUERY([Friends and Relatives];[Friends and Relatives]ChildrensName=$vsName) + $vlQueryResult:=Records in selection([Friends and Relatives]) + If($vlQueryResult>0) + $vtTheWholeStory:=$vtTheWholeStory+" who is the child of "+[Friends and Relatives]Name + $vsName:=[Friends and Relatives]Name End if - Until($vlResultRecherche=0) - $vtHistoireComplète:=$vtHistoireComplète+", fait cela pour gagner sa vie !" - ALERT($vtHistoireComplète) + Until($vlQueryResult=0) + $vtTheWholeStory:=$vtTheWholeStory+", does this for a living!" + ALERT($vtTheWholeStory) End if End if ``` -2. Vous pouvez également procéder ainsi : +2. You can also build it this way: ```4d - $vsNom:=Request("Saisissez le nom :";"Pierre") - If(OK=1) - QUERY([Amis et parents];[Amis et parents]Nom=$vsNom) - If(Records in selection([Amis et parents])>0) - ALERT("Un de mes amis, "+Généalogie de($vsNom)+", fait cela pour gagner sa vie !") - End if - End if + $vsName:=Request("Enter the name:";"John") + If(OK=1) + QUERY([Friends and Relatives];[Friends and Relatives]Name=$vsName) + If(Records in selection([Friends and Relatives])>0) + ALERT("A friend of mine, "+Genealogy of($vsName)+", does this for a living!") End if End if ``` -en utilisant la fonction récursive `Généalogie de` suivante : +with the recursive function `Genealogy of` listed here: ```4d - // Méthode projet Généalogie de - // Généalogie de ( Chaîne ) -> Texte - // Généalogie de ( Nom ) -> Partie de la phrase + ` Genealogy of project method + ` Genealogy of ( String ) -> Text + ` Genealogy of ( Name ) -> Part of sentence $0:=$1 - QUERY([Amis et parents];[Amis et parents]Enfant'Nom=$1) -If(Enregistrements trouves([Amis et parents])>0) - $0:=$0+" qui est le rejeton de "+Généalogie de([Amis et parents]Nom) -End if + QUERY([Friends and Relatives];[Friends and Relatives]ChildrensName=$1) + If(Records in selection([Friends and Relatives])>0) + $0:=$0+" who is the child of "+Genealogy of([Friends and Relatives]Name) + End if ``` -Vous notez que la méthode `Généalogie de` s'appelle elle-même. +Note the `Genealogy of` method which calls itself. -La première manière de procéder utilise un **algorithme itératif**. La seconde manière utilise un **algorithme récursif**. +The first way is an **iterative algorithm**. The second way is a **recursive algorithm**. -Lorsque vous implémentez du code pour traiter des cas comme celui décrit ci-dessus, vous aurez toujours le choix entre écrire des méthodes utilisant des algorithmes itératifs ou récursifs. Typiquement, la récursivité fournit un code plus concis, plus facile à lire et à maintenir, mais elle est facultative. +When implementing code for cases like the previous example, it is important to note that you can always write methods using iteration or recursion. Typically, recursion provides more concise, readable, and maintainable code, but using it is not mandatory. -Dans 4D, la récursivité est typiquement utilisée pour : +Some typical uses of recursion in 4D are: -- Traiter les enregistrements de tables liées les unes aux autres de la même manière que décrit dans l'exemple ci-dessus. -- Naviguer parmi les documents et les dossiers de votre disque à l'aide des commandes `LISTE DES DOSSIERS` et `LISTE DES DOCUMENTS`. Un dossier peut contenir des dossiers et des documents, les sous-dossiers peuvent eux-mêmes contenir des dossiers et des documents, etc. +- Treating records within tables that relate to each other in the same way as in the example. +- Browsing documents and folders on your disk, using the commands `FOLDER LIST` and `DOCUMENT LIST`. A folder may contain folders and documents, the subfolders can themselves contain folders and documents, and so on. -**Important :** Les appels récursifs doivent toujours se terminer à un moment donné. Dans l'exemple ci-dessus, la méthode `Généalogie de` cesse de s'appeler elle-même lorsque la recherche ne trouve plus d'enregistrement. Sans ce test conditionnel, la méthode s'appellerait indéfiniment et 4D pourrait au bout d'un certain temps retourner l'erreur “La pile est pleine” car le programme n'aurait plus assez de place pour "empiler" les appels (ainsi que les paramètres et les variables locales utilisés dans la méthode). +**Important:** Recursive calls should always end at some point. In the example, the method `Genealogy of` stops calling itself when the query returns no records. Without this condition test, the method would call itself indefinitely; eventually, 4D would return a “Stack Full” error becuase it would no longer have space to “pile up” the calls (as well as parameters and local variables used in the method). diff --git a/website/translated_docs/fr/Concepts/parameters.md b/website/translated_docs/fr/Concepts/parameters.md index 3bc3d75a18e7ee..e3b7fc0f75b190 100644 --- a/website/translated_docs/fr/Concepts/parameters.md +++ b/website/translated_docs/fr/Concepts/parameters.md @@ -4,53 +4,53 @@ title: Paramètres --- -Vous aurez souvent besoin de fournir des valeurs à vos méthodes et fonctions. Vous pouvez facilement effectuer cette opération grâce aux paramètres. +You'll often find that you need to pass data to your methods and functions. This is easily done with parameters. ## Aperçu -**Les paramètres** (ou **arguments**) sont des données dont une méthode ou une fonction de classe a besoin pour s’exécuter. Le terme *paramètres* ou *arguments* est utilisé indifféremment dans ce manuel. Des paramètres sont également passés aux commandes intégrées de 4D. Dans l’exemple ci-dessous, la chaîne “Bonjour” est un paramètre de la commande `ALERTE` : +**Parameters** (or **arguments**) are pieces of data that a method or a class function needs in order to perform its task. The terms *parameter* and *argument* are used interchangeably throughout this manual. Parameters are also passed to built-in 4D commands. In this example, the string “Hello” is an argument to the `ALERT` built-in command: ```4d -ALERT("Bonjour") +ALERT("Hello") ``` -Les paramètres sont passés de la même manière aux méthodes ou aux fonctions de classe (class functions). Par exemple, si une fonction de classe nommée `getArea()` accepte deux paramètres, voilà) à quoi pourrait ressembler un appel à la fonction de classe : +Parameters are passed to methods or class functions in the same way. For example, if a class function named `getArea()` accepts two parameters, a call to the class function might look like this: ``` $area:=$o.getArea(50;100) ``` -Ou si la méthode `FAIRE QUELQUE CHOSE` accepte trois paramètres, l'appel à cette méthode pourrait être de la forme suivante : +Or, if a project method named `DO_SOMETHING` accepts three parameters, a call to the method might look like this: ```4d -FAIRE QUELQUE CHOSE(AvecCeci; EtCela; CommeCeci) +DO_SOMETHING($WithThis;$AndThat;$ThisWay) ``` -Les paramètres d'entrée sont séparés par des points-virgules (;). +The input parameters are separated by semicolons (;). -Les mêmes principes s'appliquent lorsque des méthodes sont exécutées via des commandes consacrées, comme par exemple : +The same principles are used when methods are executed through dedicated commands, for example: ```4d EXECUTE METHOD IN SUBFORM("Cal2";"SetCalendarDate";*;!05/05/20!) -//passez la date du !05/05/20! comme paramètre de SetCalendarDate -// dans le contexte d'un sous-formulaire +//pass the !05/05/20! date as parameter to the SetCalendarDate +//in the context of a subform ``` -Les données peuvent également être **retournées** à partir de méthodes et de fonctions de classe. Par exemple, la ligne d’instruction suivante utilise une commande intégrée, `Longueur`, qui retourne la longueur d’une chaîne. La valeur retournée par `Longueur` est placée dans une variable appelée *MaLongueur*. +Data can also be **returned** from methods and class functions. For example, the following line is a statement that uses the built-in command, `Length`, to return the length of a string. The statement puts the value returned by `Length` in a variable called *MyLength*. Here is the statement: ```4d -MaLongueur:=Length("Comment suis-je arrivé là ?") +MyLength:=Length("How did I get here?") ``` -Toute sous-routine peut retourner une valeur. Only one single output parameter can be declared per method or class function. +Any subroutine can return a value. Only one single output parameter can be declared per method or class function. -Les valeurs d'entrée et de sortie sont [évaluées](#values-or-references) au moment de l'appel et copiée dans les variables locales au sein de la fonction de classe ou de la méthode appelée. Two syntaxes are proposed to declare variable parameters in the called code: +Input and output values are [evaluated](#values-or-references) at the moment of the call and copied into local variables within the called class function or method. Two syntaxes are proposed to declare variable parameters in the called code: - [named variables](#named-parameters) (recommended in most cases) or - [sequentially numbered variables](#sequential-parameters). -> Both [named](#named-parameters) and [sequential](#sequential-parameters) variables syntaxes can be mixed with no restriction to declare parameters. Par exemple: +> Both [named](#named-parameters) and [sequential](#sequential-parameters) variables syntaxes can be mixed with no restriction to declare parameters. For example: > > ```4d Function add($x : Integer) @@ -61,14 +61,14 @@ Function add($x : Integer) -## Paramètres nommés +## Named parameters -Dans les méthodes et fonctions de classe qui sont appelées, les valeurs des paramètres sont assignées aux variables locales. You can declare parameters using a **parameter name** along with a **parameter type**, separated by colon. +Inside called methods or class functions, parameter values are assigned to local variables. You can declare parameters using a **parameter name** along with a **parameter type**, separated by colon. -- Pour les fonctions de classe, les paramètres sont déclarés avec le mot clé `Function`. -- Pour les méthodes (méthodes projet, méthodes objet formulaire, méthodes de base de données et les triggers), les paramètres sont déclarés à l'aide du mot clé `#DECLARE` saisi au début du code de la méthode. +- For class functions, parameters are declared along with the `Function` keyword. +- For methods (project methods, form object methods, database methods, and triggers), parameters are declared using the `#DECLARE` keyword at the beginning of the method code. -Voici quelques exemples : +Examples: ```4d Function getArea($width : Integer; $height : Integer) -> $area : Integer @@ -79,12 +79,12 @@ Function getArea($width : Integer; $height : Integer) -> $area : Integer ``` -Les règles suivantes s'appliquent : +The following rules apply: -- La ligne de déclaration doit être la première ligne de code de la méthode ou de la fonction, sinon une erreur est affichée (seuls les commentaires ou les sauts de ligne peuvent précéder la déclaration). +- The declaration line must be the first line of the method or function code, otherwise an error is displayed (only comments or line breaks can precede the declaration). - Parameter names must start with a `$` character and be compliant with [property naming rules](dt_object.md#object-property-identifiers). -- Plusieurs paramètres (et types) sont séparés par des points-virgules (;). -- Les syntaxes multilignes sont prises en charge (en utilisant le caractère "\\"). +- Multiple parameters (and types) are separated by semicolons (;). +- Multiline syntaxes are supported (using "\\" character). For example, when you call a `getArea()` function with two parameters: @@ -100,7 +100,7 @@ In the class function code, the value of each parameter is copied into the corre Function getArea($width : Integer; $height : Integer)-> $area : Integer $area:=$width*$height ``` -> Si le type n'est pas défini, le paramètre sera défini comme `Variant`. +> If the type is not defined, the parameter will be defined as `Variant`. All 4D method kinds support the `#DECLARE` keyword, including database methods. For example, in the `On Web Authentication` database method, you can declare named parameters: @@ -114,15 +114,15 @@ $entitySelection:=ds.User.query("login=:1"; $user) // Check hash password... ``` -### Valeur retournée +### Returned value -You declare the return parameter of a function by adding an arrow (->) and the parameter definition after the input parameter(s) list. Par exemple: +You declare the return parameter of a function by adding an arrow (->) and the parameter definition after the input parameter(s) list. For example: ```4d Function add($x : Variant; $y : Integer) -> $result : Integer ``` -You can also declare the return parameter only by adding `: type`, in which case it will automatically be available through `$0` ([see sequential syntax below](#returned-value-1)). Par exemple: +You can also declare the return parameter only by adding `: type`, in which case it will automatically be available through `$0` ([see sequential syntax below](#returned-value-1)). For example: ```4d Function add($x : Variant; $y : Integer): Integer @@ -130,9 +130,9 @@ Function add($x : Variant; $y : Integer): Integer ``` -### Type de données pris en charge +### Supported data types -With named parameters, you can use the same data types as those which are [supported by the `var` keyword](variables.md#using-the-var-keyword), including class objects. Par exemple: +With named parameters, you can use the same data types as those which are [supported by the `var` keyword](variables.md#using-the-var-keyword), including class objects. For example: ```4d Function saveToFile($entity : cs.ShapesEntity; $file : 4D.File) @@ -142,16 +142,16 @@ Function saveToFile($entity : cs.ShapesEntity; $file : 4D.File) -## Paramètres séquentiels +## Sequential parameters -As an alternative to [named parameters](#named-parameters) syntax, you can declare parameters using sequentially numbered variables: **$1**, **$2**, **$3**, and so on. La numérotation des variables locales représente l’ordre des paramètres. +As an alternative to [named parameters](#named-parameters) syntax, you can declare parameters using sequentially numbered variables: **$1**, **$2**, **$3**, and so on. The numbering of the local variables represents the order of the parameters. > Although this syntax is supported by class functions, it is recommended to use [named parameters](#named-parameters) syntax in this case. For example, when you call a `DO_SOMETHING` project method with three parameters: ```4d -FAIRE QUELQUE CHOSE(AvecCeci; EtCela; CommeCeci) +DO_SOMETHING($WithThis;$AndThat;$ThisWay) ``` In the method code, the value of each parameter is automatically copied into $1, $2, $3 variables: @@ -167,37 +167,37 @@ In the method code, the value of each parameter is automatically copied into $1, ``` -### Valeur retournée +### Returned value The value to be returned is automatically put into the local variable `$0`. -Par exemple, la méthode suivante, appelée `Uppercase4`, retourne une chaîne dont les quatre premiers caractères ont été passés en majuscules : +For example, the following method, called `Uppercase4`, returns a string with the first four characters of the string passed to it in uppercase: ```4d $0:=Uppercase(Substring($1;1;4))+Substring($1;5) ``` -Voici un exemple qui utilise la méthode Uppercase4 : +The following is an example that uses the Uppercase4 method: ```4d $NewPhrase:=Uppercase4("This is good.") ``` -Dans cet exemple, la variable *$NewPhrase* prend la valeur “THIS is good.” +In this example, the variable *$NewPhrase* gets “THIS is good.” -La valeur retournée, `$0`, est une variable locale à la sous-routine. Elle peut être utilisée en tant que telle à l'intérieur de la sous-routine. Par exemple, vous pouvez écrire : +The returned value, `$0`, is a local variable within the subroutine. It can be used as such within the subroutine. For example, you can write: ```4d -// Faire_quelque chose +// Do_something $0:=Uppercase($1) ALERT($0) ``` -Dans cet exemple, `$0` recevait d'abord la valeur de `$1`, puis était utilisée en tant que paramètre de la commande `ALERT`. Dans une sous-méthode, vous pouvez utiliser `$0` comme n'importe quelle autre variable locale. C'est 4D qui retourne sa valeur finale `$0` (sa valeur courante au moment où la sous-routine se termine) à la méthode appelée. +In this example, `$0` is first assigned the value of `$1`, then used as parameter to the `ALERT` command. Within the subroutine, you can use `$0` in the same way you would use any other local variable. It is 4D that returns the value of `$0` (as it is when the subroutine ends) to the called method. -### Type de données pris en charge +### Supported data types You can use any [expression](quick-tour.md#expression-types) as sequential parameter, except: @@ -206,13 +206,13 @@ You can use any [expression](quick-tour.md#expression-types) as sequential param Tables or array expressions can only be passed [as reference using a pointer](dt_pointer.md#pointers-as-parameters-to-methods). -### Indirections sur les paramètres +### Parameter indirection -Les méthodes projets 4D acceptent un grand nombre de paramètres de même type, commençant par la droite. Ce principe est appelé **l'indirection des paramètres**. L'utilisation de la commande `Count parameters` vous permet d'adresser ces paramètres avec la boucle `For...End for` ainsi que la syntaxe de l'indirection des paramètres. +4D project methods accept a variable number of parameters of the same type, starting from the right. This principle is called **parameter indirection**. Using the `Count parameters` command you can then address those parameters with a `For...End for` loop and the parameter indirection syntax. > Parameter indirection can only be used with the [sequential](#sequential-parameters) syntax. -Dans l'exemple qui suit, la méthode projet `ENVOYER PAQUET` accepte le paramètre de temps suivi d'un nombre de variables des paramètres de texte : +In the following example, the project method `SEND PACKETS` accepts a time parameter followed by a variable number of text parameters: ```4d //SEND PACKETS Project Method @@ -228,52 +228,52 @@ Dans l'exemple qui suit, la méthode projet `ENVOYER PAQUET` accepte le paramèt End for ``` -Pour une bonne gestion de cette indirection, il est important de respecter la convention suivante : si tous les paramètres ne sont pas adressés par indirection, ce qui est le cas le plus fréquent, il faut que les paramètres adressés par indirection soient passés en fin de liste. A l’intérieur de la méthode, l’adressage par indirection se fait sous la forme : ${$i}, $i étant une variable numérique. ${$i} est appelé **paramètre générique**. +Parameter indirection is best managed if you respect the following convention: if only some of the parameters are addressed by indirection, they should be passed after the others. Within the method, an indirection address is formatted: ${$i}, where $i is a numeric variable. ${$i} is called a **generic parameter**. -Illustrons notre propos par un exemple : écrivons une fonction qui prend des valeurs, fait leur somme et renvoie cette somme formatée suivant un format qui peut varier avec les valeurs. A chaque appel à cette méthode, le nombre de valeurs à additionner peut varier. Il faudra donc passer comme paramètre à notre méthode les valeurs, en nombre variable, et le format, exprimé sous forme d’une chaîne de caractères. +For example, consider a function that adds values and returns the sum formatted according to a format that is passed as a parameter. Each time this method is called, the number of values to be added may vary. We must pass the values as parameters to the method and the format in the form of a character string. The number of values can vary from call to call. -Un appel à cette fonction se fera de la façon suivante : +This function is called in the following manner: ```4d - Résultat:=LaSomme("##0,00";125,2;33,5;24) + Result:=MySum("##0.00";125,2;33,5;24) ``` -La méthode appelante récupérera dans ce cas la chaîne : 182,70, somme des nombres passés, formatée suivant le format spécifié. Les paramètres de la fonction doivent être passés dans un ordre précis : le format d’abord et ensuite les valeurs, dont le nombre peut varier d’un appel à l’autre. +In this case, the calling method will get the string “182.70”, which is the sum of the numbers, formatted as specified. The function's parameters must be passed in the correct order: first the format and then the values. -Examinons maintenant la fonction que nous appelons `LaSomme` : +Here is the function, named `MySum`: ```4d - $Somme:=0 - For($i;2;Nombre de paramètres) - $Somme:=$Somme+${$i} + $Sum:=0 + For($i;2;Count parameters) + $Sum:=$Sum+${$i} End for - $0:=String($Somme;$1) + $0:=String($Sum;$1) ``` -Cette fonction pourra être appelée de diverses manières : +This function can now be called in various ways: ```4d - Résultat:=LaSomme("##0,00";125,2;33,5;24) - Résultat:=LaSomme("000";1;18;4;23;17) + Result:=MySum("##0.00";125,2;33,5;24) + Result:=MySum("000";1;18;4;23;17) ``` -De même que pour les autres variables locales, la déclaration du paramètre générique par directive de compilation n’est pas obligatoire. Il est néanmoins recommandé d'éviter toute ambiguïté. Pour déclarer ces paramètres, utilisez une directive de compilateur à laquelle vous passez ${N} comme paramètre, où N est le premier paramètre générique. +As with other local variables, it is not mandatory to declare generic parameters by compiler directive. However, it is recommended to avoid any ambiguity. To declare these parameters, you use a compiler directive to which you pass ${N} as a parameter, where N specifies the first generic parameter. ```4d C_LONGINT(${4}) ``` -La commande ci-dessus signifie que tous les paramètres à partir du quatrième (inclus) seront adressés par indirection. Ils seront tous de type Entier long. Les types de $1, $2 et $3 pourront être quelconques. En revanche, si vous utilisez $2 par indirection, le type utilisé sera le type générique. Il sera donc de type Entier long, même si pour vous, par exemple, il était de type Réel. +This command means that starting with the fourth parameter (included), the method can receive a variable number of parameters of longint type. $1, $2 and $3 can be of any data type. However, if you use $2 by indirection, the data type used will be the generic type. Thus, it will be of the data type Longint, even if for you it was, for instance, of the data type Real. > The number in the declaration has to be a constant and not a variable. -### Déclaration des paramètres pour le mode compilé +### Declaring parameters for compiled mode Even if it is not mandatory in [interpreted mode](interpreted.md), you must declare each parameter in the called methods or functions to prevent any trouble. -When using the [named variable syntax](#named-parameters), parameters are automatically declared through the `#DECLARE` keyword or `Function` prototype. Par exemple: +When using the [named variable syntax](#named-parameters), parameters are automatically declared through the `#DECLARE` keyword or `Function` prototype. For example: ```4d Function add($x : Variant; $y : Integer)-> $result : Integer @@ -281,18 +281,18 @@ Function add($x : Variant; $y : Integer)-> $result : Integer ``` -When using the sequential variable syntax, you need to make sure all parameters are properly declared. Dans l'exemple suivant, la méthode projet `ajoutCapitale` accepte un paramètre texte et retourne un résultat texte : +When using the sequential variable syntax, you need to make sure all parameters are properly declared. In the following example, the `Capitalize` project method accepts a text parameter and returns a text result: ```4d - // Méthode projet ajoutCapitale - // ajoutCapitale ( Texte ) -> Texte - // ajoutCapitale( Chaîne source ) -> chaîne avec la première lettre capitale + // Capitalize Project Method + // Capitalize ( Text ) -> Text + // Capitalize ( Source string ) -> Capitalized string - C_TEXTE($0;$1) - $0:=Majusc(Sous chaine($1;1;1))+Minusc(Sous chaine($1;2)) + C_TEXT($0;$1) + $0:=Uppercase(Substring($1;1;1))+Lowercase(Substring($1;2)) ``` -L'utilisation de commandes telles que `Nouveau process` avec les méthodes process qui acceptent les paramètres nécessite également que les paramètres soient explicitement déclarés dans la méthode appelée. Par exemple: +Using commands such as `New process` with process methods that accept parameters also require that parameters are explicitely declared in the called method. For example: ```4d C_TEXT($string) @@ -302,7 +302,7 @@ C_OBJECT($obj) $idProc:=New process("foo_method";0;"foo_process";$string;$int;$obj) ``` -Ce code peut être exécuté en mode compilé, uniquement si "foo_method" déclare ses paramètres : +This code can be executed in compiled mode only if "foo_method" declares its parameters: ```4d //foo_method @@ -312,27 +312,27 @@ C_OBJECT($3) ... ``` -> En mode compilé, vous pouvez regrouper tous les paramètres de variables locales pour les méthodes projets dans un méthode spécifique avec un nom commençant par "Compiler". Dans cette méthode, vous pouvez prédéclarer les paramètres de chaque méthode, comme par exemple : +> For compiled mode, you can group all local variable parameters for project methods in a specific method with a name starting with "Compiler". Within this method, you can predeclare the parameters for each method, for example: ```4d // Compiler_method C_REAL(OneMethodAmongOthers;$1) ``` See [Interpreted and compiled modes](interpreted.md) page for more information. -La déclaration des paramètres est également obligatoire dans les contextes suivants (ces contextes ne prennent pas en charge les déclarations dans une méthode "Compiler") : +Parameter declaration is also mandatory in the following contexts (these contexts do not support declaration in a "Compiler" method): -- Méthodes base - Par exemple, la `méthode base Sur connexion Web` reçoit six paramètres, allant de $1 à $6, de type Texte. Au début de la méthode base, vous devez écrire (même si tous les paramètres ne sont pas utilisés) : +- Database methods - For example, the `On Web Connection Database Method` receives six parameters, $1 to $6, of the data type Text. At the beginning of the database method, you must write (even if all parameters are not used): ```4d -// Sur connexion Web +// On Web Connection C_TEXT($1;$2;$3;$4;$5;$6) ``` > You can also use [named parameters](#named-parameters) with the `#DECLARE` keyword. -- Triggers - Le paramètre $0 (Entier long), qui résulte d'un trigger, sera typé par le compilateur si le paramètre n'a pas été explicitement déclaré. Néanmoins, si vous souhaitez le déclarer, vous devez le faire dans le trigger lui-même. +- Triggers - The $0 parameter (Longint), which is the result of a trigger, will be typed by the compiler if the parameter has not been explicitly declared. Nevertheless, if you want to declare it, you must do so in the trigger itself. -- Objets formulaires qui acceptent l'événement formulaire `Sur glisser` - Le paramètre $0 (Entier long), qui résulte de l'événement formulaire `Sur glisser` est typé par le compilateur si le paramètre n'a pas été explicitement déclaré. Néanmoins, si vous souhaitez le déclarer, vous devez le faire dans la méthode projet. **Note :** Le compilateur n'initialise pas le paramètre $0. Ainsi, dès que vous utilisez l'événement formulaire `Sur glisser`, vous devez initialiser $0. Par exemple: +- Form objects that accept the `On Drag Over` form event - The $0 parameter (Longint), which is the result of the `On Drag Over` form event, is typed by the compiler if the parameter has not been explicitly declared. Nevertheless, if you want to declare it, you must do so in the object method. **Note:** The compiler does not initialize the $0 parameter. So, as soon as you use the `On Drag Over` form event, you must initialize $0. For example: ```4d C_LONGINT($0) @@ -349,11 +349,11 @@ C_TEXT($1;$2;$3;$4;$5;$6) -## Utilisation des propriétés d'objet comme paramètres nommés +## Using object properties as named parameters -L'utilisation d'objets en tant que paramètres vous permet de gérer des **paramètres nommés**. Ce style de programmation est simple, souple et facile à lire. +Using objects as parameters allow you to handle **named parameters**. This programming style is simple, flexible, and easy to read. -Par exemple, si vous utilisez la méthode `CreatePerson` : +For example, using the `CreatePerson` method: ```4d //CreatePerson @@ -363,7 +363,7 @@ Par exemple, si vous utilisez la méthode `CreatePerson` : ALERT(String($person.Age)) ``` -Dans la méthode `ChangeAge`, vous pouvez écrire : +In the `ChangeAge` method you can write: ```4d //ChangeAge @@ -373,12 +373,12 @@ Dans la méthode `ChangeAge`, vous pouvez écrire : ALERT($para.Name+" is "+String($para.Age)+" years old.") ``` -C'est un moyen puissant de définir des [paramètres optionnels](#optional-parameters) (voir ci-dessous également). Pour gérer les paramètres manquants, vous pouvez : -- vérifier si tous les paramètres attendus sont fournis en les comparant à la valeur `Null`, ou -- prédéfinir les valeurs des paramètres, ou -- les utiliser sous forme de valeurs vides. +This provides a powerful way to define [optional parameters](#optional-parameters) (see also below). To handle missing parameters, you can either: +- check if all expected parameters are provided by comparing them to the `Null` value, or +- preset parameter values, or +- use them as empty values. -Dans la méthode `ChangeAge` ci-dessus, les propriétés Age et Nom sont obligatoires et pourraient générer des erreurs si elles sont manquantes. Pour éviter cela, vous pouvez simplement écrire : +In the `ChangeAge` method above, both Age and Name properties are mandatory and would produce errors if they were missing. To avoid this case, you can just write: ```4d //ChangeAge @@ -387,9 +387,9 @@ Dans la méthode `ChangeAge` ci-dessus, les propriétés Age et Nom sont obligat $para.Age:=Num($para.Age)+10 ALERT(String($para.Name)+" is "+String($para.Age)+" years old.") ``` -Les deux paramètres sont alors optionnels. S'ils ne sont pas renseignés, le résultat sera "a 10 ans", mais aucune erreur ne sera générée. +Then both parameters are optional; if they are not filled, the result will be " is 10 years old", but no error will be generated. -Enfin, les paramètres nommés permettent de maintenir et de reproduire des applications en toutes simplicité et sécurité. Imaginez que vous réalisez, par la suite, qu'ajouter 10 ans n'est pas toujours approprié. Vous aurez besoin d'un autre paramètre pour définir le nombre d'années à ajouter. Vous pouvez écrire : +Finally, with named parameters, maintaining or refactoring applications is very simple and safe. Imagine you later realize that adding 10 years is not always appropriate. You need another parameter to set how many years to add. You write: ```4d $person:=New object("Name";"Smith";"Age";40;"toAdd";10) @@ -405,36 +405,36 @@ $para.Age:=Num($para.Age)+$para.toAdd ALERT(String($para.Name)+" is "+String($para.Age)+" years old.") ``` -Ici, toute la puissance réside dans le fait de ne pas avoir à changer votre code existant. Cela fonctionnera toujours dans l'ancienne version, mais le cas échéant, vous pouvez utiliser une autre valeur que 10 ans. +The power here is that you will not need to change your existing code. It will always work as in the previous version, but if necessary, you can use another value than 10 years. -Avec les variables nommées, n'importe quel paramètre peut être optionnel. Dans l'exemple ci-dessus, tous les paramètres sont optionnels et peuvent être donnés, dans n'importe quel ordre. +With named variables, any parameter can be optional. In the above example, all parameters are optional and anyone can be given, in any order. -## Variables d'entrée/de sortie +## Input/Output variables -Dans une sous-méthode, vous pouvez utiliser les paramètres $1, $2... comme n'importe quelle autre variable locale. Toutefois, dans le cas où vous utilisez des commandes qui modifient la valeur de la variable passée en paramètre (par exemple `Trouver dans champ`), les paramètres $1, $2, etc. ne peuvent pas être utilisés directement. Vous devez d'abord les recopier dans des variables locales standard (par exemple `$mavar:=$1`). +Within the subroutine, you can use the parameters $1, $2... in the same way you would use any other local variable. However, in the case where you use commands that modify the value of the variable passed as parameter (for example `Find in field`), the parameters $1, $2, and so on cannot be used directly. You must first copy them into standard local variables (for example: `$myvar:=$1`). -## Paramètres optionnels +## Optional parameters -Dans le manuel *Langage de 4D*, les caractères { } (accolades) indiquent des paramètres facultatifs. Par exemple, `ALERT (message{; okButtonTitle})` signifie que le paramètre *okButtonTitle* doit être omis lors de l'appel de la commande. Vous pouvez l'appeler comme suit : +In the *4D Language Reference* manual, the { } characters (braces) indicate optional parameters. For example, `ALERT (message{; okButtonTitle})` means that the *okButtonTitle* parameter may be omitted when calling the command. You can call it in the following ways: ```4d -ALERT("Etes*vous sûr?";"Oui, je le suis") //2 paramètres -ALERT("Temps écoulé") //1 paramètre +ALERT("Are you sure?";"Yes I am") //2 parameters +ALERT("Time is over") //1 parameter ``` -Les méthodes projet 4D acceptent également des paramètres optionnels, en commençant par la droite. Cependant, il est difficile de gérer les paramètres optionnels lorsque certains d'entre eux sont manquants dans la méthode appelée - cela ne devrait jamais générer d'erreur. Une bonne pratique consisterait à assigner des valeurs par défaut aux paramètres non utilisés. +4D project methods also accept such optional parameters, starting from the right. The issue with optional parameters is how to handle the case where some of them are missing in the called method - it should never produce an error. A good practice is to assign default values to unused parameters. -> Lorsque les paramètres sont nécessaires dans vos méthodes, vous pouvez également envisager des [propriétés d'objet comme paramètres nommés](#using-objects-properties-as-named-parameters) pour gérer plusieurs paramètres de manière flexible. +> When optional parameters are needed in your methods, you might also consider using [object properties as named parameters](#using-objects-properties-as-named-parameters) which provide a flexible way to handle variable numbers of parameters. -A l'aide de la commande `Count parameters` contenue dans la méthode appelée, vous pouvez détecter le nombre de paramètres et effectuer des opérations différentes en fonction de ce nombre. +Using the `Count parameters` command from within the called method, you can detect the actual number of parameters and perform different operations depending on what you have received. -L'exemple suivant affiche un message et peut insérer le texte dans un document sur disque ou dans une zone 4D Write Pro : +The following example displays a text message and can insert the text into a document on disk or in a 4D Write Pro area: ```4d // APPEND TEXT Project Method @@ -452,71 +452,71 @@ L'exemple suivant affiche un message et peut insérer le texte dans un document End if End if ``` -Une fois que cette méthode projet a été ajoutée à votre application, vous pouvez écrire : +After this project method has been added to your application, you can write: ```4d -APPEND TEXT(vtSomeText) //Affichera uniquement le message -APPEND TEXT(vtSomeText;$path) //Affiche le message et l'annexe au document dans $path -APPEND TEXT(vtSomeText;"";$wpArea) //Affiche le message et l'écrit dans $wpArea +APPEND TEXT(vtSomeText) //Will only display the message +APPEND TEXT(vtSomeText;$path) //Displays text message and appends it to document at $path +APPEND TEXT(vtSomeText;"";$wpArea) //Displays text message and writes it to $wpArea ``` -## Valeurs ou références +## Values or references -Lorsque vous passez un paramètre, 4D évalue toujours l'expression du paramètre dans le contexte de la méthode appelée et définit la**valeur résultante** sur les variables locales dans la fonction de classe ou la sous-routine. Les variables/paramètres locaux ne correspondent pas aux véritables champs, variables ou expressions passés par la méthode appelée; ils contiennent uniquement les valeurs qui n'ont pas été passées. Cette portée étant locale, si la valeur d'un paramètre est modifiée dans la sous-routine/fonction de classe, elle ne modifie pas la valeur dans la méthode appelée. Par exemple: +When you pass a parameter, 4D always evaluates the parameter expression in the context of the calling method and sets the **resulting value** to the local variables in the class function or subroutine. The local variables/parameters are not the actual fields, variables, or expressions passed by the calling method; they only contain the values that have been passed. Since its scope is local, if the value of a parameter is modified in the class function/subroutine, it does not change the value in the calling method. For example: ```4d - //Voici du code extrait de la méthode MY_METHOD + //Here is some code from the method MY_METHOD DO_SOMETHING([People]Name) //Let's say [People]Name value is "williams" ALERT([People]Name) - //Voici du code extrait de la méthode DO_SOMETHING + //Here is the code of the method DO_SOMETHING $1:=Uppercase($1) ALERT($1) ``` -La boîte de dialogue d'alerte affichée par `FAIRE QUELQUE CHOSE` contiendra "WILLIAM" et celle affichée par `MA METHODE` contiendra "william". La méthode a modifié localement la valeur du paramètre $1, mais cela n'affecte pas la valeur du champ `[Personnes]Nom` passé en paramètre par la méthode `MA METHODE`. +The alert box displayed by `DO_SOMETHING` will read "WILLIAMS" and the alert box displayed by `MY_METHOD` will read "williams". The method locally changed the value of the parameter $1, but this does not affect the value of the field `[People]Name` passed as parameter by the method `MY_METHOD`. -Si vous voulez réellement que la méthode `FAIRE QUELQUE CHOSE` modifie la valeur du champ, deux solutions s'offrent à vous : +There are two ways to make the method `DO_SOMETHING` change the value of the field: -1. Plutôt que de passer le champ à la méthode, vous lui passez un pointeur : +1. Rather than passing the field to the method, you pass a pointer to it, so you would write: ```4d - //Voici du code extrait de la méthode MY_METHOD + //Here is some code from the method MY_METHOD DO_SOMETHING(->[People]Name) //Let's say [People]Name value is "williams" ALERT([People]Last Name) - //Voici du code extrait de la méthode DO_SOMETHING + //Here the code of the method DO_SOMETHING $1->:=Uppercase($1->) ALERT($1->) ``` -Ici, le paramètre n'est pas le champ lui-même, mais un pointeur vers le champ. Ainsi, à l'intérieur de la méthode `FAIRE QUELQUE CHOSE`, $1 ne contient plus la valeur du champ mais un pointeur vers le champ. L'objet **référencé** par $1 ($1-> dans le code ci-dessus) est le champ lui-même. Par conséquent, la modification de l'objet référencé dépasse les limites de la sous-routine et le champ lui-même est affecté. Dans cet exemple, les deux boîtes de dialogue d'alerte afficheront "WILLIAM". +Here the parameter is not the field, but a pointer to it. Therefore, within the `DO SOMETHING` method, $1 is no longer the value of the field but a pointer to the field. The object **referenced** by $1 ($1-> in the code above) is the actual field. Consequently, changing the referenced object goes beyond the scope of the subroutine, and the actual field is affected. In this example, both alert boxes will read "WILLIAMS". -2. Plutôt que la méthode `FAIRE QUELQUE CHOSE` “fasse quelque chose”, vous pouvez la réécrire de manière à ce qu'elle retourne une valeur. +2. Rather than having the method `DO_SOMETHING` "doing something," you can rewrite the method so it returns a value. Thus you would write: ```4d - //Voici du code extrait de la méthode MY METHOD + //Here is some code from the method MY METHOD [People]Name:=DO_SOMETHING([People]Name) //Let's say [People]Name value is "williams" ALERT([People]Name) - //Voici du code extrait de la méthode DO SOMETHING + //Here the code of the method DO SOMETHING $0:=Uppercase($1) ALERT($0) ``` -Cette deuxième technique de renvoi d'une valeur par une sous-routine est appelée «utilisation d'une fonction». Ceci est décrit dans le paragraphe [Valeurs retournées](#returning-values). +This second technique of returning a value by a subroutine is called “using a function.” This is described in the [Returning values](#returning-values) paragraph. -### Cas particuliers : objets et collections +### Particular cases: objects and collections -Veillez à ce que les types de données d'Objet et Collection ne puissent être gérés que via une référence (c'est-à-dire un* pointeur* interne). +You need to pay attention to the fact that Object and Collection data types can only be handled through a reference (i.e. an internal *pointer*). -Par conséquent, lorsque vous utilisez des types de données comme paramètres, `$1, $2 ...` ne contiennent pas des *valeurs*, mais des *références*. La modification de la valeur des paramètres `$1, $2 ...` dans la sous-routine sera propagée à chaque fois que l'objet ou la collection source est utilisé(e). This is the same principle as for [pointers](dt_pointer.md#pointers-as-parameters-to-methods), except that `$1, $2...` parameters do not need to be dereferenced in the subroutine. +Consequently, when using such data types as parameters, `$1, $2...` do not contain *values* but *references*. Modifying the value of the `$1, $2...` parameters within the subroutine will be propagated wherever the source object or collection is used. This is the same principle as for [pointers](dt_pointer.md#pointers-as-parameters-to-methods), except that `$1, $2...` parameters do not need to be dereferenced in the subroutine. -Par exemple, considérons que la méthode `CreatePerson`, qui crée un objet et qui l'envoie comme paramètre : +For example, consider the `CreatePerson` method that creates an object and sends it as a parameter: ```4d //CreatePerson @@ -526,7 +526,7 @@ Par exemple, considérons que la méthode `CreatePerson`, qui crée un objet et ALERT(String($person.Age)) ``` -La méthode `ChangeAge` ajoute 10 à l'attribut Age de l'objet reçu +The `ChangeAge` method adds 10 to the Age attribute of the received object ```4d //ChangeAge @@ -535,8 +535,8 @@ La méthode `ChangeAge` ajoute 10 à l'attribut Age de l'objet reçu ALERT(String($person.Age)) ``` -Si vous exécutez la méthode `CreatePerson`, les deux messages d'alerte contiendront "50" car le même objet est traité par les deux méthodes. +When you execute the `CreatePerson` method, both alert boxes will read "50" since the same object reference is handled by both methods. -**4D Server :** Lorsque des paramètres sont passés entre des méthodes qui ne sont pas exécutées sur la même machine (lors de l'utilisation de l'option Exécuter sur serveur par exemple), il n'est pas possible d'utiliser des références. Dans ce cas, ce sont des copies des paramètres objet ou collection qui sont envoyées au lieu de références. +**4D Server:** When parameters are passed between methods that are not executed on the same machine (using for example the "Execute on Server" option), references are not usable. In these cases, copies of object and collection parameters are sent instead of references. diff --git a/website/translated_docs/fr/Concepts/plug-ins.md b/website/translated_docs/fr/Concepts/plug-ins.md index dcf1118eb70357..0e62435acb5e9f 100644 --- a/website/translated_docs/fr/Concepts/plug-ins.md +++ b/website/translated_docs/fr/Concepts/plug-ins.md @@ -3,57 +3,57 @@ id: plug-ins title: Plug-ins --- -En développant une application 4D, vous découvrirez de nombreuses fonctionnalités que vous n'aviez pas remarquées au début. Vous pouvez même étendre la version standard de 4D en ajoutant des **plug-ins** à votre environnement de développement 4D. +As you develop a 4D application, you will discover many capabilities that you did not notice when you started. You can even augment the standard version of 4D by adding **plug-ins** to your 4D development environment. -## Pourquoi un plugin ? +## Why the need for a plug-in? -Bien que 4D propose des centaines de méthodes intégrées permettant de manipuler des objets et des enregistrements, et d'implémenter une interface utilisateur, une utilisation ou des fonctionnalités spéciales (parfois dépendantes de la plate-forme) peuvent être nécessaires : l'une peut nécessiter ODBC sous Windows, une autre peut nécessiter des services Apple sous macOS, et un autre peut souhaiter implémenter des outils statistiques spécifiques, une connexion à un réseau social, une plateforme de paiement, un accès à un fichier sur le réseau, une interface utilisateur spéciale ou une structure d'image privée. +Although 4D provides hundred of built-in methods used to manipulate objects, records and implement user interface, some special use or feature (sometimes platform dependant) may be needed: one may need ODBC under Windows, another may need Apple services under macOS, while yet another may want to implement specific statistics tools, social network login, payment platform, file access over the network, a special user interface, or a private picture structure. -Il est évident que couvrir tous les domaines des systèmes d'exploitation macOS et Windows au moyen de commandes 4D mènerait certainement à un produit contenant des milliers de commandes et, dans le même temps, la plupart des utilisateurs n'auraient pas besoin d'un si grand ensemble de fonctionnalités. De plus, la création d'un outil aussi complet rendrait l'environnement 4D incroyablement complexe et demanderait des mois d'étude à la plupart des utilisateurs avant de pouvoir obtenir des résultats utiles. +It is obvious that covering all areas of both the macOS and Windows operating systems by way of 4D commands would certainly lead to a product with thousands of commands, and at the same time, most users would have no need for such a large set of capabilities. Also, creating such an all-encompassing tool would make the 4D environment incredibly complex and would take most users months of study before useful results could be expected. -La nature modulaire de l'environnement 4D permet la création d'applications de base, mais n'exclut pas le développement de systèmes extrêmement complexes. L'architecture du plug-in 4D ouvre l'environnement 4D à tout type d'application ou d'utilisateur. Les plug-ins 4D multiplient la puissance et la productivité de cette application ou de l'utilisateur. +The modular nature of the 4D environment allows the creation of basic applications but does not preclude the development of highly complex systems. The 4D Plug-in architecture opens the 4D environment to any type of application or user. 4D Plug-ins multiply that application or user's power and productivity. -## Qu'est-ce qu'un plug-in et à quoi sert-il ? +## What is a plug-in and what can it do? -Un plug-in est un morceau de code que 4D lance au démarrage. Il ajoute des fonctionnalités à 4D et augmente ainsi sa capacité. +A plug-in is a piece of code that 4D launches at start up. It adds functionality to 4D and thus increases its capacity. -Habituellement, un plug-in fait des choses : -- Que 4D ne peut pas effectuer (c'est-à-dire une technologie de plate-forme spécifique), -- Qui sera très difficile à écrire en utilisant uniquement 4D, -- Qui sont uniquement disponibles en tant que point d'entrée de plug-in +Usually, a plug-in does things that: +- 4D cannot do (ie, specific platform technology), +- will be very hard to write just using 4D, +- are only available as Plug-in Entrypoint -Un plug-in contient généralement un ensemble de routines données au développeur 4D. Il peut gérer une zone externe et exécuter un processus externe. +A plug-in usually contains a set of routines given to the 4D Developer. It can handle an External Area and run an external process. -- Une **routine de plug-in** est une routine écrite en langage natif (généralement C ou C ++) qui déclenche une action. -- Une **zone externe** est une partie d'un formulaire pouvant presque tout afficher et interagir avec l'utilisateur si nécessaire. -- Un **processus externe** est un processus qui s'exécute seul, généralement en boucle, et qui fait quasiment tout ce qu'il souhaite. Tout le code de process appartient au plug-in, 4D est simplement présent pour recevoir/envoyer des événements au process. +- A **plug-in routine** is a routine written in native language (usually C or C++) that causes an action. +- An **external area** is a part of a form that can display almost everything and interact with the user when necessary. +- An **external process** is a process that runs alone, usually in a loop, doing almost everything it wants. All process code belongs to the plug-in, 4D is simply present to receive/send events to the process. -### Note importante +### Important note -Un plug-in peut être très simple, avec une seule routine effectuant une très petite tâche, ou très complexe, impliquant une centaine de routines et de domaines. Cependant, chaque développeur de plug-in doit se rappeler qu'un plug-in est un "échantillon" de code. C'est le plug-in qui s'exécute dans 4D, et non l'inverse. En tant que morceau de code, c'est l'hôte de 4D; ce n'est pas une application autonome. Il partage le temps CPU et la mémoire avec 4D et d'autres plug-ins. Il doit donc s'agir d'un code poli, qui utilise exactement ce qui est nécessaire à son fonctionnement. Par exemple, dans les longues boucles, un plug-in doit appeler `PA_Yield ()` pour donner du temps au planificateur 4D, à moins que sa tâche ne soit critique aussi bien pour lui que pour l'application. +A plug-in can be very simple, with just one routine performing a very small task, or it can be very complex, involving hundred of routines and areas. There is virtually no limit to what a plug-in can do, however every plug-in developer should remember that a plug-in is a "sample" piece of code. It is the plug-in that runs within 4D, not the opposite. As a piece of code, it is the host of 4D; it is not a stand-alone application. It shares CPU time and memory with 4D and other plug-ins, thus, it should be a polite code, using just what is necessary to run. For example, in long loops, a plug-in should call `PA_Yield()` to give time to the 4D scheduler unless its task is critical for both it and the application. -## Comment créer un plug-in ? +## How to create a plug-in? -Sur GitHub, 4D fournit un [**plug-in SDK**](https://github.com/4d/4D-Plugin-SDK) open source, contenant le plug-in API 4D et l'assistant de plug-in 4D : +4D provides on GitHub an open-source [**plug-in SDK**](https://github.com/4d/4D-Plugin-SDK), containing the 4D Plugin API and the 4D Plugin Wizard: -- le [**Plugin API de 4D**](https://github.com/4d/4D-Plugin-SDK/blob/master/4D%20Plugin%20API), écrit en C, ajoute plus de 400 fonctions qui vous aident à créer facilement vos propres plug-ins pour ajouter de nouvelles fonctionnalités à votre application 4D. Les fonctions du plug-in API de 4D gèrent toutes les interactions entre l'application 4D et votre plug-in. -- [**L'assistant de plug-in 4D**](https://github.com/4d/4D-Plugin-SDK/blob/master/4D%20Plugin%20Wizard) est un outil essentiel qui simplifie la tâche de développement des plug-ins 4D. Il écrit le code dont 4D a besoin pour interagir correctement avec un plug-in et le charger, afin de vous concentrer sur votre propre code. +- the [**4D Plugin API**](https://github.com/4d/4D-Plugin-SDK/blob/master/4D%20Plugin%20API), written in C, adds more than 400 functions that help you to easily create your own plug-ins to add new functionnalities to your 4D application. 4D Plug-in API functions manage all the interactions between the 4D application and your plug-in. +- The [**4D Plugin Wizard**](https://github.com/4d/4D-Plugin-SDK/blob/master/4D%20Plugin%20Wizard) is an essential tool that simplifies the task of developing 4D plug-ins. It writes the code 4D needs to correctly load and interact with a plug-in, allowing you to concentrate on your own code. -## Comment installer un plug-in? +## How to install a plug-in? -L’installation des plug-ins et composants dans l’environnement 4D s’effectue par simple copie des fichiers des plug-ins ou des composants dans des dossiers appropriés. +You install plug-ins in the 4D environment by copying their files into the appropriate folder. -Les dossiers “NomPlugin.bundle” (appelés paquets ou packages sous Mac Os) contiennent à la fois les versions Windows et Mac Os des plug-ins 4D. Leur architecture interne spécifique permet notamment à 4D Server de charger la version adéquate en fonction de la plate-forme d’exécution du poste client. Pour installer un plug-in dans votre environnement, il vous suffit de placer le dossier ou progiciel “NomPlugin.bundle” concerné dans le dossier **Plugins** souhaité. +“PluginName.bundle” folders contain both Windows and macOS versions of 4D plug-ins. Their specific internal architecture lets 4D Server load the appropriate version according to the platform where the client machine will be run. To install a plug-in in your environment, you just need to put the “PluginName.bundle” folder or package concerned into the desired **Plugins** folder. -Vous pouvez placer les dossiers Plugins et Components à deux endroits : +You can put the Plugins folder in two different places: -- Au niveau de l’application 4D exécutable, c'est-à-dire .: - - Sous Windows : à côté du fichier .exe +- At the level of the 4D executable application, i.e.: + - Under Windows: next to the .exe file - Under macOS: at the first level of the Contents folder inside the application package. In this case, plug-ins are available in every project opened by this application. -- At the same level as the Project folder. Dans ce cas, les plug-ins et les composants sont disponibles dans cette application uniquement. +- At the same level as the Project folder. In this case, plug-ins are only available in this particular project. -Le choix de l’emplacement dépend de votre mode d’utilisation du plug-in ou du composant. +The choice of location depends on how you want to use the plug-in. -Si un même plug-in ou un même composant est placé aux deux endroits, 4D charge uniquement celui situé à côté de la structure. Dans le cas d’une application compilée et fusionnée avec 4D Volume Desktop, la présence de plusieurs instances d’un même plug-in ou d'un même composant empêchera l’ouverture de l’application. +If the same plug-in is placed in both locations, 4D will only load the one located next to the structure. In an application that is compiled and merged using 4D Volume Desktop, if there are several instances of the same plug-in present, this will prevent the application from opening. -Les plug-ins et les composants sont chargés par 4D lors du lancement de l’application. Vous devez donc quitter votre application 4D avant d’effectuer vos copies de fichiers ou dossiers. Ouvrez ensuite votre projet avec 4D. Si l’utilisation d'un plug-in nécessite une licence spécifique, le plug-in est chargé mais n’est pas actif. \ No newline at end of file +Plug-ins are loaded by 4D when the application is launched so you will need to quit your 4D application before installing them. Then open your project with 4D. If any plug-in requires a specific license for use, it will be loaded but not available for use. \ No newline at end of file diff --git a/website/translated_docs/fr/Concepts/quick-tour.md b/website/translated_docs/fr/Concepts/quick-tour.md index c07250a783c6e9..c3acc07f7b0508 100644 --- a/website/translated_docs/fr/Concepts/quick-tour.md +++ b/website/translated_docs/fr/Concepts/quick-tour.md @@ -4,39 +4,39 @@ title: Tour d'horizon sidebar_label: Tour d'horizon --- -En utilisant le langage 4D, le traditionnel "Hello, world!" peut s'afficher à l'écran de plusieurs manières. Le plus simple est probablement d'écrire la ligne suivante dans une méthode de projet : +Using the 4D language, printing the traditional "Hello, world!" message on screen can be done in several ways. The most simple is probably to write the following single line in a project method: ```4d ALERT("Hello, World!") ``` -Ce code affichera une boîte de dialogue d'alerte standard contenant le message "Hello, World!" et un bouton OK. Pour exécuter le code, il vous suffit de cliquer sur le bouton d'exécution dans l'éditeur de méthode : +This code will display a platform-standard alert dialog box with the "Hello, World!" message, containing an OK button. To execute the code, you just need to click on the execution button in the Method editor: ![alt-text](assets/en/Concepts/helloworld.png) -Vous pouvez également associer ce code à un bouton de formulaire et exécuter le formulaire. Dans ce cas, en cliquant sur le bouton, vous afficherez la boîte de dialogue d'alerte. Dans tous les cas, vous venez d'exécuter votre première ligne de code 4D ! +Or, you could attach this code to a button in a form and execute the form, in which case clicking on the button would display the alert dialog box. In any cases, you have just executed your first line of 4D code! -## Assigner des valeurs +## Assigning Values -Vous pouvez donner des valeurs aux variables, aux champs, aux éléments de tableaux et/ou récupérer leur valeur. Donner une valeur à une variable s’appelle assigner une valeur (ou affecter une valeur) et s’effectue à l’aide de l’opérateur d’assignation (:=). L’opérateur d’assignation est également utilisé pour assigner des valeurs aux champs ou aux éléments de tableaux. +Data can be put into and copied out of variables, fields, array elements... Putting data into a variable is called assigning the data to the variable and is done with the assignment operator (:=). The assignment operator is also used to assign data to fields or array elements. ```4d -$MyNumber:=3 //assigne 3 à la variable MyNumber -[Products]Size:=$MyNumber //assigne la variable MyNumber au champ [Products]Size -arrDays{2}:="Mardi" //assigne la chaîne "Mardi" au 2ème élément arrDays -MyVar:=Length("Acme") //assigne le résultat de la fonction (4) à MyVar -$myDate:=!2018/01/21! //assigne une date littérale -$myHour:=?08:12:55? //assigne une heure littérale +$MyNumber:=3 //assigns 3 to MyNumber variable +[Products]Size:=$MyNumber //assigns MyNumber variable to [Products]Size field +arrDays{2}:="Tuesday" //assigns "Tuesday" string to the 2nd arrDays element +MyVar:=Length("Acme") //assigns the result of the function (4) to MyVar +$myDate:=!2018/01/21! //assigns a date literal +$myHour:=?08:12:55? //assigns a time literal ``` -Vous devez impérativement distinguer l'opérateur d'affectation := des autres opérateurs. Plutôt que de combiner des expressions dans une nouvelle expression, l'opérateur d'affectation copie la valeur de l'expression à droite de l'opérateur d'affectation dans la variable ou le champ situé à gauche de l'opérateur. +You MUST distinguish the assignment operator := from the other operators. Rather than combining expressions into a new one, the assignment operator copies the value of the expression to the right of the assignment operator into the variable or field to the left of the operator. -**Important :** Ne confondez pas l’opérateur d’assignation (:=) avec le signe égal (=). Un opérateur d'affectation différent (et non pas =) a été choisi délibérément pour éviter les problèmes et la confusion qui surviennent souvent avec == ou === dans d'autres langages de programmation. De telles erreurs sont souvent difficiles à reconnaître pour le compilateur et conduisent à un dépannage fastidieux. +**Important:** 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. ## Variables -Le langage 4D est fortement typé, bien qu'une certaine flexibilité soit autorisée dans de nombreux cas. You create a typed variable using the `var` keyword. Par exemple, pour créer une variable du type date, vous pouvez écrire : +The 4D language is strongly typed, although some flexibility is allowed in many cases. You create a typed variable using the `var` keyword. For example, to create a variable of the date type, you can write: ```4d var MyDate : Date @@ -50,23 +50,23 @@ var myPerson : cs.Person ``` -Even if it is usually not recommended, you can declare variables simply by using them; you do not necessarily need to formally define them. Par exemple, si vous voulez créer une variable qui contient la date du jour plus 30 jours, il vous suffit d’écrire dans 4D : +Even if it is usually not recommended, you can declare variables simply by using them; you do not necessarily need to formally define them. For example, if you want a variable that will hold the current date plus 30 days, you can write: ```4d MyOtherDate:=Current date+30 ``` -La ligne de code indique "MyOtherDate obtient la date actuelle plus 30 jours." This line declares the variable, assigns it with both the (temporary) date type and a content. A variable declared by assignment is interpreted as typeless, that is, it can be assigned with other types in other lines and then changes the type dynamically. A variable typed with `var` cannot change the type. In [compiled mode](interpreted.md) however, the type can never be changed, regardless of how the variable was declared. +The line of code reads “MyOtherDate gets the current date plus 30 days.” This line declares the variable, assigns it with both the (temporary) date type and a content. A variable declared by assignment is interpreted as typeless, that is, it can be assigned with other types in other lines and then changes the type dynamically. A variable typed with `var` cannot change the type. In [compiled mode](interpreted.md) however, the type can never be changed, regardless of how the variable was declared. -## Commandes +## Commands -Les commandes 4D sont des méthodes intégrées qui permettent d'effectuer une action. Toutes les commandes 4D, telles que `CREATE RECORD` ou `ALERT`, sont décrites dans le _Manuel Langage de 4D_, et sont regroupées par thème. Les commandes sont souvent utilisées avec des paramètres qui sont passés entre parenthèses () et séparés par des points-virgules (;). Exemple : +4D commands are built-in methods to perform an action. All 4D commands, such as `CREATE RECORD`, or `ALERT`, are described in the _4D Language Reference_ manual, grouped by theme. Commands are often used with parameters, which are passed in brackets () and separated by semicolons (;). Example: ```4d -COPY DOCUMENT("dossier1\\nom1";"dossier2\\" ; "nouveau") +COPY DOCUMENT("folder1\\name1";"folder2\\" ; "new") ``` -Certaines commandes sont reliées à des collections ou à des objets, auquel cas ce sont des méthodes nommées qui sont utilisées à l'aide de la notation en point. Par exemple: +Some commands are attached to collections or objects, in which case they are named methods and are used using the dot notation. For example: ```4d $c:=New collection(1;2;3;4;5) @@ -75,144 +75,143 @@ $nc:=$c.slice(0;3) //$nc=[1,2,3] $lastEmployee:=$employee.last() ``` -Vous pouvez utiliser des plug-ins ou des composants 4D qui ajoutent de nouvelles commandes à votre environnement de développement 4D. +You can use 4D plug-ins or 4D components that add new commands to your 4D development environment. -Il existe de nombreux plug-ins proposés par la communauté des utilisateurs de 4D ou des développeurs tiers. Par exemple, en utilisant les pages [4d-plugin-pdf-pages](https://github.com/miyako/4d-plugin-pdf-pages) sur macOS : +There are many plug-ins proposed by the 4D user community or 3rd-party developers on the market. For example, using the [4d-plugin-pdf-pages](https://github.com/miyako/4d-plugin-pdf-pages) on macOS: ```4d PDF REMOVE PAGE(path;page) ``` -4D SVG est un exemple de composant utilitaire qui augmente les capacités de votre application : +4D SVG is an example of a utility component extending the capabilities of your application: ```4d -//faire un dessin +//drawing a picture svgRef:=SVG_New objectRef:=SVG_New_arc(svgRef;100;100;90;90;180) ``` -4D SVG est inclus dans 4D. +4D SVG is included in 4D. -## Constantes +## Constants -4D propose un large ensemble de constantes prédéfinies, dont les valeurs sont accessibles par un nom. Par exemple, `XML DATA` est une constante (valeur 6). Par défaut, les constantes prédéfinies sont soulignées dans l'éditeur de méthodes 4D. Elles permettent d'écrire un code plus lisible. +4D proposes an extensed set of predefined constants, whose values are accessible by name. For example, `Read Mode` is a constant (value 2). Predefined constants appear underlined by default in the 4D Method editor. They allow writing more readable code. ```4d -vRef:=Open document("PassFile";"TEXTE";Read Mode) // ouvrir le doc en mode lecture seule +vRef:=Open document("PassFile";"TEXT";Read Mode) // open doc in read only mode ``` ## Méthodes -4D propose un grand nombre de méthodes (ou de commandes) intégrées, mais vous permet également de créer vos propres **méthodes de projet**. Les méthodes de projet sont des méthodes définies par l'utilisateur qui contiennent des commandes, des opérateurs et d'autres parties du langage. Les méthodes projet sont des méthodes génériques, mais il existe d'autres types de méthodes : les méthodes objet, les méthodes formulaire, les méthodes table (Triggers) et les méthodes base. +4D provides a large number of built-in methods (or commands) but also lets you can create your own **project methods**. Project methods are user-defined methods that contain commands, operators, and other parts of the language. Project methods are generic methods, but there are other kinds of methods: Object methods, Form methods, Table methods (Triggers), and Database methods. -Une méthode est composée de plusieurs lignes d’instructions. Une ligne d’instructions effectue une action. Cette ligne d’instruction peut être simple ou complexe. +A method is composed of statements; each statement consists of one line in the method. A statement performs an action, and may be simple or complex. -Par exemple, la ligne de code suivante est une instruction qui affichera une boîte de dialogue de confirmation : +For example, the following line is a statement that will display a confirmation dialog box: ```4d -CONFIRM("Souhaitez-vous vraiment clore ce compte ?";"Oui";"Non") +CONFIRM("Do you really want to close this account?";"Yes";"No") ``` -Une méthode contient également des testes et des boucles qui gèrent le flux d'exécution. Les méthodes 4D prennent en charge les structures `If...Else...End if` et `Case of...Else...End case` ainsi que les boucles : `While...End while`, `Repeat...Until`, `For...End for`, et `For each...End for each`: +A method also contains tests and loops that control the flow of the execution. 4D methods support `If...Else...End if` and `Case of...Else...End case` branching structures as well as looping structures: `While...End while`, `Repeat...Until`, `For...End for`, and `For each...End for each`: -L'exemple suivant permet d'examiner chaque caractère du texte vtSomeText : +The following example goes through all the characters of the text vtSomeText: ```4d For($vlChar;1;Length(vtSomeText)) - //Faire quelque chose avec le caractère s'il s'agit d'une tabulation + //Do something with the character if it is a TAB If(Character code(vtSomeText[[$vlChar]])=Tab) //... End if End for ``` -Une méthode projet peut en appeler une autre avec ou sans les paramètres (arguments). Les paramètres sont passés à la méthode entre parenthèses, à la suite du nom de la méthode. Chaque paramètre est séparé par des points virgule (;). Les paramètres sont passés à la méthode appelée en tant que variables locales numérotées séquentiellement : $1, $2,…, $n. Une méthode peut retourner une seule valeur dans le paramètre $0. Lorsque vous appelez une méthode, vous saisissez simplement son nom : +A project method can call another project method with or without parameters (arguments). The parameters are passed to the method in parentheses, following the name of the method. Each parameter is separated from the next by a semicolon (;). The parameters are available within the called method as consecutively numbered local variables: $1, $2,…, $n. A method can return a single value in the $0 parameter. When you call a method, you just type its name: ```4d $myText:="hello" -$myText:=Do_Something($myText) //Appelle la méthode Do_Something +$myText:=Do_Something($myText) //Call the Do_Something method ALERT($myText) //"HELLO" - //Voici le code de la méthode Do_Something + //Here the code of the method Do_Something $0:=Uppercase($1) ``` -## Types de données +## Data Types -De nombreux types de données peuvent être manipulés via le langage 4D. Il existe des types de données élémentaires (chaîne, numérique, date, heure, booléen, image, pointeur, tableau), ainsi que des types de données composites (BLOBs, objets, collections). +In the language, the various types of data that can be handled are referred to as data types. There are basic data types (string, numeric, date, time, Boolean, picture, pointers, arrays), and also composite data types (BLOBs, objects, collections). -A noter que les données de type chaîne et numérique peuvent être associées à plusieurs types de champ. Lorsque des données sont placées dans un champ, le langage les convertit automatiquement dans le type du champ. Par exemple, si un champ de type entier est utilisé, les valeurs qu’il contient sont automatiquement traitées en tant que numériques. En d’autres termes, vous n’avez pas à vous préoccuper du mélange de champs de types semblables lorsque vous programmez avec 4D ; le langage le gère pour vous. +Note that string and numeric data types can be associated with more than one type of field. When data is put into a field, the language automatically converts the data to the correct type for the field. For example, if an integer field is used, its data is automatically treated as numeric. In other words, you need not worry about mixing similar field types when using the language; it will manage them for you. -Cependant, il est important, lorsque vous utilisez le langage, de ne pas mélanger les différents types de données. Tout comme il est absurde de stocker la valeur “ABC” dans un champ de type Date, il est absurde de donner la valeur “ABC” à une variable utilisée pour des dates. Dans la plupart des cas, 4D est très tolérant et tentera d’utiliser de manière logique ce que vous faites. Par exemple, si vous additionnez un nombre x et une date, 4D déduira que vous voulez ajouter x jours à la date, mais si vous tentez d’ajouter une chaîne à une date, 4D vous préviendra que cette opération est impossible. +However, when using the language it is important that you do not mix different data types. In the same way that it makes no sense to store “ABC” in a Date field, it makes no sense to put “ABC” in a variable used for dates. In most cases, 4D is very tolerant and will try to make sense of what you are doing. For example, if you add a number to a date, 4D will assume that you want to add that number of days to the date, but if you try to add a string to a date, 4D will tell you that the operation cannot work. -Certains cas nécessitent que vous stockiez des données dans un type et que vous les utilisiez dans un autre. Le langage contient un ensemble complet de commandes vous permettant de convertir des types de données en d’autres types. Par exemple, si vous voulez créer un numéro de matricule commençant par des chiffres et se terminant par des lettres, telles que "abc", vous pouvez écrire : vous pouvez écrire : +There are cases in which you need to store data as one type and use it as another type. The language contains a full complement of commands that let you convert from one data type to another. For example, you may need to create a part number that starts with a number and ends with characters such as “abc”. In this case, you might write: ```4d -[Produits]Matricule:=String(Numéro)+"abc" +[Products]Part Number:=String(Number)+"abc" ``` -Si _Numéro_ vaut 17, _[Produits]Matricule_ prendra la valeur “17abc”. +If _Number_ is 17, then _[Products]Part Number_ will get the string “17abc”. -Les types de données sont détaillés dans la section [Types de données](Concepts/data-types.md). +The data types are fully defined in the section [Data Types](Concepts/data-types.md). -## Objets et collections +## Objects and collections -Vous pouvez gérer les objets et collections du langage 4D à l'aide de la notation objet pour lire ou définir leurs valeurs. Par exemple: +You can handle 4D language objects and collections using the object notation to get or to set their values. For example: ```4d employee.name:="Smith" ``` -Vous pouvez également utiliser de crochets, comme dans l'exemple ci-dessous : +You can also use a string within square brackets, for example: ```4d -$vName:=employee["nom"] +$vName:=employee["name"] ``` -Comme la valeur d'une propriété d'objet peut elle-même être un objet ou une collection, la notation objet requiert une séquence de symboles pour accéder aux sous-propriétés, par exemple : +Since an object property value can be an object or a collection, object notation accepts a sequence of symbols to access sub-properties, for example: ```4d $vAge:=employee.children[2].age ``` -A noter que si la valeur de la propriété de l'objet est un objet qui encapsule une méthode (une formule), vous devez ajouter des parenthèses () au nom de la propriété pour exécuter la méthode : +Note that if the object property value is an object that encapsulates a method (a formula), you need to add parenthesis () to the property name to execute the method: ``` $f:=New object $f.message:=New formula(ALERT("Hello world!")) -$f.message() //affiche "Hello world!" -$f.message() //affiche "Hello world!" +$f.message() //displays "Hello world!" ``` -Pour accéder à un élément de collection, vous devez passer le numéro de l'élément situé entre crochets : +To access a collection element, you have to pass the element number embedded in square brackets: ```4d C_COLLECTION(myColl) myColl:=New collection("A";"B";1;2;Current time) -myColl[3] //accède au 4ème élément de la collection +myColl[3] //access to 4th element of the collection ``` ## Classes -Le langage 4D prend en charge les classes d'objets. Ajoutez un fichier `myClass.4dm` dans le dossier Project/Sources/Classes d'un projet pour créer une classe nommée "myClass". +The 4D language supports object classes. Add a `myClass.4dm` file in the Project/Sources/Classes folder of a project to create a class named "myClass". -To instantiate an object of the class in a method, call the user class from the *class store* (`cs`) and use the `new()` member function. Vous pouvez passer des paramètres. +To instantiate an object of the class in a method, call the user class from the *class store* (`cs`) and use the `new()` member function. You can pass parameters. ```4d -// dans une méthode 4D +// in a 4D method $o:=cs.myClass.new() ``` -In the `myClass` class method, use the `Function ` statement to define the *methodName* class member method. Une méthode membre de classe peut recevoir et retourner des paramètres comme n'importe quelle méthode, et utiliser `This` comme instance d'objet. +In the `myClass` class method, use the `Function ` statement to define the *methodName* class member method. A class member method can receive and return parameters like any method, and use `This` as the object instance. ```4d -// dans le fichier myClass.4dm -Fonction bonjour - C_TEXT (0 $) - $0: = "Hello" + This.who +//in the myClass.4dm file +Function hello + C_TEXT($0) + $0:="Hello "+This.who ``` -Pour exécuter une méthode membre de classe, utilisez simplement l'opérateur `()` sur la méthode membre de l'instance d'objet. +To execute a class member method, just use the `()` operator on the member method of the object instance. ```4d $o:=cs.myClass.new() @@ -232,7 +231,7 @@ This.width:=$2 This.name:="Rectangle" ``` -A class can extend another class by using `Class extends `. Superclasses can be called using the `Super` command. Par exemple: +A class can extend another class by using `Class extends `. Superclasses can be called using the `Super` command. For example: ```4d //in the Square.4dm file @@ -249,141 +248,141 @@ This.name:="Square" ``` -## Opérateurs -Lorsque vous programmez avec 4D, il est rare que vous ayez simplement besoin de données “brutes”. Le plus souvent, il sera nécessaire de traiter ces données d'une manière ou d'une autre. Vous effectuez ces calculs avec des opérateurs. Les opérateurs, en général, prennent deux valeurs et effectuent avec elles une opération dont le résultat est une troisième valeur. Vous connaissez déjà la plupart des opérateurs. Par exemple, 1 + 2 utilise l’opérateur d’addition (ou signe plus) pour faire la somme de deux nombres, et le résultat est 3. Le tableau ci-dessous présente quelques opérateurs courants : +## Operators +When you use the language, it is rare that you will simply want a piece of data. It is more likely that you will want to do something to or with that data. You perform such calculations with operators. Operators, in general, take two pieces of data and perform an operation on them that results in a new piece of data. You are already familiar with many operators. For example, 1 + 2 uses the addition (or plus sign) operator to add two numbers together, and the result is 3. This table shows some familiar numeric operators: -| Opérateur | Opération | Exemple | -| --------- | -------------- | --------- | -| + | Addition | 1 +2 = 3 | -| – | Soustraction | 3 - 2 = 1 | -| * | Multiplication | 2 * 3 = 6 | -| / | Division | 6 / 2 = 3 | +| Operator | Operation | Example | +| -------- | -------------- | ------------------ | +| + | Addition | 1 + 2 results in 3 | +| – | Subtraction | 3 – 2 results in 1 | +| * | Multiplication | 2 * 3 results in 6 | +| / | Division | 6 / 2 results in 3 | -Les opérateurs numériques ne représentent qu’un seul des différents types d’opérateurs disponibles. Comme 4D traite de multiples types de données, tels que des nombres, des dates ou des images, vous disposez d’opérateurs particuliers effectuant des opérations sur ces données. +Numeric operators are just one type of operator available to you. 4D supports many different types of data, such as numbers, text, dates, and pictures, so there are operators that perform operations on these different data types. -Souvent, les mêmes symboles sont utilisés pour des opérations différentes, en fonction du type de données traitées. Par exemple, le signe (+) peut effectuer diverses opérations, comme le montre le tableau suivant : +The same symbols are often used for different operations, depending on the data type. For example, the plus sign (+) performs different operations with different data: -| Type de données | Opération | Exemple | -| ----------------- | ---------------- | --------------------------------------------------------------------------------------------------- | -| Nombre | Addition | 1 + 2 ajoute les nombres, le résultat est 3 | -| Chaine | Concaténation | “Bonjour” + “à tous” concatène (met bout à bout) les chaînes, le résultat est “Bonjour à tous” | -| Date et Numérique | Addition de date | !1989-01-01! + 20 ajoute 20 jours à la date 1 janvier 1989, le résultat est la date 21 janvier 1989 | +| Data Type | Operation | Example | +| --------------- | ------------- | ---------------------------------------------------------------------------------------------------- | +| Number | Addition | 1 + 2 adds the numbers and results in 3 | +| Chaine | Concatenation | “Hello ” + “there” concatenates (joins together) the strings and results in “Hello there” | +| Date and Number | Date addition | !1989-01-01! + 20 adds 20 days to the date January 1, 1989, and results in the date January 21, 1989 | ## Expressions -Pour parler simplement, les expressions retournent une valeur. En fait, lorsque vous programmez avec 4D, vous utilisez systématiquement des expressions et avez tendance à les manipuler uniquement à travers la valeur qu’elles représentent. Les expressions sont aussi appelées formules. - -Les expressions peuvent être constituées de presque tous les éléments du langage : commandes, opérateurs, variables, champs, propriétés d'objets et éléments de collection. Vous utilisez des expressions pour écrire des lignes de code, qui sont à leur tour utilisées pour construire des méthodes. Des expressions sont employées à chaque fois que le langage 4D a besoin de connaître la valeur d’une donnée. - -Les expressions sont rarement «autonomes». Il existe plusieurs endroits dans 4D où une expression peut être utilisée seule. Par exemple : - -- Editeur de formule (apply formula, query with formula, order by formula) -- La commande `EXECUTE FORMULA` -- La liste de propriétés, où une expression peut être utilisée en tant que source de données pour la plupart des widgets -- Dans la fenêtre du Débogueur où la valeur des expressions peut être évaluée -- Dans l’éditeur d’états semi-automatiques en tant que formule dans une colonne - - -### Types d’expressions -Vous vous référez à une expression via le type de données qu’elle retourne. Il existe plusieurs types d’expressions : Il existe plusieurs types d’expressions : Le tableau suivant fournit des exemples de chaque type d'expression. - -| Expression | Type | Description | -| ----------------------- | --------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| “Bonjour” | Chaine | Le mot Bonjour est une constante chaîne, signalée par les guillemets. | -| “Bonjour ” + “à tous” | Chaine | Deux chaînes, “Bonjour ” et “à tous”, sont mises bout à bout (concaténées) à l'aide de l'opérateur de concaténation de chaînes (+). La chaîne “Bonjour à tous” est retournée. | -| “Mr. ” + [Personnes]Nom | Chaine | Deux chaînes sont concaténées : la chaîne "Mr." et la valeur courante du champ Nom dans la table Personnes. Si le champ contient “Dupont”, l'expression retourne “M. Dupont”. | -| Uppercase("smith") | Chaine | Cette expression utilise `Uppercase`, une commande du langage, pour convertir la chaîne "dupont" en majuscules. Elle retourne “DUPONT”. | -| 4 | Nombre | C'est une constante numérique, 4. | -| 4 * 2 | Nombre | Deux nombres, 4 et 2, sont multipliés à l'aide de l'opérateur de multiplication (*). Le résultat est le nombre 8. | -| MonBouton | Nombre | C'est le nom d'un bouton. Il retourne la valeur courante du bouton : 1 s'il y a eu un clic sur le bouton, 0 sinon. | -| !1997-01-25! | Date | C'est une constante date pour la date 25/01/97 (25 janvier 1997). | -| Current date+ 30 | Date | C'est une expression de type Date qui utilise la commande `Current date` pour récupérer la date courante. Elle ajoute 30 jours à la date d'aujourd'hui et retourne la nouvelle date. | -| ?8:05:30? | Heure | C'est une constante heure qui représente 8 heures, 5 minutes, et 30 secondes. | -| ?2:03:04? + ?1:02:03? | Heure | Cette expression ajoute une heure à une autre et retourne l'heure 3:05:07. | -| Vrai | Booléen | Cette commande retourne la valeur booléenne TRUE. | -| 10 # 20 | Booléen | C'est une comparaison logique entre deux nombres. Le symbole (#) signifie “est différent de”. Comme 10 “est différent de” 20, l'expression retourne TRUE. | -| “ABC” = “XYZ” | Booléen | C'est une comparaison logique entre deux chaînes. Elles sont différentes, donc l'expression retourne FALSE. | -| MonImage + 50 | Image | Cette expression considère l'image placée dans MonImage, la déplace de 50 pixels vers la droite, et retourne l'image résultante. | -| ->[Personnes]Nom | Pointeur | Cette expression retourne un pointeur vers le champ [Amis]Nom. | -| Table(1) | Pointeur | C'est une commande qui retourne un pointeur vers la première table. | -| JSON Parse (MaChaine) | Objet | C'est une commande qui retourne MaChaine sous forme d'objet (si format adéquat) | -| JSON Parse (MonTabJSON) | Collection | C'est une commande qui retourne MonTabJSON sous forme de collection (si format adéquat) | -| Form.pageNumber | Propriété objet | Une propriété objet est une expression qui peut être de tout type | -| Col[5] | Élément de collection | Un élément de collection est une expression qui peut être de tout type | -| $entitySel[0] | Entity | Un élément d'une sélection d'entité ORDA est une expression de type entité. Ce type d'expression n'est **pas affectable** | - -### Expressions assignables et non-assignables - -Une expression peut simplement être une constante littérale, telle que le chiffre 4 ou la chaîne "Hello", ou une variable telle que `$myButton`. Elle peut également utiliser des opérateurs. Par exemple, 4 + 2 est une expression qui utilise l'opérateur d'addition pour additionner deux nombres et renvoyer le résultat 6. Dans tous les cas, ces expressions sont **non-assignables**, ce qui signifie que vous ne pouvez pas leur affecter de valeur. Dans 4D, les expressions peuvent être **assignables**. Une expression est assignable quand elle peut être utilisée à droite d'une assignation. Par exemple: +Simply put, expressions return a value. In fact, when using the 4D language, you use expressions all the time and tend to think of them only in terms of the value they represent. Expressions are also sometimes referred to as formulas. + +Expressions are made up of almost all the other parts of the language: commands, operators, variables, fields, object properties, and collection elements. You use expressions to build statements (lines of code), which in turn are used to build methods. The language uses expressions wherever it needs a piece of data. + +Expressions rarely “stand alone.” There are several places in 4D where an expression can be used by itself. It includes: + +- Formula editor (apply formula, query with formula, order by formula) +- The `EXECUTE FORMULA` command +- The Property list, where an expression can be used as a data source for most of widgets +- Debugger where the value of expressions can be checked +- Quick Report editor as a formula for a column + + +### Expression types +You refer to an expression by the data type it returns. There are several expression types. The following table gives examples of each type of expression. + +| Expression | Type | Description | +| ------------------------ | ------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| “Hello” | Chaine | The word Hello is a string constant, indicated by the double quotation marks. | +| “Hello ” + “there” | Chaine | Two strings, “Hello ” and “there”, are added together (concatenated) with the string concatenation operator (+). The string “Hello there” is returned. | +| “Mr. ” + [People]Name | Chaine | Two strings are concatenated: the string “Mr. ” and the current value of the Name field in the People table. If the field contains “Smith”, the expression returns “Mr. Smith”. | +| Uppercase("smith") | Chaine | This expression uses `Uppercase`, a command from the language, to convert the string “smith” to uppercase. It returns “SMITH”. | +| 4 | Number | This is a number constant, 4. | +| 4 * 2 | Number | Two numbers, 4 and 2, are multiplied using the multiplication operator (*). The result is the number 8. | +| myButton | Number | This is a variable associated to a button. It returns the current value of the button: 1 if it was clicked, 0 if not. | +| !1997-01-25! | Date | This is a date constant for the date 1/25/97 (January 25, 1997). | +| Current date+ 30 | Date | This is a date expression that uses the `Current date` command to get today’s date. It adds 30 days to today’s date and returns the new date. | +| ?8:05:30? | Heure | This is a time constant that represents 8 hours, 5 minutes, and 30 seconds. | +| ?2:03:04? + ?1:02:03? | Heure | This expression adds two times together and returns the time 3:05:07. | +| True | Booléen | This command returns the Boolean value TRUE. | +| 10 # 20 | Booléen | This is a logical comparison between two numbers. The number sign (#) means “is not equal to”. Since 10 “is not equal to” 20, the expression returns TRUE. | +| “ABC” = “XYZ” | Booléen | This is a logical comparison between two strings. They are not equal, so the expression returns FALSE. | +| My Picture + 50 | Image | This expression takes the picture in My Picture, moves it 50 pixels to the right, and returns the resulting picture. | +| ->[People]Name | Pointeur | This expression returns a pointer to the field called [People]Name. | +| Table (1) | Pointeur | This is a command that returns a pointer to the first table. | +| JSON Parse (MyString) | Objet | This is a command that returns MyString as an object (if proper format) | +| JSON Parse (MyJSONArray) | Collection | This is a command that returns MyJSONArray as a collection (if proper format) | +| Form.pageNumber | Object property | An object property is an expression that can be of any supported type | +| Col[5] | Collection element | A collection element is an expression that can be of any supported type | +| $entitySel[0] | Entity | A element of an ORDA entity selection is an expression of the entity type. This kind of expression is **non-assignable** | + +### Assignable vs non-assignable expressions + +An expression can simply be a literal constant, such as the number 4 or the string "Hello", or a variable like `$myButton`. It can also use operators. For example, 4 + 2 is an expression that uses the addition operator to add two numbers together and return the result 6. In any cases, these expressions are **non-assignable**, which means that you cannot assign a value to them. In 4D, expressions can be **assignable**. An expression is assignable when it can be used on the right side of an assignation. For example: ```4d -//La variable $myVar est assignable, vous pouvez écrire : -$myVar:="Hello" //assigner "Hello" à myVar -//Form.pageNumber est assignable, vous pouvez écrire : -Form.pageNumber:=10 //assigne 10 à Form.pageNumber -//Form.pageTotal-Form.pageNumber n'est pas assignable : -Form.pageTotal- Form.pageNumber:=10 //erreur, non assignable +//$myVar variable is assignable, you can write: +$myVar:="Hello" //assign "Hello" to myVar +//Form.pageNumber is assignable, you can write: +Form.pageNumber:=10 //assign 10 to Form.pageNumber +//Form.pageTotal-Form.pageNumber is not assignable: +Form.pageTotal- Form.pageNumber:=10 //error, non-assignable ``` -En général, les expressions qui utilisent un opérateur ne sont pas assignables. Par exemple, `[Personne] Prénom " " +[Personne]Nom` n'est pas assignable. +In general, expressions that use an operator are non-assignable. For example, `[Person]FirstName+" "+[Person]LastName` is not assignable. -## Pointeurs +## Pointers -Le langage 4D fournit une mise en oeuvre avancée des pointeurs, pour vous permettre d'écrire un code puissant et modulaire. Vous pouvez utiliser des pointeurs pour référencer des tables, des champs, des variables, des tableaux et des éléments de tableaux. +The 4D language provides an advanced implementation of pointers, that allow writing powerful and modular code. You can use pointers to reference tables, fields, variables, arrays, and array elements. -Un pointeur sur un élément est créé en ajoutant un symbole "->" avant le nom de l'élément, et peut être déréférencé en ajoutant le symbole "->" après le nom du pointeur. +A pointer to an element is created by adding a "->" symbol before the element name, and can be dereferenced by adding the "->" symbol after the pointer name. ```4d -MaVar:="Bonjour" -MonPointeur->->MaVar -ALERT(MonPointeur->) +MyVar:="Hello" +MyPointer:=->MyVar +ALERT(MyPointer->) ``` -## Commentaires +## Comments -Les commentaires sont des lignes d’instructions inactives. Ces lignes ne sont pas interprétées par le programme (4D n’applique aucun style spécifique à l’intérieur de la ligne de commentaire) et ne sont pas exécutées lorsque la méthode est appelée. +Comments are inactive lines of code. These lines are not interpreted by the 4D language and are not executed when the code is called. -Voici deux manières de créer des commentaires : +There are two ways to create comments: -- `//` pour créer une ligne de commentaire -- `/*...*/` pour les blocs de commentaire en ligne et multi-lignes. +- `//` for single line comments +- `/*...*/` for inline or multiline commnents. -Les deux styles de commentaires peuvent être utilisés simultanément. +Both styles of comments can be used simultaneously. -#### Ligne de commentaire (//) +#### Single line comments (//) -Insérez les caractères `//` au début de la ligne ou après une instruction pour ajouter une ligne de commentaire. Exemple : +Insert `//` at the beginning of a line or after a statement to add a single line comment. Example: ```4d -//Ceci est un commentaire -For($vCounter;1;100) //Début de la boucle - //commentaire - //commentaire - //commentaire - End for +//This is a comment +For($vCounter;1;100) //Starting loop + //comment + //comment + //comment + End for ``` -#### Commentaires en ligne ou multi-lignes (/* */) +#### Inline or multiline comments (/* */) -Entourez le contenu avec des caractères `/*` ... `*/` pour créer des commentaires en ligne ou des blocs de commentaires multilignes. Les blocs de commentaire en ligne et multi-lignes commencent par `/*` et se terminent par `*/`. +Surround contents with `/*` ... `*/` characters to create inline comments or multiline comment blocks. Both inline and multiline comment blocks begin with `/*` and end with `*/`. -- Les **lignes de commentaires en ligne** - peuvent être insérées n'importe où dans le code. Exemple : +- **Inline comments** can be inserted anywhere in the code. Example: ```4d -For /* ligne de commentaire */ ($vCounter;1;100) +For /* inline comment */ ($vCounter;1;100) ... End for ``` -- Les **blocs de commentaires multi-lignes** permettent de commenter un nombre illimité de lignes. Les blocs de commentaires peuvent être imbriqués (ce qui est utile, étant donné que l'éditeur de code 4D prend en charge les blocs condensés). Exemple : +- **Multiline comment blocks** allows commenting an unlimited number of lines. Comment blocks can be nested (useful since the 4D code editor supports block collapsing). Example: ```4d For ($vCounter;1;100) /* -commentaires +comments /* - autres commentaires + other comments */ */ ... diff --git a/website/translated_docs/fr/Concepts/shared.md b/website/translated_docs/fr/Concepts/shared.md index 0a07505b522a19..008190fa8848c3 100644 --- a/website/translated_docs/fr/Concepts/shared.md +++ b/website/translated_docs/fr/Concepts/shared.md @@ -3,100 +3,100 @@ id: shared title: Objets et collections partagés --- -**Les objets partagés** et **les collections partagées** sont des [objets](Concepts/dt_object.md) et des [collections](Concepts/dt_collection.md) spécifiques dont le contenu est partagé entre les process. Comparés aux [Variables interprocess](Concepts/variables.md#interprocess-variables), les objets partagés et les collections partagées ont l'avantage d'être compatibles avec les **Process 4D préemptifs** : il peuvent être passés en paramètres (par référence) aux commandes telles que `New process` ou `CALL WORKER`. +**Shared objects** and **shared collections** are specific [objects](Concepts/dt_object.md) and [collections](Concepts/dt_collection.md) whose contents are shared between processes. In contrast to [interprocess variables](Concepts/variables.md#interprocess-variables), shared objects and shared collections have the advantage of being compatible with **preemptive 4D processes**: they can be passed by reference as parameters to commands such as `New process` or `CALL WORKER`. -Les objets partagés et les collections partagées peuvent être stockés dans des variables déclarées à l'aide des commandes standard `C_OBJECT` et `C_COLLECTION`, mais doivent être instanciées à l'aide de commandes spécifiques : +Shared objects and shared collections can be stored in variables declared with standard `C_OBJECT` and `C_COLLECTION` commands, but must be instantiated using specific commands: -- pour créer un objet partagé, utilisez la commande `New shared object`, -- pour créer une collection partagée, utilisez la commande `New shared collection`. +- to create a shared object, use the `New shared object` command, +- to create a shared collection, use the `New shared collection` command. -**Note :** Des objets partagés et des collections partagées peuvent être définis comme propriétés d'objets/éléments de collections standard (non partagés). +**Note:** Shared objects and collections can be set as properties of standard (not shared) objects or collections. -Toute modification d'un objet/d'une collection partagé(e) doit s'effectuer à l'intérieur d'une structure **Utiliser...Fin utiliser**. La lecture d'une valeur d'objet/collection ne nécessite pas de structure **Utiliser...Fin utiliser**. +In order to modify a shared object/collection, the **Use...End use** structure must be called. Reading a shared object/collection value does not require **Use...End use**. -Un catalogue unique et global, retourné par la commande `Storage`, est disponible à tout moment et depuis tout process de l'application et de ses composants. +A unique, global catalog returned by the `Storage` command is always available throughout the application and its components, and can be used to store all shared objects and collections. -## Utilisation des objets et collections partagés +## Using shared objects or collections -Une fois instanciés à l'aide des commandes `Creer objet partage` ou `Creer collection partagee`, les objets partagés et les collections partagées peuvent être modifiés et lus depuis n'importe quel process. +Once instantiated with the `New shared object` or `New shared collection` commands, shared object/collection properties and elements can be modified or read from any process of the application. ### Modification -Les modifications suivantes peuvent être effectuées sur les objets partagés et les collections partagées : +Modifications can be applied to shared objects and shared collections: -- ajout ou suppression de propriétés d'objets, -- ajout ou modification de valeurs (prises en charge par les objets/collections partagé(e) s), y compris d'autres objets et collections partagé(s) (ce qui crée un groupe partagé, cf. ci-dessous). +- adding or removing object properties, +- adding or editing values (provided they are supported in shared objects), including other shared objects or collections (which creates a shared group, see below). -Toute instruction de modification d'objet ou de collection partagé(e) doit être encadrée par les mots-clés `Use...End use`, sinon une erreur est générée. +However, all modification instructions in a shared object or collection must be surrounded by the `Use...End use` keywords, otherwise an error is generated. ```4d $s_obj:=New shared object("prop1";"alpha") Use($s_obj) $s_obj.prop1:="omega" -End Use + End Use ``` -Un objet/une collection partagé(e) ne peut être modifié(e) que par un seul process à la fois. `Use` locks the shared object/collection from other threads, while `End use` unlocks the shared object/collection (if the locking counter is at 0, see below). . Toute tentative de modification d'un objet/d'une collection partagé(e) sans au moins un appel à `Use...End use` génère une erreur. Lorsqu'un process appelle `Use...End use` avec un objet/une collection partagé(e) qui est déjà "utilisé(e)" par un autre process, il est simplement mis en attente jusqu'à ce qu'il soit déverrouillé par l'appel à `End use` (aucune erreur n'est générée). En conséquence, les instructions situées à l'intérieur des structures `Use...End use` doivent toujours s'exécuter rapidement et déverrouiller les éléments dès que possible. Il est donc fortement déconseillé de modifier un objet ou une collection partagé(e) directement depuis l'interface, par exemple depuis une boîte de dialogue. +A shared object/collection can only be modified by one process at a time. `Use` locks the shared object/collection from other threads, while `End use` unlocks the shared object/collection (if the locking counter is at 0, see below). . Trying to modify a shared object/collection without at least one `Use...End use` generates an error. When a process calls `Use...End use` on a shared object/collection that is already in use by another process, it is simply put on hold until the `End use` unlocks it (no error is generated). Consequently, instructions within `Use...End use` structures should execute quickly and unlock the elements as soon as possible. Thus, it is strongly advised to avoid modifying a shared object or collection directly from the interface, e.g. through a dialog box. -L'assignation d'objets/collections partagé(e) s à des propriétés ou éléments d'autres objets/collections partagé(e) s est autorisée et entraîne la création de **groupes partagés**. Un groupe partagé est automatiquement créé lorsqu'un objet ou une collection partagé(e) est assigné(e) en tant que valeur de propriété ou élément à un autre objet ou collection partagé(e). Les groupes partagés permettent d'imbriquer des objets et collections partagé(e)s mais nécessitent d'observer des règles supplémentaires : +Assigning shared objects/collections to properties or elements of other shared objects/collections is allowed and creates **shared groups**. A shared group is automatically created when a shared object/collection is set as property value or element of another shared object/collection. Shared groups allow nesting shared objects and collections but enforce additional rules: - Calling `Use` on a shared object/collection belonging to a group locks properties/elements of all shared objects/collections of the group and increments its locking counter. Calling `End use` decrements the locking counter of the group and when the counter is at 0, all the linked shared objects/collections are unlocked. -- Un objet ou une collection partagé(e) peut appartenir à un seul groupe partagé. Une erreur est générée si vous tentez d'assigner un objet ou une collection appartenant déjà à un groupe à un groupe différent. -- Les objets/collections groupé(e) s ne peuvent plus être dégroupé(e) s. Une fois inclus dans un groupe partagé, un objet ou une collection partagé(e) est lié(e) définitivement au groupe pendant toute la durée de la session. Même si toutes les références de l'objet/la collection sont supprimé(e) s des objets/collections parent(e) s, ils resteront liés. +- A shared object/collection can only belong to one shared group. An error is returned if you try to set an already grouped shared object/collection to a different group. +- Grouped shared objects/collections cannot be ungrouped. Once included in a shared group, a shared object/collection is linked permanently to that group during the whole session. Even if all references of an object/collection are removed from the parent object/collection, they will remain linked. -Reportez-vous à l'exemple 2 pour l'illustration des règles des groupes partagés. +Please refer to example 2 for an illustration of shared group rules. -**Note :** Les groupes partagés sont gérés via une propriété interne nommée *locking identifier*. Si vous avez besoin de plus d'informations sur les mécanismes utilisés, reportez-vous au Guide du développeur de 4D. +**Note:** Shared groups are managed through an internal property named *locking identifier*. For detailed information on this value, please refer to the 4D Developer's guide. -### Lecture +### Read -La lecture de propriétés ou d'éléments d'un objet ou d'une collection partagé(e) est possible sans appel de la structure `Use...End use`, même si l'objet ou la collection partagé(e) est "utilisé(e)" par un autre process. +Reading properties or elements of a shared object/collection is allowed without having to call the `Use...End use` structure, even if the shared object/collection is in use by another process. -Cependant, lorsque plusieurs valeurs sont interdépendantes et doivent être lues simultanément, il est nécessaire d'encadrer l'accès en lecture par une structure `Use...End use` pour des raisons de cohérence. +However, it is necessary to read a shared object/collection within `Use...End use` when several values are linked together and must be read at once, for consistency reasons. ### Duplication -Appeler `OB Copier` avec un objet partagé (ou avec un objet dont des propriétés sont des objets partagés) est possible, mais dans ce cas un objet standard (non partagé) est retourné. +Calling `OB Copy` with a shared object (or with an object containing shared object(s) as properties) is possible, but will return a standard (not shared) object including its contained objects (if any). ### Storage -**Storage** est un objet partagé unique, disponible automatiquement pour chaque application et machine. Cet objet partagé est retourné par la commande `Storage`. Il est destiné à référencer les objets ou collections partagé(e)s défini(e)s durant la session que vous souhaitez rendre accessibles à tous les process, préemptifs ou standard. +**Storage** is a unique shared object, automatically available on each application and machine. This shared object is returned by the `Storage` command. You can use this object to reference all shared objects/collections defined during the session that you want to be available from any preemptive or standard processes. -A noter que, à la différence de objets partagés standard, l'objet `Storage` ne crée par de groupe partagé lorsque des objets/collection lui sont assigné(e) s en tant que propriétés. Cette exception permet à l'objet **Storage** d'être utilisé sans verrouiller les objets/collections partagé(e) s connecté(e) s. +Note that, unlike standard shared objects, the `storage` object does not create a shared group when shared objects/collections are added as its properties. This exception allows the **Storage** object to be used without locking all connected shared objects or collections. -Pour plus d'informations, reportez-vous à la description de la commande `Storage`. +For more information, refer to the `Storage` command description. -## Utiliser...Fin utiliser +## Use...End use -La syntaxe de la structure `Use...End use` est la suivante : +The formal syntax of the `Use...End use` structure is: ```4d Use(Shared_object_or_Shared_collection) - instruction(s) + statement(s) End use ``` -La structure `Use...End use` définit une séquence d'instructions qui exécutera des tâches sur le paramètre *Objet_partagé_ou_Collection_partagée* sous la protection d'un sémaphore interne. *Objet_partagé_ou_Collection_partagée* peut être tout objet partagé ou collection partagée valide. +The `Use...End use` structure defines a sequence of statements that will execute tasks on the *Shared_object_or_Shared_collection* parameter under the protection of an internal semaphore. *Shared_object_or_Shared_collection* can be any valid shared object or shared collection. -Les objets partagés et les collections partagées permettent d'établir des communications entre les process, en particulier les **Process 4D préemptifs**. Ils peuvent être passés par référence en paramètre d'un process à un autre. Pour plus de détails sur les objets partagés et les collections partagées, reportez-vous à la page **Objets et collections partagés**. Encadrer les modifications sur les objets partagés et les collections partagées à l'aide des mots-clés `Use...End use` est obligatoire pour empêcher les accès concurrents entre les process. +Shared objects and shared collections are designed to allow communication between processes, in particular, **preemptive 4D processes**. They can be passed by reference as parameters from a process to another one. For detailed information on shared objects or shared collections, refer to the **Shared objects and shared collections** page. Surrounding modifications on shared objects or shared collections by the `Use...End use` keywords is mandatory to prevent concurrent access between processes. -- Une fois que la ligne **Use/Utiliser** est exécutée avec succès, toutes les propriétés/éléments de _Objet_partagé_ou_Collection_partagée_ sont verrouillé(e) s en écriture pour tous les autres process jusqu'à ce que la ligne `End use/Fin` utiliser correspondante soit éxécutée. -- La séquence _d'instructions_ peut alors effectuer toute modification dans les propriétés/éléments de Objet_partagé_ou_Collection_partagée sans risque d'accès concurrent. -- Si un autre objet ou collection partagé(e) est ajouté(e) en tant que propriété du paramètre _Objet_partagé_ou_Collection_partagée_, il ou elle devient connecté(e) et appartiennent au même groupe partagé (cf.** Utilisation des objets et collections partagés**). -- Si un autre process tente d'accéder à une propriété de _Objet_partagé_ou_Collection_partagée_ ou une propriété connectée alors qu'une séquence **Utiliser...Fin** utiliser est en cours d'exécution sur le même Objet_partagé_ou_Collection_partagée, il est automatiquement placé en attente et attendra jusqu'à ce que la séquence courante soit terminée. +- Once the **Use** line is successfully executed, all _Shared_object_or_Shared_collection_ properties/elements are locked for all other process in write access until the corresponding `End use` line is executed. +- The _statement(s)_ sequence can execute any modification on the Shared_object_or_Shared_collection properties/elements without risk of concurrent access. +- If another shared object or collection is added as a property of the _Shared_object_or_Shared_collection_ parameter, they become connected within the same shared group (see **Using shared objects or collections**). +- If another process tries to access one of the _Shared_object_or_Shared_collection_ properties or connected properties while a **Use...End use** sequence is being executed, it is automatically put on hold and waits until the current sequence is terminated. - The **End use** line unlocks the _Shared_object_or_Shared_collection_ properties and all objects of the same group. -- Plusieurs structures **Utiliser...Fin** utiliser peuvent être imbriquées dans le code 4D. In the case of a group, each **Use** increments the locking counter of the group and each **End use** decrements it; all properties/elements will be released only when the last **End use** call sets the locking counter to 0. +- Several **Use...End use** structures can be nested in the 4D code. In the case of a group, each **Use** increments the locking counter of the group and each **End use** decrements it; all properties/elements will be released only when the last **End use** call sets the locking counter to 0. -**Note :** Si une fonction membre d'une collection modifie une collection partagée, un **Utiliser** interne est automatiquement mis en place pour cette collection partagée durant l'exécution de la fonction. +**Note:** If a collection method modifies a shared collection, an internal **Use** is automatically called for this shared collection while the function is executed. -## Exemple 1 +## Example 1 -Vous souhaitez lancer plusieurs process qui vont effectuer des tâches d'inventaire parmi différents produits et mettre à jour le même objet partagé. Le process principal instancie un objet partagé vide et ensuite lance les autres process, passant en paramètre l'objet partagé et les produits à comptabiliser : +You want to launch several processes that perform an inventory task on different products and update the same shared object. The main process instantiates an empty shared object and then, launches the other processes, passing the shared object and the products to count as parameters: ```4d ARRAY TEXT($_items;0) - ... //remplir le tableau avec les éléments à compter + ... //fill the array with items to count $nbItems:=Size of array($_items) C_OBJECT($inventory) $inventory:=New shared object @@ -104,59 +104,59 @@ Vous souhaitez lancer plusieurs process qui vont effectuer des tâches d'inventa $inventory.nbItems:=$nbItems End use - //Créer un process + //Create processes For($i;1;$nbItems) $ps:=New process("HowMany";0;"HowMany_"+$_items{$i};$_items{$i};$inventory) - // objet $inventory envoyé par référence + //$inventory object sent by reference End for ``` -Dans la méthode "HowMany", l'inventaire est effectué et l'objet partagé $inventory est mis à jour dès que possible : +In the "HowMany" method, inventory is done and the $inventory shared object is updated as soon as possible: ```4d C_TEXT($1) C_TEXT($what) C_OBJECT($2) C_OBJECT($inventory) - $what:=$1 //pour une meilleure lisibilité + $what:=$1 //for better readability $inventory:=$2 - - $count:=CountMethod($what) //méthode de comptage des produits - Use($inventory) //Utiliser l'objet partagé - $inventory[$what]:=$count //stockage des résultats pour cet article -End use + + $count:=CountMethod($what) //method to count products + Use($inventory) //use shared object + $inventory[$what]:=$count //save the results for this item + End use ``` -## Exemple 2 +## Example 2 -Les exemples suivants illustrent les règles spécifiques à observer lorsque vous utilisez des groupes partagés : +The following examples highlight specific rules when handling shared groups: ```4d $ob1:=New shared object $ob2:=New shared object Use($ob1) - $ob1.a:=$ob2 //un premier groupe est créé - End use + $ob1.a:=$ob2 //group 1 is created + End use $ob3:=New shared object $ob4:=New shared object Use($ob3) - $ob3.a:=$ob4 //un 2e groupe est créé + $ob3.a:=$ob4 //group 2 is created End use - Use($ob1) //Utilisation d'un objet du groupe 1 - $ob1.b:=$ob4 //ERREUR - //$ob4 appartient déjà à un autre groupe - //son assignation n'est pas permise -End use + Use($ob1) //use an object from group 1 + $ob1.b:=$ob4 //ERROR + //$ob4 already belongs to another group + //assignment is not allowed + End use Use($ob3) - $ob3.a:=Null //on enlève la référence de $ob4 du groupe 2 + $ob3.a:=Null //remove any reference to $ob4 from group 2 End use - Use($ob1) //Utilisation d'un objet du groupe 1 - $ob1.b:=$ob4 //ERREUR - //$ob4 appartient toujours au groupe 2 - //son assignation n'est pas permise + Use($ob1) //use an object from group 1 + $ob1.b:=$ob4 //ERROR + //$ob4 still belongs to group 2 + //assignment is not allowed End use ``` diff --git a/website/translated_docs/fr/Concepts/variables.md b/website/translated_docs/fr/Concepts/variables.md index 10a71e450c145c..5dcb524b60a8f8 100644 --- a/website/translated_docs/fr/Concepts/variables.md +++ b/website/translated_docs/fr/Concepts/variables.md @@ -3,25 +3,25 @@ id: variables title: Variables --- -Fondamentalement, dans 4D, les données peuvent être stockées de deux manières. **Les champs** stockent les données sur disque, de manière permanente ; **les variables** stockent les données en mémoire, de manière temporaire. +Data in 4D is stored in two fundamentally different ways. **Fields** store data permanently on disk; **variables** store data temporarily in memory. -Lorsque vous définissez votre base, vous indiquez à 4D les noms et les types de champs que vous voulez utiliser. C’est pratiquement la même chose pour les variables — vous leur donnez un nom et un type (cf. [Type de données](Concepts/data-types.md)). +When you set up your 4D database, you specify the names and types of fields that you want to use. Variables are much the same—you also give them names and different types (see [Data types](Concepts/data-types.md)). -Une fois créée, vous pouvez utiliser une variable partout dans votre application. For example, you might need to store a text variable in a field of same type: +Once created, you can use a variable wherever you need it in your application. For example, you might need to store a text variable in a field of same type: ```4d - [MaTable]MonChamp:=MonTexte + [MyTable]MyField:=MyText ``` -Les variables sont des objets du langage; vous pouvez créer et utiliser des variables qui n’apparaîtront jamais à l'écran. Dans vos formulaires, vous pouvez afficher des variables à l’écran (à l'exception des pointeurs et des BLOB), les utiliser pour saisir des données, et les imprimer dans des états. Dans ces cas, elles se comportent exactement comme des champs, et les mêmes contrôles intégrés sont disponibles lorsque vous les créez . Les variables peuvent également servir à contrôler des boutons, des list box, des zones de défilement, des boutons image, etc., ou à afficher les résultats de calculs ne devant pas être sauvegardés. +Variables are language objects; you can create and use variables that will never appear on the screen. In your forms, you can display variables (except Pointer and BLOB) on the screen, enter data into them, and print them in reports. In this way, enterable and non-enterable area variables act just like fields, and the same built-in controls are available when you create them. Form variables can also control buttons, list boxes, scrollable areas, picture buttons, and so on, or display results of calculations that do not need to be saved. -## Déclaration des variables +## Declaring Variables -Vous créez des variables en les déclarant. Le langage 4D propose deux manières de déclarer des variables : +You create variables by declaring them. The 4D language offers two ways to declare variables: -- à l'aide du mot-clé `var` (recommandé particulièrement si votre code utilise des objets et des classes), -- à l'aide de l'une des commandes du langage 4D du thème "Compilateur" ou "Tableaux" (obsolète, langage classique uniquement). +- using the `var` keyword (recommended, specially if your code uses objects and classes), +- using one of the "Compiler" or "Arrays" theme 4D language commands (deprecated, classic language only). **Note:** Although it is usually not recommended, you can create basic variables simply by using them; you do not necessarily need to formally define them. For example, to declare a variable that will hold the current date plus 30 days, you can write: @@ -40,7 +40,7 @@ To declare a variable of any type with the `var` keyword, use the following synt `var {; ;...}{ : }` -Par exemple: +For example: ```4d var $myText : Text //a text variable @@ -59,26 +59,26 @@ This syntax only supports [local and process variables](#local-process-and-inter If `varType` is omitted, a variable of the **variant** type is created. -Le tableau suivant répertorie toutes les valeurs `varType` prises en charge : - -| varType | Contenu | -| -------------- | ---------------------------------------- | -| Texte | Valeur texte | -| Date | Valeur date | -| Heure | Valeur Heure | -| Booléen | Valeur booléen | -| Entier long | Valeur entier long | -| Réel | Valeur réel | -| Pointeur | Valeur pointeur | -| Image | Valeur image | -| Blob | Valeur BLOB | -| Collection | Valeur collection | -| Variant | Valeur variant | -| Objet | Objet avec classe par défaut (4D.object) | -| 4D.*className* | Objet du nom de la classe 4D | -| cs.*className* | Objet du nom de la classe utilisateur | - -#### Exemples +The following table lists all supported `varType` values: + +| varType | Contents | +| -------------- | ------------------------------------- | +| Text | Text value | +| Date | Date value | +| Heure | Time value | +| Booléen | Boolean value | +| Integer | Long integer value | +| Real | Real value | +| Pointeur | Pointer value | +| Image | Picture value | +| Blob | BLOB value | +| Collection | Collection value | +| Variant | Variant value | +| Objet | Object with default class (4D.Object) | +| 4D.*className* | Object of the 4D class name | +| cs.*className* | Object of the user class name | + +#### Examples - To declare local and process basic variables: @@ -87,9 +87,9 @@ var $myText; myText; $vt : Text var myVar //variant var $o : Object -//équivalent à : +//equivalent to: var $o : 4D.Object -//également équivalent à C_OBJECT($o) +//also equivalent to C_OBJECT($o) ``` - To declare object variables of 4D class: @@ -114,107 +114,109 @@ var $entity : cs.EmployeeEntity Directives from the "Compiler" theme commands allow you to declare variables of basic types. -Par exemple, si vous souhaitez définir une variable de type texte, il suffira d'écrire : +For example, if you want to define a text variable, you write: ```4d - C_TEXT(monTexte) + C_TEXT(myText) ``` -Voici quelques déclarations de variables simples : +The following are some basic variable declarations: ```4d - C_BLOB(vxMyBlob) // La variable process vxMyBlob est déclarée comme variable de type BLOB - C_DATE($vdCurDate) // La variable locale $vdCurDate est déclarée comme variable de type Date - C_C_LONGINT(vg1;vg2;vg3) // Les 3 variables process vg1, vg2 et vg3 sont déclarées comme variables de type Entier long - C_OBJECT($vObj) // La variable locale $vObj est déclarée comme variable de type Objet - C_COLLECTION($vCol) // La variable locale $vCol est déclarée comme variable de type Collection -ARRAY LONGINT(alAnArray;10) //La variable process alAnArray est déclarée comme un tableau entier long de 10 éléments + C_BLOB(vxMyBlob) // The process variable vxMyBlob is declared as a variable of type BLOB + C_DATE($vdCurDate) // The local variable $vdCurDate is declared as a variable of type Date + C_LONGINT(vg1;vg2;vg3) // The 3 process variables vg1, vg2 and vg3 are declared as variables of type longint + C_OBJECT($vObj) // The local variable $vObj is declared as a variable of type Object + C_COLLECTION($vCol) // The local variable $vCol is declared as a variable of type Collection + ARRAY LONGINT(alAnArray;10) //The process alAnArray variable is declared as a Longint array of 10 elements ``` -**Note :** Les tableaux sont un type particulier de variables. Un tableau est une série ordonnée de variables de même type. Pour plus d'informations, veuillez consulter le thème [Tableaux](Concepts/arrays.md). +**Note:** Arrays are a particular type of variables. An array is an ordered series of variables of the same type. For more information, please refer to [Arrays](Concepts/arrays.md). -## Assigner des valeurs +## Assigning Data -Vous pouvez donner des valeurs aux variables ou aux tableaux et/ou récupérer leur valeur. Donner une valeur à une variable s’appelle **assigner une valeur (ou affecter une valeur)** et s’effectue à l’aide de l’opérateur d’assignation (:=). L’opérateur d’assignation est également utilisé pour assigner des valeurs aux champs. +Data can be put into and copied out of variables and arrays. Putting data into a variable is called **assigning the data to the variable** and is done with the assignment operator (:=). The assignment operator is also used to assign data to fields. -L’opérateur d’assignation est un premier moyen pour créer une variable et lui donner une valeur. Vous placez le nom de la variable que vous voulez créer à gauche de l’opérateur. Par exemple: +The assignment operator is a primary way to create a variable and to put data into it. You write the name of the variable that you want to create on the left side of the assignment operator. For example: ```4d -MonNombre:=3 +MyNumber:=3 ``` -crée la variable _MonNombre_ et lui donne la valeur numérique 3. Si MonNombre existait déjà, elle prend simplement la valeur 3. +creates the variable _MyNumber_ and puts the number 3 into it. If MyNumber already exists, then the number 3 is just put into it. > It is usually not recommended to create variables without [declaring their type](#creating-variables). -Bien entendu, les variables ne seraient pas très utiles si vous ne pouviez pas récupérer les valeurs qu’elles contiennent. De nouveau, vous utilisez l’opérateur d’assignation. Si vous devez placer la valeur de MonNombre dans un champ nommé [Produits]Taille, il vous suffit de placer _MonNombre_ à droite de l’opérateur d’assignation : +Of course, variables would not be very useful if you could not get data out of them. Once again, you use the assignment operator. If you need to put the value of MyNumber in a field called [Products]Size, you would write _MyNumber_ on the right side of the assignment operator: ```4d -[Produits]Taille:=MonNombre +[Products]Size:=MyNumber ``` -Dans ce cas, _[Produits]Taille_ vaudrait 3. Cet exemple est plutôt simple, mais il illustre le moyen élémentaire dont vous disposez pour transférer des données d’un objet vers un autre en utilisant le langage. +In this case, _[Products]Size_ would be equal to 3. This example is rather simple, but it illustrates the fundamental way that data is transferred from one place to another by using the language. -Vous assignez des valeurs aux éléments du tableau à l'aide d'accolades ({...}) : +You assign data to array elements by using curly braces ({...}): ```4d -atNoms{1}:="Richard" +atNames{1}:="Richard" ``` -## Variables locales, process et interprocess +## Local, Process, and Interprocess variables -Vous pouvez créer trois types de variables : des variables **locales**, des variables **process** et des variables **interprocess**. La différence entre ces trois types de variables est leur portée, ou les objets pour lesquels elles sont disponibles. +You can create three types of variables: **local**, **process**, and **interprocess**. The difference between the three types of elements is their scope, or the objects to which they are available. -### Variables locales +### Local variables -Une variable locale, comme son nom l’indique, est locale à une méthode — c’est-à-dire accessible uniquement à l’intérieur de la méthode dans laquelle elle a été créée et inaccessible à l’extérieur de cette méthode. Le fait d'être local à une méthode est formellement qualifié de «portée locale». Les variables locales sont utilisées pour restreindre une variable afin qu'elle ne fonctionne que dans la méthode. +A local variable is, as its name implies, local to a method—accessible only within the method in which it was created and not accessible outside of that method. Being local to a method is formally referred to as being “local in scope.” Local variables are used to restrict a variable so that it works only within the method. -- Eviter des conflits de noms avec les autres variables -- Utiliser temporairement des valeurs, -- Réduire le nombre de variables process +You may want to use a local variable to: -Le nom d’une variable locale commence toujours par le signe dollar ($) et peut contenir jusqu’à 31 autres caractères. Si vous saisissez un nom plus long, 4D le tronque pour le ramener à 31 caractères. +- Avoid conflicts with the names of other variables +- Use data temporarily +- Reduce the number of process variables -Lorsque vous développez un projet d'application comportant de nombreuses méthodes et variables, il arrive souvent que vous n’ayez besoin d’utiliser une variable que dans une méthode. Vous pouvez alors créer et utiliser une variable locale, sans devoir vous soucier de l’existence d’une autre variable du même nom ailleurs dans la base. +The name of a local variable always starts with a dollar sign ($) and can contain up to 31 additional characters. If you enter a longer name, 4D truncates it to the appropriate length. -Souvent, dans une application, des informations ponctuelles sont demandées à l’utilisateur. The `Request` command can obtain this information. Elle affiche une boîte de dialogue comportant un message demandant à l’utilisateur de répondre et, lorsque la réponse est validée, la retourne. Généralement, il n’est pas nécessaire de conserver cette information très longtemps dans vos méthodes. C’est l’endroit parfait pour utiliser une variable locale. Voici un exemple : +When you are working in an application project with many methods and variables, you often find that you need to use a variable only within the method on which you are working. You can create and use a local variable in the method without worrying about whether you have used the same variable name somewhere else. + +Frequently, in an application, small pieces of information are needed from the user. The `Request` command can obtain this information. It displays a dialog box with a message prompting the user for a response. When the user enters the response, the command returns the information the user entered. You usually do not need to keep this information in your methods for very long. This is a typical way to use a local variable. Here is an example: ```4d - $vsID:=Request("Saisissez votre numéro d'identification :") -If(OK=1) - QUERY([Personnes];[Personnes]ID=$vsID) + $vsID:=Request("Please enter your ID:") + If(OK=1) + QUERY([People];[People]ID =$vsID) End if ``` -Cette méthode demande simplement à l’utilisateur de saisir un numéro d’identification. La réponse est placée dans une variable locale, $vsID, puis la méthode la recherche parmi les champs [Personnes]ID. Une fois la méthode terminée, la variable locale $vsID est effacée de la mémoire. Ce fonctionnement est bien adapté puisque la variable n’est utile qu’une seule fois et dans cette méthode uniquement. +This method simply asks the user to enter an ID. It puts the response into a local variable, $vsID, and then searches for the ID that the user entered. When this method finishes, the $vsID local variable is erased from memory. This is fine, because the variable is needed only once and only in this method. -**Note :** les paramètres $1, $2 etc. passés aux méthodes sont des variables locales. Pour plus d'informations, veuillez consulter le thème [Paramètres](Concepts/parameters.md). +**Note:** Parameters $1, $2... passed to methods are local variables. For more information, please refer to [Parameters](Concepts/parameters.md). -### Variables process +### Process variables -Une variable process est “visible” uniquement dans le process où elle a été créée. Elle est utilisable par toutes les méthodes du process et toutes les méthodes appelées depuis le process. +A process variable is available only within a process. It is accessible to the process method and any other method called from within the process. -Le nom d’une variable process ne comporte aucun préfixe. Ce nom peut contenir jusqu’à 31 caractères. +A process variable does not have a prefix before its name. A process variable name can contain up to 31 characters. -En mode interprété, les variables sont gérées dynamiquement; elles sont créées et effacées de la mémoire «à la volée». En mode compilé, tous les process que vous créez (process utilisateur) partagent la même définition de variables process, mais chaque process a une instance différente pour chaque variable. Par exemple, la variable maVar est une certaine variable dans le process P_1 et une autre variable dans le process P_2. +In interpreted mode, variables are maintained dynamically; they are created and erased from memory “on the fly.” In compiled mode, all processes you create (user processes) share the same definition of process variables, but each process has a different instance for each variable. For example, the variable myVar is one variable in the process P_1 and another one in the process P_2. -Un process peut lire et écrire des variables process dans un autre process à l'aide des commandes `LIRE VARIABLE PROCESS` et `ECRIRE VARIABLE PROCESS`. Nous vous recommandons de n'utiliser ces commandes que dans le cadre des besoins décrits ci-dessous (qui sont les raisons pour lesquelles ces commandes ont été créées dans 4D) : +A process can “peek and poke” process variables from another process using the commands `GET PROCESS VARIABLE` and `SET PROCESS VARIABLE`. It is good programming practice to restrict the use of these commands to the situation for which they were added to 4D: -- Communication interprocess à des endroits particuliers de votre code -- Gestion du glisser-déposer interprocess -- En client/serveur, communication entre les process sur les postes clients et les procédures stockées exécutées sur le serveur +- Interprocess communication at specific places or your code +- Handling of interprocess drag and drop +- In Client/Server, communication between processes on client machines and the stored procedures running on the server machines -Pour plus d'informations, reportez-vous à la section **Process** et à la description de ces commandes. +For more information, see the chapter **Processes** and the description of these commands. -### Variables interprocess +### Interprocess variables -Les variables interprocess sont visibles dans tout le projet et sont disponibles pour tous les process. Les variables interprocess sont principalement utilisées pour le partage d’informations entre les process. +Interprocess variables are available throughout the project and are shared across all cooperative processes. They are primarily used to share information between processes. -> L'utilisation de variables interprocess n'est pas recommandée car elles ne sont pas disponibles depuis le process préemptif et peuvent rendre le code moins maintenable. +> Use of interprocess variables is not recommended since they are not available from preemptive processes and tend to make the code less maintainable. -Le nom d’une variable interprocess débute toujours par le symbole (<>) — formé du symbole “inférieur à” suivi du symbole “supérieur à” — et peut comporter jusqu’à 31 caractères supplémentaires. +The name of an interprocess variable always begins with the symbols (<>) — a “less than” sign followed by a “greater than” sign— followed by 31 characters. -En mode client/serveur, chaque poste (client et serveur) partage la même définition des variables interprocess, mais chacun utilise une instance différente d'une variable. +In Client/Server, each machine (Client machines and Server machine) share the same definition of interprocess variables, but each machine has a different instance for each variable. diff --git a/website/translated_docs/fr/Events/onActivate.md b/website/translated_docs/fr/Events/onActivate.md index df119463ce9fd3..ab79ae0dddfe34 100644 --- a/website/translated_docs/fr/Events/onActivate.md +++ b/website/translated_docs/fr/Events/onActivate.md @@ -3,15 +3,15 @@ id: onActivate title: Sur activation --- -| Code | Peut être appelé par | Définition | -| ---- | -------------------- | ---------------------------------------------------------------------------------------- | -| 11 | Formulaire | The form's window becomes the frontmost window or the subform's container gets the focus | +| Code | Can be called by | Definition | +| ---- | ---------------- | ---------------------------------------------------------------------------------------- | +| 11 | Form | The form's window becomes the frontmost window or the subform's container gets the focus | ## Description -Si la fenêtre d'un formulaire a été envoyée en arrière-plan, cet événement est appelé lorsque la fenêtre devient la fenêtre active. +If the window of a form was sent to the background, this event is called when the window becomes the frontmost window. -Cet événement s'applique au formulaire dans son ensemble et non à un objet particulier. Par conséquent, si la propriété d'événement formulaire `On Activate` est sélectionnée, seul le formulaire aura sa méthode formulaire appelée. +This event applies to the form as a whole and not to a particular object. Consequently, if the `On Activate` form event property is selected, only the form will have its form method called. In the case of a subform, this event is passed to the subform when the container gets the focus (if it has the [focusable](FormObjects/properties_Entry.md#focusable) property). \ No newline at end of file diff --git a/website/translated_docs/fr/Events/onAfterEdit.md b/website/translated_docs/fr/Events/onAfterEdit.md index 8eda378ab28191..955d969bdbff4d 100644 --- a/website/translated_docs/fr/Events/onAfterEdit.md +++ b/website/translated_docs/fr/Events/onAfterEdit.md @@ -3,57 +3,57 @@ id: onAfterEdit title: Sur après modification --- -| Code | Peut être appelé par | Définition | -| ---- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | -| 45 | [Zone 4D View Pro](FormObjects/viewProArea_overview) - [Zone 4D Write Pro](FormObjects/writeProArea_overview) - [Combo Box](FormObjects/comboBox_overview.md) - Formulaire - [Zone de saisie](FormObjects/input_overview.md) - [Liste hiérarchique](FormObjects/list_overview.md) - [List Box](FormObjects/listbox_overview.md) - [Colonne List Box](FormObjects/listbox_overview.md#list-box-columns) | The contents of the enterable object that has the focus has just been modified | +| Code | Can be called by | Definition | +| ---- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------ | +| 45 | [4D View Pro area](FormObjects/viewProArea_overview) - [4D Write Pro area](FormObjects/writeProArea_overview) - [Combo Box](FormObjects/comboBox_overview.md) - Form - [Input](FormObjects/input_overview.md) - [Hierarchical List](FormObjects/list_overview.md) - [List Box](FormObjects/listbox_overview.md) - [List Box Column](FormObjects/listbox_overview.md#list-box-columns) | The contents of the enterable object that has the focus has just been modified | ## Description -### Cas général +### General case -Cet événement peut être utilisé pour filtrer la saisie de données dans les objets saisissables au clavier au niveau le plus bas. +This event can be used filter the data entry in keyboard enterable objects at the lowest level. When it is used, this event is generated after each change made to the contents of an enterable object, regardless of the action that caused the change, *i.e.*: -- Actions d'édition standard qui modifient le contenu comme les actions coller, couper, supprimer ou annuler; -- Déposer une valeur (action similaire à coller); -- Toute entrée au clavier effectuée par l'utilisateur; dans ce cas, l'événement `On After Edit` est généré après les événements [`On Before Keystroke`](onBeforeKeystroke.md) et [`On After Keystroke`](onAfterKeystroke.md), s'ils sont utilisés. -- Toute modification apportée à l'aide d'une commande de langage qui simule une action de l'utilisateur (c'est-à-dire `POST KEY`). +- Standard editing actions which modify content like paste, cut, delete or cancel; +- Dropping a value (action similar to paste); +- Any keyboard entry made by the user; in this case, the `On After Edit` event is generated after the [`On Before Keystroke`](onBeforeKeystroke.md) and [`On After Keystroke`](onAfterKeystroke.md) events, if they are used. +- Any modification made using a language command that simulates a user action (i.e., `POST KEY`). ### 4D View Pro The object returned by the `FORM Event` command contains: -| Propriété | Type | Description | -| ----------- | ----------- | --------------------------------------------------------------------------------------------------- | -| code | entier long | Sur après modification | -| description | Texte | "On After Edit" | -| objectName | Texte | 4D View Pro area name | -| sheetName | Texte | Name of the sheet of the event | -| action | Texte | "editChange", "valueChanged", "DragDropBlock", "DragFillBlock", "formulaChanged", "clipboardPasted" | +| Property | Type | Description | +| ----------- | ------- | --------------------------------------------------------------------------------------------------- | +| code | longint | Sur après modification | +| description | text | "On After Edit" | +| objectName | text | 4D View Pro area name | +| sheetName | text | Name of the sheet of the event | +| action | text | "editChange", "valueChanged", "DragDropBlock", "DragFillBlock", "formulaChanged", "clipboardPasted" | Depending on the `action` property value, the [event object](overview.md#event-object) will contain additional properties. #### action = editChange -| Propriété | Type | Description | +| Property | Type | Description | | ----------- | ------- | --------------------------------- | | range | object | Cell range | | editingText | variant | The value from the current editor | #### action = valueChanged -| Propriété | Type | Description | -| --------- | ------- | --------------------------- | -| range | object | Cell range | -| oldValue | variant | Value of cell before change | -| newValue | variant | Value of cell after change | +| Property | Type | Description | +| -------- | ------- | --------------------------- | +| range | object | Cell range | +| oldValue | variant | Value of cell before change | +| newValue | variant | Value of cell after change | #### action = DragDropBlock -| Propriété | Type | Description | +| Property | Type | Description | | --------- | ------- | --------------------------------------------------- | | fromRange | object | Range of source cell range (being dragged) | | toRange | object | Range of the destination cell range (drop location) | @@ -63,7 +63,7 @@ Depending on the `action` property value, the [event object](overview.md#event-o #### action = DragFillBlock -| Propriété | Type | Description | +| Property | Type | Description | | --------- | ------ | ------------------- | | fillRange | object | Range used for fill | autoFillType|longint|Value used for the fill.

  • 0: Cells are filled with all data (values, formatting, and formulas)
  • 1: Cells are filled with automatically sequential data
  • 2: Cells are filled with formatting only
  • 3: Cells are filled with values but not formatting
  • 4: Values are removed from the cells
  • 5: Cells are filled automatically| |fillDirection|longint|Direction of the fill.
  • 0: The cells to the left are filled
  • 1: The cells to the right are filled
  • 2: The cells above are filled
  • 3: The cells below are filled| @@ -71,21 +71,21 @@ Depending on the `action` property value, the [event object](overview.md#event-o #### action = formulaChanged -| Propriété | Type | Description | -| --------- | ------ | ------------------- | -| range | object | Cell range | -| formula | Texte | The formula entered | +| Property | Type | Description | +| -------- | ------ | ------------------- | +| range | object | Cell range | +| formula | text | The formula entered | #### action = clipboardPasted -| Propriété | Type | Description | -| ----------- | ----------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| range | object | Cell range | -| pasteOption | entier long | Specifies what is pasted from the clipboard:
  • 0: Everything is pasted (values, formatting, and formulas)
  • 1: Only values are pasted
  • 2: Only the formatting is pasted
  • 3: Only formulas are pasted
  • 4: Values and formatting are pasted (not formulas)
  • 5: Formulas and formatting are pasted (not values) | -| pasteData | object | The data from the clipboard to be pasted
  • "text" (text): The text from the clipboard
  • "html" (text): The HTML from the clipboard | +| Property | Type | Description | +| ----------- | ------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| range | object | Cell range | +| pasteOption | longint | Specifies what is pasted from the clipboard:
  • 0: Everything is pasted (values, formatting, and formulas)
  • 1: Only values are pasted
  • 2: Only the formatting is pasted
  • 3: Only formulas are pasted
  • 4: Values and formatting are pasted (not formulas)
  • 5: Formulas and formatting are pasted (not values) | +| pasteData | object | The data from the clipboard to be pasted
  • "text" (text): The text from the clipboard
  • "html" (text): The HTML from the clipboard | -#### Exemple +#### Example Here is an example handling an `On After Edit` event: @@ -96,10 +96,6 @@ Here is an example handling an `On After Edit` event: from "+String(FORM Event.oldValue)+\ " to "+String(FORM Event.newValue)+"!") End if - End if - End if - End if - End if End if ``` diff --git a/website/translated_docs/fr/Events/onAfterKeystroke.md b/website/translated_docs/fr/Events/onAfterKeystroke.md index 6e85b2c6394e80..5208a9d50cb20b 100644 --- a/website/translated_docs/fr/Events/onAfterKeystroke.md +++ b/website/translated_docs/fr/Events/onAfterKeystroke.md @@ -3,13 +3,13 @@ id: onAfterKeystroke title: Sue après frappe clavier --- -| Code | Peut être appelé par | Définition | -| ---- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | -| 28 | [4D Write Pro area](FormObjects/writeProArea_overview) - [Combo Box](FormObjects/comboBox_overview.md) - Form - [Input](FormObjects/input_overview.md) - [List Box](FormObjects/listbox_overview.md) - [List Box Column](FormObjects/listbox_overview.md#list-box-columns) | Un caractère est sur le point d'être saisi dans l'objet qui a le focus. `Get edited text` returns the object's text **including** this character. | +| Code | Can be called by | Definition | +| ---- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------- | +| 28 | [4D Write Pro area](FormObjects/writeProArea_overview) - [Combo Box](FormObjects/comboBox_overview.md) - Form - [Input](FormObjects/input_overview.md) - [List Box](FormObjects/listbox_overview.md) - [List Box Column](FormObjects/listbox_overview.md#list-box-columns) | A character is about to be entered in the object that has the focus. `Get edited text` returns the object's text **including** this character. | -
    Historique +
    History -| Version | Modifications | +| Version | Changes | | ------- | ---------------------------------------------------------------------------------------------------------------- | | v18 R5 | - Support in non-enterable list boxes

    - The event is now triggered after IME validation |

    @@ -17,25 +17,25 @@ title: Sue après frappe clavier ## Description -> L'événement `On After Keystroke` peut généralement être remplacé par l'événement On After Edit (voir ci-dessous). +> The `On After Keystroke` event can generally be replaced by the [`On After Edit`](onAfterEdit.md) event (see below). -Après avoir sélectionné les propriétés d'événement [`On Before Keystroke`](onBeforeKeystroke.md) et `On After Keystroke` pour un objet, vous pouvez détecter et gérer les frappes au sein de l'objet, en utilisant la commande `FORM event` qui renverra `On Before Keystroke` puis `On After Keystroke` (pour plus d'informations, veuillez reportez-vous à la description de la commande `Get edited text`). +After the [`On Before Keystroke`](onBeforeKeystroke.md) and `On After Keystroke` event properties are selected for an object, you can detect and handle the keystrokes within the object, using the `FORM event` command that will return `On Before Keystroke` and then `On After Keystroke` (for more information, please refer to the description of the `Get edited text` command). -> Ces événements sont également activés par des commandes de langage qui simulent une action utilisateur telle que `POST KEY`. +> These events are also activated by language commands that simulate a user action like `POST KEY`. -L'événement `On After Keystroke` n'est pas généré : +The `On After Keystroke` event is not generated: -- dans la méthode [des colonnes de list box](FormObjects/listbox_overview.md#list-box-columns), sauf lorsqu'une cellule est en cours d'édition (cependant elle est générée dans tous les cas dans la méthode de [list box](FormObjects/listbox_overview.md)), -- lorsque les modifications utilisateur ne sont pas effectuées à l'aide du clavier (coller, glisser-déposer, case à cocher, liste déroulante, combo box). Pour traiter ces événements, vous devez utiliser [`On After Edit`](onAfterEdit.md). +- in [list box columns](FormObjects/listbox_overview.md#list-box-columns) method except when a cell is being edited (however it is generated in any cases in the [list box](FormObjects/listbox_overview.md) method), +- when user modifications are not carried out using the keyboard (paste, drag-and-drop, checkbox, drop down list, combo box). To process these events, you must use [`On After Edit`](onAfterEdit.md). -### Séquence de frappe +### Keystroke sequence -Lorsqu'une entrée nécessite une séquence de frappes clavier, les événements [`On Before Keystroke`](onBeforeKeystroke.md) et [`On After Keystroke event`] sont générés uniquement lorsque l'entrée est entièrement validée par l'utilisateur. La commande `Keystroke` retourne le caractère validé. Ce cas se produit principalement : +When an entry requires a sequence of keystrokes, the [`On Before Keystroke`](onBeforeKeystroke.md) and [`On After Keystroke event`] events are generated only when the entry is fully validaded by the user. The `Keystroke` command returns the validated character. This case mainly occurs: -- lors de l'utilisation de touches "mortes" telles que ^ ou ~: les événements ne sont générés que lorsque le caractère étendu est éventuellement saisi (par exemple "ê" ou ñ), -- lorsqu'un IME (Input method editor) affiche une boîte de dialogue intermédiaire où l'utilisateur peut saisir une combinaison de caractères : les événements sont générés uniquement lorsque la boîte de dialogue IME est validée. +- when using "dead" keys such as ^ or ~: events are generated only when the extended character is eventuelly entered (e.g. "ê" or ñ), +- when an IME (Input method editor) displays an intermediary dialog box where the user can enter a combination of characters: events are generated only when the IME dialog is validated. -### Voir également +### See also [On Before Keystroke](onBeforeKeystroke.md). \ No newline at end of file diff --git a/website/translated_docs/fr/Events/onAfterSort.md b/website/translated_docs/fr/Events/onAfterSort.md index 42960efc05a02a..d125cb3fe934a5 100644 --- a/website/translated_docs/fr/Events/onAfterSort.md +++ b/website/translated_docs/fr/Events/onAfterSort.md @@ -3,7 +3,7 @@ id: onAfterSort title: Sur après tri --- -| Code | Peut être appelé par | Définition | +| Code | Can be called by | Definition | | ---- | ----------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------- | | 30 | [List Box](FormObjects/listbox_overview.md) - [List Box Column](FormObjects/listbox_overview.md#list-box-columns) | A standard sort has just been carried out in a list box column. | diff --git a/website/translated_docs/fr/Events/onAlternativeClick.md b/website/translated_docs/fr/Events/onAlternativeClick.md index 45374c0278ed20..69ab04a846720f 100644 --- a/website/translated_docs/fr/Events/onAlternativeClick.md +++ b/website/translated_docs/fr/Events/onAlternativeClick.md @@ -3,7 +3,7 @@ id: onAlternativeClick title: Sur clic alternatif --- -| Code | Peut être appelé par | Définition | +| Code | Can be called by | Definition | | ---- | ------------------------------------------------------------------------------------------------------------------------------------------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | 38 | [Button](FormObjects/button_overview.md) - [List Box](FormObjects/listbox_overview.md) - [List Box Column](FormObjects/listbox_overview.md#list-box-columns) |
  • Buttons: The "arrow" area of a button is clicked
  • List boxes: In a column of an object array, an ellipsis button ("alternateButton" attribute) is clicked | diff --git a/website/translated_docs/fr/Events/onBeforeDataEntry.md b/website/translated_docs/fr/Events/onBeforeDataEntry.md index d39909a97c18c3..ccfa74ee9ace58 100644 --- a/website/translated_docs/fr/Events/onBeforeDataEntry.md +++ b/website/translated_docs/fr/Events/onBeforeDataEntry.md @@ -3,7 +3,7 @@ id: onBeforeDataEntry title: Sur avant saisie --- -| Code | Peut être appelé par | Définition | +| Code | Can be called by | Definition | | ---- | ----------------------------------------------------------------------------------------------------------------- | -------------------------------------------------- | | 41 | [List Box](FormObjects/listbox_overview.md) - [List Box Column](FormObjects/listbox_overview.md#list-box-columns) | A list box cell is about to change to editing mode | diff --git a/website/translated_docs/fr/Events/onBeforeKeystroke.md b/website/translated_docs/fr/Events/onBeforeKeystroke.md index 76c7b421b3baf2..da066197bdf710 100644 --- a/website/translated_docs/fr/Events/onBeforeKeystroke.md +++ b/website/translated_docs/fr/Events/onBeforeKeystroke.md @@ -3,13 +3,13 @@ id: onBeforeKeystroke title: Sue avant frappe clavier --- -| Code | Peut être appelé par | Définition | -| ---- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------- | -| 17 | [4D Write Pro area](FormObjects/writeProArea_overview) - [Combo Box](FormObjects/comboBox_overview.md) - Form - [Input](FormObjects/input_overview.md) - [List Box](FormObjects/listbox_overview.md) - [List Box Column](FormObjects/listbox_overview.md#list-box-columns) | Un caractère est sur le point d'être saisi dans l'objet qui a le focus. `Get edited text` returns the object's text **without** this character. | +| Code | Can be called by | Definition | +| ---- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------- | +| 17 | [4D Write Pro area](FormObjects/writeProArea_overview) - [Combo Box](FormObjects/comboBox_overview.md) - Form - [Input](FormObjects/input_overview.md) - [List Box](FormObjects/listbox_overview.md) - [List Box Column](FormObjects/listbox_overview.md#list-box-columns) | A character is about to be entered in the object that has the focus. `Get edited text` returns the object's text **without** this character. | -
    Historique +
    History -| Version | Modifications | +| Version | Changes | | ------- | ---------------------------------------------------------------------------------------------------------------- | | v18 R5 | - Support in non-enterable list boxes

    - The event is now triggered after IME validation |

    @@ -17,29 +17,29 @@ title: Sue avant frappe clavier ## Description -Après avoir sélectionné les événements `On Before Keystroke` et [`On After Keystroke event`](onAfterKeystroke.md) pour un objet, vous pouvez détecter et gérer les frappes au sein de l'objet, en utilisant la commande `Form event` qui retournera `On Before Keystroke` puis [`On After Keystroke`](onAfterKeystroke.md) (pour plus d'informations, veuillez vous reporter à la description de la commande `Get edited text`). Dans l'événement `On Before Keystroke`, la commande `FILTER KEYSTROKE` peut être utilisée pour filtrer les caractères typés. +After the `On Before Keystroke` and [`On After Keystroke event`](onAfterKeystroke.md) events are selected for an object, you can detect and handle the keystrokes within the object, using the `Form event code` command that will return `On Before Keystroke` and then [`On After Keystroke event`](onAfterKeystroke.md) (for more information, please refer to the description of the `Get edited text` command). Within the `On Before Keystroke` event, the `FILTER KEYSTROKE` command can be used to filter typed chars. -> Ces événements sont également activés par des commandes de langage qui simulent une action utilisateur telle que `POST KEY`. +> These events are also activated by language commands that simulate a user action like `POST KEY`. -L'événement `On Before Keystroke` n'est pas généré : +The `On Before Keystroke` event is not generated: -- dans une méthode [colonnes de list box](FormObjects/listbox_overview.md#list-box-columns), sauf lorsqu'une cellule est en cours d'édition (cependant elle est générée dans tous les cas dans la méthode de [list box](FormObjects/listbox_overview.md)), -- lorsque les modifications utilisateur ne sont pas effectuées à l'aide du clavier (coller, glisser-déposer, case à cocher, liste déroulante, combo box). Pour traiter ces événements, vous devez utiliser [`On After Edit`](onAfterEdit.md). +- in a [list box column](FormObjects/listbox_overview.md#list-box-columns) method except when a cell is being edited (however it is generated in any cases in the [list box](FormObjects/listbox_overview.md) method), +- when user modifications are not carried out using the keyboard (paste, drag-and-drop, checkbox, drop down list, combo box). To process these events, you must use [`On After Edit`](onAfterEdit.md). -### Objets non saisissables +### Non-enterable objects -L'événement `On Before Keystroke` peut être généré dans des objets non saisissables, par exemple dans une list box même si les cellules de la list box ne sont pas saisissables ou si les lignes ne peuvent pas être sélectionnées. Cela vous permet de créer des interfaces dans lesquelles l'utilisateur peut faire défiler dynamiquement jusqu'à une ligne spécifique dans une list box en saisissant les premières lettres d'une valeur. Dans le cas où les cellules de la list box sont saisissables, vous pouvez utiliser la commande `Is editing text` pour savoir si l'utilisateur saisit réellement du texte dans une cellule ou s'il utilise la fonction de saisie prédictive, puis exécutez le code approprié. +The `On Before Keystroke` event can be generated in non-enterable objects, e.g. in a list box even if the list box cells are not enterable, or rows are not selectable. This allows you to build interfaces where the user can scroll dynamically to a specific row in a list box by entering the first letters of a value. In case where the list box cells are enterable, you can use the `Is editing text` command to know if the user is actually entering text in a cell or is using the type-ahead feature and then, execute appropriate code. -### Séquence de frappe +### Keystroke sequence -Lorsqu'une entrée nécessite une séquence de frappes clavier, les événements ``On Before Keystroke[` et [`On After Keystroke](onAfterKeystroke.md)] sont générés uniquement lorsque la saisie est entièrement validée par l'utilisateur. La commande `Keystroke` retourne le caractère validé. Ce cas se produit principalement : +When an entry requires a sequence of keystrokes, the `On Before Keystroke` and [`On After Keystroke`](onAfterKeystroke.md) events are generated only when the entry is fully validaded by the user. The `Keystroke` command returns the validated character. This case mainly occurs: -- lors de l'utilisation de touches "mortes" telles que ^ ou ~: les événements ne sont générés que lorsque le caractère étendu est éventuellement saisi (par exemple "ê" ou ñ), -- lorsqu'un IME (Input method editor) affiche une boîte de dialogue intermédiaire où l'utilisateur peut saisir une combinaison de caractères : les événements sont générés uniquement lorsque la boîte de dialogue IME est validée. +- when using "dead" keys such as ^ or ~: events are generated only when the extended character is eventuelly entered (e.g. "ê" or ñ), +- when an IME (Input method editor) displays an intermediary dialog box where the user can enter a combination of characters: events are generated only when the IME dialog is validated. -### Voir également +### See also [On After Keystroke](onAfterKeystroke.md). \ No newline at end of file diff --git a/website/translated_docs/fr/Events/onBeginDragOver.md b/website/translated_docs/fr/Events/onBeginDragOver.md index 05e3dc802a5f0f..638b197e4097be 100644 --- a/website/translated_docs/fr/Events/onBeginDragOver.md +++ b/website/translated_docs/fr/Events/onBeginDragOver.md @@ -3,7 +3,7 @@ id: onBeginDragOver title: Sur début survol --- -| Code | Peut être appelé par | Définition | +| Code | Can be called by | Definition | | ---- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------- | | 17 | [4D Write Pro area](FormObjects/writeProArea_overview) - [Button](FormObjects/button_overview.md) - [Button Grid](FormObjects/buttonGrid_overview.md) - [Check Box](FormObjects/checkbox_overview.md) - [Dropdown list](FormObjects/dropdownList_Overview.md) - Form - [Hierarchical List](FormObjects/list_overview.md#overview) - [Input](FormObjects/input_overview.md) - [List Box](FormObjects/listbox_overview.md) - [List Box Column](FormObjects/listbox_overview.md#list-box-columns) - [Picture Button](FormObjects/pictureButton_overview.md) - [Picture Pop up menu](FormObjects/picturePopupMenu_overview.md) - [Plug-in Area](FormObjects/pluginArea_overview.md#overview) - [Progress Indicators](FormObjects/progressIndicator.md) - [Radio Button](FormObjects/radio_overview.md) - [Ruler](FormObjects/ruler.md) - [Spinner](FormObjects/spinner.md) - [Splitter](FormObjects/splitters.md) - [Stepper](FormObjects/stepper.md) - [Tab control](FormObjects/tabControl.md) | An object is being dragged | diff --git a/website/translated_docs/fr/Events/onBeginUrlLoading.md b/website/translated_docs/fr/Events/onBeginUrlLoading.md index 330a1a09e1fffb..f7eb5de22cbe11 100644 --- a/website/translated_docs/fr/Events/onBeginUrlLoading.md +++ b/website/translated_docs/fr/Events/onBeginUrlLoading.md @@ -3,9 +3,9 @@ id: onBeginUrlLoading title: On Begin URL Loading --- -| Code | Peut être appelé par | Définition | +| Code | Can be called by | Definition | | ---- | ------------------------------------------- | ----------------------------------- | -| 47 | [Zone Web](FormObjects/webArea_overview.md) | A new URL is loaded in the Web area | +| 47 | [Web Area](FormObjects/webArea_overview.md) | A new URL is loaded in the Web area | ## Description diff --git a/website/translated_docs/fr/Events/onBoundVariableChange.md b/website/translated_docs/fr/Events/onBoundVariableChange.md index 7d4928731a877c..239aae38ad4eb0 100644 --- a/website/translated_docs/fr/Events/onBoundVariableChange.md +++ b/website/translated_docs/fr/Events/onBoundVariableChange.md @@ -3,9 +3,9 @@ id: onBoundVariableChange title: On Bound Variable Change --- -| Code | Peut être appelé par | Définition | -| ---- | -------------------- | ------------------------------------------- | -| 54 | Formulaire | The variable bound to a subform is modified | +| Code | Can be called by | Definition | +| ---- | ---------------- | ------------------------------------------- | +| 54 | Form | The variable bound to a subform is modified | ## Description diff --git a/website/translated_docs/fr/Events/onClicked.md b/website/translated_docs/fr/Events/onClicked.md index 6512d8a9f6267c..c49940f4bdc916 100644 --- a/website/translated_docs/fr/Events/onClicked.md +++ b/website/translated_docs/fr/Events/onClicked.md @@ -3,7 +3,7 @@ id: onClicked title: Sur clic --- -| Code | Peut être appelé par | Définition | +| Code | Can be called by | Definition | | ---- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ----------------------------- | | 4 | [4D View Pro Area](FormObjects/viewProArea_overview.md) - [4D Write Pro area](FormObjects/writeProArea_overview) - [Button](FormObjects/button_overview.md) - [Button Grid](FormObjects/buttonGrid_overview.md) - [Check Box](FormObjects/checkbox_overview.md) - [Combo Box](FormObjects/comboBox_overview.md) - [Dropdown list](FormObjects/dropdownList_Overview.md) - Form - [Hierarchical List](FormObjects/list_overview.md#overview) - [Input](FormObjects/input_overview.md) - [List Box](FormObjects/listbox_overview.md) - [List Box Column](FormObjects/listbox_overview.md#list-box-columns) - [Picture Button](FormObjects/pictureButton_overview.md) - [Picture Pop up menu](FormObjects/picturePopupMenu_overview.md) - [Plug-in Area](FormObjects/pluginArea_overview.md#overview) - [Progress Indicators](FormObjects/progressIndicator.md) - [Radio Button](FormObjects/radio_overview.md) - [Ruler](FormObjects/ruler.md) - [Spinner](FormObjects/spinner.md) - [Splitter](FormObjects/splitters.md) - [Stepper](FormObjects/stepper.md) - [Tab control](FormObjects/tabControl.md) | A click occurred on an object | @@ -20,7 +20,7 @@ The `On Clicked` event usually occurs once the mouse button is released. However - [Rulers](FormObjects/ruler.md): If the [Execute object method](FormObjects/properties_Action.md#execute-object-method) option is set to **true**, the `On Clicked` event occurs as soon as the click is made. - [Combo boxes](FormObjects/comboBox_overview.md): The `On Clicked` event occurs only if the user selects another value in the associated menu. A [combo box](FormObjects/comboBox_overview.md) must be treated as an enterable text area whose associated drop-down list provides default values. Consequently, you handle data entry within a combo box through the `On Before Keystroke`, `On After Keystroke` and `On Data Change` events. - [Drop-down lists](FormObjects/dropdownList_Overview.md): The `On Clicked` event occurs only if the user selects another value in the menu. The `On Data Change` event allows you to detect the activation of the object when a value different from the current value is selected -- Lorsqu'une cellule d'entrée de list box est [en cours d'édition](FormObjects/listbox_overview.md#managing-entry), l'événement `On Clicked` est généré lorsque le bouton de la souris est enfoncé, permettant d'utiliser la commande `Contextual click` par exemple. +- When a list box input cell is [being edited](FormObjects/listbox_overview.md#managing-entry), the `On Clicked` event is generated when the mouse button is pressed, allowing to use the `Contextual click` command for example. In the context of an `On Clicked` event, you can test the number of clicks made by the user by means of the `Clickcount` command. @@ -34,15 +34,15 @@ If both events are selected for an object, the `On Clicked` and then the `On Dou This event is generated when the user clicks anywhere on a 4D View Pro document. On this context, the [event object](overview.md#event-object) returned by the `FORM Event` command contains: -| Propriété | Type | Description | -| ----------- | ----------- | ------------------------------ | -| code | entier long | Sur clic | -| description | Texte | "On Clicked" | -| objectName | Texte | 4D View Pro area name | -| sheetName | Texte | Name of the sheet of the event | -| range | object | Cell range | +| Property | Type | Description | +| ----------- | ------- | ------------------------------ | +| code | longint | Sur clic | +| description | text | "On Clicked" | +| objectName | text | 4D View Pro area name | +| sheetName | text | Name of the sheet of the event | +| range | object | Cell range | -#### Exemple +#### Example ```4d If(FORM Event.code=On Clicked) diff --git a/website/translated_docs/fr/Events/onCloseBox.md b/website/translated_docs/fr/Events/onCloseBox.md index 0bfb4f742c3daf..5c0bff081375fc 100644 --- a/website/translated_docs/fr/Events/onCloseBox.md +++ b/website/translated_docs/fr/Events/onCloseBox.md @@ -3,16 +3,16 @@ id: onCloseBox title: On Close Box --- -| Code | Peut être appelé par | Définition | -| ---- | -------------------- | --------------------------------------- | -| 22 | Formulaire | The window’s close box has been clicked | +| Code | Can be called by | Definition | +| ---- | ---------------- | --------------------------------------- | +| 22 | Form | The window’s close box has been clicked | ## Description The `On Close Box` event is generated when the user clicks on the clos box of the window. -### Exemple +### Example This example shows how to respond to a close window event with a form used for record data entry: @@ -24,8 +24,6 @@ This example shows how to respond to a close window event with a form used for r :(Form event code=On Close Box) If(Modified record($vpFormTable->)) CONFIRM("This record has been modified. Save Changes?") - Save Changes?") - Save Changes?") If(OK=1) ACCEPT Else @@ -35,6 +33,5 @@ This example shows how to respond to a close window event with a form used for r CANCEL End if //... - //déclaration(s) End case ``` \ No newline at end of file diff --git a/website/translated_docs/fr/Events/onCloseDetail.md b/website/translated_docs/fr/Events/onCloseDetail.md index a0e9f5526674a0..1a918df966f165 100644 --- a/website/translated_docs/fr/Events/onCloseDetail.md +++ b/website/translated_docs/fr/Events/onCloseDetail.md @@ -3,7 +3,7 @@ id: onCloseDetail title: Sur fermeture corps --- -| Code | Peut être appelé par | Définition | +| Code | Can be called by | Definition | | ---- | -------------------------------------------------- | -------------------------------------------------------------- | | 26 | Form - [List Box](FormObjects/listbox_overview.md) | You left the detail form and are going back to the output form | diff --git a/website/translated_docs/fr/Events/onCollapse.md b/website/translated_docs/fr/Events/onCollapse.md index bcaf2c2adb740e..f70bcda98f633e 100644 --- a/website/translated_docs/fr/Events/onCollapse.md +++ b/website/translated_docs/fr/Events/onCollapse.md @@ -3,7 +3,7 @@ id: onCollapse title: Sur contracter --- -| Code | Peut être appelé par | Définition | +| Code | Can be called by | Definition | | ---- | -------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------ | | 44 | [Hierarchical List](FormObjects/list_overview.md#overview) - [List Box](FormObjects/listbox_overview.md) | An element of the hierarchical list or hierarchical list box has been collapsed using a click or a keystroke | @@ -14,5 +14,5 @@ title: Sur contracter - [Hierarchical list boxes](FormObjects/listbox_overview.md#hierarchical-list-boxes): This event is generated when a row of the hierarchical list box is collapsed. -### Voir également +### See also [Sur déployer](onExpand.md) \ No newline at end of file diff --git a/website/translated_docs/fr/Events/onColumnMoved.md b/website/translated_docs/fr/Events/onColumnMoved.md index 77fbb35304d3d4..4e3d82c46d0c6d 100644 --- a/website/translated_docs/fr/Events/onColumnMoved.md +++ b/website/translated_docs/fr/Events/onColumnMoved.md @@ -3,7 +3,7 @@ id: onColumnMoved title: Sur déplacement colonne --- -| Code | Peut être appelé par | Définition | +| Code | Can be called by | Definition | | ---- | ----------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------- | | 32 | [List Box](FormObjects/listbox_overview.md) - [List Box Column](FormObjects/listbox_overview.md#list-box-columns) | A list box column is moved by the user via drag and drop | diff --git a/website/translated_docs/fr/Events/onColumnResize.md b/website/translated_docs/fr/Events/onColumnResize.md index fd419fabd42059..29f29c769d64e6 100644 --- a/website/translated_docs/fr/Events/onColumnResize.md +++ b/website/translated_docs/fr/Events/onColumnResize.md @@ -3,7 +3,7 @@ id: onColumnResize title: Sur redimensionnement colonne --- -| Code | Peut être appelé par | Définition | +| Code | Can be called by | Definition | | ---- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | | 33 | [4D View Pro Area](FormObjects/viewProArea_overview.md) - [List Box](FormObjects/listbox_overview.md) - [List Box Column](FormObjects/listbox_overview.md#list-box-columns) | The width of a column is modified directly by the user or consequently to a form window resize | @@ -20,16 +20,16 @@ This event is generated when the width of a column in the list box is modified b This event is generated when the width of a column is modified by a user. On this context, the [event object](overview.md#event-object) returned by the `FORM Event` command contains: -| Propriété | Type | Description | -| ----------- | ----------- | ------------------------------------------------------------------- | -| code | entier long | Sur redimensionnement colonne | -| description | Texte | "On Column Resize" | -| objectName | Texte | 4D View Pro area name | -| sheetName | Texte | Name of the sheet of the event | -| range | object | Cell range of the columns whose widths have changed | -| header | boolean | True if the row header column (first column) is resized, else false | +| Property | Type | Description | +| ----------- | ------- | ------------------------------------------------------------------- | +| code | longint | Sur redimensionnement colonne | +| description | text | "On Column Resize" | +| objectName | text | 4D View Pro area name | +| sheetName | text | Name of the sheet of the event | +| range | object | Cell range of the columns whose widths have changed | +| header | boolean | True if the row header column (first column) is resized, else false | -#### Exemple +#### Example ```4d If(FORM Event.code=On Column Resize) diff --git a/website/translated_docs/fr/Events/onDataChange.md b/website/translated_docs/fr/Events/onDataChange.md index 0e62a62846fc98..d0ef7c294b5e00 100644 --- a/website/translated_docs/fr/Events/onDataChange.md +++ b/website/translated_docs/fr/Events/onDataChange.md @@ -3,7 +3,7 @@ id: onDataChange title: Sur données modifiées --- -| Code | Peut être appelé par | Définition | +| Code | Can be called by | Definition | | ---- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------- | | 20 | [4D Write Pro area](FormObjects/writeProArea_overview) - [Dropdown list](FormObjects/dropdownList_Overview.md) - Form - [Hierarchical List](FormObjects/list_overview.md) - [Input](FormObjects/input_overview.md) - [List Box](FormObjects/listbox_overview.md) - [List Box Column](FormObjects/listbox_overview.md#list-box-columns) - [Plug-in Area](FormObjects/pluginArea_overview.md#overview) - [Progress Indicators](FormObjects/progressIndicator.md) - [Ruler](FormObjects/ruler.md) - [Spinner](FormObjects/spinner.md) - [Stepper](FormObjects/stepper.md) - [Subform](FormObjects/subform_overview.md) | An object data has been modified | diff --git a/website/translated_docs/fr/Events/onDeactivate.md b/website/translated_docs/fr/Events/onDeactivate.md index 06babd10114d8f..28554948af4078 100644 --- a/website/translated_docs/fr/Events/onDeactivate.md +++ b/website/translated_docs/fr/Events/onDeactivate.md @@ -3,16 +3,16 @@ id: onDeactivate title: On Deactivate --- -| Code | Peut être appelé par | Définition | -| ---- | -------------------- | --------------------------------------------------- | -| 12 | Formulaire | The form’s window ceases to be the frontmost window | +| Code | Can be called by | Definition | +| ---- | ---------------- | --------------------------------------------------- | +| 12 | Form | The form’s window ceases to be the frontmost window | ## Description If the window of a form was the frontmost window, this event is called when the window is sent to the background. -Cet événement s'applique au formulaire dans son ensemble et non à un objet particulier. Consequently, if the `On Deactivate` form event property is selected, only the form will have its form method called. +This event applies to the form as a whole and not to a particular object. Consequently, if the `On Deactivate` form event property is selected, only the form will have its form method called. -### Voir également +### See also [Sur activation](onActivate.md) \ No newline at end of file diff --git a/website/translated_docs/fr/Events/onDeleteAction.md b/website/translated_docs/fr/Events/onDeleteAction.md index ae16c780ff3d45..505ad869d88384 100644 --- a/website/translated_docs/fr/Events/onDeleteAction.md +++ b/website/translated_docs/fr/Events/onDeleteAction.md @@ -3,7 +3,7 @@ id: onDeleteAction title: Sur action suppression --- -| Code | Peut être appelé par | Définition | +| Code | Can be called by | Definition | | ---- | ----------------------------------------------------------------------------------------------- | ----------------------------------- | | 58 | [Hierarchical List](FormObjects/list_overview.md) - [List Box](FormObjects/listbox_overview.md) | The user attempts to delete an item | diff --git a/website/translated_docs/fr/Events/onDisplayDetail.md b/website/translated_docs/fr/Events/onDisplayDetail.md index 732fcabae0fe4b..e24b6b4a99a3eb 100644 --- a/website/translated_docs/fr/Events/onDisplayDetail.md +++ b/website/translated_docs/fr/Events/onDisplayDetail.md @@ -3,7 +3,7 @@ id: onDisplayDetail title: Sur affichage corps --- -| Code | Peut être appelé par | Définition | +| Code | Can be called by | Definition | | ---- | -------------------------------------------------- | ------------------------------------------------------------------------------------------------- | | 8 | Form - [List Box](FormObjects/listbox_overview.md) | A record is about to be displayed in a list form or a row is about to be displayed in a list box. | @@ -30,7 +30,7 @@ In this context, the following sequence of calls to methods and form events is t Calling a 4D command that displays a dialog box from the `On Display Detail` event is not allowed and will cause a syntax error to occur. More particularly, the commands concerned are: `ALERT`, `DIALOG`, `CONFIRM`, `Request`, `ADD RECORD`, `MODIFY RECORD`, `DISPLAY SELECTION`, and `MODIFY SELECTION`. -### Liste box sélection +### Selection list box This event is generated when a row of a [**selection type**](FormObjects/listbox_overview.md#selection-list-boxes) list box is displayed. diff --git a/website/translated_docs/fr/Events/onDoubleClicked.md b/website/translated_docs/fr/Events/onDoubleClicked.md index 37321a524ac976..c8ef29f842df33 100644 --- a/website/translated_docs/fr/Events/onDoubleClicked.md +++ b/website/translated_docs/fr/Events/onDoubleClicked.md @@ -3,7 +3,7 @@ id: onDoubleClicked title: Sur double clic --- -| Code | Peut être appelé par | Définition | +| Code | Can be called by | Definition | | ---- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------ | | 13 | [4D View Pro Area](FormObjects/viewProArea_overview.md) - [4D Write Pro area](FormObjects/writeProArea_overview) - [Button](FormObjects/button_overview.md) - [Button Grid](FormObjects/buttonGrid_overview.md) - [Check Box](FormObjects/checkbox_overview.md) - [Combo Box](FormObjects/comboBox_overview.md) - [Dropdown list](FormObjects/dropdownList_Overview.md) - Form - [Hierarchical List](FormObjects/list_overview.md#overview) - [Input](FormObjects/input_overview.md) - [List Box](FormObjects/listbox_overview.md) - [List Box Column](FormObjects/listbox_overview.md#list-box-columns) - [Picture Button](FormObjects/pictureButton_overview.md) - [Picture Pop up menu](FormObjects/picturePopupMenu_overview.md) - [Plug-in Area](FormObjects/pluginArea_overview.md#overview) - [Progress Indicators](FormObjects/progressIndicator.md) - [Radio Button](FormObjects/radio_overview.md) - [Ruler](FormObjects/ruler.md) - [Spinner](FormObjects/spinner.md) - [Splitter](FormObjects/splitters.md) - [Stepper](FormObjects/stepper.md) - [Tab control](FormObjects/tabControl.md) | A double click occurred on an object | @@ -20,15 +20,15 @@ If both events are selected for an object, the `On Clicked` and then the `On Dou This event is generated when the user doubl-clicks anywhere on a 4D View Pro document. On this context, the [event object](overview.md#event-object) returned by the `FORM Event` command contains: -| Propriété | Type | Description | -| ----------- | ----------- | ------------------------------ | -| code | entier long | 13 | -| description | Texte | "On Double Clicked" | -| objectName | Texte | 4D View Pro area name | -| sheetName | Texte | Name of the sheet of the event | -| range | object | Cell range | +| Property | Type | Description | +| ----------- | ------- | ------------------------------ | +| code | longint | 13 | +| description | text | "On Double Clicked" | +| objectName | text | 4D View Pro area name | +| sheetName | text | Name of the sheet of the event | +| range | object | Cell range | -#### Exemple +#### Example ```4d If(FORM Event.code=On Double Clicked) diff --git a/website/translated_docs/fr/Events/onDragOver.md b/website/translated_docs/fr/Events/onDragOver.md index 1df5eb3b8ddf1a..ac1f3264af1112 100644 --- a/website/translated_docs/fr/Events/onDragOver.md +++ b/website/translated_docs/fr/Events/onDragOver.md @@ -3,7 +3,7 @@ id: onDragOver title: Sur glisser --- -| Code | Peut être appelé par | Définition | +| Code | Can be called by | Definition | | ---- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------ | | 21 | [4D Write Pro area](FormObjects/writeProArea_overview) - [Button](FormObjects/button_overview.md) - [Button Grid](FormObjects/buttonGrid_overview.md) - [Check Box](FormObjects/checkbox_overview.md) - [Dropdown list](FormObjects/dropdownList_Overview.md) - [Hierarchical List](FormObjects/list_overview.md#overview) - [Input](FormObjects/input_overview.md) - [List Box](FormObjects/listbox_overview.md) - [List Box Column](FormObjects/listbox_overview.md#list-box-columns) - [Picture Button](FormObjects/pictureButton_overview.md) - [Picture Pop up menu](FormObjects/picturePopupMenu_overview.md) - [Plug-in Area](FormObjects/pluginArea_overview.md#overview) - [Progress Indicators](FormObjects/progressIndicator.md) - [Radio Button](FormObjects/radio_overview.md) - [Ruler](FormObjects/ruler.md) - [Spinner](FormObjects/spinner.md) - [Splitter](FormObjects/splitters.md) - [Stepper](FormObjects/stepper.md) - [Tab control](FormObjects/tabControl.md) | Data could be dropped onto an object | @@ -26,5 +26,5 @@ The `On Drag Over` event is the means by which you control the first phase of a The code handling an `On Drag Over` event should be short and execute quickly, because that event is sent repeatedly to the current destination object, due to the movements of the mouse. -#### Voir également +#### See also [`Sur début survol`](onBeginDragOver.md) \ No newline at end of file diff --git a/website/translated_docs/fr/Events/onDrop.md b/website/translated_docs/fr/Events/onDrop.md index a98c854be5b24e..10b471fc4b5645 100644 --- a/website/translated_docs/fr/Events/onDrop.md +++ b/website/translated_docs/fr/Events/onDrop.md @@ -3,7 +3,7 @@ id: onDrop title: Sur déposer --- -| Code | Peut être appelé par | Définition | +| Code | Can be called by | Definition | | ---- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------ | | 16 | [4D Write Pro area](FormObjects/writeProArea_overview) - [Button](FormObjects/button_overview.md) - [Button Grid](FormObjects/buttonGrid_overview.md) - [Check Box](FormObjects/checkbox_overview.md) - [Dropdown list](FormObjects/dropdownList_Overview.md) - Form - [Hierarchical List](FormObjects/list_overview.md#overview) - [Input](FormObjects/input_overview.md) - [List Box](FormObjects/listbox_overview.md) - [List Box Column](FormObjects/listbox_overview.md#list-box-columns) - [Picture Button](FormObjects/pictureButton_overview.md) - [Picture Pop up menu](FormObjects/picturePopupMenu_overview.md) - [Plug-in Area](FormObjects/pluginArea_overview.md#overview) - [Progress Indicators](FormObjects/progressIndicator.md) - [Radio Button](FormObjects/radio_overview.md) - [Ruler](FormObjects/ruler.md) - [Spinner](FormObjects/spinner.md) - [Splitter](FormObjects/splitters.md) - [Stepper](FormObjects/stepper.md) - [Tab control](FormObjects/tabControl.md) | Data has been dropped onto an object | @@ -16,5 +16,5 @@ This event is not sent to the object if the drag was not accepted during the [`O -#### Voir également +#### See also [`Sur début survol`](onBeginDragOver.md) \ No newline at end of file diff --git a/website/translated_docs/fr/Events/onEndUrlLoading.md b/website/translated_docs/fr/Events/onEndUrlLoading.md index c81f3db1961f5b..d709c273a971bb 100644 --- a/website/translated_docs/fr/Events/onEndUrlLoading.md +++ b/website/translated_docs/fr/Events/onEndUrlLoading.md @@ -3,9 +3,9 @@ id: onEndUrlLoading title: On End URL Loading --- -| Code | Peut être appelé par | Définition | +| Code | Can be called by | Definition | | ---- | ------------------------------------------- | --------------------------------------------- | -| 49 | [Zone Web](FormObjects/webArea_overview.md) | All the resources of the URL have been loaded | +| 49 | [Web Area](FormObjects/webArea_overview.md) | All the resources of the URL have been loaded | ## Description diff --git a/website/translated_docs/fr/Events/onExpand.md b/website/translated_docs/fr/Events/onExpand.md index 4316ad953c2406..1ed4b237d48d52 100644 --- a/website/translated_docs/fr/Events/onExpand.md +++ b/website/translated_docs/fr/Events/onExpand.md @@ -3,7 +3,7 @@ id: onExpand title: Sur déployer --- -| Code | Peut être appelé par | Définition | +| Code | Can be called by | Definition | | ---- | -------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- | | 44 | [Hierarchical List](FormObjects/list_overview.md#overview) - [List Box](FormObjects/listbox_overview.md) | An element of the hierarchical list or hierarchical list box has been expanded using a click or a keystroke | @@ -14,5 +14,5 @@ title: Sur déployer - [Hierarchical list boxes](FormObjects/listbox_overview.md#hierarchical-list-boxes): This event is generated when a row of the hierarchical list box is expanded. -### Voir également +### See also [Sur contracter](onCollapse.md) \ No newline at end of file diff --git a/website/translated_docs/fr/Events/onFooterClick.md b/website/translated_docs/fr/Events/onFooterClick.md index a863e202ae7644..ce240164e27c7c 100644 --- a/website/translated_docs/fr/Events/onFooterClick.md +++ b/website/translated_docs/fr/Events/onFooterClick.md @@ -3,7 +3,7 @@ id: onFooterClick title: Sur clic pied --- -| Code | Peut être appelé par | Définition | +| Code | Can be called by | Definition | | ---- | ----------------------------------------------------------------------------------------------------------------- | ------------------------------------------------- | | 57 | [List Box](FormObjects/listbox_overview.md) - [List Box Column](FormObjects/listbox_overview.md#list-box-columns) | A click occurs in the footer of a list box column | diff --git a/website/translated_docs/fr/Events/onGettingFocus.md b/website/translated_docs/fr/Events/onGettingFocus.md index e49076ae6335cc..c86645d8b2e85f 100644 --- a/website/translated_docs/fr/Events/onGettingFocus.md +++ b/website/translated_docs/fr/Events/onGettingFocus.md @@ -3,7 +3,7 @@ id: onGettingFocus title: On getting focus --- -| Code | Peut être appelé par | Définition | +| Code | Can be called by | Definition | | ---- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------- | | 15 | [4D View Pro Area](FormObjects/viewProArea_overview.md) - [4D Write Pro area](FormObjects/writeProArea_overview) - [Button](FormObjects/button_overview.md) - [Check Box](FormObjects/checkbox_overview.md) - [Combo Box](FormObjects/comboBox_overview.md) - Form - [Hierarchical List](FormObjects/list_overview.md#overview) - [Input](FormObjects/input_overview.md) - [List Box](FormObjects/listbox_overview.md) - [List Box Column](FormObjects/listbox_overview.md#list-box-columns) - [Plug-in Area](FormObjects/pluginArea_overview.md#overview) - [Progress Indicators](FormObjects/progressIndicator.md) - [Radio Button](FormObjects/radio_overview.md) - [Ruler](FormObjects/ruler.md) - [Spinner](FormObjects/spinner.md) - [Stepper](FormObjects/stepper.md) - [Subform](FormObjects/subform_overview.md) - [Web area](FormObjects/webArea_overview.md) | A form object is getting the focus | diff --git a/website/translated_docs/fr/Events/onHeader.md b/website/translated_docs/fr/Events/onHeader.md index 3ad80eaab9ce72..f77341d85b2841 100644 --- a/website/translated_docs/fr/Events/onHeader.md +++ b/website/translated_docs/fr/Events/onHeader.md @@ -3,7 +3,7 @@ id: onHeader title: Sur entête --- -| Code | Peut être appelé par | Définition | +| Code | Can be called by | Definition | | ---- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------- | | 5 | [4D Write Pro area](FormObjects/writeProArea_overview) - [Button](FormObjects/button_overview.md) - [Button Grid](FormObjects/buttonGrid_overview.md) - [Check Box](FormObjects/checkbox_overview.md) - [Dropdown list](FormObjects/dropdownList_Overview.md) - Form (list form only) - [Hierarchical List](FormObjects/list_overview.md#overview) - [Input](FormObjects/input_overview.md) - [Picture Button](FormObjects/pictureButton_overview.md) - [Picture Pop up menu](FormObjects/picturePopupMenu_overview.md) - [Plug-in Area](FormObjects/pluginArea_overview.md#overview) - [Progress Indicators](FormObjects/progressIndicator.md) - [Radio Button](FormObjects/radio_overview.md) - [Ruler](FormObjects/ruler.md) - [Spinner](FormObjects/spinner.md) - [Splitter](FormObjects/splitters.md) - [Stepper](FormObjects/stepper.md) - [Tab control](FormObjects/tabControl.md) | The form's header area is about to be printed or displayed. | diff --git a/website/translated_docs/fr/Events/onHeaderClick.md b/website/translated_docs/fr/Events/onHeaderClick.md index e0b5002b0e9af5..a0bdfca05c816e 100644 --- a/website/translated_docs/fr/Events/onHeaderClick.md +++ b/website/translated_docs/fr/Events/onHeaderClick.md @@ -3,7 +3,7 @@ id: onHeaderClick title: Sur clic entête --- -| Code | Peut être appelé par | Définition | +| Code | Can be called by | Definition | | ---- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------- | | 42 | [4D View Pro Area](FormObjects/viewProArea_overview.md) - [List Box](FormObjects/listbox_overview.md) - [List Box Column](FormObjects/listbox_overview.md#list-box-columns) | A click occurs in a column header | @@ -25,16 +25,16 @@ If the [Sortable](FormObjects/properties_Action.md#sortable) property is not sel This event is generated when the user clicks on a column or row header in a 4D View Pro document. In this context, the [event object](overview.md#event-object) returned by the `FORM Event` command contains: -| Propriété | Type | Description | -| ----------- | ----------- | ----------------------------------------------------------------------------------------------------------------------------------- | -| code | entier long | 42 | -| description | Texte | "On Header Click" | -| objectName | Texte | 4D View Pro area name | -| sheetName | Texte | Name of the sheet of the event | -| range | object | Cell range | -| sheetArea | entier long | The sheet location where the event took place:
  • 0: The crossing area between column number/letter headers (top left of the sheet)
  • 1: The column headers (area indicating the column numbers/letters)
  • 2: The row headers (area indicating the row numbers)
  • | +| Property | Type | Description | +| ----------- | ------- | ----------------------------------------------------------------------------------------------------------------------------------- | +| code | longint | 42 | +| description | text | "On Header Click" | +| objectName | text | 4D View Pro area name | +| sheetName | text | Name of the sheet of the event | +| range | object | Cell range | +| sheetArea | longint | The sheet location where the event took place:
  • 0: The crossing area between column number/letter headers (top left of the sheet)
  • 1: The column headers (area indicating the column numbers/letters)
  • 2: The row headers (area indicating the row numbers)
  • | -#### Exemple +#### Example ```4d If(FORM Event.code=On Header Click) diff --git a/website/translated_docs/fr/Events/onLoad.md b/website/translated_docs/fr/Events/onLoad.md index c9fe3362c0522f..0a803c759a9503 100644 --- a/website/translated_docs/fr/Events/onLoad.md +++ b/website/translated_docs/fr/Events/onLoad.md @@ -3,7 +3,7 @@ id: onLoad title: On Load --- -| Code | Peut être appelé par | Définition | +| Code | Can be called by | Definition | | ---- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------- | | 1 | [4D View Pro Area](FormObjects/viewProArea_overview.md) - [4D Write Pro area](FormObjects/writeProArea_overview) - [Button](FormObjects/button_overview.md) - [Button Grid](FormObjects/buttonGrid_overview.md) - [Check Box](FormObjects/checkbox_overview.md) - [Combo Box](FormObjects/comboBox_overview.md) - [Dropdown list](FormObjects/dropdownList_Overview.md) - Form - [Hierarchical List](FormObjects/list_overview.md#overview) - [Input](FormObjects/input_overview.md) - [List Box](FormObjects/listbox_overview.md) - [List Box Column](FormObjects/listbox_overview.md#list-box-columns) - [Picture Button](FormObjects/pictureButton_overview.md) - [Picture Pop up menu](FormObjects/picturePopupMenu_overview.md) - [Plug-in Area](FormObjects/pluginArea_overview.md#overview) - [Progress Indicators](FormObjects/progressIndicator.md) - [Radio Button](FormObjects/radio_overview.md) - [Ruler](FormObjects/ruler.md) - [Spinner](FormObjects/spinner.md) - [Splitter](FormObjects/splitters.md) - [Stepper](FormObjects/stepper.md) - [Subform](FormObjects/subform_overview.md) - [Tab control](FormObjects/tabControl.md) - [Web Area](FormObjects/webArea_overview.md) | The form is about to be displayed or printed | @@ -17,11 +17,11 @@ All the objects of the form (from any page) whose `On Load` object event propert > The `On Load` and [`On Unload`](onUnload.md) events are generated for objects if they are enabled for both the objects and the form to which the objects belong. If the events are enabled for objects only, they will not occur; these two events must also be enabled at the form level. -### Sous-formulaire +### Subform The `On Load` event is generated when opening the subform (this event must also have been activated at the parent form level in order to be taken into account). The event is generated before those of the parent form. Also note that, in accordance with the operating principles of form events, if the subform is placed on a page other than page 0 or 1, this event will only be generated when that page is displayed (and not when the form is displayed). -### Voir également +### See also [`On Unload`](onUnload.md) \ No newline at end of file diff --git a/website/translated_docs/fr/Events/onLoadRecord.md b/website/translated_docs/fr/Events/onLoadRecord.md index d3ecfc68df0f86..4adf64d7543572 100644 --- a/website/translated_docs/fr/Events/onLoadRecord.md +++ b/website/translated_docs/fr/Events/onLoadRecord.md @@ -3,9 +3,9 @@ id: onLoadRecord title: Sur chargement ligne --- -| Code | Peut être appelé par | Définition | -| ---- | -------------------- | ------------------------------------------------------------------- | -| 40 | Formulaire | During user entry in list, a record is loaded and a field is edited | +| Code | Can be called by | Definition | +| ---- | ---------------- | ------------------------------------------------------------------- | +| 40 | Form | During user entry in list, a record is loaded and a field is edited | ## Description diff --git a/website/translated_docs/fr/Events/onLongClick.md b/website/translated_docs/fr/Events/onLongClick.md index 24fa5a4818db50..46063597b2a71d 100644 --- a/website/translated_docs/fr/Events/onLongClick.md +++ b/website/translated_docs/fr/Events/onLongClick.md @@ -3,9 +3,9 @@ id: onLongClick title: Sur clic long --- -| Code | Peut être appelé par | Définition | +| Code | Can be called by | Definition | | ---- | ---------------------------------------- | ------------------------------------------------------------------------------------ | -| 39 | [Bouton](FormObjects/button_overview.md) | A button is clicked and the mouse button remains pushed for a certain length of time | +| 39 | [Button](FormObjects/button_overview.md) | A button is clicked and the mouse button remains pushed for a certain length of time | ## Description @@ -14,17 +14,17 @@ This event is generated when a button receives a click and the mouse button is h This event can be generated for the following button styles: -- [Barre d’outils](FormObjects/button_overview.md#toolbar) +- [Toolbar](FormObjects/button_overview.md#toolbar) - [Bevel](FormObjects/button_overview.md#bevel) -- [Bevel arrondi](FormObjects/button_overview.md#rounded-bevel) +- [Rounded Bevel](FormObjects/button_overview.md#rounded-bevel) - [OS X Gradient](FormObjects/button_overview.md#os-x-gradient) -- [OS X Texture](FormObjects/button_overview.md#os-x-textured) +- [OS X Textured](FormObjects/button_overview.md#os-x-textured) - [Office XP](FormObjects/button_overview.md#office-xp) -- [Aide](FormObjects/button_overview.md#help) -- [Rond](FormObjects/button_overview.md#circle) -- [Personnalisé](FormObjects/button_overview.md#custom) +- [Help](FormObjects/button_overview.md#help) +- [Circle](FormObjects/button_overview.md#circle) +- [Custom](FormObjects/button_overview.md#custom) This event is generally used to display pop-up menus in case of long button clicks. The [`On Clicked`](onClicked.md) event, if enabled, is generated if the user releases the mouse button before the "long click" time limit. -### Voir également +### See also [`Sur clic alternatif`](onAlternativeClick.md) \ No newline at end of file diff --git a/website/translated_docs/fr/Events/onLosingFocus.md b/website/translated_docs/fr/Events/onLosingFocus.md index 9d94b10ab7f84d..6c220efb0a9bd1 100644 --- a/website/translated_docs/fr/Events/onLosingFocus.md +++ b/website/translated_docs/fr/Events/onLosingFocus.md @@ -3,7 +3,7 @@ id: onLosingFocus title: Sur perte focus --- -| Code | Peut être appelé par | Définition | +| Code | Can be called by | Definition | | ---- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------- | | 14 | [4D View Pro Area](FormObjects/viewProArea_overview.md) - [4D Write Pro area](FormObjects/writeProArea_overview) - [Button](FormObjects/button_overview.md) - [Check Box](FormObjects/checkbox_overview.md) - [Combo Box](FormObjects/comboBox_overview.md) - Form - [Hierarchical List](FormObjects/list_overview.md#overview) - [Input](FormObjects/input_overview.md) - [List Box](FormObjects/listbox_overview.md) - [List Box Column](FormObjects/listbox_overview.md#list-box-columns) - [Plug-in Area](FormObjects/pluginArea_overview.md#overview) - [Progress Indicators](FormObjects/progressIndicator.md) - [Radio Button](FormObjects/radio_overview.md) - [Ruler](FormObjects/ruler.md) - [Spinner](FormObjects/spinner.md) - [Stepper](FormObjects/stepper.md) - [Subform](FormObjects/subform_overview.md) - [Web area](FormObjects/webArea_overview.md) | A form object is losing the focus | diff --git a/website/translated_docs/fr/Events/onMenuSelected.md b/website/translated_docs/fr/Events/onMenuSelected.md index 608e0183031cf5..cdcb510c49b3f0 100644 --- a/website/translated_docs/fr/Events/onMenuSelected.md +++ b/website/translated_docs/fr/Events/onMenuSelected.md @@ -3,9 +3,9 @@ id: onMenuSelected title: Sur menu sélectionné --- -| Code | Peut être appelé par | Définition | -| ---- | -------------------- | ------------------------------------------------------ | -| 18 | Formulaire | A menu item has been chosen in the associated menu bar | +| Code | Can be called by | Definition | +| ---- | ---------------- | ------------------------------------------------------ | +| 18 | Form | A menu item has been chosen in the associated menu bar | ## Description diff --git a/website/translated_docs/fr/Events/onMouseEnter.md b/website/translated_docs/fr/Events/onMouseEnter.md index db70c0143d1251..921ca04daa4781 100644 --- a/website/translated_docs/fr/Events/onMouseEnter.md +++ b/website/translated_docs/fr/Events/onMouseEnter.md @@ -3,7 +3,7 @@ id: onMouseEnter title: Sur début survol --- -| Code | Peut être appelé par | Définition | +| Code | Can be called by | Definition | | ---- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------- | | 35 | [4D Write Pro area](FormObjects/writeProArea_overview) - [Button](FormObjects/button_overview.md) - [Button Grid](FormObjects/buttonGrid_overview.md) - [Check Box](FormObjects/checkbox_overview.md) - [Combo Box](FormObjects/comboBox_overview.md) - [Dropdown list](FormObjects/dropdownList_Overview.md) - Form - [Hierarchical List](FormObjects/list_overview.md#overview) - [Input](FormObjects/input_overview.md) - [List Box](FormObjects/listbox_overview.md) - [Picture Button](FormObjects/pictureButton_overview.md) - [Picture Pop up menu](FormObjects/picturePopupMenu_overview.md) - [Plug-in Area](FormObjects/pluginArea_overview.md#overview) - [Progress Indicators](FormObjects/progressIndicator.md) - [Radio Button](FormObjects/radio_overview.md) - [Ruler](FormObjects/ruler.md) - [Spinner](FormObjects/spinner.md) - [Splitter](FormObjects/splitters.md) - [Stepper](FormObjects/stepper.md) - [Tab control](FormObjects/tabControl.md) | The mouse cursor enters the graphic area of an object | @@ -21,7 +21,7 @@ Objects that are made invisible using the `OBJECT SET VISIBLE` command or the [V If the `On Mouse Enter` event has been checked for the form, it is generated for each form object. If it is checked for an object, it is generated only for that object. When there are superimposed objects, the event is generated by the first object capable of managing it that is found going in order from top level to bottom. -### Voir également +### See also - [`Sur survol`](onMouseMove.md) - [`Sur fin survol`](onMouseLeave.md) \ No newline at end of file diff --git a/website/translated_docs/fr/Events/onMouseLeave.md b/website/translated_docs/fr/Events/onMouseLeave.md index da9471aae28032..0e9c67c23752be 100644 --- a/website/translated_docs/fr/Events/onMouseLeave.md +++ b/website/translated_docs/fr/Events/onMouseLeave.md @@ -3,7 +3,7 @@ id: onMouseLeave title: Sur fin survol --- -| Code | Peut être appelé par | Définition | +| Code | Can be called by | Definition | | ---- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------- | | 36 | [4D Write Pro area](FormObjects/writeProArea_overview) - [Button](FormObjects/button_overview.md) - [Button Grid](FormObjects/buttonGrid_overview.md) - [Check Box](FormObjects/checkbox_overview.md) - [Combo Box](FormObjects/comboBox_overview.md) - [Dropdown list](FormObjects/dropdownList_Overview.md) - Form - [Hierarchical List](FormObjects/list_overview.md#overview) - [Input](FormObjects/input_overview.md) - [List Box](FormObjects/listbox_overview.md) - [Picture Button](FormObjects/pictureButton_overview.md) - [Picture Pop up menu](FormObjects/picturePopupMenu_overview.md) - [Plug-in Area](FormObjects/pluginArea_overview.md#overview) - [Progress Indicators](FormObjects/progressIndicator.md) - [Radio Button](FormObjects/radio_overview.md) - [Ruler](FormObjects/ruler.md) - [Spinner](FormObjects/spinner.md) - [Splitter](FormObjects/splitters.md) - [Stepper](FormObjects/stepper.md) - [Tab control](FormObjects/tabControl.md) | The mouse cursor leaves the graphic area of an object | @@ -21,7 +21,7 @@ Objects that are made invisible using the `OBJECT SET VISIBLE` command or the [V If the `On Mouse Leave` event has been checked for the form, it is generated for each form object. If it is checked for an object, it is generated only for that object. When there are superimposed objects, the event is generated by the first object capable of managing it that is found going in order from top level to bottom. -### Voir également +### See also - [`Sur survol`](onMouseMove.md) - [`Sur fin survol`](onMouseLeave.md) \ No newline at end of file diff --git a/website/translated_docs/fr/Events/onMouseMove.md b/website/translated_docs/fr/Events/onMouseMove.md index 6a59622485b6b4..406a87374a9110 100644 --- a/website/translated_docs/fr/Events/onMouseMove.md +++ b/website/translated_docs/fr/Events/onMouseMove.md @@ -3,7 +3,7 @@ id: onMouseMove title: Sur survol --- -| Code | Peut être appelé par | Définition | +| Code | Can be called by | Definition | | ---- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- | | 37 | [4D Write Pro area](FormObjects/writeProArea_overview) - [Button](FormObjects/button_overview.md) - [Button Grid](FormObjects/buttonGrid_overview.md) - [Check Box](FormObjects/checkbox_overview.md) - [Combo Box](FormObjects/comboBox_overview.md) - [Dropdown list](FormObjects/dropdownList_Overview.md) - Form - [Hierarchical List](FormObjects/list_overview.md#overview) - [Input](FormObjects/input_overview.md) - [List Box](FormObjects/listbox_overview.md) - [Picture Button](FormObjects/pictureButton_overview.md) - [Picture Pop up menu](FormObjects/picturePopupMenu_overview.md) - [Plug-in Area](FormObjects/pluginArea_overview.md#overview) - [Progress Indicators](FormObjects/progressIndicator.md) - [Radio Button](FormObjects/radio_overview.md) - [Ruler](FormObjects/ruler.md) - [Spinner](FormObjects/spinner.md) - [Splitter](FormObjects/splitters.md) - [Stepper](FormObjects/stepper.md) - [Tab control](FormObjects/tabControl.md) | The mouse cursor moves at least one pixel OR a modifier key (Shift, Alt/Option, Shift Lock) was pressed | @@ -26,7 +26,7 @@ Objects that are made invisible using the `OBJECT SET VISIBLE` command or the [V If the `On Mouse Move` event has been checked for the form, it is generated for each form object. If it is checked for an object, it is generated only for that object. When there are superimposed objects, the event is generated by the first object capable of managing it that is found going in order from top level to bottom. -### Voir également +### See also - [`Sur début survol`](onMouseEnter.md) - [`Sur fin survol`](onMouseLeave.md) \ No newline at end of file diff --git a/website/translated_docs/fr/Events/onMouseUp.md b/website/translated_docs/fr/Events/onMouseUp.md index 76761dd253b56b..a79ed6300ff914 100644 --- a/website/translated_docs/fr/Events/onMouseUp.md +++ b/website/translated_docs/fr/Events/onMouseUp.md @@ -3,7 +3,7 @@ id: onMouseUp title: On Mouse Up --- -| Code | Peut être appelé par | Définition | +| Code | Can be called by | Definition | | ---- | ----------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------- | | 2 | [Input](FormObjects/input_overview.md) of the `picture` [Type](FormObjects/properties_Object.md#type) | The user has just released the left mouse button in a Picture object | @@ -12,7 +12,7 @@ title: On Mouse Up The `On Mouse Up` event is generated when the user has just released the left mouse button while dragging in a picture input. This event is useful, for example, when you want the user to be able to move, resize or draw objects in a SVG area. -When the `On Mouse Up` event is generated, you can get the local coordinates where the mouse button was released. These coordinates are returned in the `MouseX` and `MouseY` System variables. Les coordonnées sont exprimées en pixels par rapport à l'angle supérieur gauche de l'image (0,0). +When the `On Mouse Up` event is generated, you can get the local coordinates where the mouse button was released. These coordinates are returned in the `MouseX` and `MouseY` System variables. The coordinates are expressed in pixels with respect to the top left corner of the picture (0,0). When using this event, you must also use the `Is waiting mouse up` command to handle cases where the "state manager" of the form is desynchronized, i.e. when the `On Mouse Up` event is not received after a click. This is the case for example when an alert dialog box is displayed above the form while the mouse button has not been released. For more information and an example of use of the `On Mouse Up` event, please refer to the description of the `Is waiting mouse up` command. diff --git a/website/translated_docs/fr/Events/onOpenDetail.md b/website/translated_docs/fr/Events/onOpenDetail.md index d45cab7ac8dfad..94f5cb038f4466 100644 --- a/website/translated_docs/fr/Events/onOpenDetail.md +++ b/website/translated_docs/fr/Events/onOpenDetail.md @@ -3,7 +3,7 @@ id: onOpenDetail title: Sur ouverture corps --- -| Code | Peut être appelé par | Définition | +| Code | Can be called by | Definition | | ---- | -------------------------------------------------- | ------------------------------------------------------------------------------------------- | | 25 | Form - [List Box](FormObjects/listbox_overview.md) | The detail form associated with the output form or with the list box is about to be opened. | diff --git a/website/translated_docs/fr/Events/onOpenExternalLink.md b/website/translated_docs/fr/Events/onOpenExternalLink.md index 474e997aab0c4b..120a009da05026 100644 --- a/website/translated_docs/fr/Events/onOpenExternalLink.md +++ b/website/translated_docs/fr/Events/onOpenExternalLink.md @@ -3,9 +3,9 @@ id: onOpenExternalLink title: On Open External Link --- -| Code | Peut être appelé par | Définition | +| Code | Can be called by | Definition | | ---- | ------------------------------------------- | ---------------------------------------------- | -| 52 | [Zone Web](FormObjects/webArea_overview.md) | An external URL has been opened in the browser | +| 52 | [Web Area](FormObjects/webArea_overview.md) | An external URL has been opened in the browser | ## Description @@ -15,5 +15,5 @@ This event is generated when the loading of a URL was blocked by the Web area an You can find out the blocked URL using the `WA Get last filtered URL` command. -### Voir également +### See also [`On URL Filtering`](onUrlFiltering.md) \ No newline at end of file diff --git a/website/translated_docs/fr/Events/onOutsideCall.md b/website/translated_docs/fr/Events/onOutsideCall.md index f759867393d437..6f584430593139 100644 --- a/website/translated_docs/fr/Events/onOutsideCall.md +++ b/website/translated_docs/fr/Events/onOutsideCall.md @@ -3,9 +3,9 @@ id: onOutsideCall title: Sur appel extérieur --- -| Code | Peut être appelé par | Définition | -| ---- | -------------------- | -------------------------------------------- | -| 10 | Formulaire | The form received a `POST OUTSIDE CALL` call | +| Code | Can be called by | Definition | +| ---- | ---------------- | -------------------------------------------- | +| 10 | Form | The form received a `POST OUTSIDE CALL` call | ## Description diff --git a/website/translated_docs/fr/Events/onPageChange.md b/website/translated_docs/fr/Events/onPageChange.md index bd7d72a9d83349..3770239bcb97d1 100644 --- a/website/translated_docs/fr/Events/onPageChange.md +++ b/website/translated_docs/fr/Events/onPageChange.md @@ -3,9 +3,9 @@ id: onPageChange title: Sur changement page --- -| Code | Peut être appelé par | Définition | -| ---- | -------------------- | --------------------------------------- | -| 56 | Formulaire | The current page of the form is changed | +| Code | Can be called by | Definition | +| ---- | ---------------- | --------------------------------------- | +| 56 | Form | The current page of the form is changed | ## Description diff --git a/website/translated_docs/fr/Events/onPlugInArea.md b/website/translated_docs/fr/Events/onPlugInArea.md index 202d90d00e27b5..640b1bf8caede3 100644 --- a/website/translated_docs/fr/Events/onPlugInArea.md +++ b/website/translated_docs/fr/Events/onPlugInArea.md @@ -3,7 +3,7 @@ id: onPlugInArea title: Sur appel zone du plug in --- -| Code | Peut être appelé par | Définition | +| Code | Can be called by | Definition | | ---- | ------------------------------------------------------------------ | ------------------------------------------------------------- | | 19 | Form - [Plug-in Area](FormObjects/pluginArea_overview.md#overview) | An external object requested its object method to be executed | diff --git a/website/translated_docs/fr/Events/onPrintingBreak.md b/website/translated_docs/fr/Events/onPrintingBreak.md index 879ba3117ec355..d6fde44f7cd5f2 100644 --- a/website/translated_docs/fr/Events/onPrintingBreak.md +++ b/website/translated_docs/fr/Events/onPrintingBreak.md @@ -3,7 +3,7 @@ id: onPrintingBreak title: On Printing Break --- -| Code | Peut être appelé par | Définition | +| Code | Can be called by | Definition | | ---- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------- | | 6 | [4D Write Pro area](FormObjects/writeProArea_overview) - [Button](FormObjects/button_overview.md) - [Button Grid](FormObjects/buttonGrid_overview.md) - [Check Box](FormObjects/checkbox_overview.md) - [Combo Box](FormObjects/comboBox_overview.md) - [Dropdown list](FormObjects/dropdownList_Overview.md) - Form - [Hierarchical List](FormObjects/list_overview.md) - [Input](FormObjects/input_overview.md) - [Picture Button](FormObjects/pictureButton_overview.md) - [Picture Pop up menu](FormObjects/picturePopupMenu_overview.md) - [Plug-in Area](FormObjects/pluginArea_overview.md#overview) - [Progress Indicators](FormObjects/progressIndicator.md) - [Radio Button](FormObjects/radio_overview.md) - [Ruler](FormObjects/ruler.md) - [Spinner](FormObjects/spinner.md) - [Splitter](FormObjects/splitters.md) - [Stepper](FormObjects/stepper.md) - [Tab control](FormObjects/tabControl.md) | One of the form’s break areas is about to be printed | diff --git a/website/translated_docs/fr/Events/onPrintingDetail.md b/website/translated_docs/fr/Events/onPrintingDetail.md index e04039919ee5bf..7770c6c6afad20 100644 --- a/website/translated_docs/fr/Events/onPrintingDetail.md +++ b/website/translated_docs/fr/Events/onPrintingDetail.md @@ -3,7 +3,7 @@ id: onPrintingDetail title: On Printing Detail --- -| Code | Peut être appelé par | Définition | +| Code | Can be called by | Definition | | ---- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------- | | 23 | [4D Write Pro area](FormObjects/writeProArea_overview) - [Button](FormObjects/button_overview.md) - [Button Grid](FormObjects/buttonGrid_overview.md) - [Check Box](FormObjects/checkbox_overview.md) - [Combo Box](FormObjects/comboBox_overview.md) - [Dropdown list](FormObjects/dropdownList_Overview.md) - Form - [Hierarchical List](FormObjects/list_overview.md) - [Input](FormObjects/input_overview.md) - [Picture Button](FormObjects/pictureButton_overview.md) - [Picture Pop up menu](FormObjects/picturePopupMenu_overview.md) - [Plug-in Area](FormObjects/pluginArea_overview.md#overview) - [Progress Indicators](FormObjects/progressIndicator.md) - [Radio Button](FormObjects/radio_overview.md) - [Ruler](FormObjects/ruler.md) - [Spinner](FormObjects/spinner.md) - [Splitter](FormObjects/splitters.md) - [Stepper](FormObjects/stepper.md) - [Tab control](FormObjects/tabControl.md) | The form’s detail area is about to be printed | diff --git a/website/translated_docs/fr/Events/onPrintingFooter.md b/website/translated_docs/fr/Events/onPrintingFooter.md index ed66a547593634..940044383e1760 100644 --- a/website/translated_docs/fr/Events/onPrintingFooter.md +++ b/website/translated_docs/fr/Events/onPrintingFooter.md @@ -3,7 +3,7 @@ id: onPrintingFooter title: On Printing Footer --- -| Code | Peut être appelé par | Définition | +| Code | Can be called by | Definition | | ---- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------- | | 7 | [4D Write Pro area](FormObjects/writeProArea_overview) - [Button](FormObjects/button_overview.md) - [Button Grid](FormObjects/buttonGrid_overview.md) - [Check Box](FormObjects/checkbox_overview.md) - [Combo Box](FormObjects/comboBox_overview.md) - [Dropdown list](FormObjects/dropdownList_Overview.md) - Form - [Hierarchical List](FormObjects/list_overview.md) - [Input](FormObjects/input_overview.md) - [Picture Button](FormObjects/pictureButton_overview.md) - [Picture Pop up menu](FormObjects/picturePopupMenu_overview.md) - [Plug-in Area](FormObjects/pluginArea_overview.md#overview) - [Progress Indicators](FormObjects/progressIndicator.md) - [Radio Button](FormObjects/radio_overview.md) - [Ruler](FormObjects/ruler.md) - [Spinner](FormObjects/spinner.md) - [Splitter](FormObjects/splitters.md) - [Stepper](FormObjects/stepper.md) - [Tab control](FormObjects/tabControl.md) | The form’s footer area is about to be printed | diff --git a/website/translated_docs/fr/Events/onResize.md b/website/translated_docs/fr/Events/onResize.md index 9258900815af35..de069bcca70cda 100644 --- a/website/translated_docs/fr/Events/onResize.md +++ b/website/translated_docs/fr/Events/onResize.md @@ -3,9 +3,9 @@ id: onResize title: Sur redimensionnement --- -| Code | Peut être appelé par | Définition | -| ---- | -------------------- | ------------------------------------------------------------------------------------------------------------------------------------- | -| 29 | Formulaire | The form's window is resized or the subform object is resized (in this case the event is generated in the form method of the subform) | +| Code | Can be called by | Definition | +| ---- | ---------------- | ------------------------------------------------------------------------------------------------------------------------------------- | +| 29 | Form | The form's window is resized or the subform object is resized (in this case the event is generated in the form method of the subform) | ## Description diff --git a/website/translated_docs/fr/Events/onRowMoved.md b/website/translated_docs/fr/Events/onRowMoved.md index b73bc7248df3bd..71ff0c4ce6b236 100644 --- a/website/translated_docs/fr/Events/onRowMoved.md +++ b/website/translated_docs/fr/Events/onRowMoved.md @@ -3,7 +3,7 @@ id: onRowMoved title: Sur déplacement ligne --- -| Code | Peut être appelé par | Définition | +| Code | Can be called by | Definition | | ---- | ---------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------- | | 34 | [List Box of the array type](FormObjects/listbox_overview.md#array-list-boxes) - [List Box Column](FormObjects/listbox_overview.md#list-box-columns) | A list box row is moved by the user via drag and drop | diff --git a/website/translated_docs/fr/Events/onRowResize.md b/website/translated_docs/fr/Events/onRowResize.md index 197fb0abdd6bab..85d571afe88df2 100644 --- a/website/translated_docs/fr/Events/onRowResize.md +++ b/website/translated_docs/fr/Events/onRowResize.md @@ -3,7 +3,7 @@ id: onRowResize title: On Row Resize --- -| Code | Peut être appelé par | Définition | +| Code | Can be called by | Definition | | ---- | ------------------------------------------------------- | -------------------------------------------------------- | | 60 | [4D View Pro Area](FormObjects/viewProArea_overview.md) | The height of a row is modified by a user with the mouse | @@ -12,16 +12,16 @@ title: On Row Resize This event is generated when the height of a row is modified by a user in a 4D View Pro document. In this context, the [event object](overview.md#event-object) returned by the `FORM Event` command contains: -| Propriété | Type | Description | -| ----------- | ----------- | ---------------------------------------------------------------- | -| code | entier long | 60 | -| description | Texte | "On Row Resize" | -| objectName | Texte | 4D View Pro area name | -| sheetName | Texte | Name of the sheet of the event | -| range | object | Cell range of the rows whose heights have changed | -| header | boolean | True if the column header row (first row) is resized, else false | +| Property | Type | Description | +| ----------- | ------- | ---------------------------------------------------------------- | +| code | longint | 60 | +| description | text | "On Row Resize" | +| objectName | text | 4D View Pro area name | +| sheetName | text | Name of the sheet of the event | +| range | object | Cell range of the rows whose heights have changed | +| header | boolean | True if the column header row (first row) is resized, else false | -#### Exemple +#### Example ```4d If(FORM Event.code=On Row Resize) diff --git a/website/translated_docs/fr/Events/onScroll.md b/website/translated_docs/fr/Events/onScroll.md index 368213959a1f69..640af5ab1ee425 100644 --- a/website/translated_docs/fr/Events/onScroll.md +++ b/website/translated_docs/fr/Events/onScroll.md @@ -3,7 +3,7 @@ id: onScroll title: Sur défilement --- -| Code | Peut être appelé par | Définition | +| Code | Can be called by | Definition | | ---- | --------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------ | | 59 | [Input](FormObjects/input_overview.md) of the `picture` [Type](FormObjects/properties_Object.md#type) - [List Box](FormObjects/listbox_overview.md) | The user scrolls the contents of a picture object or list box using the mouse or keyboard. | diff --git a/website/translated_docs/fr/Events/onSelectionChange.md b/website/translated_docs/fr/Events/onSelectionChange.md index d44004a6b1f106..7983d9db36f916 100644 --- a/website/translated_docs/fr/Events/onSelectionChange.md +++ b/website/translated_docs/fr/Events/onSelectionChange.md @@ -3,7 +3,7 @@ id: onSelectionChange title: Sur nouvelle sélection --- -| Code | Peut être appelé par | Définition | +| Code | Can be called by | Definition | | ---- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------- | | 31 | [4D View Pro area](FormObjects/viewProArea_overview.md) - [4D Write Pro area](FormObjects/writeProArea_overview.md) - Form - [Hierarchical List](FormObjects/list_overview.md) - [Input](FormObjects/input_overview.md) - [List Box](FormObjects/listbox_overview.md) | The selection in the object is modified | @@ -16,16 +16,16 @@ This event can be generated in different contexts. ### 4D View Pro The current selection of rows or columns is modified. In this context, the [event object](overview.md#event-object) returned by the `FORM Event` command contains: -| Propriété | Type | Description | -| ------------- | ----------- | ------------------------------ | -| code | entier long | 31 | -| description | Texte | "On Selection Change" | -| objectName | Texte | 4D View Pro area name | -| sheetName | Texte | Name of the sheet of the event | -| oldSelections | object | Cell range before change | -| newSelections | object | Cell range after change | +| Property | Type | Description | +| ------------- | ------- | ------------------------------ | +| code | longint | 31 | +| description | text | "On Selection Change" | +| objectName | text | 4D View Pro area name | +| sheetName | text | Name of the sheet of the event | +| oldSelections | object | Cell range before change | +| newSelections | object | Cell range after change | -#### Exemple +#### Example ```4d If(FORM Event.code=On Selection Change) diff --git a/website/translated_docs/fr/Events/onTimer.md b/website/translated_docs/fr/Events/onTimer.md index 8f35ec82fc92ef..497ad22e399838 100644 --- a/website/translated_docs/fr/Events/onTimer.md +++ b/website/translated_docs/fr/Events/onTimer.md @@ -3,9 +3,9 @@ id: onTimer title: Sur minuteur --- -| Code | Peut être appelé par | Définition | -| ---- | -------------------- | ----------------------------------------------------------------- | -| 27 | Formulaire | The number of ticks defined by the `SET TIMER` command has passed | +| Code | Can be called by | Definition | +| ---- | ---------------- | ----------------------------------------------------------------- | +| 27 | Form | The number of ticks defined by the `SET TIMER` command has passed | ## Description diff --git a/website/translated_docs/fr/Events/onUnload.md b/website/translated_docs/fr/Events/onUnload.md index 1dfcf112e86609..eb978ff72d16ad 100644 --- a/website/translated_docs/fr/Events/onUnload.md +++ b/website/translated_docs/fr/Events/onUnload.md @@ -3,7 +3,7 @@ id: onUnload title: On Unload --- -| Code | Peut être appelé par | Définition | +| Code | Can be called by | Definition | | ---- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------- | | 24 | [4D View Pro Area](FormObjects/viewProArea_overview.md) - [4D Write Pro area](FormObjects/writeProArea_overview) - [Button](FormObjects/button_overview.md) - [Button Grid](FormObjects/buttonGrid_overview.md) - [Check Box](FormObjects/checkbox_overview.md) - [Combo Box](FormObjects/comboBox_overview.md) - [Dropdown list](FormObjects/dropdownList_Overview.md) - Form - [Hierarchical List](FormObjects/list_overview.md#overview) - [Input](FormObjects/input_overview.md) - [List Box](FormObjects/listbox_overview.md) - [List Box Column](FormObjects/listbox_overview.md#list-box-columns) - [Picture Button](FormObjects/pictureButton_overview.md) - [Picture Pop up menu](FormObjects/picturePopupMenu_overview.md) - [Plug-in Area](FormObjects/pluginArea_overview.md#overview) - [Progress Indicators](FormObjects/progressIndicator.md) - [Radio Button](FormObjects/radio_overview.md) - [Ruler](FormObjects/ruler.md) - [Spinner](FormObjects/spinner.md) - [Splitter](FormObjects/splitters.md) - [Stepper](FormObjects/stepper.md) - [Subform](FormObjects/subform_overview.md) - [Tab control](FormObjects/tabControl.md) - [Web Area](FormObjects/webArea_overview.md) | The form is about to be exited and released | @@ -18,11 +18,11 @@ All the objects of the form (from any page) whose `On Unload` object event prope -### Sous-formulaire +### Subform -The `On Unload` event is generated when the subform is closing (this event must also have been activated at the parent form level in order to be taken into account). The event is generated before those of the parent form. The event is generated before those of the parent form. +The `On Unload` event is generated when the subform is closing (this event must also have been activated at the parent form level in order to be taken into account). The event is generated before those of the parent form. Also note that, in accordance with the operating principles of form events, if the subform is placed on a page other than page 0 or 1, this event will only be generated when that page is closed (and not when the form is closed). -### Voir également +### See also [`On Load`](onLoad.md) \ No newline at end of file diff --git a/website/translated_docs/fr/Events/onUrlFiltering.md b/website/translated_docs/fr/Events/onUrlFiltering.md index dde9d375bed51d..4a950e58287b8a 100644 --- a/website/translated_docs/fr/Events/onUrlFiltering.md +++ b/website/translated_docs/fr/Events/onUrlFiltering.md @@ -3,9 +3,9 @@ id: onUrlFiltering title: On URL Filtering --- -| Code | Peut être appelé par | Définition | +| Code | Can be called by | Definition | | ---- | ------------------------------------------- | --------------------------------- | -| 51 | [Zone Web](FormObjects/webArea_overview.md) | A URL was blocked by the Web area | +| 51 | [Web Area](FormObjects/webArea_overview.md) | A URL was blocked by the Web area | ## Description @@ -14,5 +14,5 @@ This event is generated when the loading of a URL is blocked by the Web area bec You can find out the blocked URL using the `WA Get last filtered URL` command. -### Voir également +### See also [`On Open External Link`](onOpenExternalLink.md) \ No newline at end of file diff --git a/website/translated_docs/fr/Events/onUrlLoadingError.md b/website/translated_docs/fr/Events/onUrlLoadingError.md index 73f78df966eeef..b5b6930770155a 100644 --- a/website/translated_docs/fr/Events/onUrlLoadingError.md +++ b/website/translated_docs/fr/Events/onUrlLoadingError.md @@ -3,9 +3,9 @@ id: onUrlLoadingError title: On URL Loading Error --- -| Code | Peut être appelé par | Définition | +| Code | Can be called by | Definition | | ---- | ------------------------------------------- | ------------------------------------------ | -| 50 | [Zone Web](FormObjects/webArea_overview.md) | An error occurred when the URL was loading | +| 50 | [Web Area](FormObjects/webArea_overview.md) | An error occurred when the URL was loading | ## Description @@ -15,5 +15,5 @@ This event is generated when an error is detected during the loading of a URL. You can call the `WA GET LAST URL ERROR` command in order to get information about the error. -### Voir également +### See also [`On Open External Link`](onOpenExternalLink.md) \ No newline at end of file diff --git a/website/translated_docs/fr/Events/onUrlResourceLoading.md b/website/translated_docs/fr/Events/onUrlResourceLoading.md index 9724229d7f807c..529bff80d522be 100644 --- a/website/translated_docs/fr/Events/onUrlResourceLoading.md +++ b/website/translated_docs/fr/Events/onUrlResourceLoading.md @@ -3,9 +3,9 @@ id: onUrlResourceLoading title: On URL Resource Loading --- -| Code | Peut être appelé par | Définition | +| Code | Can be called by | Definition | | ---- | ------------------------------------------- | ---------------------------------------- | -| 48 | [Zone Web](FormObjects/webArea_overview.md) | A new resource is loaded in the Web area | +| 48 | [Web Area](FormObjects/webArea_overview.md) | A new resource is loaded in the Web area | ## Description @@ -15,5 +15,5 @@ This event is generated each time a new resource (picture, frame, etc.) is loade The [Progression](FormObjects/properties_WebArea.md#progression) variable associated with the area lets you find out the current state of the loading. -### Voir également +### See also [`On Open External Link`](onOpenExternalLink.md) \ No newline at end of file diff --git a/website/translated_docs/fr/Events/onValidate.md b/website/translated_docs/fr/Events/onValidate.md index 29bf3e88ad4ac8..36f9d7aac17467 100644 --- a/website/translated_docs/fr/Events/onValidate.md +++ b/website/translated_docs/fr/Events/onValidate.md @@ -3,7 +3,7 @@ id: onValidate title: Sur validation --- -| Code | Peut être appelé par | Définition | +| Code | Can be called by | Definition | | ---- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------- | | 3 | [4D Write Pro area](FormObjects/writeProArea_overview) - [Button](FormObjects/button_overview.md) - [Button Grid](FormObjects/buttonGrid_overview.md) - [Check Box](FormObjects/checkbox_overview.md) - [Combo Box](FormObjects/comboBox_overview.md) - [Dropdown list](FormObjects/dropdownList_Overview.md) - Form - [Hierarchical List](FormObjects/list_overview.md#overview) - [Input](FormObjects/input_overview.md) - [List Box](FormObjects/listbox_overview.md) - [List Box Column](FormObjects/listbox_overview.md#list-box-columns) - [Picture Button](FormObjects/pictureButton_overview.md) - [Picture Pop up menu](FormObjects/picturePopupMenu_overview.md) - [Plug-in Area](FormObjects/pluginArea_overview.md#overview) - [Progress Indicators](FormObjects/progressIndicator.md) - [Radio Button](FormObjects/radio_overview.md) - [Ruler](FormObjects/ruler.md) - [Spinner](FormObjects/spinner.md) - [Splitter](FormObjects/splitters.md) - [Stepper](FormObjects/stepper.md) - [Subform](FormObjects/subform_overview.md) - [Tab control](FormObjects/tabControl.md) | The record data entry has been validated | @@ -13,6 +13,6 @@ title: Sur validation This event is triggered when the record data entry has been validated, for example after a `SAVE RECORD` command call or an `accept` [standard action](FormObjects/properties_Action.md#standard-action). -### Sous-formulaire +### Subform The `On Validate` event is triggered when data entry is validated in the subform. \ No newline at end of file diff --git a/website/translated_docs/fr/Events/onVpRangeChanged.md b/website/translated_docs/fr/Events/onVpRangeChanged.md index ec2bb0d8ce7309..dc6962fd57f24a 100644 --- a/website/translated_docs/fr/Events/onVpRangeChanged.md +++ b/website/translated_docs/fr/Events/onVpRangeChanged.md @@ -3,25 +3,25 @@ id: onVpRangeChanged title: On VP Range Changed --- -| Code | Peut être appelé par | Définition | -| ---- | ------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- | -| 61 | [4D View Pro Area](FormObjects/viewProArea_overview.md) | La plage de cellules 4D View Pro a changé (ex : un calcul de formule, une valeur supprimée d'une cellule, etc.) | +| Code | Can be called by | Definition | +| ---- | ------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- | +| 61 | [4D View Pro Area](FormObjects/viewProArea_overview.md) | The 4D View Pro cell range has changed (e.g., a formula calculation, value removed from a cell, etc.) | ## Description -Cet événement est généré lorsqu'un changement intervient dans une plage de cellules dans le document 4D View Pro. +This event is generated when a change occurs within a cell range in the 4D View Pro document. -L'objet retourné par la commande FORM Event contient : +The object returned by the FORM Event command contains: -| Propriété | Type | Description | -| ------------ | ----------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| objectName | Texte | 4D View Pro area name | -| code | entier long | On VP Range Changed | -| description | Texte | "On VP Range Changed" | -| sheetName | Texte | Name of the sheet of the event | -| range | object | Plage de cellules liées au changement | -| changedCells | object | Plage contenant uniquement les cellules modifiées. Il peut s'agir d'une gamme combinée. | -| action | Texte | Le type d'opération générant l'événement :

  • "clear" - A clear range value operation
  • "dragDrop" - Une opération de glisser-déposer
  • "dragFill" - Une opération de remplissage par glisser
  • "evaluFormula" - Définition d'une formule dans une plage de cellules spécifiée
  • "coller" - Une opération de collage
  • "setArrayFormula" - Définition d'une formule dans une plage de cellules spécifiée
  • "sort" - Tri d'une plage de cellules
  • | -> Voir également [On After Edit](onAfterEdit.md). +| Property | Type | Description | +| ------------ | ------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| objectName | text | 4D View Pro area name | +| code | longint | On VP Range Changed | +| description | text | "On VP Range Changed" | +| sheetName | text | Name of the sheet of the event | +| range | object | Cell range of the change | +| changedCells | object | Range containing only the changed cells. It can be a combined range. | +| action | text | The type of operation generating the event:

  • "clear" - A clear range value operation
  • "dragDrop" - A drag and drop operation
  • "dragFill" - A drag fill operation
  • "evaluateFormula" - Setting a formula in a specified cell range
  • "paste" - A paste operation
  • "setArrayFormula" - Setting a formula in a specified cell range
  • "sort" - Sorting a range of cells
  • | +> See also [On After Edit](onAfterEdit.md). diff --git a/website/translated_docs/fr/Events/onVpReady.md b/website/translated_docs/fr/Events/onVpReady.md index 853f1b1aade52d..b6faa860588d50 100644 --- a/website/translated_docs/fr/Events/onVpReady.md +++ b/website/translated_docs/fr/Events/onVpReady.md @@ -3,7 +3,7 @@ id: onVpReady title: On VP Ready --- -| Code | Peut être appelé par | Définition | +| Code | Can be called by | Definition | | ---- | ------------------------------------------------------- | ----------------------------------------------- | | 9 | [4D View Pro Area](FormObjects/viewProArea_overview.md) | The loading of the 4D View Pro area is complete | diff --git a/website/translated_docs/fr/Events/onWindowOpeningDenied.md b/website/translated_docs/fr/Events/onWindowOpeningDenied.md index 5ec79b5c22d122..baf5cec0a000a4 100644 --- a/website/translated_docs/fr/Events/onWindowOpeningDenied.md +++ b/website/translated_docs/fr/Events/onWindowOpeningDenied.md @@ -3,9 +3,9 @@ id: onWindowOpeningDenied title: On Window Opening Denied --- -| Code | Peut être appelé par | Définition | +| Code | Can be called by | Definition | | ---- | ------------------------------------------- | -------------------------------- | -| 53 | [Zone Web](FormObjects/webArea_overview.md) | A pop-up window has been blocked | +| 53 | [Web Area](FormObjects/webArea_overview.md) | A pop-up window has been blocked | ## Description @@ -15,5 +15,5 @@ This event is generated when the opening of a pop-up window is blocked by the We You can find out the blocked URL using the `WA Get last filtered URL` command. -### Voir également +### See also [`On Open External Link`](onOpenExternalLink.md) \ No newline at end of file diff --git a/website/translated_docs/fr/Events/overview.md b/website/translated_docs/fr/Events/overview.md index b9c8515e00ef46..9fca6707a66cb0 100644 --- a/website/translated_docs/fr/Events/overview.md +++ b/website/translated_docs/fr/Events/overview.md @@ -5,7 +5,7 @@ title: Aperçu Form events are events that can lead to the execution of the form method and/or form object method(s). Form events allow you to control the flow of your application and to write code that is executed only when a specific event occurs. -In your code, you control the events using the `FORM Event` command, that returns the triggered event. Par exemple: +In your code, you control the events using the `FORM Event` command, that returns the triggered event. For example: ```4d //code of a button @@ -21,15 +21,17 @@ End if Each event is returned as an object by the `FORM Event` command. By default, it contains the following properties: -| Propriété | Type | Description | -| --------- | ---- | ----------- | -| | | | - objectName|text|Name of the object triggering the event - Not included if the event is triggered by the form| |code|longint|Numeric value of the form event. Also returned by the +| Property | Type | Description | +| -------- | ---- | ----------- | +| | | | + objectName|text|Name of the object triggering the event - Not included if the event is triggered by the form| |code|longint|Numeric value of the form event. Also returned by the -Additional properties are returned when the event occurs on specific objects. En particulier : +`Form event code` command| |description|text|Name of the form event (e.g. "On After Edit")| -- Les [list box](FormObjects/listbox_overview.md#supported-form-events) et les [colonnes de list box](FormObjects/listbox_overview.md#supported-form-events-1) retournent des [propriétés supplémentaires](FormObjects/listbox_overview.md#additional-properties) telles que `columnName` ou `isRowSelected`. -- Les [zones 4D View Pro](FormObjects/viewProArea_overview.md) retournent par exemple des propriétés `sheetName` ou `action` dans l'objet événement [On After Edit](onAfterEdit.md). +Additional properties are returned when the event occurs on specific objects. In particular: + +- [list boxes](FormObjects/listbox_overview.md#supported-form-events) and [list box columns](FormObjects/listbox_overview.md#supported-form-events-1) return [additional properties](FormObjects/listbox_overview.md#additional-properties) such as `columnName` or `isRowSelected`. +- [4D View Pro areas](FormObjects/viewProArea_overview.md) return for example `sheetName` or `action` properties in the [On After Edit](onAfterEdit.md) event object. ## Events and Methods @@ -49,68 +51,68 @@ The number of objects involved in an event depends on the nature of the event. The following table summarizes how object and form methods are called for each event type: -| Evénement | Méthode objet | Méthode formulaire | Objets | -| ----------------------------- | ---------------------------------- | ------------------ | --------------------------- | -| On Load | Oui | Oui | Tous les objets | -| On Unload | Oui | Oui | Tous les objets | -| Sur validation | Oui | Oui | Tous les objets | -| Sur clic | Oui | Oui | Objets concernés uniquement | -| Sur double clic | Oui | Oui | Objets concernés uniquement | -| Sue avant frappe clavier | Oui | Oui | Objets concernés uniquement | -| Sue après frappe clavier | Oui | Oui | Objets concernés uniquement | -| Sur après modification | Oui | Oui | Objets concernés uniquement | -| On Getting Focus | Oui | Oui | Objets concernés uniquement | -| On Losing Focus | Oui | Oui | Objets concernés uniquement | -| Sur activation | Jamais | Oui | Aucun | -| On Deactivate | Jamais | Oui | Aucun | -| Sur appel extérieur | Jamais | Oui | Aucun | -| Sur changement page | Jamais | Oui | Aucun | -| Sur début survol | Oui | Oui | Objets concernés uniquement | -| Sur déposer | Oui | Oui | Objets concernés uniquement | -| Sur glisser | Oui | Jamais | Objets concernés uniquement | -| Sur début survol | Oui | Oui | Tous les objets | -| Sur survol | Oui | Oui | Tous les objets | -| Sur fin survol | Oui | Oui | Tous les objets | -| On Mouse Up | Oui | Jamais | Objets concernés uniquement | -| Sur menu sélectionné | Jamais | Oui | Aucun | -| On Bound variable change | Jamais | Oui | Aucun | -| Sur données modifiées | Oui | Oui | Objets concernés uniquement | -| Sur appel zone du plug in | Oui | Oui | Objets concernés uniquement | -| Sur entête | Oui | Oui | Tous les objets | -| On Printing Detail | Oui | Oui | Tous les objets | -| On Printing Break | Oui | Oui | Tous les objets | -| On Printing Footer | Oui | Oui | Tous les objets | -| On Close Box | Jamais | Oui | Aucun | -| Sur affichage corps | Oui | Oui | Tous les objets | -| Sur ouverture corps | Oui (List box) | Oui | Aucun, excepté les List box | -| Sur fermeture corps | Oui (List box) | Oui | Aucun, excepté les List box | -| Sur redimensionnement | Jamais | Oui | Aucun | -| Sur nouvelle sélection | Oui | Oui | Objets concernés uniquement | -| Sur chargement ligne | Jamais | Oui | Aucun | -| Sur minuteur | Jamais | Oui | Aucun | -| Sur défilement | Oui | Jamais | Objets concernés uniquement | -| Sur avant saisie | Oui (List box) | Jamais | Objets concernés uniquement | -| Sur déplacement colonne | Oui (List box) | Jamais | Objets concernés uniquement | -| Sur déplacement ligne | Oui (List box) | Jamais | Objets concernés uniquement | -| Sur redimensionnement colonne | Oui (List box et Zone 4D View Pro) | Jamais | Objets concernés uniquement | -| Sur clic entête | Oui (List box et Zone 4D View Pro) | Jamais | Objets concernés uniquement | -| Sur clic pied | Oui (List box) | Jamais | Objets concernés uniquement | -| Sur après tri | Oui (List box) | Jamais | Objets concernés uniquement | -| Sur clic long | Oui (Bouton) | Oui | Objets concernés uniquement | -| Sur clic alternatif | Oui (Bouton et List box) | Jamais | Objets concernés uniquement | -| Sur déployer | Yes (Hier. list and list box) | Jamais | Objets concernés uniquement | -| Sur contracter | Yes (Hier. list and list box) | Jamais | Objets concernés uniquement | -| Sur action suppression | Yes (Hier. list and list box) | Jamais | Objets concernés uniquement | -| On URL Resource Loading | Oui (Zone Web) | Jamais | Objets concernés uniquement | -| On Begin URL Loading | Oui (Zone Web) | Jamais | Objets concernés uniquement | -| On URL Loading Error | Oui (Zone Web) | Jamais | Objets concernés uniquement | -| On URL Filtering | Oui (Zone Web) | Jamais | Objets concernés uniquement | -| On End URL Loading | Oui (Zone Web) | Jamais | Objets concernés uniquement | -| On Open External Link | Oui (Zone Web) | Jamais | Objets concernés uniquement | -| On Window Opening Denied | Oui (Zone Web) | Jamais | Objets concernés uniquement | -| On VP Range Changed | Oui (4D View Pro Area) | Jamais | Objets concernés uniquement | -| On VP Ready | Oui (4D View Pro Area) | Jamais | Objets concernés uniquement | -| On Row Resize | Oui (4D View Pro Area) | Jamais | Objets concernés uniquement | +| Event | Object Methods | Form Method | Which Objects | +| ----------------------------- | ----------------------------------- | ----------- | ---------------------- | +| On Load | Yes | Yes | All objects | +| On Unload | Yes | Yes | All objects | +| Sur validation | Yes | Yes | All objects | +| Sur clic | Yes | Yes | Involved object only | +| Sur double clic | Yes | Yes | Involved object only | +| Sue avant frappe clavier | Yes | Yes | Involved object only | +| Sue après frappe clavier | Yes | Yes | Involved object only | +| Sur après modification | Yes | Yes | Involved object only | +| On Getting Focus | Yes | Yes | Involved object only | +| On Losing Focus | Yes | Yes | Involved object only | +| Sur activation | Never | Yes | None | +| On Deactivate | Never | Yes | None | +| Sur appel extérieur | Never | Yes | None | +| Sur changement page | Never | Yes | None | +| Sur début survol | Yes | Yes | Involved object only | +| Sur déposer | Yes | Yes | Involved object only | +| Sur glisser | Yes | Never | Involved object only | +| Sur début survol | Yes | Yes | All objects | +| Sur survol | Yes | Yes | All objects | +| Sur fin survol | Yes | Yes | All objects | +| On Mouse Up | Yes | Never | Involved object only | +| Sur menu sélectionné | Never | Yes | None | +| On Bound variable change | Never | Yes | None | +| Sur données modifiées | Yes | Yes | Involved object only | +| Sur appel zone du plug in | Yes | Yes | Involved object only | +| Sur entête | Yes | Yes | All objects | +| On Printing Detail | Yes | Yes | All objects | +| On Printing Break | Yes | Yes | All objects | +| On Printing Footer | Yes | Yes | All objects | +| On Close Box | Never | Yes | None | +| Sur affichage corps | Yes | Yes | All objects | +| Sur ouverture corps | Yes (List box) | Yes | None except List boxes | +| Sur fermeture corps | Yes (List box) | Yes | None except List boxes | +| Sur redimensionnement | Never | Yes | None | +| Sur nouvelle sélection | Yes | Yes | Involved object only | +| Sur chargement ligne | Never | Yes | None | +| Sur minuteur | Never | Yes | None | +| Sur défilement | Yes | Never | Involved object only | +| Sur avant saisie | Yes (List box) | Never | Involved object only | +| Sur déplacement colonne | Yes (List box) | Never | Involved object only | +| Sur déplacement ligne | Yes (List box) | Never | Involved object only | +| Sur redimensionnement colonne | Yes (List box and 4D View Pro Area) | Never | Involved object only | +| Sur clic entête | Yes (List box and 4D View Pro Area) | Never | Involved object only | +| Sur clic pied | Yes (List box) | Never | Involved object only | +| Sur après tri | Yes (List box) | Never | Involved object only | +| Sur clic long | Yes (Button) | Yes | Involved object only | +| Sur clic alternatif | Yes (Button and List box) | Never | Involved object only | +| Sur déployer | Yes (Hier. list and list box) | Never | Involved object only | +| Sur contracter | Yes (Hier. list and list box) | Never | Involved object only | +| Sur action suppression | Yes (Hier. list and list box) | Never | Involved object only | +| On URL Resource Loading | Yes (Web Area) | Never | Involved object only | +| On Begin URL Loading | Yes (Web Area) | Never | Involved object only | +| On URL Loading Error | Yes (Web Area) | Never | Involved object only | +| On URL Filtering | Yes (Web Area) | Never | Involved object only | +| On End URL Loading | Yes (Web Area) | Never | Involved object only | +| On Open External Link | Yes (Web Area) | Never | Involved object only | +| On Window Opening Denied | Yes (Web Area) | Never | Involved object only | +| On VP Range Changed | Yes (4D View Pro Area) | Never | Involved object only | +| On VP Ready | Yes (4D View Pro Area) | Never | Involved object only | +| On Row Resize | Yes (4D View Pro Area) | Never | Involved object only | Always keep in mind that, for any event, the method of a form or an object is called if the corresponding event property is selected for the form or objects. The benefit of disabling events in the Design environment (using the Property List of the Form editor) is that you can reduce the number of calls to methods and therefore significantly optimize the execution speed of your forms. diff --git a/website/translated_docs/fr/FormEditor/createStylesheet.md b/website/translated_docs/fr/FormEditor/createStylesheet.md index fcd7ffb551c9e6..453ea419580adb 100644 --- a/website/translated_docs/fr/FormEditor/createStylesheet.md +++ b/website/translated_docs/fr/FormEditor/createStylesheet.md @@ -4,51 +4,51 @@ title: Feuilles de style (style sheets) --- -Une feuille de style regroupe une combinaison d’attributs d'objets formulaire — allant des attributs de texte à quasiment tous les attributs d'objet disponibles. +A style sheet groups together a combination of attributes for form objects — from text attributes to nearly any available object attribute. -Outre l’harmonisation de l’interface de vos applications, l’usage de feuilles de style a trois avantages majeurs : +In addition to harmonizing an application's interface, style sheets provide three major advantages: -* Gain de temps en développement : pour chaque objet, vous définissez en une seule opération un ensemble de paramétrages. -* Facilité de maintenance : les feuilles de styles ont la propriété de modifier l’apparence de tous les objets qui les utilisent. Changer, par exemple, la taille de la police dans une feuille de style changera la taille de la police pour tous les objets qui utilisent cette feuille de style. -* Contrôle du développement multi-plate-forme : les feuilles de style peuvent s'appliquer aux deux plate-formes macOS et Windows, ou bien à l'une d'elles uniquement. Lorsqu'une feuille de style est appliquée, 4D utilise automatiquement la feuille de style appropriée. +* Saves time during development: Each object has specific group of settings within a single operation. +* Facilitates maintenance: Style sheets modify the appearance of any objects that uses them, so changing the font size in a style sheet will change the font size for all of the objects that use this same style sheet. +* Controls multi-platform development: You can have a style sheets that apply to both macOS and Windows platforms, only macOS, or only Windows. When a style sheet is applied, 4D automatically uses the appropriate style sheet. -## Fichiers feuilles de style +## Style Sheet Files -4D accepte trois fichiers feuilles de style spécifiques : +4D accepts three, specific style sheet files: -| Feuille de style | Plateforme | -| ----------------------- | ----------------------------------------------------------------------- | -| styleSheets.css | Feuille de style globale par défaut pour macOS et Windows | -| styleSheets_mac.css | Pour définir des styles d'attributs spécifiques de macOS uniquement | -| styleSheets_windows.css | Pour définir des styles d'attributs spécifiques pour Windows uniquement | +| Style Sheet | Platform | +| ----------------------- | ----------------------------------------------------- | +| styleSheets.css | Default global style sheet for both macOS and Windows | +| styleSheets_mac.css | For defining macOS only specific attribute styles | +| styleSheets_windows.css | For defining Windows only specific attribute styles | -Ces fichiers sont stockés dans le dossier "/SOURCES" du projet. Ils sont également accessibles directement via le [CSS Preview](formEditor.md#css-preview) dans la barre d'outils de l'éditeur de formulaires. +These files are stored in the project's "/SOURCES" folder. They can also be accessed directly via the [CSS Preview](formEditor.md#css-preview) in the Form editor toobar. -## Architecture des feuilles de style +## Style Sheet Architecture While adapted to meet the specific needs of 4D forms, style sheets for application projects generally follow CSS2 syntax and grammar. -Chaque règle de style d'une feuille de style contient deux parties : +Every style rule in a style sheet contains two parts: -* un *sélecteur* - Un sélecteur définit où appliquer le style. 4D prend en charge les sélecteurs "object type", "object name", "class", "all objects", et "attribute value". +* a *Selector* - A selector defines where to apply the style. 4D supports "object type", "object name", "class", "all objects", as well as "attribute value" selectors. -* une *déclaration* - La déclaration définit le style à appliquer. Plusieurs lignes de déclaration peuvent être regroupées pour former un bloc de déclaration. Chaque ligne d'un bloc de déclaration CSS doit se terminer par un point-virgule et l'intégralité du bloc doit être entourée d'accolades. +* a *Declaration* - The declaration defines the actual style to apply. Multiple declaration lines can be grouped together to form a declaration block. Each line in a CSS declaration block must end with a semicolon, and the entire block must be surrounded by curly braces. -## Sélecteurs de feuilles de style +## Style Sheet Selectors -### Type d'objet +### Object Type -Le type d'objet définit le type d'objet à styler et correspond au sélecteur d'élément CSS. +Corresponding to the CSS element selector, the object type defines the type of object to style. Specify the object type, then in curly braces, declare the style(s) to apply. > The object type corresponds to the JSON [type](FormObjects/properties_Object.md#type) property of form objects. -Dans l'exemple suivant, tous les objets du type *bouton* afficheront du texte dans la police Helvetica Neue, d'une taille de 20 pixels : +In the following example, all objects of the *button* type will display text in the Helvetica Neue font, with a size of 20 pixels: ``` button { @@ -66,13 +66,13 @@ text, input { } ``` -### Nom d'objet +### Object Name -Le nom de l'objet correspond au **sélecteur d'ID** CSS et définit un objet spécifique à styler, puisque que ce nom est unique dans le formulaire. +Corresponding to the CSS **ID selector**, the object name defines a specific object to style since the object's name is unique within the form. -Désignez l'objet avec le caractère "#" avant le nom de l'objet, puis entre accolades, déclarez le(s) style(s) à appliquer. +Designate the object with a "#" character before the object's name, then in curly braces, declare the style(s) to apply. -Dans l'exemple suivant, le texte de l'objet portant le nom "okButton" sera affiché dans la police Helvetica Neue, avec une taille de 20 pixels : +In the following example, the text of the object with the name "okButton" will be displayed in Helvetica Neue font, with a size of 20 pixels: ``` #okButton { @@ -85,11 +85,11 @@ Dans l'exemple suivant, le texte de l'objet portant le nom "okButton" sera affic ### Class -Class correspond au **sélecteur class** CSS et définit un objet le style de tous les objets formulaires de l'attribut `class`. +Corresponding to the CSS **class selector**, the class defines the style for all form objects with the `class` attribute. -Vous pouvez spécifier les classes à utiliser avec un caractère "." suivi du nom de la classe et, entre accolades, déclarez le(s) style(s) à appliquer. +You can specify the classes to use with a "." character followed by the name of the class, and in curly braces, declare the style(s) to apply. -Dans l'exemple suivant, le texte de tous les objets de la classe `okButtons` sera affiché dans la police Helvetica Neue, avec une taille de 20 pixels, alignée au centre : +In the following example, the text of all objects with the `okButtons` class will be displayed in Helvetica Neue font, with a size of 20 pixels, aligned in the center: ``` .okButtons { @@ -99,7 +99,7 @@ Dans l'exemple suivant, le texte de tous les objets de la classe `okButtons` ser } ``` -Pour indiquer qu'un style doit être appliqué uniquement à des objets de type différent, spécifiez le type suivi de "." et du nom de la classe, puis déclarez entre accolades le(s) style(s) à appliquer. +To designate that a style should be applied only to objects of a distinct type, specify the type followed by "." and the name of the class, then in curly braces, declare the style(s) to apply. ``` text.center { @@ -108,20 +108,20 @@ text.center { } ``` -Dans la description du formulaire 4D, vous associez un nom de classe à un objet à l'aide de l'attribut `class`. Cet attribut contient un ou plusieurs noms de "class", séparés par un espace : +In the 4D form description, you associate a class name to an object using the `class` attribute. This attribute contains one or several class names, separated by a space character: ``` class: "okButtons important" ``` -### Tous les objets +### All Objects -Le caractère "*" correspond au **sélecteur universel** CSS et indique que le style qui suit sera appliqué à tous les objets du formulaire. +Corresponding to the CSS **universal selector**, the "*" character indicates that the following style will be applied to all objects on the form. -Indiquez qu'un style doit s'appliquer à tous les objets de formulaire avec le caractère "*", puis, entre accolades, déclarez le(s) style(s) à appliquer. +Designate that a style should apply to all form objects with the "*" character, then in curly braces, declare the style(s) to apply. -Dans l'exemple suivant, tous les objets auront un fond gris : +In the following example, all objects will have a gray fill: ``` * { @@ -130,24 +130,24 @@ Dans l'exemple suivant, tous les objets auront un fond gris : ``` -### Attributs spécifiques +### Specific Attribute -Les styles correspondent aux **sélecteurs d'attributs** et peuvent s'appliquer à tous les objets du formulaire avec un attribut spécifique. +Corresponding to the CSS **attribute selectors**, styles can be applied to all form objects with a specific attribute. -Spécifiez l'attribut entre parenthèses, puis entre accolades, déclarez le(s) style(s) à appliquer. +Specify the attribute within brackets, then in curly braces, declare the style(s) to apply. -#### Syntaxes prises en charge +#### Supported syntaxes -| Syntaxe | Description | -| -------------------------- | --------------------------------------------------------------------------------------------------------------------------- | -| [attribute] | les objets ayant un `attribute` | -| [attribute="valeur"] | les objets dont la valeur de l'`attribute` correspond à la "valeur" indiquée | -| [attribute~="valeur"] | les objets dont la valeur de l'`attribute` correspond à la "valeur" présente dans une liste de mots séparés par des espaces | -| [attribute|="valeur"] | les objets dont l'`attribute` contient une valeur qui commence par celle de "valeur" | +| Syntax | Description | +| ------------------------- | ------------------------------------------------------------------------------------------------------- | +| [attribute] | matches objects with the `attribute` | +| [attribute="value"] | matches objects with the `attribute` value containing exactly the specified "value" | +| [attribute~="value"] | matches objects with the `attribute` value containing the "value" among a space-separated list of words | +| [attribute|="value"] | matches objects with an `attribute` whose value starts with "value" | -#### Exemples +#### Examples -Tous les objets ayant l'attribut `borderStyle` auront des lignes violettes : +All objects with the `borderStyle` attribute will have purple lines: ``` [borderStyle] @@ -156,7 +156,7 @@ Tous les objets ayant l'attribut `borderStyle` auront des lignes violettes : } ``` -Tous les objets de type texte ayant un attribut text dont la valeur est "Hello" auront des lettres bleues : +All objects of the text type with a text attribute whose value is "Hello" will have blue letters: ``` @@ -166,7 +166,7 @@ text[text=Hello] } ``` -Tous les objets ayant un attribut text dont la valeur est "Hello" auront des traits bleus : +All objects with a text attribute whose value contains "Hello" will have blue lines: ``` [text~=Hello] @@ -176,7 +176,7 @@ Tous les objets ayant un attribut text dont la valeur est "Hello" auront des tra ``` -Tous les objets de type texte ayant un attribut text dont la valeur commence par "Hello" auront des lettres jaunes : +All objects of the text type with a text attribute whose value starts with "Hello" will have yellow letters: ``` text[text|=Hello] @@ -188,25 +188,25 @@ text[text|=Hello] ``` -## Déclarations de feuilles de style +## Style Sheet Declarations -La majorité des attributs d'objet formulaire peuvent être définis dans une feuille de style, à l'exception des attributs suivants : +The majority of form object attributes can be defined within a style sheet, except the following attributes: - "method" - "type" - - "type" - "class" - - choiceList, excludedList, labels, list, requiredList (type liste) + - "event" + - choiceList, excludedList, labels, list, requiredList (list type) -Les attributs d'objet formulaire peuvent être déclarés avec leur nom JSON en tant qu'attributs CSS (à l'exclusion des types d'objet, méthodes, événements et listes). Pour plus d'informations, voir la page **Formulaires dynamiques** dans le manuel du mode Développement. +Form object attributes can be declared with their JSON name as CSS attributes (not including object types, methods, events, and lists). For more information, see the **Dynamic Forms** page in the Design Reference. -### Mappage d'attributs +### Attribute Mapping -Les attributs répertoriés ci-dessous peuvent accepter le nom 4D ou le nom CSS. +The attributes listed below are able to accept either the 4D name or the CSS name. | 4D | CSS | | -------------- | ---------------- | | borderStyle | border-style | -| border-style | background-color | +| fill | background-color | | fontFamily | font-family | | fontSize | font-size | | fontStyle | font-style | @@ -215,70 +215,70 @@ Les attributs répertoriés ci-dessous peuvent accepter le nom 4D ou le nom CSS. | textAlign | text-align | | textDecoration | text-decoration | | verticalAlign | vertical-align | -> Les valeurs spécifiques à 4D (*ex :* "enfoncées") ne sont pas prises en charge lors de l'utilisation de noms d'attribut CSS. +> 4D-specific values (*e.g.*, "sunken") are not supported when using CSS attribute names. -### Valeurs d'attributs spécifiques +### Specific Attribute Values -- Pour les attributs `icon`, `picture`, et `customBackgroundPicture` qui prennent en charge un chemin vers une image, la syntaxe est la suivante : +- For `icon`, `picture`, and `customBackgroundPicture` attributes that support a path to an image, the syntax is: ``` -icon: url("/RESOURCES/Images/Buttons/edit.png"); /* chemin absolu */ -icon: url("edit.png"); /* chemin relatif vers le fichier du formulaire */ +icon: url("/RESOURCES/Images/Buttons/edit.png"); /* absolute path */ +icon: url("edit.png"); /* relative path to the form file */ ``` -- Pour `fill`, `stroke` , `alternateFill` , `horizontalLineStroke` et `verticalLineStroke`, trois syntaxes sont prises en charge : +- For `fill`, `stroke` , `alternateFill` , `horizontalLineStroke` and `verticalLineStroke`, three syntaxes are supported: - - Nom la couleur CSS : `fill: red;` - - Valeur hexadécimale : `fill: #FF0000;` - - fonction `rgb()` : `fill:rgb(255,0,0)` + - CSS color name: `fill: red;` + - Hexa value: `fill: #FF0000;` + - the `rgb()` function: `fill:rgb(255,0,0)` -- Si une chaîne utilise des caractères interdits en CSS, vous pouvez l'entourer de guillemets simples ou doubles. Par exemple: - - une référence xliff : `tooltip: ":xliff:CommonMenuFile";` - - un datasource avec l'expression de champ : `dataSource: "[Table_1:1]ID:1";` +- If a string uses forbidden characters in CSS, you can surround the string with simple or double quotes. For example: + - a xliff reference: `tooltip: ":xliff:CommonMenuFile";` + - a datasource with a field expression: `dataSource: "[Table_1:1]ID:1";` -## Ordre de priorité +## Priority Order -Les projets 4D hiérarchisent les définitions de style en conflit, d'abord par la définition du formulaire, puis par les feuilles de style. +4D projects prioritizes conflicting style definitions first by the form definition, then by the style sheets. -### JSON vs Feuille de style +### JSON vs Style Sheet -Si un attribut est défini dans la description du formulaire JSON et dans une feuille de style, 4D utilisera la valeur du fichier JSON. +If an attribute is defined in the JSON form description and a style sheet, 4D will use the value in the JSON file. -Pour remplacer ce comportement, la valeur du style doit être suivie d'une déclaration `! Important`. +To override this behavior, the style value must be followed with an `!important` declaration. -**Exemple 1 :** +**Example 1:** -| Description du formulaire JSON | Feuille de style | 4D affiche | -| ------------------------------ | ---------------- | ---------- | -| `"text": "Button",` | `text: Edit;` | `"Button"` | +| JSON form description | Style Sheet | 4D displays | +| --------------------- | ------------- | ----------- | +| `"text": "Button",` | `text: Edit;` | `"Button"` | -**Exemple 2 :** +**Example 2:** -| Description du formulaire JSON | Feuille de style | 4D affiche | -| ------------------------------ | ------------------------ | ---------- | -| `"text": "Button",` | `text: Edit !important;` | `"Edit"` | +| JSON form description | Style Sheet | 4D displays | +| --------------------- | ------------------------ | ----------- | +| `"text": "Button",` | `text: Edit !important;` | `"Edit"` | -### Feuilles de style multiples +### Multiple Style Sheets -A l'exécution, 4D hiérarchise automatiquement les feuilles de style dans l'ordre suivant : +At runtime, 4D automatically prioritizes style sheets in the following order: -1. Le formulaire 4D chargera d’abord le fichier CSS par défaut `/SOURCES/styleSheets.css`. -2. Il chargera ensuite le fichier CSS pour la plate-forme courante `/SOURCES/styleSheets__mac.css` ou `/SOURCES/styleSheets_windows.css`. -3. S'il existe, il chargera alors un fichier CSS spécifique défini dans le formulaire JSON : +1. The 4D form will first load the default CSS file `/SOURCES/styleSheets.css`. +2. It will then load the CSS file for the current platform `/SOURCES/styleSheets_mac.css` or `/SOURCES/styleSheets_windows.css`. +3. If it exists, it will then load a specific CSS file defined in the JSON form: - * un fichier pour les deux plateformes : + * a file for both platforms: ``` "css": "" ``` - * ou une liste de fichiers pour les deux plateformes : + * or a list of files for both platforms: ``` "css": [ @@ -287,7 +287,7 @@ A l'exécution, 4D hiérarchise automatiquement les feuilles de style dans l'ord ], ``` - * ou une liste de fichiers par plateforme : + * or a list of files per platform: ``` "css": [ @@ -296,19 +296,19 @@ A l'exécution, 4D hiérarchise automatiquement les feuilles de style dans l'ord ], ``` -> Les chemins de fichiers peuvent être relatifs ou absolus. * Les chemins relatifs sont résolus par rapport au fichier de description de formulaire JSON. * Pour des raisons de sécurité, seuls les chemins de système de fichiers (filesystem) sont acceptés pour les chemins absolus. (*ex :*, "/RESOURCES", "/DATA") +> Filepaths can be relative or absolute. * Relative paths are resolved relative to the JSON form description file. * For security reasons, only filesystem paths are accepted for absolute paths. (*e.g.*, "/RESOURCES", "/DATA") -## Création ou modification d'une feuille de style +## Creating or Editing Style Sheets -Vous créez des feuilles de styles à partir d'un éditeur de feuilles de styles de votre choix, en sauvegardant le fichier sous une extension ".css" dans le dossier "/SOURCES" du projet. +You can create style sheets using your preferred text editor and saving the file with a ".css" extension in the project's "/SOURCES" folder. -La Boîte à Outils fournit une page **Feuilles de style** sous forme de raccourci pour créer et modifier l'une des trois feuilles de style nommées en fonction de la plateforme. +The 4D Tool Box provides a **Style Sheets** page as a shortcut option to create and edit one of three platform-specific named style sheets. -1. Ouvrez la page **Styles** en choisissant la **Boîte à outils > Styles ** dans le menu Développement ou en cliquant sur l'icône **Boîte à outils** dans la barre d'outils de l'éditeur de formulaire. +1. Open the **Style Sheets** page by choosing the **Tool Box > Style Sheet** from the Design menu or click on the **Tool Box** icon in the Form Editor toolbar. ![](assets/en/FormEditor/stylesheets.png) -2. Choisissez le type de feuille de style que vous souhaitez créer et cliquez sur le bouton **Créer** ou **Editer** : ![](assets/en/FormEditor/createButton.png) +2. Select the type of style sheet to create and click on the **Create** or **Edit** button: ![](assets/en/FormEditor/createButton.png) -3. La feuille de style s'ouvrira dans votre éditeur de texte par défaut. +3. The style sheet will open in your default text editor. diff --git a/website/translated_docs/fr/FormEditor/formEditor.md b/website/translated_docs/fr/FormEditor/formEditor.md index f836f45866cbb7..6b1814234f782d 100644 --- a/website/translated_docs/fr/FormEditor/formEditor.md +++ b/website/translated_docs/fr/FormEditor/formEditor.md @@ -3,71 +3,71 @@ id: formEditor title: Éditeur de formulaire --- -4D propose un éditeur de formulaires très complet qui vous permet de modifier votre formulaire jusqu’à ce que vous ayez atteint le résultat escompté. Dans l’éditeur de formulaires, vous pouvez créer et supprimer des objets, manipuler directement des objets et définir les propriétés des objets et des formulaires. +4D provides a full-featured Form editor that allows you to modify your form until you achieve the effect that you want. With the Form editor, you can create and delete form objects, manipulate them directly, and set form and object properties. ## Interface -L’éditeur de formulaires affiche chaque formulaire JSON ouvert dans sa propre fenêtre, dotée d’une barre d’outils et d’une barre d’objets. Vous pouvez ouvrir plusieurs formulaires en même temps. Les règles situées sur le côté et en bas de cette fenêtre ont pour but de vous aider à placer les objets dans le formulaire. Vous pouvez changer les unités que ces règles utilisent afin qu’elles soient affichées en pouces, centimètres ou pixels. +The Form editor interface displays each JSON form in its own window, which has both an object and tool bar. You can have several forms open at the same time. The rulers on the side and bottom help you position objects in the form. You can change measurement units so that it displays inches, centimeters, or pixels. -### Afficher/masquer des éléments du formulaire +### Showing/hiding Form elements -Vous pouvez choisir d’afficher ou de masquer les éléments de la fenêtre de l’éditeur. Cette fonctionnalité permet de n’afficher que les éléments nécessaires à la création ou à la visualisation du formulaire, ou de choisir les outils que vous souhaitez utiliser. Cette option est toujours appliquée à la fenêtre courante de l’éditeur de formulaires. Par exemple, il est généralement inutile d’afficher les taquets et leurs libellés lorsque vous travaillez avec un formulaire entrée. +You can show or hide most interface elements in the Form editor. This feature allows you to show only the elements that you need to create or view in a form, or only the tools that you want to use. This option is always applied to the Form editor’s current window. For example, it is useful to show the output control lines when you are working on an output form. -Pour afficher ou masquer un élément de l’éditeur de formulaires : +To show or hide an element in the Form editor: -1. Dans le menu Formulaire, choisissez la commande **Afficher**. OU Utilisez la commande **Afficher** du menu contextuel de l’éditeur (cliquez avec le bouton droit de la souris en-dehors de tout objet). Cette commande fait apparaître un sous-menu hiérarchique listant les éléments que vous pouvez afficher ou masquer :

    ![](assets/en/FormEditor/showHideElements.png)

    Une coche placée en regard d’un élément indique son affichage. Sélectionnez l’élément que vous souhaitez masquer ou afficher. +1. Choose **Display** from the Form menu. OR Use the **Display** command in the context menu that appears in the Form editor’s window (right-click in the window without clicking on an object). A hierarchical submenu appears listing all the elements that you can show or hide:

    ![](assets/en/FormEditor/showHideElements.png)

    A check mark placed next to the element indicates that it will be shown. To hide an element, select the element so that the check mark disappears. -2. Sélectionnez l’élément que vous souhaitez masquer ou afficher.

    Voici la description des commandes de ce menu : - * **Formulaire hérité** : affiche ou masque les objets du formulaire hérité (s’il y en a un) dans la page courante du formulaire. Pour plus d’informations, reportez-vous au paragraphe Utiliser l'héritage de formulaire. - * **Page 0** : affiche ou masque les objets de la page 0 dans la page courante du formulaire. Cette option vous permet de mieux visualiser et distinguer les objets de la page courante et ceux de la page 0. Pour plus d’informations, reportez-vous à la section Définir un formulaire multi-pages. - * **Papier** : affiche ou masque les contours de la page d’impression sous forme de filets grisés. Cette option peut être sans effet apparent lorsque l’option Limites (cf. ci-dessous) est sélectionnée. En effet dans ce cas, lorsque la taille du formulaire est inférieure à celle de la page d’impression, les contours de celle-ci sont affichés en-dehors de la zone de visualisation du formulaire et donc n’apparaissent pas. Reportez-vous à la section Imprimer un formulaire. - * **Règle** : affiche ou masque les règles de la fenêtre de l’éditeur. +2. Select the element that you want to show or hide.

    Here is a description of the commands in this menu: + * **Inherited form**: Shows or hides inherited form objects (if there is an inherited form) on the current page of the form. For more information, refer to Using inherited forms. + * **Page 0**: Shows or hides the objects from page 0 on the form’s current page. This option allows you to distinguish between the objects on the form’s current page and those on page 0. For more information about pages in forms, refer to the Creating a multi-page form section. + * **Paper**: Shows or hides the borders of the printing page, which are shown as gray lines. This option may have no apparent effect when the Limits (see below) option is selected. If the size of the form is smaller than the printing page, the page’s borders are shown outside of the form’s viewing area and therefore do not appear. Refer to Printing a form. + * **Rulers**: Shows or hides the rulers in the Form editor’s window. * **Markers**: Shows or hides the output control lines and associated markers that show the limits of the form’s different areas. - * **Libellés des taquets** : affiche ou masque les libellés des taquets, lorsque ceux-ci sont affichés. Pour plus d’informations sur les taquets et leurs libellés, reportez-vous à la section Déplacer les taquets. - * **Limites** : affiche ou masque les limites du formulaire. Lorsque cette option est sélectionnée, le formulaire est affiché dans l’éditeur tel qu’il apparaîtra en mode Application. Cette possibilité est particulièrement intéressante pour ajuster un formulaire sans devoir tester le mode Application pour visualiser le résultat. -> Les options **Taille basée sur**, **Marge hor.** et **Marge ver.** des propriétés du formulaire modifient les limites du formulaire. Les limites du formulaire sont calculées en fonction des objets qui le composent. Lorsque vous déplacez ou agrandissez un objet placé près de la limite d’un formulaire, le rectangle de délimitation est modifié en conséquence. Pour plus d’informations sur les propriétés du formulaire, reportez-vous à la section [Propriétés des formulaires](jsonReference.html). + * **Marker Labels**: Shows or hides the marker labels, available only when the output control lines are displayed. For more information, refer to the Moving output control lines paragraph. + * **Limits**: Shows or hides the form’s limits. When this option is selected, the form is displayed in the Form editor as it appears in Application mode. This way you can adjust your form without having to switch to the Application mode in order to see the result. +> The **Size Based on**, **Hor margin** and **Vert margin** settings of the form properties affect the form’s limits. When using these settings, the limits are based on the objects in the form. When you modify the size of an object that is located next to the form’s border, it is modified to reflect that change. For more information on form properties, refer to the [Form properties](jsonReference.html) section. -### Utiliser la barre d’outils +### Using the toolbar -La barre d’outils de l’éditeur de formulaires propose un ensemble d’outils destinés à manipuler et modifier le formulaire. Chaque fenêtre dispose de sa propre barre d’outils. +The toolbar of the Form editor offers a set of tools to manipulate and modify the form. Each window has its own toolbar. ![](assets/en/FormEditor/toolbar.png) -La barre d’outils comporte les éléments suivants : - -| Icône | Nom | Description | -| --------------------------------------------- | --------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| ![](assets/en/FormEditor/execute.png) | Exécuter le formulaire | Permet de tester l’exécution du formulaire. Lorsque vous cliquez sur ce bouton, 4D ouvre une nouvelle fenêtre et affiche le formulaire dans son contexte (liste d’enregistrements pour un formulaire liste et enregistrement courant en page pour un formulaire détaillé). Le formulaire est exécuté dans le process principal. | -| ![](assets/en/FormEditor/selection.png) | [Flèche de sélection](#selecting-objects) | Permet de sélectionner, déplacer et redimensionner les objets du formulaire.

    **Note** : Lorsqu’un objet de type Texte ou Zone de groupe est sélectionné, appuyer sur la touche **Entrée** permet de le passer en édition. | -| ![](assets/en/FormEditor/zOrder.png) | [Ordre de saisie](#data-entry-order) | Passe en mode “Ordre de saisie”, dans lequel il est possible de visualiser et de modifier l’ordre de saisie courant du formulaire. A noter que vous pouvez également visualiser l’ordre de saisie courant tout en travaillant dans le formulaire. | -| ![](assets/en/FormEditor/moving.png) | [Déplacement](#moving-objects) | Passe en mode “Déplacement”, dans lequel il est possible d’atteindre rapidement n’importe quelle partie du formulaire en le faisant directement glisser dans la fenêtre. Le curseur prend la forme d’une main. Ce mode de navigation est particulièrement utile en cas de zoom dans le formulaire. | -| ![](assets/en/FormEditor/zoom.png) | [Zoom](#zoom) | Permet de modifier l’échelle d’affichage du formulaire (100% par défaut). Vous pouvez passer en mode “Zoom” en cliquant sur le bouton loupe ou en cliquant directement sur la barre correspondant à l’échelle désirée. Cette fonction est détaillée dans le paragraphe précédent. | -| ![](assets/en/FormEditor/alignment.png) | [Alignement](#aligning-objects) | Ce bouton est associé à un menu permettant d’aligner les objets dans le formulaire. Il est activé (ou non) en fonction des objets sélectionnés.

    Disponible uniquement avec un aperçu CSS Aucun | -| ![](assets/en/FormEditor/distribution.png) | [Répartition](#distributing-objects) | Ce bouton est associé à un menu permettant de répartir les objets dans le formulaire. Il est activé (ou non) en fonction des objets sélectionnés.

    Disponible uniquement avec un aperçu CSS Aucun | -| ![](assets/en/FormEditor/level.png) | [Niveau](#layering-objects) | Ce bouton est associé à un menu permettant de répartir les objets dans le formulaire. Il est activé (ou non) en fonction des objets sélectionnés. | -| ![](assets/en/FormEditor/group.png) | [Groupement/Dégroupement](#grouping-objects) | Ce bouton est associé à un menu permettant de grouper et dégrouper la sélection d’objets du formulaire. Il est activé (ou non) en fonction des objets sélectionnés. | -| ![](assets/en/FormEditor/displyAndPage.png) | [Affichage et gestion des pages](forms.html#form-pages) | Cette zone permet de passer d’une page du formulaire à une autre et d’ajouter des pages. Pour naviguer parmi les pages du formulaire, cliquez sur les boutons fléchés ou cliquez sur la zone centrale et choisissez la page à afficher dans le menu qui apparaît. Si vous cliquez sur le bouton fléché de droite alors que vous êtes sur la dernière page du formulaire, 4D vous permet d’ajouter une page. | -| ![](assets/en/FormEditor/cssPreviewicon.png) | [CSS Preview](#css-preview) | Ce bouton permet de sélectionner le mode CSS à utiliser. | -| ![](assets/en/FormEditor/views.png) | [Gestion des vues](#views) | Ce bouton affiche ou masque alternativement la palette des vues. Cette fonction est détaillée dans la section Utiliser les vues d'objet. | -| ![](assets/en/FormEditor/shields2.png) | [Affichage des badges](#shields) | Chaque clic sur ce bouton provoque l’affichage successif de tous les types de badges de formulaire. Le bouton est également associé à un menu permettant de sélectionner directement le type de badge à afficher. | -| ![](assets/en/FormEditor/library.png) | [Bibliothèque d'objets préconfigurés](objectLibrary.html) | Ce bouton affiche la fenêtre de la bibiliothèque d'objets préconfigurée, proposant de nombreux objets auxquels des propriétés par défaut ont déjà été appliquées. | -| ![](assets/en/FormEditor/listBoxBuilder1.png) | [Création de list box](#list-box-builder) | Ce bouton crée de nouvelles list box de type entity selection. | +The toolbar contains the following elements: + +| Icon | Name | Description | +| --------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| ![](assets/en/FormEditor/execute.png) | Execute the form | Used to test the execution of the form. When you click on this button, 4D opens a new window and displays the form in its context (list of records for a list form and current record page for a detail form). The form is executed in the main process. | +| ![](assets/en/FormEditor/selection.png) | [Selection tool](#selecting-objects) | Allows selecting, moving and resizing form objects.

    **Note**: When an object of the Text or Group Box type is selected, pressing the **Enter** key lets you switch to editing mode. | +| ![](assets/en/FormEditor/zOrder.png) | [Entry order](#data-entry-order) | Switches to “Entry order” mode, where it is possible to view and change the current entry order of the form. Note that shields allow viewing the current entry order, while still working in the form. | +| ![](assets/en/FormEditor/moving.png) | [Moving](#moving-objects) | Switches to “Move” mode, where it is possible to reach any part of the form quickly by using drag and drop in the window. The cursor takes the shape of a hand. This navigation mode is particularly useful when zooming in the form. | +| ![](assets/en/FormEditor/zoom.png) | [Zoom](#zoom) | Allows modifying the form display percentage (100% by default). You can switch to “Zoom” mode by clicking on the magnifying glass or by clicking directly on the desired bar. This feature is detailed in previous section. | +| ![](assets/en/FormEditor/alignment.png) | [Alignment](#aligning-objects) | This button is linked to a menu that allows aligning objects in the form. It is enabled (or not) depending on the objects selected.

    Available only with CSS Preview None | +| ![](assets/en/FormEditor/distribution.png) | [Distribution](#distributing-objects) | This button is linked to a menu that allows distributing objects in the form. It is enabled (or not) depending on the objects selected.

    Available only with CSS Preview None | +| ![](assets/en/FormEditor/level.png) | [Level](#layering-objects) | This button is linked to a menu that allows changing the level of objects in the form. It is enabled (or not) depending on the objects selected. | +| ![](assets/en/FormEditor/group.png) | [Group/Ungroup](#grouping-objects) | This button is linked to a menu that allows grouping and ungrouping selections of objects in the form. It is enabled (or not) depending on the objects selected. | +| ![](assets/en/FormEditor/displyAndPage.png) | [Display and page management](forms.html#form-pages) | This area allows passing from one form page to another and adding pages. To navigate among form pages, click the arrow buttons, or click the central area and choose the page to display from the menu that appears. If you click the right arrow button while the last form page is displayed, 4D allows you to add a page. | +| ![](assets/en/FormEditor/cssPreviewicon.png) | [CSS Preview](#css-preview) | This button is used to select the CSS Mode to use. | +| ![](assets/en/FormEditor/views.png) | [Managing views](#views) | This button displays or hides the views palette. This function is detailed in Using object views . | +| ![](assets/en/FormEditor/shields2.png) | [Displaying shields](#shields) | Each click on this button causes the successive display of each type of form shield. The button is also linked to a menu that allows directly selecting the type of shield to display. | +| ![](assets/en/FormEditor/library.png) | [Preconfigured object library](objectLibrary.html) | This button displays the preconfigured object library that provides numerous objects with certain properties that have been predefined. | +| ![](assets/en/FormEditor/listBoxBuilder1.png) | [List Box Builder](#list-box-builder) | This button creates new entity selection list boxes. | ### Using the object bar The object bar contains all the active and inactive objects that can be used in 4D forms. Some objects are grouped together by themes. Each theme includes several alternatives that you can choose between. When the object bar has the focus, you can select the buttons using the keys of the keyboard. The following table describes the object groups available and their associated shortcut key. -| Bouton | Group | Key | +| Button | Group | Key | | --------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |:---:| | ![](assets/en/FormEditor/text.png) | [Text](../FormObjects/text.md) / [Group Box](../FormObjects/groupBox.md) | T | | ![](assets/en/FormEditor/input.png) | [Input](../FormObjects/input_overview.md) | F | | ![](assets/en/FormEditor/listbox.png) | [Hierarchical List](../FormObjects/list_overview.md) / [List Box](../FormObjects/listbox_overview.md) | L | | ![](assets/en/FormEditor/combo.png) | [Combo Box](../FormObjects/comboBox_overview.md) / [Drop-down List](../FormObjects/dropdownList_overview.md) / [Picture Pop-up Menu](../FormObjects/picturePopupMenu_overview.md) | P | | ![](assets/en/FormEditor/button.png) | [Button](../FormObjects/button_overview.md) / [Picture Button](../FormObjects/pictureButton_overview.md) / [Button Grid](../FormObjects/buttonGrid_overview.md) | B | -| ![](assets/en/FormEditor/radio.png) | [Bouton radio](../FormObjects/radio_overview.md) | R | -| ![](assets/en/FormEditor/checkbox.png) | [Case à cocher](../FormObjects/checkbox_overview.md) | C | +| ![](assets/en/FormEditor/radio.png) | [Radio Button](../FormObjects/radio_overview.md) | R | +| ![](assets/en/FormEditor/checkbox.png) | [Check Box](../FormObjects/checkbox_overview.md) | C | | ![](assets/en/FormEditor/indicator.png) | [Progress Indicator](../FormObjects/progressIndicator.md) / [Ruler](../FormObjects/ruler.md) / [Stepper](../FormObjects/stepper.md) / [Spinner](../FormObjects/spinner.md) | I | | ![](assets/en/FormEditor/rectangle.png) | [Rectangle](../FormObjects/shapesOverview.html#rectangle) / [Line](../FormObjects/shapesOverview.html#line) / [Oval](../FormObjects/shapesOverview.html#oval) | S | | ![](assets/en/FormEditor/splitter.png) | [Splitter](../en/FormObjects/splitters.md) / [Tab Control](../FormObjects/tabControl.md) | D | @@ -89,230 +89,230 @@ You can display and modify form and object properties using the Property List. I To display/hide the Property List, choose **Property List** from the **Form** menu or from the context menu of the Form editor. You can also display it by double-clicking in an empty area of the form. -#### Raccourcis de navigation +#### Navigation shortcuts -Vous pouvez naviguer dans la Liste des propriétés à l’aide des raccourcis suivants : +You can navigate in the Property List using the following shortcuts: -* **Touches fléchées** haut ou bas ↑ ↓ : déplacement de cellule en cellule. -* **Touches fléchées** gauche ou droite ← → : déploie/contracte les thèmes ou les menus. -* **PgUp** et **PgDn** : sélectionne la première ou la dernière cellule visible de la liste affichée. -* **Début** et **Fin** : sélectionne la première ou la dernière cellule de la liste. -* **Ctrl+clic** (Windows) ou **Commande+clic** (Mac OS) sur un événement : sélectionne/désélectionne tous les événements, en fonction de l’état initial de l’événement sur lequel vous avez cliqué. -* **Ctrl+clic** (Windows) ou **Commande+clic** (Mac OS) sur un intitulé de thème : déploie/contracte tous les thèmes. +* **Arrow key**s ↑ ↓: Used to go from one cell to another. +* **Arrow keys** ← →: Used to expand/collapse themes or enter edit mode. +* **PgUp** and **PgDn**: Used to scroll the Property List contents. +* **Home** and **End**: Used to scroll the Property List so that the first or last cell is displayed. +* **Ctrl+click** (Windows) or **Command+click** (Mac OS) on an event: Used to select/deselect every event in the list, according to the initial state of the event on which you clicked. +* **Ctrl+click** (Windows) or **Command+click** (Mac OS) on a theme label: Used to Collapse/Expand every theme in the list. ## Manipulating Form Objects -### Ajouter des objets +### Adding objects -Vous pouvez ajouter des objets dans un formulaire de nombreuses manières : +You can add objects to forms in several ways: -* Par traçage d'un objet après sélection dans la barre d'objets (cf. paragraphe [Utiliser la barre d’objets](#using-the-object-bar)) -* Par glisser-déposer depuis la barre d'objets -* Par glisser-déposer ou copier-coller depuis la [bibliothèque d'objets](objectLibrary.md) préconfigurés -* Par glisser-déposer depuis un autre formulaire, -* Par glisser-déposer depuis l'Explorateur (champs) ou les éditeurs du mode Développement (énumérations, images, etc.) +* By drawing the object directly in the form after selecting its type in the object bar (see [Using the object bar](#using-the-object-bar)) +* By dragging and dropping the object from the object bar +* By drag-and-drop or copy-paste operations on an object selected from the preconfigured [object library](objectLibrary.md), +* By dragging and dropping an object from another form, +* By dragging and dropping an object from the Explorer (fields) or from other editors in the Design environment (lists, pictures, etc.) -Une fois l'objet inséré, vous pouvez modifier toutes ses caractéristiques dans l'éditeur de formulaires. +Once the object is placed in the form, you can modify its characteristics using the Form editor. -Vous pouvez travailler avec deux types d'objets dans vos formulaires : +You can work with two types of objects in your forms: -* **les objets statiques** (filets, cadres, images d'arrière-plan, etc.) : ces objets sont généralement utilisés pour le décor, les libellés ou encore l'interface graphique. Ces objets sont accessibles via la barre d'objets de l'éditeur de formulaires. Vous pouvez définir leurs attributs graphiques (taille, couleur, police...) ainsi que leurs propriétés de redimensionnement à l'aide de la Liste de propriétés. A la différence des objets actifs, les objets statiques ne sont pas associés à des variables. A noter qu'il est possible d'insérer des éléments dynamiques dans les objets statiques. +* **Static objects** (lines, frames, background pictures, etc.): These objects are generally used for setting the appearance of the form and its labels as well as for the graphic interface. They are available in the object bar of the Form editor. You can also set their graphic attributes (size, color, font, etc.) and their resizing properties using the Property List. Static objects do not have associated variables like active objects. However, you can insert dynamic objects into static objects. -* **les objets actifs** : un objet actif est un objet qui réalise une tâche ou une fonction de l’interface. Il existe de nombreux types d’objets actifs : champs, boutons, listes déroulantes, etc. Un objet actif est associé soit à un champ, soit à une variable. +* **Active objects**: These objects perform tasks or functions in the interface and can take many forms: fields, buttons, scrollable lists, etc. Each active object is associated with either a field or a variable. -### Sélectionner des objets +### Selecting objects -Avant de pouvoir réaliser une opération sur un objet (comme le changement de l’épaisseur d’une ligne ou d’une police), il est nécessaire de sélectionner cet objet. +Before you can perform any operation on an object (such as changing a line width or font), you need to select the object that you want to modify. -Pour sélectionner un objet à l’aide de la barre d’outils : +To select an object using the toolbar: -1. Cliquez sur l’outil Flèche dans la barre d’outils.

    ![](assets/en/FormEditor/selection.png)

    Lorsque vous le faites glisser au-dessus du formulaire, le pointeur prend la forme du pointeur standard. -2. Cliquez sur l’objet que vous souhaitez sélectionner. Des poignées de sélection identifient l’objet sélectionné.

    ![](assets/en/FormEditor/selectResize.png) +1. Click the Arrow tool in the toolbar.

    ![](assets/en/FormEditor/selection.png)

    When you move the pointer into the form area, it becomes a standard arrow-shaped pointer. +2. Click the object you want to select. Resizing handles identify the selected object.

    ![](assets/en/FormEditor/selectResize.png) -Pour sélectionner un objet à l’aide de la Liste des propriétés : +To select an object using the Property List: -1. Sélectionnez le nom de l’objet dans la liste de sélection située en haut de la palette.

    De cette manière, vous pouvez sélectionner un objet masqué par d’autres objets ou situé en-dehors des limites de la fenêtre. Pour désélectionner un objet, cliquez hors de ses limites ou cliquez dessus en maintenant la touche **Majuscule** enfoncée. -> Il est également possible de sélectionner des objets en double-cliquant dans la fenêtre de résultat d’une recherche globale. +1. Choose the object’s name from the Object List drop-down list located at the top of the Property List.

    Using these two methods, you can select an object that is hidden by other objects or located outside the visible area of the current window. To deselect an object, click outside the object’s boundary or **Shift+click** the object. +> It is also possible to select objects by double-clicking them in the result window of ""Find in design" operation. ### Selecting multiple objects -Il est souvent nécessaire de réaliser la même opération sur plusieurs objets d’un formulaire — par exemple, pour les déplacer, les aligner ou changer leur apparence. 4D vous permet de sélectionner plusieurs objets en même temps. Vous pouvez réaliser une sélection multiple en utilisant l’une des solutions suivantes : +You may want to perform the same operation on more than one form object — for example, to move the objects, align them, or change their appearance. 4D lets you select several objects at the same time. There are several ways to select multiple objects: -* Choisissez **Tout sélectionner** dans le menu Edition. -* Cliquez avec le bouton droit de la souris sur un objet et choisissez la commande **Sélectionner objets de même type** dans le menu contextuel. -* Maintenez la touche **Maj** enfoncée et cliquez l’un après l’autre sur tous les objets que vous souhaitez sélectionner. -* Cliquez hors du groupe d’objets que vous souhaitez sélectionner et dessinez un rectangle de sélection entourant ou traversant les objets à sélectionner. Tout objet inclus dans les limites du rectangle ou qui touche ces limites est sélectionné lorsque vous relâchez le bouton de la souris. -* Maintenez enfoncée la touche **Alt** (sous Windows) ou **Option** (sous Mac Os) et tracez un rectangle de sélection. Dans ce cas, seuls les objets entièrement inclus dans ce rectangle seront sélectionnés. +* Choose **Select All** from the Edit menu to select all the objects. +* Right-click on the object and choose the **Select Similar Objects** command in the context menu. +* Hold down the **Shift** key and click the objects you want to select. +* Start at a location outside the group of objects you want to select and drag a marquee (sometimes called a selection rectangle) around the objects. When you release the mouse button, if any part of an object lies within or touches the boundaries of the selection rectangle, that object is selected. +* Hold down the **Alt** key (Windows) or the **Option** key (macOS) and draw a marquee. Any object that is completely enclosed by the marquee is selected. -La fenêtre ci-dessous représente la sélection de deux objets à l’aide d’un rectangle de sélection : +The figure below shows a marquee being drawn to select two objects: ![](assets/en/FormEditor/selectMultiple.png) -Pour désélectionner un objet qui fait partie d’un groupe d’objets sélectionnés, maintenez la touche **Majuscule** enfoncée et cliquez sur cet objet. Les autres objets demeurent sélectionnés. Pour désélectionner tous les objets, cliquez hors des limites de ces objets. +To deselect an object that is part of a set of selected objects, hold down the **Shift** key and click the object. The other objects remain selected. To deselect all the selected objects, click outside the boundaries of all the objects. -### Dupliquer des objets +### Duplicating objects -Vous pouvez dupliquer tout objet de formulaire, y compris les objets actifs. Les copies d’objets actifs conservent toutes les propriétés de l’objet original comme le nom, le type, l’action automatique, le format d’affichage et la méthode objet. +You can duplicate any object in the form, including active objects. Copies of active objects retain all the properties of the original, including name, type, standard action, display format, and object method. -Vous pouvez dupliquer directement un objet ou une sélection d’objets, ou utiliser la boîte de dialogue “Dupliquer plusieurs” pour paramétrer une duplication multiple d’objets. Cette boîte de dialogue vous permet de créer autant de duplicata d’un ou de plusieurs objets que vous voulez, en une seule opération. +You can duplicate an object directly using the Duplicate tool in the Tools palette or use the Duplicate Many dialog box to duplicate an object more than once. Also, using this dialog box, you can set the distance between two copies. -Pour dupliquer directement un ou plusieurs objet(s) : +To duplicate one or more objects: -1. Sélectionnez le ou les objet(s) que vous souhaitez dupliquer. -2. Choisissez la commande **Dupliquer** dans le menu **Edition**. 4D crée une copie de chaque objet sélectionné et place la copie juste à côté de l’original. -3. Déplacez la copie à l’emplacement souhaité. Si vous choisissez de nouveau la commande Dupliquer, 4D crée une autre copie pour chaque objet et la place exactement au même placement relatif par rapport à la première copie. Si vous devez répartir plusieurs copies d’un objet sur un axe, appliquez la procédure suivante. Dupliquez l’objet original, déplacez la copie à un autre emplacement sur le formulaire, puis dupliquez la copie. La deuxième copie adopte le même positionnement relatif par rapport à la première copie que celui qui existe entre la position de l’original et celle de la première copie. Les copies suivantes seront alors placées avec le même écart par rapport à leur original. Le schéma ci-dessous explique le fonctionnement du placement relatif des copies : +1. Select the object or objects that you want to duplicate. +2. Choose **Duplicate** from the **Edit** menu. 4D creates a copy of each selected object and places the copy in front and slightly to the side of the original. +3. Move the copy (or copies) to the desired location. If you choose the Duplicate menu item again, 4D creates another copy of each object and moves it the exact same distance and direction from the first copy. If you need to distribute copies of the object along a line, you should use the following procedure. Duplicate the original object, move the copy to another location in the form, and then duplicate the copy. The second copy is automatically placed in the same relation to the first copy as the first copy was in relation to the original object. Subsequent copies are also placed in the same relation to their originals. The figure below shows how this relative placement of copies works: ![](assets/en/FormEditor/duplicateObjects.png) -#### Dupliquer plusieurs +#### Duplicate Many -La boîte de dialogue “Dupliquer plusieurs” apparaît lorsque vous sélectionnez un ou plusieurs objet(s) puis choisissez la commande **Dupliquer plusieurs...** dans le menu **Objets**. +The "Duplicate Many" dialog box appears when you select one or more object(s) and choose the **Duplicate Many...** command from the **Object** menu. ![](assets/en/FormEditor/duplcateMany.png) -* Dans la zone supérieure, saisissez le nombre de colonnes et de lignes d’objets que vous souhaitez obtenir.

    Par exemple, si vous voulez obtenir 3 colonnes et 2 lignes d’objets, saisissez 3 dans la zone Colonne(s) et 2 dans la zone Ligne(s). Si vous souhaitez ajouter horizontalement deux copies d’un objet, saisissez 3 dans la zone Colonnes (laissez la zone Ligne(s) à 1). +* In the upper area, enter the number of columns and lines (rows) of objects you want to get.

    For example, if you want three columns and two lines of objects, enter 3 in the Column(s) area and 2 in the Line(s) area. If you want three horizontal new copies of an object, enter 4 in the Column(s) area and leave the default value, 1, in the Line(s) area. -* Pour les lignes et les colonnes, définissez le décalage que vous souhaitez appliquer à chaque nouveau duplicata.

    La valeur saisie doit être exprimée en points et sera appliquée relativement à l’origine de l’objet dupliqué.

    Par exemple, si vous souhaitez laisser un intervalle vertical de 20 points entre chaque objet, et que la hauteur de l’objet source est de 50 points, saisissez 70 dans la zone “Intervalle” de Colonne. +* For lines and columns, define the offset that you wish to leave between each copy.

    The value must be expressed in points. It will be applied to each copy, or copies, in relation to the original object.

    For example, if you want to leave a vertical offset of 20 points between each object and the height of the source object is 50 points, enter 70 in the column’s “Offset” area. -* Si vous souhaitez créer une matrice de variables, cochez l’option **Numéroter les variables** et sélectionnez le sens dans lequel la numérotation des variables doit s’effectuer. Cette option n’est active que si l’objet sélectionné est une variable. Pour plus d’informations sur cette option, reportez-vous à la section **Dupliquer sur matrice** du *Manuel de développement*. +* If you wish to create a matrix of variables, select the **Number Variables** option and select the direction in which the variables are to be numbered, either by line(s) or by column(s). This option is active only when the selected object is a variable. For more information on this option, refer to **Duplicating on a matrix** in the *Design Reference*. -### Déplacer des objets +### Moving objects -Vous pouvez déplacer tout objet d’un formulaire, graphique ou actif, y compris les champs ou les objets créés à l’aide d’un modèle. Pour déplacer un objet, vous pouvez : +You can move any graphic or active object in the form including fields and objects created with a template. When moving an object, you have the following options: -* Déplacer l’objet en le faisant glisser avec la souris, -* Déplacer l’objet pixel par pixel en utilisant les touches fléchées du clavier, -* Déplacer l’objet par paliers (de 20 pixels par défaut), +* Move the object by dragging it, +* Move the object one pixel at a time using the arrow keys, +* Move the object by steps using the arrow keys (20-pixel steps by default), -Lorsque vous commencez à déplacer un objet à l'aide de la souris, les poignées disparaissent. 4D affiche des marqueurs qui indiquent l’emplacement des limites de l’objet dans les règles, vous pouvez ainsi placer les objets avec précision. Prenez garde à ne pas cliquer sur les poignées, ce qui aurait pour effet de redimensionner l’objet. Appuyez sur la touche **Majuscule** pour effectuer un déplacement avec contrainte. +As you begin dragging the selected object, its handles disappear. 4D displays markers that show the location of the object’s boundaries in the rulers so that you can place the object exactly where you want it. Be careful not to drag a handle. Dragging a handle resizes the object. You can press the **Shift** key to carry out the move with a constraint. -Si la [grille magnétique](#using-the-magnetic-grid) est activée, le déplacement de l’objet s’effectue par paliers indiquant les emplacements remarquables. +When the [Magnetic Grid](#using-the-magnetic-grid) is on, objects are moved in stages indicating noticeable locations. -Pour déplacer un objet pixel par pixel : +To move an object one pixel at a time: -* Sélectionnez le ou les objet(s) que vous souhaitez déplacer. A chaque fois que vous appuyez sur une touche fléchée, la sélection est déplacée d’un pixel dans la direction de la flèche. +* Select the object or objects and use the arrow keys on the keyboard to move the object. Each time you press an arrow key, the object moves one pixel in the direction of the arrow. -Pour déplacer l’objet par paliers : +To move an object by steps: -* Sélectionnez le ou les objet(s) que vous souhaitez déplacer, appuyez sur la touche **Majuscule** et utilisez les touches fléchées du clavier pour déplacer l’objet par paliers. Par défaut, les paliers sont de 20 pixels. Vous pouvez modifier le pas dans la Page Formulaires des Préférences. +* Select the object or objects you want to move and hold down the **Shift** key and use the arrow keys to move the object by steps. By default, steps are 20 pixels at a time. You can change this value on the Forms Page of the Preferences. -### Grouper des objets +### Grouping objects -4D vous permet de grouper des objets de manière à ce que vous puissiez sélectionner, déplacer et modifier ce groupe comme un seul objet. Les objets qui sont groupés conservent leur position relative par rapport aux autres objets du groupe. Les objets groupés sont par exemple un champ et son libellé, un bouton invisible et son icône, etc. +4D lets you group objects so that you can select, move, and modify the group as a single object. Objects that are grouped retain their position in relation to each other. You would typically group a field and its label, an invisible button and its icon, and so forth. -Lorsque vous redimensionnez un groupe, tous les objets du groupe sont redimensionnés proportionnellement (hormis les zones de texte, qui sont redimensionnées par étape suivant leur taille de police de caractères). +When you resize a group, all the objects in the group are resized proportionally (except text areas, which are resized in steps according to their font sizes. -Vous pouvez dégrouper un groupe d’objets à tout moment et les traiter de nouveau comme des objets indépendants. +You can ungroup a group of objects to treat them as individual objects again. -Un objet actif qui a été groupé doit être dégroupé pour que vous puissiez accéder à ses propriétés ou à sa méthode. Il est toutefois possible de sélectionner un objet appartenant à un groupe sans devoir dégrouper l’ensemble : pour cela, effectuez **Ctrl+clic** (Windows) ou **Commande+clic** (Mac Os) sur l’objet (le groupe doit être sélectionné au préalable). +An active object that has been grouped must be ungrouped before you can access its properties or method. However, it is possible to select an object belonging to a group without degrouping the set: to do this, **Ctrl+click** (Windows) or **Command+click** (macOS) on the object (the group must be selected beforehand). -Grouper des objets n’a d’effet que dans l’éditeur de formulaires. Lors de l’exécution du formulaire, tous les objets groupés (hormis les boutons radio dans les bases binaires) se comportent comme s’ils étaient indépendants. -> Il n’est pas possible de grouper des objets appartenant à des vues différentes et seuls les objets appartenant à la vue courante peuvent être groupés (cf. section [Utiliser les vues d'objet](#views)). +Grouping only affects objects in the Form editor. When the form is executed, all grouped objects act as if they were ungrouped. +> It is not possible to group objects belonging to different views and only those objects belonging to the current view can be grouped (see [Views](#views) ). -Pour grouper les objets : +To group objects: -1. Sélectionnez les objets que vous souhaitez grouper. -2. Sélectionnez **Grouper** dans le menu Objets.

    OU

    Cliquez sur le bouton Grouper dans la barre d’outils de l’éditeur de formulaires :

    ![](assets/en/FormEditor/group.png)

    4D matérialise les bordures du groupe avec des poignées. Les objets du groupe ne sont plus marqués séparément par des poignées. Désormais, lorsque vous modifiez le groupe d’objets, vous modifiez tous les objets qui le composent. +1. Select the objects that you want to group. +2. Choose **Group** from the Object menu.

    OR

    Click the Group button in the toolbar of the Form editor:

    ![](assets/en/FormEditor/group.png)

    4D marks the boundary of the newly grouped objects with handles. No handles mark the boundary of any of the individual objects within the group. Now, when you modify the grouped object, you change all the objects that make up the group. -Pour dégrouper un groupe d’objets : +To ungroup an object: -1. Sélectionnez le groupe que vous souhaitez dégrouper. -2. Choisissez **Dégrouper** dans le menu **Objets**.

    OU

    Sélectionnez la commande **Dégrouper** (menu du bouton **Grouper**) dans la barre d’outils de l’éditeur de formulaires.

    Si la commande **Dégrouper** est désactivée, cela veut dire que l’objet sélectionné est déjà sous sa forme la plus simple.

    4D rematérialise les bordures des objets qui constituaient le groupe avec des poignées. +1. Select the grouped object that you want to ungroup. +2. Choose **Ungroup** from the **Object** menu.

    OR

    Click the **Ungroup** button (variant of the **Group** button) in the toolbar of the Form editor.

    If **Ungroup** is dimmed, this means that the selected object is already separated into its simplest form.

    4D marks the boundaries of the individual objects with handles. -### Aligner des objets +### Aligning objects -Vous pouvez aligner un ensemble d’objets entre eux ou à l’aide d’une grille magnétique. +You can align objects with each other or using an invisible grid on the form. -* Vous pouvez aligner entre eux des objets sur le haut, le bas, le côté, le centre horizontal ou le centre vertical. Vous pouvez aligner directement une sélection d’objets ou utiliser une boîte de dialogue vous permettant d’appliquer tout type d’alignement et de répartition aux objets sélectionnés. Cette boîte de dialogue vous permet en outre de sélectionner l’objet par rapport auquel vous voulez aligner les autres et de prévisualiser le résultat de vos paramétrages. -* Lorsque vous utilisez la grille magnétique, chaque objet peut être aligné manuellement avec les autres sur la base de positions “remarquables” représentées visuellement. +* When you align one object to another, you can align it to the top, bottom, side, or horizontal or vertical center of the other object. You can directly align a selection of objects using the alignment tools or apply more advanced alignment settings using the Alignment Assistant. The latter option allows you, for example, to set the object that will be used as the position reference and to preview the alignment in the form before applying it. +* When you use the invisible grid, each object can be aligned manually with others based on “noticeable” positions which are depicted with dotted lines that appear when the object being moved approaches other objects. -#### Utiliser les outils et les commandes d’alignement direct +#### Using the instantaneous alignment tools -Le sous-menu Aligner du menu Objets (ou du menu contextuel de l’éditeur) et les outils d’alignement de la barre d’outils vous permettent de rapidement aligner entre eux des objets sélectionnés. +The alignment tools in the toolbar and in the Align submenu of the Object menu allow you to quickly align selected objects. ![](assets/en/FormEditor/alignmentMenu.png) -Lorsque 4D aligne des objets, il utilise l’objet le plus avancé dans la direction de l’alignement comme “ancre” sur laquelle tous les autres objets vont être alignés. This object is the “anchor.” It uses the object that is the furthest in the alignment’s direction as the anchor and aligns the other objects to that object. Par exemple, si vous alignez un groupe d’objets à droite, les objets seront alignés sur le côté droit de l’objet situé le plus à droite. Voici le résultat des alignements "aucun", "à gauche", "centré horizontalement" et "à droite" : +When 4D aligns objects, it leaves one selected object in place and aligns the remaining objects to that one. This object is the “anchor.” It uses the object that is the furthest in the alignment’s direction as the anchor and aligns the other objects to that object. For instance, if you want to perform a right alignment on a set of objects, the rightmost object will be used as the anchor. The figure below shows objects with no alignment, "aligned left", "aligned horizontally by centers", and "aligned right": ![](assets/en/FormEditor/alignmentTools.png) -#### Utiliser la boîte de dialogue d’alignement +#### Using the alignment assistant -La boîte de dialogue d’alignement vous permet d’appliquer tout type d’alignement et/ou de répartition aux objets sélectionnés. +The Alignment Assistant allows you to perform any type of alignment and/or distribution of objects. ![](assets/en/FormEditor/alignmentAssistant.png) -Pour afficher cette boîte de dialogue, vous devez sélectionner les objets que vous souhaitez aligner puis choisir la commande **Alignement...** dans le sous-menu **Aligner** du menu **Objets** ou du menu contextuel de l’éditeur. +To display this dialog box, select the objects you want to align then choose the **Alignment** command from the **Align** submenu in the **Object** menu or from the context menu of the editor. -* Cliquez sur l’icône d’alignement de votre choix dans les zones “Alignement droite/gauche” et/ou “Alignement haut/bas”.

    La zone d’exemple illustre le principe de l’opération sélectionnée. +* In the “Left/Right Alignment” and/or “Top/Bottom Alignment” areas, click the icon that corresponds to the alignment you want to perform.

    The example area displays the results of your selection. -* Pour effectuer un alignement standard des objets sélectionnés, cliquez sur le bouton **Prévisualisation** ou **Appliquer**.

    Dans ce cas, 4D utilisera l’objet le plus avancé dans la direction de l’alignement comme “ancre” sur laquelle tous les autres objets vont être alignés. Par exemple, si vous alignez un groupe d’objets à droite, les objets seront alignés sur le côté droit de l’objet situé le plus à droite.

    OU BIEN :

    Pour aligner le groupe d’objets par rapport un objet particulier, cochez l’option **Aligner sur** puis sélectionnez dans la liste déroulante le nom de l’objet par rapport auquel aligner les autres. Dans ce cas, la position de l’objet de référence ne variera pas. +* To perform an alignment that uses the standard anchor scheme, click **Preview** or **Apply**.

    In this case 4D uses the object that is the furthest in the alignment’s direction as the anchor and aligns the other objects to that object. For instance, if you want to perform a right alignment on a set of objects, the rightmost object will be used as the anchor.

    OR:

    To align objects to a specific object, select the **Align on** option and select the object to which you want the other objects to be aligned from the object list. In this case, the position of the reference object will not be altered. -Vous pouvez prévisualiser le résultat réel de vos paramétrages en cliquant sur le bouton **Prévisualisation**. l’opération s’effectue dans l’éditeur de formulaires, mais la boîte de dialogue reste au premier plan. Vous pouvez alors Appliquer ou Annuler les modifications. -> Cette boîte de dialogue combine l’alignement d’objets et leur répartition. Pour plus d’informations sur la répartition, reportez-vous au paragraphe [Répartir des objets](#distributing-objects). +You can preview the results of the alignment by clicking the **Preview** button. The objects are then aligned in the Form editor but since the dialog box does not go away, you can still cancel or apply the alignment. +> This dialog box allows you to align and distribute objects in one operation. For more information on how to distribute objects, refer to [Distributing objects](#distributing-objects). -#### Utiliser l’alignement magnétique +#### Using the Magnetic Grid -L’éditeur de formulaires est doté d’une grille magnétique virtuelle qui peut vous aider à placer et à aligner des objets sur un formulaire. L’alignement magnétique des objets est basée sur la position relative des objets entre eux. Le magnétisme n’est utilisable que lorsqu’au moins deux objets sont présents dans le formulaire. +The Form editor provides a virtual magnetic grid that can help you place and align objects in a form. Magnetic alignment of objects is based on their position in relation to each other. The magnetic grid can only be used when at least two objects are present in the form. -Le principe est le suivant : lorsque vous faites glisser un objet dans le formulaire, 4D indique des emplacements possibles pour cet objet sur la base d’alignements remarquables avec les autres objets du formulaire. Un alignement remarquable est établi à chaque fois que : +This works as follows: When you move an object in the form, 4D indicates possible locations for this object based on noticeable alignments with other form objects. A noticeable alignment is established each time that: * Horizontally, the edges or centers of two objects coincide, * Vertically, the edges of two objects coincide. -A ce moment, 4D place l’objet à l’emplacement et affiche un trait rouge indiquant l’alignement remarquable pris en compte : +When this happens, 4D places the object at the location and displays a red line indicating the noticeable alignment taken into account: ![](assets/en/FormEditor/magneticGrid1.png) -En ce qui concerne la répartition des objets, 4D propose une distance basée sur les standards d’interface (20 points). Comme pour l’alignement magnétique, des traits rouges indiquent les distances remarquables au moment où elles sont atteintes. +Concerning the distribution of objects, 4D proposes a distance based on interface standards. Like with magnetic alignment, red lines indicate the noticeable differences once they are reached. ![](assets/en/FormEditor/magneticGrid2.png) -Ce fonctionnement s’applique à tous les types d’objets des formulaires. Le magnétisme peut être activé ou désactivé à tout moment à l’aide de la commande **Activer la grille magnétique** du menu **Formulaire** ou du menu contextuel de l’éditeur. Il est également possible de définir l’activation par défaut de cette fonction dans la page **Préférences** >**Formulaires** (option **Activer l'auto-alignement par défaut**). Il est possible d’activer ou de désactiver manuellement la grille magnétique lorsqu’un objet est sélectionné en appuyant sur la touche **Ctrl** (Windows) ou **Control** (Mac Os). -> Le magnétisme entraîne également l’observation de paliers lors du redimensionnement manuel des objets. +This operation applies to all types of form objects. The Magnetic Grid can be enabled or disabled at any time using the **Magnetic Grid** command in the **Form** menu or in the editor context menu. It is also possible to set the activation of this feature by default on the **Preferences** > **Forms** page (**Activate auto alignment by default** option). You can manually activate or deactivate the magnetic grid when an object is selected by pressing the **Ctrl** (Windows) or **Control** (macOS) key . +> The Magnetic Grid also influences the manual resizing of objects. ### Distributing objects -Vous pouvez répartir des objets de manière à ce qu’ils soient disposés en respectant un espacement égal entre eux. Pour cela, vous pouvez utiliser des commandes directes de répartition ou passer par l’intermédiaire de la boîte de dialogue d’alignement et répartition pour effectuer des répartitions spécifiques ou combiner alignement et répartition. The latter allows you to align and distribute objects in one operation. -> Lorsque la [grille magnétique](#using-the-magnetic-grid) est activée, une aide visuelle est également fournie pour la répartition lors du déplacement manuel d’un objet. +You can distribute objects so that they are set out with an equal amount of space between them. To do this, you can distribute objects using either the Distribute tools in the Tools palette or the Alignment Assistant. The latter allows you to align and distribute objects in one operation. +> When the [Magnetic Grid](#using-the-magnetic-grid) is on, a visual guide is also provided for distribution when an object is moved manually. -Pour répartir directement une sélection d’objets (verticalement ou horizontalement) : +To distribute objects with equal spacing: -1. Sélectionnez les objets (au moins trois) que vous souhaitez répartir. +1. Select three or more objects and click the desired Distribute tool. -2. Dans la barre d’outils, cliquez sur l’outil de répartition qui correspond la répartition que vous souhaitez appliquer.

    ![](assets/en/FormEditor/distributionTool.png)

    OU

    Choisissez la commande Répartir horizontalement ou Répartir verticalement dans le sous-menu **Aligner** du menu **Objets** ou du menu contextuel de l'éditeur.

    4D répartit les objets par rapport à leurs centres, la plus grande distance entre deux objets contigus est utilisée comme distance de référence. +2. In the toolbar, click on the distribution tool that corresponds to the distribution you want to apply.

    ![](assets/en/FormEditor/distributionTool.png)

    OR

    Select a distribution menu command from the **Align** submenu in the **Object** menu or from the context menu of the editor.

    4D distributes the objects accordingly. Objects are distributed using the distance to their centers and the largest distance between two consecutive objects is used as a reference. -Pour répartir des objets à l’aide de la boîte de dialogue d'alignement et répartition : +To distribute objects using the Align and Distribute dialog box: -1. Sélectionnez les objets que vous souhaitez répartir. +1. Select the objects you want to distribute. -2. Choisissez la commande **Alignement...** dans le sous-menu **Aligner** du menu **Objets** ou du menu contextuel de l’éditeur.

    La boîte de dialogue suivante apparaît :![](assets/en/FormEditor/alignmentAssistant.png) +2. Choose the **Alignment** command from the **Align** submenu in the **Object** menu or from the context menu of the editor.

    The following dialog box appears:![](assets/en/FormEditor/alignmentAssistant.png) -3. Cliquez sur l’icône de répartition standard (horizontale ou verticale) de votre choix: ![](assets/en/FormEditor/horizontalDistribution.png)

    (icône de répartition horizontale standard)

    La zone d’exemple illustre le principe de l’opération sélectionnée. +3. In the Left/Right Alignment and/or Top/Bottom Alignment areas, click the standard distribution icon: ![](assets/en/FormEditor/horizontalDistribution.png)

    (Standard horizontal distribution icon)

    The example area displays the results of your selection. -4. Pour effectuer une répartition standard, cliquez sur le bouton **Prévisualisation** ou *Appliquer*.

    Dans ce cas, les objets seront répartis de manière à ce que leurs côtés soient équidistants (répartition standard).

    OU BIEN :

    Pour effectuer une répartition spécifique (par exemple répartir les objets de manière à ce que leurs côtés droits — et non plus leurs intervalles soient équidistants), cochez une option **Répartir**. This option acts like a switch. Lorsque l'option Répartir est cochée, les icônes situées au-dessous d’elle s’appliquent alors à la répartition : +4. To perform a distribution that uses the standard scheme, click **Preview** or *Apply*.

    In this case 4D will perform a standard distribution, so that the objects are set out with an equal amount of space between them.

    OR:

    To execute a specific distribution, select the **Distribute** option (for example if you want to distribute the objects based on the distance to their right side). This option acts like a switch. If the Distribute check box is selected, the icons located below it perform a different function: * Horizontally, the icons correspond to the following distributions: evenly with respect to left sides, centers (hor.) and right sides of the selected objects. * Vertically, the icons correspond to the following distributions: evenly with respect to top edges, centers (vert.) and bottom edges of the selected objects. You can preview the actual result of your settings by clicking on the **Preview** button: the operation is carried out in the Form editor but the dialog box stays in the foreground. You can then **Cancel** or **Apply** the modifications. -> Cette boîte de dialogue vous permet de combiner l’alignement d’objets et leur répartition. Pour plus d’informations sur l’alignement, reportez-vous au paragraphe [Aligner des objets](#aligning-objects). +> This dialog box lets you combine object alignment and distribution. For more information about alignment, refer to [Aligning objects](#aligning-objects). -### Gérer les plans des objets +### Layering objects -Il est parfois nécessaire de réorganiser certains objets qui occultent d’autres objets du formulaire. Par exemple, vous pouvez souhaiter voir apparaître un graphique derrière les champs dans un formulaire. 4D propose 4 commandes, **Passer au dernier plan**, **Passer au premier plan**, **Plan suivant** et **Plan précédent**, qui vous permettent d’organiser les plans des objets du formulaire. These layers also determine the default entry order (see Modifying data entry order). La fenêtre ci-dessous représente des objets organisés en couches : +You will sometimes have to rearrange objects that are obstructing your view of other objects in the form. For example, you may have a graphic that you want to appear behind the fields in a form. 4D provides four menu items, **Move to Back**, **Move to Front**, **Up One Level** and **Down One Level** that let you “layer” objects on the form. These layers also determine the default entry order (see Modifying data entry order). The figure below shows objects in front of and behind other objects: ![](assets/en/FormEditor/layering.png) -Pour modifier le plan d'un objet, sélectionnez-le et choisissez : +To move an object to another level, select it and choose: * One of the **Move to Back**, **Move to Front**, **Up One Level** and **Down One Level** commands of the Object menu, * One of the commands in the **Level>** submenu in the context menu of the editor, @@ -321,11 +321,11 @@ Pour modifier le plan d'un objet, sélectionnez-le et choisissez : ![](assets/en/FormEditor/level2.png) > When several objects are superimposed, the **Ctrl+Shift+click** / **Command+Shift+click** shortcut can be used to select each object successively by going down a layer with each click. -Pour ordonner les différents plans, 4D va toujours de l’arrière-plan vers l’avant-plan. Par conséquent, le plan précédent fait reculer la sélection d’objets d’un plan vers l’arrière-plan du formulaire. Le plan suivant fait avancer la sélection d’objets d’un plan vers l’avant-plan du formulaire. +When ordering different levels, 4D always goes from the background to the foreground. As a result, the previous level moves the selection of objects one level towards the background. The next level moves the selection one level towards the foreground of the form. -### Ordre de saisie des données +### Data entry order -L’ordre de saisie est l’ordre dans lequel les champs, les sous-formulaires et les autres objets actifs sont sélectionnés lorsque vous appuyez sur la touche **Tabulation** ou **Retour chariot** dans un formulaire. Il est possible de parcourir le formulaire dans le sens inverse de l’ordre de saisie en appuyant sur les touches **Maj+Tabulation** ou **Maj+Retour chariot**. +The data entry order is the order in which fields, subforms, and other active objects are selected as you hit the **Tab** or the **Carriage return** key in an input form. It is possible to move through the form in the opposite direction (reverse data entry order) by pressing the **Shift+Tab** or **Shift+Carriage** return keys. > You can change the entry order at runtime using the `FORM SET ENTRY ORDER` and `FORM GET ENTRY ORDER` commands. @@ -333,47 +333,47 @@ Every object that supports the focusable property is included in the data entry Setting the entry order for a JSON form is done with the [`entryOrder`](properties_JSONref.md) property. -Si vous ne spécifiez pas d’ordre de saisie personnalisé, 4D utilise par défaut le plan des objets comme ordre de saisie, dans le sens “arrière-plan vers premier plan.” Par défaut, l’ordre de saisie correspond donc à l’ordre de création des objets dans le formulaire. +If you don’t specify a custom entry order, by default 4D uses the layering of the objects to determine the entry order in the direction “background towards foreground.” The standard entry order thus corresponds to the order in which the objects were created in the form. -Dans certains formulaires, il est nécessaire de définir un ordre de saisie personnalisé. Ci-dessous par exemple, des champs supplémentaires relatifs à l’adresse ont été ajoutés après la création du formulaire. The resulting standard entry order thus becomes illogical and forces the user to enter the information in an awkward manner: +In some forms, a custom data entry order is needed. Below, for example, additional fields related to the address have been added after the creation of the form. The resulting standard entry order thus becomes illogical and forces the user to enter the information in an awkward manner: ![](assets/en/FormEditor/entryOrder1.png) -Il est dans ce cas nécessaire de personnaliser l’ordre de saisie afin de proposer une progression plus logique : +In cases such as this, a custom data entry order allows you to enter the information in a more logical order: ![](assets/en/FormEditor/entryOrder2.png) -#### Visualiser et modifier l’ordre de saisie +#### Viewing and changing the data entry order -Vous pouvez visualiser l’ordre de saisie courant soit à l’aide des badges “Ordre de saisie”, soit à l’aide du mode “Ordre de saisie”. En revanche, vous ne pouvez modifier l’ordre de saisie qu’en mode “Ordre de saisie”. +You can view the current entry order either using the “Entry order” shields, or by using the “Entry order” mode. However, you can only modify the entry order using the “Entry order” mode. -Ce paragraphe décrit la visualisation et la modification de l’ordre de saisie en mode “Ordre de saisie”. Pour plus d’informations sur la visualisation de l’ordre de saisie à l’aide des badges, reportez-vous au paragraphe [Using shields](#using-shields). +This paragraph describes viewing and modifying the entry order using the “Entry order” mode. For more information about viewing the entry order using shields, refer to [Using shields](#using-shields). -Pour visualiser ou modifier l’ordre de saisie : +To view or change the entry order: -1. Sélectionnez **Ordre de saisie** dans le menu **Formulaire** ou cliquez sur le bouton dans la barre d’outils de la fenêtre :

    ![](assets/en/FormEditor/zOrder.png)

    Le pointeur prend la forme d’un pointeur d’ordre, et 4D dessine une ligne qui permet de visualiser la séquence de l’ordre de saisie courant.

    Visualiser et modifier l’ordre de saisie sont les seules opérations que vous pouvez réaliser dans ce mode. +1. Choose **Entry Order** from the **Form** menu or click on the Entry Order button in the toolbar of the window:

    ![](assets/en/FormEditor/zOrder.png)

    The pointer turns into an entry order pointer and 4D draws a line in the form showing the order in which it selects objects during data entry.

    Viewing and changing the data entry order are the only actions you can perform until you click any tool in the Tools palette. -2. Pour changer l’ordre de saisie, placez le pointeur sur un objet, cliquez dessus et, tout en maintenant le bouton de la souris enfoncé, déplacez le pointeur vers l’objet qui doit le suivre dans l’ordre de saisie.

    ![](assets/en/FormEditor/entryOrder3.png)

    4D ajuste l’ordre de saisie en conséquence. +2. To change the data entry order, position the pointer on an object in the form and, while holding down the mouse button, drag the pointer to the object you want next in the data entry order.

    ![](assets/en/FormEditor/entryOrder3.png)

    4D will adjust the entry order accordingly. -3. Répétez l’étape 2 autant de fois que nécessaire pour obtenir le nouvel ordre de saisie. +3. Repeat step 2 as many times as necessary to set the data entry order you want. -4. Lorsque vous êtes satisfait de l’ordre de saisie, sélectionnez de nouveau la commande **Ordre de saisie** dans le menu **Formulaire**.

    4D retourne dans le mode de fonctionnement normal de l’éditeur de formulaires. +4. When you are satisfied with the data entry order, click any unselected tool in the toolbar or choose **Entry Order** from the **Form** menu.

    4D returns to normal operation of the Form editor. -> Seul l’ordre de saisie de la page courante du formulaire est affiché. Si le formulaire contient des objets saisissables sur la page 0 ou provenant d’un formulaire hérité, l’ordre de saisie par défaut est le suivant : Objets de la page zéro du formulaire hérité > Objets de la page 1 du formulaire hérité > Objets de la page zéro du formulaire ouvert > Objets de la page courante du formulaire ouvert. +> Only the entry order of the current page of the form is displayed. If the form contains enterable objects on page 0 or coming from an inherited form, the default entry order is as follows: Objects from page 0 of the inherited form > Objects from page 1 of the inherited form > Objects from page 0 of the open form > Objects from the current page of the open form. -#### Utiliser un groupe de saisie +#### Using a data entry group -Lorsque vous changez l’ordre de saisie, vous pouvez sélectionner un groupe d’objets dans le formulaire afin que l’ordre de saisie s’applique aux objets du groupe. Ceci vous permet de définir facilement l’ordre de saisie pour les formulaires dans lesquels les champs sont organisés en groupes et colonnes. +While you are changing the data entry order, you can select a group of objects in a form so that the standard data entry order applies to the objects within the group. This allows you to easily set the data entry order on forms in which fields are separated into groups or columns. -Pour créer un groupe de saisie : +To create a data entry group: -1. Sélectionnez **Ordre de saisie** dans le menu *Formulaire* ou cliquez sur le bouton dans la barre d’outils de la fenêtre. -2. Dessinez un rectangle de sélection autour des objets que vous souhaitez grouper pour la saisie. +1. Choose **Entry Order** from the *Form* menu or click the button in the toolbar. +2. Draw a marquee around the objects you want to group for data entry. -Lorsque vous relâchez le bouton de la souris, les objets contenus ou touchés par le rectangle suivent l’ordre de saisie par défaut. L’ordre de saisie des autres objets est réorganisé en conséquence. +When you release the mouse button, the objects enclosed or touched by the rectangle follow the standard data entry order. The data entry order for the remaining objects adjusts as necessary. -#### Exclure un objet de l’ordre de saisie +#### Excluding an object from the entry order By default, all objects that support the focusable property are included in the entry order. To exclude an object from the entry order: @@ -402,8 +402,8 @@ Select one of the following preview modes from the menu: | Toolbar Icon | CSS Preview Mode | Description | | ------------------------------------ | ---------------- | ------------------------------------------------------------------------------------------------------------- | -| ![](assets/en/FormEditor/cssNo.png) | Aucun | No CSS values are applied in the form and no CSS values or icons displayed in the Property List. | -| ![](assets/en/FormEditor/cssWin.png) | Sous Windows | CSS values for Windows platform are applied in the form. CSS values and icons displayed in the Property List. | +| ![](assets/en/FormEditor/cssNo.png) | None | No CSS values are applied in the form and no CSS values or icons displayed in the Property List. | +| ![](assets/en/FormEditor/cssWin.png) | Windows | CSS values for Windows platform are applied in the form. CSS values and icons displayed in the Property List. | | ![](assets/en/FormEditor/cssMac.png) | macOS | CSS values for macOS platform are applied in the form. CSS values and icons displayed in the Property List. | > If a font size too large for an object is defined in a style sheet or JSON, the object will automatically be rendered to accommodate the font, however the size of the object will not be changed. @@ -434,7 +434,7 @@ An attribute value defined in a style sheet can be overridden in the JSON form d #### Property List CSS Icons -| Icône | Description | +| Icon | Description | | ------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | ![](assets/en/FormEditor/cssIcon.png) | Indicates that an attribute value has been defined in a style sheet | | ![](assets/en/FormEditor/cssImportant.png) | Indicates that an attribute value has been defined in a style sheet with the `!important` declaration | @@ -442,52 +442,52 @@ An attribute value defined in a style sheet can be overridden in the JSON form d -## Création de list box +## List Box Builder -Vous pouvez créer rapidement de nouvelles list box de type sélection d'entités avec le **générateur de list box**. La nouvelle list box peut être utilisée immédiatement ou elle peut être modifiée via l'éditeur de formulaires. +You can create new entity selection list boxes quickly with the **List box builder**. The new list box can be used immediately or it can be edited via the Form Editor. -Le générateur de list box vous permet de créer et de remplir des list box de type sélection d'entités en quelques opérations simples. +The List box builder lets you create and fill entity selection list boxes in a few simple operations. -### Utilisation du générateur de list box +### Using the List Box Builder -1. Dans la barre d'outils de l'éditeur de formulaire, cliquez sur l'icône du générateur de zone de liste : +1. In the Form Editor toolbar, click on the List box builder icon: ![](assets/en/FormEditor/listboxBuilderIcon.png) - Le générateur de list box s'affiche : + The List box builder is displayed: ![](assets/en/FormEditor/listboxBuilder.png) -2. Sélectionnez une table dans la liste déroulante **Table** : +2. Select a table from the **Table** dropdown list: ![](assets/en/FormEditor/listboxBuilderTable.png) -3. Sélectionnez les champs de la list box dans la zone **Champs** : +3. Select the fields for the list box in the **Fields** area: ![](assets/en/FormEditor/listboxBuilderFields.png) - Par défaut, tous les champs sont sélectionnés. Vous pouvez sélectionner ou désélectionner les champs individuellement ou utiliser **Ctrl+clic** (Windows) ou **Cmd+clic** (macOS) pour les sélectionner ou les désélectionner tous à la fois. + By default, all fields are selected. You can select or deselect fields individually or use **Ctrl+click** (Windows) or **Cmd+click** (macOS) to select or deselect them all at once. - Vous pouvez modifier l'ordre des champs via un glisser-déposer. + You can change the order of the fields by dragging them and dropping them. -4. L'expression qui permet de remplir les lignes de la list box à partir de la sélection d'entité est préremplie : +4. The expression to fill the list box's rows from the entity selection is prefilled: ![](assets/en/FormEditor/listboxBuilderExpression.png) - Cette expression peut être modifiée si nécessaire. + This expression can be changed if necessary. -5. En cliquant sur le bouton **Copier**, l'expression sera copiée pour charger tous les enregistrements en mémoire : +5. Clicking on the **Copy** button will copy the expression for loading all records into memory: ![](assets/en/FormEditor/listboxBuilderCode.png) -6. Cliquez sur le bouton **Créer un widget** pour créer la list box. +6. Click the the **Build widget** button to create the list box. ![](assets/en/FormEditor/listboxBuilderBuild.png) -La list box finale : +The final list box: ![](assets/en/FormEditor/listboxBuilderListbox.png) @@ -499,261 +499,261 @@ La list box finale : -## Badges +## Shields -L’éditeur de formulaires 4D permet d’utiliser des badges afin de faciliter la visualisation des propriétés des objets. Ils se trouvent dans la barre d'outils du formulaire : +The 4D Form Editor uses shields to make viewing object properties easier. You can find them on the form toolbar: ![](assets/en/FormEditor/shields.png) -Le principe de cette fonction est le suivant : chaque badge est associé à une propriété (par exemple **Vues**, signifiant que l'objet “est dans la vue courante”). Lorsque vous activez un badge, 4D affiche une petite icône (un badge) en haut à gauche de chaque objet du formulaire auquel s’applique la propriété. +This function works as follows: Each shield is associated with a property (for example, **Views**, which means the object “is in the current view”). When you activate a shield, 4D displays a small icon (shield) in the upper left of each object of the form where the property is applied. ![](assets/en/FormEditor/shield.png) -### Utilisation des badges +### Using shields -Pour activer un badge, cliquez sur l'icône *badge* jusqu’à ce que le badge souhaité soit sélectionné. Vous pouvez également cliquer sur la partie droite du bouton et sélectionner directement le type de badge à afficher dans le menu associé : +To activate a shield, click the *Shield* icon from the toolbar until the desired shield is selected. You can also click on the right side of the button and select the type of shield to display directly in the associated menu: -Pour ne pas afficher de badges, choisissez la ligne **Pas de badges** dans le menu de sélection. -> Vous pouvez définir les badges à afficher par défaut dans la Préférences de l’application. +If you don't want to display shields, select **No Shields** in the selection menu. +> You can set which shields to display by default on the Forms Page of the application Preferences. -### Description du badge +### Shield descriptions -Voici la description de chaque type de badge : +Here is a description of each type of shield: -| Icône | Nom | Est affiché... | -| -------------------------------------------- | ------------------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------- | -| ![](assets/en/FormEditor/objectMethod.png) | Méthode objet | Pour les objets auxquels une méthode objet est associée | -| ![](assets/en/FormEditor/standardAction.png) | Action standard | Pour les objets auxquels une action standard est associée | -| ![](assets/en/FormEditor/resizing.png) | Redimensionnement | Pour les objets disposant d’au moins une propriété de redimensionnement, indique la combinaison de propriétés courante | -| ![](assets/en/FormEditor/entryOrder.png) | Ordre de saisie | Pour les objets saisissables, indique le numéro d’ordre de saisie | -| ![](assets/en/FormEditor/viewNumber.png) | Vue courante | Pour tous les objets de la vue courante | -| ![](assets/en/FormEditor/cssShield.png) | [Feuille de style](stylesheets.html) | Pour les objets avec une ou plusieurs valeurs d'attribut remplacées par une feuille de style. | -| ![](assets/en/FormEditor/filter.png) | Filtre | Pour les objets saisissables auxquels un filtre de saisie est associé | -| ![](assets/en/FormEditor/helpTip.png) | Infobulle | Pour les objets auxquels une infobulle (message d’aide) est associée | -| ![](assets/en/FormEditor/localized.png) | Localisé | Pour les objets dont le libellé provient d’une référence (libellé débutant par “:”). La référence peut être de type ressource (STR#) ou XLIFF | -| ![](assets/en/FormEditor/noShields.png) | Pas de badge | Aucun badge n’apparaît | +| Icon | Name | Is displayed ... | +| -------------------------------------------- | ------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------ | +| ![](assets/en/FormEditor/objectMethod.png) | Object Method | For objects with an associated object method | +| ![](assets/en/FormEditor/standardAction.png) | Standard Action | For objects with an associated standard action | +| ![](assets/en/FormEditor/resizing.png) | Resizing | For objects with at least one resizing property, indicates the combination of current properties | +| ![](assets/en/FormEditor/entryOrder.png) | Entry Order | For enterable objects, indicates the number of entry order | +| ![](assets/en/FormEditor/viewNumber.png) | Current View | For all objects in the current view | +| ![](assets/en/FormEditor/cssShield.png) | [Style Sheet](stylesheets.html) | For objects with one or more attribute values overridden by a style sheet. | +| ![](assets/en/FormEditor/filter.png) | Filter | For enterable objects with an associated entry filter | +| ![](assets/en/FormEditor/helpTip.png) | Help Tip | For objects with an associated tip | +| ![](assets/en/FormEditor/localized.png) | Localized | For objects whose label comes from a reference (label beginning with “:”). The reference can be of the resource (STR#) or XLIFF type | +| ![](assets/en/FormEditor/noShields.png) | No Shields | No shields appear | -## Vues +## Views -L'éditeur de formulaires 4D vous permet de créer des formulaires complexes en distribuant des objets de formulaire entre des vues séparées qui peuvent ensuite être masquées ou affichées selon les besoins. +The 4D Form Editor enables you to build complex forms by distributing form objects among separate views that can then be hidden or shown as needed. -Par exemple, vous pouvez répartir les objets par type (champs, variables, objets statiques, etc.). Tout type d'objet formulaire, y compris les sous-formulaires et les zones de plug-in, peut être inclus dans les vues. +For example, you can distribute objects according to type (fields, variables, static objects, etc.). Any type of form object, including subforms and plug-in areas, can be included in views. -Il n'y a pas de limite au nombre de vues par formulaire. Vous pouvez créer autant de vues différentes que nécessaire. De plus, chaque vue peut être affichée, masquée et/ou verrouillée. +There is no limit on the number of views per form. You can create as many different views as you need. Additionally, each view can be displayed, hidden, and/or locked. -Les vues sont gérées via à la palette de vues. +View management is handled via the View palette. ![](assets/en/FormEditor/viewEditor.png) -### Accéder à la palette de vues +### Accessing the View palette -Il existe trois façons d'accéder à la palette de vues : +There are three ways to access the View palette: -* **Barre d'outils** : cliquez sur l'icône de Vues dans la barre d'outils de l'éditeur de formulaires. (Cette icône apparaît en gris lorsqu'au moins un objet appartient à une vue autre que la vue par défaut.) +* **Toolbar**: Click on the Views icon in the Form Editor toolbar. (This icon appears gray when at least one object belongs to a view other than the default view.) - | Vue par défaut uniquement | Avec des vues supplémentaires | + | Default view only | With additional views | |:----------------------------------------------------:|:--------------------------------------------------:| | ![](assets/en/FormEditor/icon.png "No views in use") | ![](assets/en/FormEditor/icon2.png "Views in use") | -* **Menu contextuel** (formulaire ou objet) : faites un clic droit n'importe où dans l'éditeur de formulaires ou sur un objet, puis sélectionnez **Vue courante** +* **Context menu** (form or object): Right-click anywhere in the Form Editor or an object, and select **Current View** ![](assets/en/FormEditor/contextMenu.png) -La vue courante est indiquée par une coche (par exemple, "Adresse professionnelle" dans l'image ci-dessus) +The current view is indicated with a check mark (*e.g.*, "Work Address" in the image above) -* **Menu Formulaire** : cliquez sur le menu **Formulaire** et sélectionnez **Afficher la liste** +* **Form menu**: Click on the **Form** menu and select **View List** ![](assets/en/FormEditor/formMenu.png) -### Avant de commencer +### Before you begin -Voici quelques éléments importants à connaitre avant de commencer à travailler avec les vues : +Here are a few important things to know before you start working with views: -* **Contexte d’utilisation** : les vues sont un outil purement graphique, utilisable uniquement dans l’éditeur de formulaires ; il n’est pas possible d’accéder aux vues par programmation ou en mode Application. +* **Context of use**: Views are a purely graphic tool which can only be used in the Form Editor; you cannot access views programmatically or in the Application environment. -* **Vues et pages** : Les objets d’une même vue peuvent appartenir à des pages différentes d’un formulaire ; seuls les objets de la page courante (et de la page 0 si elle est visible) peuvent être affichés, quelle que soit la configuration des vues. +* **Views and pages**: Objects of the same view can belong to different form pages; only objects of the current page (and of page 0 if it is visible) can be displayed, regardless of the view configuration. -* **Vues et plans** : Les vues sont indépendantes des plans des objets, il n’y a pas de hiérarchie d’affichage entre les différentes vues. +* **Views and levels**: Views are independent of object levels; there is no display hierarchy among different views. -* **Vues et groupes** : Seuls les objets appartenant à la vue courante peuvent être groupés. +* **Views and groups**: Only objects belonging to the current view can be grouped. -* **Vues courantes et par défaut** : la vue par défaut est la première vue d'un formulaire et ne peut pas être supprimée; la vue courante est la vue en cours de modification et le nom est affiché en gras. +* **Current and Default** views: The Default view is the first view of a form and cannot be deleted; the Current view is the view that is being edited and the name is displayed in bold text. -### Gestion des vues +### Managing views -#### Créer des vues +#### Creating views -Tout objet créé dans un formulaire est placé dans la première vue ("Vue 1") du formulaire. La première vue 1 est **toujours** la vue par défaut, indiquée par (par défaut) après le nom. Le nom de la vue peut être modifié (voir [Renommer les vues](#renaming-views)), mais il demeure la vue par défaut. +Any object created in a form is placed in the first view ("View 1") of the form. The first view is **always** the default view, indicated by (Default) after the name. The view's name can be changed (see [Renaming views](#renaming-views)), however it remains the default view. ![](assets/en/FormEditor/createView.png) -Il existe deux façons d'ajouter des vues supplémentaires : +There are two ways to add additional views: -* Cliquez sur le bouton **Ajouter une nouvelle vue** en bas de la palette Vue : +* Click on the **Add a new view** button at the bottom of the View palette: ![](assets/en/FormEditor/addView.png) -* Faites un clic droit sur une vue existante et sélectionnez **Insérer une vue** : +* Right-click on an existing view and select **Insert view**: ![](assets/en/FormEditor/addView2.png) -Il n'y a pas de limitation du nombre de vues. +There is no limitation on the number of views. -#### Renommer des vues +#### Renaming views -Par défaut, les vues sont nommées "Vue" + le numéro de vue, mais vous pouvez modifier ces noms pour améliorer la lisibilité et mieux répondre à vos besoins. +By default views are named as "View" + the view number, however you can change these names to improve readability and better suit your needs. -Pour renommer une vue, vous pouvez soit : +To rename a view, you can use either: -* Double-cliquer directement sur le nom de la vue (dans ce cas, la vue est sélectionnée). Le nom devient alors éditable : +* Double-click directly on the view name (the selected view in this case). The name then becomes editable: ![](assets/en/FormEditor/rename.png) -* Faire un clic droit sur le nom de la vue. Le nom devient alors éditable : +* Right-click on the view name. The name then becomes editable: ![](assets/en/FormEditor/rename2.png) -#### Réordonner les vues +#### Reordering views -Vous pouvez modifier l'ordre d'affichage des vues en les faisant glisser/déposer dans la palette des vues. +You can change the display order of views by dragging/dropping them within the View palette. -A noter que la vue par défaut ne change pas : +Note that the Default view does not change: ![](assets/en/FormEditor/reorderView.png) -#### Supprimer des vues +#### Deleting views -Pour renommer une vue, vous pouvez soit : +To rename a view, you can use either: -* Cliquer sur le bouton **Supprimer la vue sélectionnée** en bas de la palette des vues : +* Click on the **Delete the selected view** button at the bottom of the View palette: ![](assets/en/FormEditor/deleteView.png) -* Faire un clic droit sur le nom de la vue et sélectionner **Supprimer la vue** : +* Right-click on the view name, and select **Delete View**: ![](assets/en/FormEditor/deleteView2.png) -> Si une vue est supprimée, tous les objets qu'elle contient sont automatiquement déplacés vers la vue par défaut. +> If a view is deleted, any objects in it are automatically moved to the Default view. -### Utilisation des vues +### Using views -Une fois que les vues sont créées, vous pouvez utiliser la palette des vues pour : +Once views are created, you can use the View palette to: -* Ajouter un objet aux vues, -* Déplacer des objets d'une vue à une autre, -* Sélectionner tous les objets d'une même vue en un seul clic, -* Afficher ou masquer des objets pour chaque vue, -* Verrouiller les objets d'une vue. +* Add object to views, +* Move objects from one view to another, +* Select all objects of the same view in a single click, +* Display or hide objects for each view, +* Lock the objects of a view. -#### Ajouter des objets aux vues +#### Adding objects to views -Un objet ne peut appartenir qu’à une seule vue. +An object can only belong to a single view. -Pour créer un objet dans une autre vue, sélectionnez simplement la vue dans la palette des vues (avant de créer l'objet) en cliquant sur son nom (une icône Modifier est affichée pour la [Vue courante](#before-you-begin) et le nom apparaît en gras) : +To create an object in another view, simply select the view in the View palette (prior to creating the object) by clicking its name (an Edit icon is displayed for the [Current view](#before-you-begin) and the name appears in bold text): ![](assets/en/FormEditor/addObject.png) -#### Déplacer des objets entre les vues +#### Moving objects between views -Il est également possible de déplacer un ou plusieurs objets d'une vue à une autre. Dans le formulaire, sélectionnez le ou les objets dont vous souhaitez modifier la vue. La liste des vues indique, à l'aide d'un symbole, la vue à laquelle appartient la sélection : +It's also possible to move one or more objects from one view to another. In the form, select the object(s) whose view you wish to change. The view list indicates, using a symbol, the view to which the selection belongs: ![](assets/en/FormEditor/symbol.png) -> La sélection peut contenir plusieurs objets appartenant à différentes vues. +> The selection can contain several objects belonging to different views. -Sélectionnez simplement la vue de destination, faites un clic droit puis sélectionnez **Déplacer vers** : +Simply select the destination view, right-click, and select **Move to**: ![](assets/en/FormEditor/moveObject.png) -OU +OR -Sélectionnez la vue de destination de la sélection et cliquez sur le bouton **Déplacer vers** en bas de la palette des vues : +Select the destination view of the selection and click **Move to** button at the bottom of the View palette: ![](assets/en/FormEditor/moveObject3.png) -La sélection est ensuite placée dans la nouvelle vue : +The selection is then placed in the new view: ![](assets/en/FormEditor/objNewView.png) -Vous pouvez également déplacer un objet vers une autre vue via le menu contextuel de l'objet. Faites un clic droit sur l'objet, sélectionnez **Déplacer vers la vue** puis sélectionnez une vue dans la liste de vues disponibles : +You can also move an object to another view via the object's context menu. Right-click on the object, select **Move to view**, and select a view from the list of available views: ![](assets/en/FormEditor/moveObject2.png) -> La [vue courante](#before-you-begin) est affichée en texte gras. +> The [Current view](#before-you-begin) is shown in bold text. -#### Sélectionner tous les objets d’une vue +#### Select all objects of a view -Vous pouvez sélectionner dans la page courante du formulaire tous les objets appartenant à une même vue. Cette fonction est utile pour appliquer des modifications globales à un ensemble d’objets. +You can select all objects belong to the same view in the current page of the form. This function is useful for applying global changes to a set of objects. -Pour cela, faites un clic droit sur la vue dans laquelle vous souhaitez sélectionner tous les objets et cliquez sur le bouton **Tout sélect. dans vue**: +To do this, right-click on the view in which you wish to select all the objects, click on **Select All**: ![](assets/en/FormEditor/selectAll.png) -Vous pouvez également utiliser le bouton situé en dessous de la palette des vues : +You can also use the button at the bottom of the View palette: ![](assets/en/FormEditor/selectAll2.png) -#### Afficher ou masquer les objets d’une vue +#### Show or hide objects of a view -Vous pouvez à tout moment afficher ou masquer les objets d’une vue dans la page courante du formulaire. Cette fonction permet par exemple de se concentrer sur certains objets lors de la modification du formulaire. +You can show or hide objects belonging to a view at any time in the form's current page. This way you can focus on certain objects when editing the form, for example. -Par défaut, toutes les vues sont affichées, comme l’indique l’icône en regard de chaque vue dans la palette des vues: +By default, all views are shown, as indicated by the *Show/Hide* icon: ![](assets/en/FormEditor/showHide.png) -Pour masquer une vue, cliquez sur cette icône. Elle est alors grisée et les objets de la vue correspondante ne sont plus affichés dans le formulaire : +To hide a view, click the *Show/Hide* icon. It is then dimmed and objects of the corresponding view are no longer shown in the form: ![](assets/en/FormEditor/hidden.png) -> Il n’est pas possible de masquer la [vue courante](#before-you-begin). +> The [Current view](#before-you-begin) cannot be hidden. -Pour afficher une vue masquée, il suffit de la sélectionner ou de cliquer de nouveau sur l’icône de visualisation. +To show a view that is hidden, simply select it or click on the *Show/Hide* icon for that view. -#### Verrouiller les objets d’une vue +#### Locking objects of a view -Vous pouvez verrouiller les objets d’une vue. Cela empêche leur sélection, leur modification ou leur suppression dans le formulaire. Une fois verrouillé, un objet ne peut pas être sélectionné par un clic, un rectangle de sélection ou la commande **Sélectionner objets de même type** du menu contextuel. Cette fonction est utile pour éviter les erreurs de manipulation. +You can lock the objects of a view. This prevents them from being selected, changed, or deleted from the form. Once locked, an object cannot be selected by a click, a rectangle, or the **Select Similar Objects** command of the context menu. This function is useful for preventing handling errors. -Par défaut, toutes les vues sont déverrouillées, comme l’indique l’icône en regard de chaque vue dans la palette des vues: +By default, all views are unlocked, as indicated by the *Lock/Unlock* icon next to each view: ![](assets/en/FormEditor/lockUnlock.png) -Pour verrouiller les objets d’une vue, cliquez sur cette icône. Le cadenas est alors refermé, ce qui indique que la vue est verrouillée : +To lock the objects of a view, click the *Lock/Unlock* icon. The padlock is shut, which means that the view is now locked: ![](assets/en/FormEditor/locked.png) -> Il n’est pas possible de verrouiller la [vue courante](#before-you-begin). +> The [Current view](#before-you-begin) cannot be locked. -Pour déverrouiller une vue, il suffit de la sélectionner ou de cliquer à nouveau sur l’icône de verrouillage. +To unlock a view that is locked, simply select it or click on the *Lock/Unlock* icon for that view. ## Zoom -Il est possible de zoomer dans le formulaire courant. Vous pouvez passer en mode “Zoom” soit en cliquant sur l'icône de loupe, soit en cliquant directement sur la barre correspondant à l’échelle désirée dans la barre d’outils de la fenêtre (les paliers d’affichage sont 50%, 100%, 200%, 400% et 800%) : +You can zoom in the current form. Switch to “Zoom” mode by clicking on the magnifying glass icon or clicking directly on the desired percentage bar (50%, 100%, 200%, 400% and 800%): ![](assets/en/FormEditor/zoom.png) -* Lorsque vous cliquez sur le bouton loupe, le curseur prend la forme d’une loupe. Pour augmenter le pourcentage d’affichage d’un palier, cliquez dans le formulaire. Pour réduire le pourcentage d’affichage d’un palier, appuyez sur la touche Majuscule et cliquez dans le formulaire. -* Lorsque vous cliquez sur une barre de pourcentage, l’affichage est immédiatement modifié. +* When you click on the magnifying glass, the cursor changes into one. You can then click in the form to increase the display or hold down Shift and click to reduce the display percentage. +* When you click on a percentage bar, the display is immediately modified. -En mode Zoom, toutes les fonctions de l’éditeur de formulaires restent disponibles(*). +In Zoom mode, all Form editor functions remain available(*). -(*) Pour des raisons techniques, il n'est toutefois pas possible de sélectionner d'élément de list box (en-tête, colonne ou pied) lorsque l'éditeur de formulaires est en mode Zoom. +(*) For technical reasons, it is not possible to select list box elements (headers, columns, footers) when the Form editor is in Zoom mode. diff --git a/website/translated_docs/fr/FormEditor/forms.md b/website/translated_docs/fr/FormEditor/forms.md index a338bcff0948b5..dda91548bc3313 100644 --- a/website/translated_docs/fr/FormEditor/forms.md +++ b/website/translated_docs/fr/FormEditor/forms.md @@ -20,7 +20,7 @@ You can add or modify 4D forms using the following elements: - **4D Developer interface:** Create new forms from the **File** menu or the **Explorer** window. - **Form Editor**: Modify your forms using the **[Form Editor](FormEditor/formEditor.md)**. -- **JSON code:** Create and design your forms using JSON and save the form files at the [appropriate location](Project/architecture.md#sources-folder). Exemple : +- **JSON code:** Create and design your forms using JSON and save the form files at the [appropriate location](Project/architecture.md#sources-folder). Example: ``` { @@ -82,7 +82,7 @@ There are two categories of forms: Typically, you select the form category when you create the form, but you can change it afterwards. -## Pages formulaire +## Form pages Each form has is made of at least two pages: @@ -93,7 +93,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. -- Réduir ou éliminer le défilement pendant la saisie des données en définissant [l'ordre de saisie](../FormEditor/formEditor.html#data-entry-order). +- Reduce or eliminate scrolling during data entry by setting the [entry order](../FormEditor/formEditor.html#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. @@ -103,35 +103,35 @@ There are no restrictions on the number of pages a form can have. The same field A multi-page form has both a background page and several display pages. Objects that are placed on the background page may be visible on all display pages, but can be selected and edited only on the background page. In multi-page forms, you should put your button palette on the background page. You also need to include one or more objects on the background page that provide page navigation tools for the user. -## Formulaires hérités +## Inherited Forms 4D forms can use and be used as "inherited forms," meaning that all of the objects from *Form A* can be used in *Form B*. In this case, *Form B* "inherits" the objects from *Form A*. -Les références à un formulaire hérité est toujours active : si un élément d'un formulaire hérité est modifié (par exemple le style des boutons), tous les formulaires qui l’utilisent seront automatiquement modifiés. +References to an inherited form are always active: if an element of an inherited form is modified (button styles, for example), all forms using this element will automatically be modified. -Tous les formulaires (formulaires table et formulaires projet) peuvent être désignés comme un formulaire hérité. Cependant, les éléments qu'ils contiennent doivent être compatibles avec une utilisation dans différentes tables de base de données. +All forms (table forms and project forms) can be designated as an inherited form. However, the elements they contain must be compatible with use in different database tables. -A l’exécution du formulaire, les objets sont chargés et combinés dans l’ordre suivant : +When a form is executed, the objects are loaded and combined in the following order: -1. Page zéro du formulaire hérité -2. Page 1 du formulaire hérité -3. Page zéro du formulaire ouvert -4. Page courante du formulaire ouvert. +1. Page zero of the inherited form +2. Page 1 of the inherited form +3. Page zero of the open form +4. Current page of the open form. -Cet ordre détermine [l'ordre de saisie](../FormEditor/formEditor.html#data-entry-order) par défaut des objets dans le formulaire. +This order determines the default [entry order](../FormEditor/formEditor.html#data-entry-order) of objects in the form. -> Seules les pages 0 et 1 du formulaire hérité peuvent apparaître dans les autres formulaires. +> Only pages 0 and 1 of an inherited form can appear in other forms. -Les propriétés ainsi que la méthode d’un formulaire ne sont pas prises en compte lorsque celui-ci est utilisé comme formulaire hérité. En revanche, les méthodes des objets qu’il contient sont appelées. +The properties and method of a form are not considered when that form is used as an inherited form. On the other hand, the methods of objects that it contains are called. -Pour définir un formulaire hérité, les propriétés de [Inherited Form Name](properties_FormProperties.md#inherited-form-name) et [Inherited Form Table](properties_FormProperties.md#inherited-form-table) (pour les formulaires table) doivent être définies dans le formulaire qui héritera de quelque chose issue d'un autre formulaire. +To define an inherited form, the [Inherited Form Name](properties_FormProperties.md#inherited-form-name) and [Inherited Form Table](properties_FormProperties.md#inherited-form-table) (for table form) properties must be defined in the form that will inherit something from another form. A form can inherit from a project form, by setting the [Inherited Form Table](properties_FormProperties.md#inherited-form-table) property to **\** in the Property List (or " " in JSON). To stop inheriting a form, select **\** in the Property List (or " " in JSON) for the [Inherited Form Name](properties_FormProperties.md#inherited-form-name) property. -> Il est possible de définir un formulaire hérité dans un formulaire qui servira à son tour de formulaire hérité pour un troisième formulaire. La combinaison des objets s’effectue alors de manière récursive. 4D détecte les boucles récursives (par exemple si le formulaire [table1]form1 est défini comme formulaire hérité de [table1]form1, c’est-à-dire de lui-même) et interrompt le chaînage des formulaires. +> It is possible to define an inherited form in a form that will eventually be used as an inherited form for a third form. The combining of objects takes place in a recursive manner. 4D detects recursive loops (for example, if form [table1]form1 is defined as the inherited form of [table1]form1, in other words, itself) and interrupts the form chain. -## Propriétés prises en charge +## Supported Properties [Associated Menu Bar](properties_Menu.md#associated-menu-bar) - [Fixed Height](properties_WindowSize.md#fixed-height) - [Fixed Width](properties_WindowSize.md#fixed-width) - [Form Break](properties_Markers.md#form-break) - [Form Detail](properties_Markers.md#form-detail) - [Form Footer](properties_Markers.md#form-footer) - [Form Header](properties_Markers.md#form-header) - [Form Name](properties_FormProperties.md#form-name) - [Form Type](properties_FormProperties.md#form-type) - [Inherited Form Name](properties_FormProperties.md#inherited-form-name) - [Inherited Form Table](properties_FormProperties.md#inherited-form-table) - [Maximum Height](properties_WindowSize.md#maximum-height-minimum-height) - [Maximum Width](properties_WindowSize.md#maximum-width-minimum-width) - [Method](properties_Action.md#method) - [Minimum Height](properties_WindowSize.md#maximum-height-minimum-height) - [Minimum Width](properties_WindowSize.md#maximum-width-minimum-width) - [Pages](properties_FormProperties.md#pages) - [Print Settings](properties_Print.md#settings) - [Published as Subform](properties_FormProperties.md#published-as-subform) - [Save Geometry](properties_FormProperties.md#save-geometry) - [Window Title](properties_FormProperties.md#window-title) diff --git a/website/translated_docs/fr/FormObjects/properties_Action.md b/website/translated_docs/fr/FormObjects/properties_Action.md index 91b3efe5bf48d0..d7ebc5c0888179 100644 --- a/website/translated_docs/fr/FormObjects/properties_Action.md +++ b/website/translated_docs/fr/FormObjects/properties_Action.md @@ -117,9 +117,9 @@ Plusieurs types de références de méthode sont pris en charge : - un nom de méthode projet : nom d'une méthode projet existante sans extension de fichier, c'est-à-dire : `maMéthode` Dans ce cas, 4D ne prend pas en charge automatiquement les opérations objet. -- un chemin d'accès du fichier de méthode personnalisé comprenant l'extension .4dm, par exemple : - `ObjectMethods/objectName.4dm` Vous pouvez également utiliser un filesystem : - `/RESOURCES/Buttons/bOK.4dm` Dans ce cas, 4D ne prend pas en charge automatiquement les opérations sur les objets. +- a custom method file path including the .4dm extension, e.g.: + `../../CustomMethods/myMethod.4dm` You can also use a filesystem: + `/RESOURCES/Buttons/bOK.4dm` In this case, 4D does not provide automatic support for object operations. diff --git a/website/translated_docs/fr/FormObjects/properties_Text.md b/website/translated_docs/fr/FormObjects/properties_Text.md index ff9adc94a51d8e..50664c6400a275 100644 --- a/website/translated_docs/fr/FormObjects/properties_Text.md +++ b/website/translated_docs/fr/FormObjects/properties_Text.md @@ -560,7 +560,7 @@ Cette propriété permet d'utiliser des styles spécifiques dans la zone sélect

    - Permet de définir une couleur de police personnalisée à chaque ligne de list box ou de chaque cellule de la colonne. + Permet de définir un style de police personnalisé à chaque ligne de list box ou de chaque cellule de la colonne.

    @@ -623,7 +623,7 @@ Cette propriété permet d'utiliser des styles spécifiques dans la zone sélect

    - Permet de définir un style de police personnalisé à chaque ligne de list box ou de chaque cellule de la colonne. + List Box - Colonne List Box

    diff --git a/website/translated_docs/fr/ORDA/entities.md b/website/translated_docs/fr/ORDA/entities.md index 85e38beff2777e..411244dc3f8734 100644 --- a/website/translated_docs/fr/ORDA/entities.md +++ b/website/translated_docs/fr/ORDA/entities.md @@ -184,71 +184,109 @@ You can create an object of type [entity selection](dsMapping.md#entity-selectio Vous pouvez créer et utiliser simultanément autant de sélections d'entités différentes que vous le souhaitez pour une dataclass. A noter qu'une sélection d'entité ne contient que des références à des entités. Différentes sélections d'entités peuvent contenir des références vers les mêmes entités. -### Shareable or non-shareable entity selections +### Shareable or alterable entity selections -An entity selection can be **shareable** (readable by multiple processes, but not modifiable after creation) or **non-shareable** (only usable by the current process, but modifiable afterwards): +An entity selection can be **shareable** (readable by multiple processes, but not alterable after creation) or **alterable** (supports the [`.add()`](API/entitySelectionClass.md#add) function, but only usable by the current process). -- a **shareable** entity selection has the following characteristics: - - it can be stored in a shared object or shared collection, and can be shared between several processes or workers; - - it can be stored in several shared objects or collections, or in a shared object or collection which already belongs to a group (it does not have a *locking identifier*); - - it does not allow the addition of new entities. Trying to add an entity to a shareable entity selection will trigger an error (1637 - This entity selection cannot be altered). To add an entity to a shareable entity selection, you must first transform it into a non-shareable entity selection using the [`.copy()`](API/entitySelectionClass.md#copy) function, before calling [`.add()`](API/entitySelectionClass.md#add). +#### Propriétés -- a **non-shareable** entity selection has the following characteristics: - + it cannot be shared between processes, nor be stored in a shared object or collection. Trying to store a non-shareable entity selection in a shared object or collection will trigger an error (-10721 - Not supported value type in a shared object or shared collection); - + it accepts the addition of new entities. +A **shareable** entity selection has the following characteristics: -In most cases, new entity selections are **shareable**, including: +- it can be stored in a shared object or shared collection, and can be passed as parameter between several processes or workers; +- it can be stored in several shared objects or collections, or in a shared object or collection which already belongs to a group (it does not have a *locking identifier*); +- it does not allow the addition of new entities. Trying to add an entity to a shareable entity selection will trigger an error (1637 - This entity selection cannot be altered). To add an entity to a shareable entity selection, you must first transform it into a non-shareable entity selection using the [`.copy()`](API/entitySelectionClass.md#copy) function, before calling [`.add()`](API/entitySelectionClass.md#add). -- entity selections resulting from various ORDA class functions ([`.query()`](API/entitySelectionClass.md#query), [`.query()`](API/dataclassClass.md#query), etc.), -- entity selections based upon relations (e.g. `company.employee`), -- entity selections resulting from projections of values (e.g. `ds.Employee.all().employer`), -- entity selections explicitely copied as shareable with [`.copy()`](API/entitySelectionClass.md#copy) or `OB Copy`. +> Most entity selection functions (such as [`.slice()`](API/entitySelectionClass.md#slice), [`.and()`](API/entitySelectionClass.md#and)...) support shareable entity selections since they do not need to alter the original entity selection (they return a new one). -New entity selections are **non-shareable** in the following cases: +An **alterable** entity selection has the following characteristics: -- blank entity selections created using the [`.newSelection()`](API/dataclassClass.md#newselection) function or `Create entity selection` command, -- entity selections explicitely copied as non-shareable with [`.copy()`](API/entitySelectionClass.md#copy) or `OB Copy`. +- it cannot be shared between processes, nor be stored in a shared object or collection. Trying to store a non-shareable entity selection in a shared object or collection will trigger an error (-10721 - Not supported value type in a shared object or shared collection); +- it accepts the addition of new entities, i.e. it is supports the [`.add()`](API/entitySelectionClass.md#add) function. -#### Exemple + +#### How are they defined? + +The **shareable** or **alterable** nature of an entity selection is defined when the entity selection is created (it cannot be modified afterwards). You can know the nature of an entity selection using the [.isAlterable()](API/entitySelectionClass.md#isalterable) function or the `OB Is shared` command. + + +A new entity selection is **shareable** in the following cases: + +- the new entity selection results from an ORDA class function applied to a dataClass: [dataClass.all()](API/dataclassClass.md#all), [dataClass.fromCollection()](API/dataclassClass.md#fromcollection), [dataClass.query()](API/dataclassClass.md#query), +- the new entity selection is based upon a relation [entity.*attributeName*](API/entityClass.md#attributename) (e.g. "company.employees") when *attributeName* is a one-to-many related attribute but the entity does not belong to an entity selection. +- the new entity selection is explicitely copied as shareable with [entitySelection.copy()](API/entitySelectionClass.md#copy) or `OB Copy` (i.e. with the `ck shared` option). + +Exemple : +```4d +$myComp:=ds.Company.get(2) //$myComp does not belong to an entity selection +$employees:=$myComp.employees //$employees is shareable +``` + +A new entity selection is **alterable** in the following cases: + +- the new entity selection created blank using the [dataClass.newSelection()](API/dataclassClass.md#newselection) function or `Create entity selection` command, +- the new entity selection is explicitely copied as alterable with [entitySelection.copy()](API/entitySelectionClass.md#copy) or `OB Copy` (i.e. without the `ck shared` option). + +Exemple : +```4d +$toModify:=ds.Company.all().copy() //$toModify is alterable +``` + + +A new entity selection **inherits** from the original entity selection nature in the following cases: + +- the new entity selection results from one of the various ORDA class functions applied to an existing entity selection ([.query()](API/entitySelectionClass.md#query), [.slice()](API/entitySelectionClass.md#slice), etc.) . +- the new entity selection is based upon a relation: + - [entity.*attributeName*](API/entityClass.md#attributename) (e.g. "company.employees") when *attributeName* is a one-to-many related attribute and the entity belongs to an entity selection (same nature as [.getSelection()](API/entityClass.md#getselection) entity selection), + - [entitySelection.*attributeName*](API/entitySelectionClass.md#attributename) (e.g. "employees.employer") when *attributeName* is a related attribute (same nature as the entity selection), + - [.extract()](API/entitySelectionClass.md#extract) when the resulting collection contains entity selections (same nature as the entity selection). + +Voici quelques exemples : + +```4d +$highSal:=ds.Employee.query("salary >= :1"; 1000000) + //$highSal is shareable because of the query on dataClass +$comp:=$highSal.employer //$comp is shareable because $highSal is shareable + +$lowSal:=ds.Employee.query("salary <= :1"; 10000).copy() + //$lowSal is alterable because of the copy() +$comp2:=$lowSal.employer //$comp2 is alterable because $lowSal is alterable +``` + + +#### Sharing an entity selection between processes (example) You work with two entity selections that you want to pass to a worker process so that it can send mails to appropriate persons: ```4d - If(Storage.info=Null) - Use(Storage) - Storage.info:=New shared object() - End use - End if - Use(Storage.info) - //Put entity selections in a shared object - Storage.info.paid:=ds.Invoices.query("status=:1";"Paid") - Storage.info.unpaid:=ds.Invoices.query("status=:1";"Unpaid") - End use +var $paid; $unpaid : cs.InvoicesSelection +//We get entity selections for paid and unpaid invoices +$paid:=ds.Invoices.query("status=:1"; "Paid") +$unpaid:=ds.Invoices.query("status=:1"; "Unpaid") + +//We pass entity selection references as parameters to the worker +CALL WORKER("mailing"; "sendMails"; $paid; $unpaid) + +``` - CALL WORKER("mailing";"sendMails";Storage.info) -The sendMails method: +The `sendMails` method: - var $info: ;$1Object - var $paid;$unpaid : cs.InvoicesSelection +```4d + + #DECLARE ($paid : cs.InvoicesSelection; $unpaid : cs.InvoicesSelection) var $invoice : cs.InvoicesEntity - var $server;$transporter;$email;$status : Object + var $server; $transporter; $email; $status : Object //Prepare emails - $server:=New object + $server:=New object() $server.host:="exchange.company.com" $server.user:="myName@company.com" $server.password:="my!!password" $transporter:=SMTP New transporter($server) - $email:=New object + $email:=New object() $email.from:="myName@company.com" - //Get entity selections - $info:=$1 - $paid:=$info.paid - $unpaid:=$info.unpaid - //Loops on entity selections For each($invoice;$paid) $email.to:=$invoice.customer.address // email address of the customer @@ -384,6 +422,7 @@ Les méthodes suivantes associent automatiquement le contexte d'optimisation de * `entitySelection.drop()` + **Exemple** Considérons le code suivant : diff --git a/website/translated_docs/ja/API/cryptoKeyClass.md b/website/translated_docs/ja/API/cryptoKeyClass.md index b23277f85b874c..9812b481bbcf65 100644 --- a/website/translated_docs/ja/API/cryptoKeyClass.md +++ b/website/translated_docs/ja/API/cryptoKeyClass.md @@ -29,7 +29,7 @@ ASSERT($status.success) ### Summary | | | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| [](#4dcryptokeynew)

        | +| [](#4dcryptokeynew)

        | | [](#curve)

         | | [](#decrypt)

        | | [](#encrypt)

        | @@ -46,6 +46,8 @@ ASSERT($status.success) + + ## 4D.CryptoKey.new()

    履歴 @@ -57,7 +59,7 @@ ASSERT($status.success) **4D.CryptoKey.new**( *settings* : Object ) : 4D.CryptoKey - + | 参照 | タイプ | | 説明 | | -------- | ------------ | -- | ---------------------------------------------------------------------- | | settings | オブジェクト | -> | キーペアを生成・ロードするための設定 | @@ -82,7 +84,7 @@ The `4D.CryptoKey.new()` function create #### *cryptoKey* The returned `cryptoKey` object encapsulates an encryption key pair. It is a shared object and can therefore be used by multiple 4D processes simultaneously. - + diff --git a/website/translated_docs/ja/API/datastoreClass.md b/website/translated_docs/ja/API/datastoreClass.md index 8efbd5459edf2d..f708486da568d3 100644 --- a/website/translated_docs/ja/API/datastoreClass.md +++ b/website/translated_docs/ja/API/datastoreClass.md @@ -10,13 +10,14 @@ A [Datastore](ORDA/dsMapping.md#datastore) is the interface object provided by O ### Summary -| | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | [](#canceltransaction)

        | | [](#dataclassname)

         | | [](#encryptionstatus)

         | | [](#getinfo)

         | | [](#getrequestlog)

         | +| [](#makeSelectionsAlterable)

         | | [](#providedatakey)

         | | [](#startrequestlog)

         | | [](#starttransaction)

         | @@ -75,7 +76,7 @@ Using the main datastore on the 4D database: #### 例題 2 -```4d +```4d var $connectTo; $firstFrench; $firstForeign : Object var $frenchStudents; $foreignStudents : cs.DataStore @@ -166,7 +167,7 @@ Pass in *connectionInfo* an object describing the remote datastore you want to c Connection to a remote datastore without user / password: ```4d - var $connectTo : Object + var $connectTo : Object var $remoteDS : cs.DataStore $connectTo:=New object("type";"4D Server";"hostname";"192.168.18.11:8044") $remoteDS:=Open datastore($connectTo;"students") @@ -178,7 +179,7 @@ Connection to a remote datastore without user / password: Connection to a remote datastore with user / password / timeout / tls: ```4d - var $connectTo : Object + var $connectTo : Object var $remoteDS : cs.DataStore $connectTo:=New object("type";"4D Server";"hostname";\"192.168.18.11:4443";\ "user";"marie";"password";$pwd;"idleTimeout";70;"tls";True) @@ -191,7 +192,7 @@ Connection to a remote datastore with user / password / timeout / tls: Working with several remote datastores: ```4d - var $connectTo : Object + var $connectTo : Object var $frenchStudents; $foreignStudents : cs.DataStore $connectTo:=New object("hostname";"192.168.18.11:8044") $frenchStudents:=Open datastore($connectTo;"french") @@ -203,7 +204,7 @@ Working with several remote datastores: #### Error management -In case of error, the command returns **Null**. If the remote datastore cannot be reached (wrong address, web server not started, http and https not enabled...), error 1610 "A remote request to host XXX has failed" is raised. You can intercept this error with a method installed by `ON ERR CALL`. +In case of error, the command returns **Null**. If the remote datastore cannot be reached (wrong address, web server not started, http and https not enabled...), error 1610 "A remote request to host XXX has failed" is raised. You can intercept this error with a method installed by `ON ERR CALL`. @@ -380,11 +381,11 @@ The `.getInfo()` function returns **Returned object** -| プロパティ | タイプ | 説明 | -| ---------- | ------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| type | string |

  • "4D": main datastore, available through ds
  • "4D Server": remote datastore, open with Open datastore
  • | -| networked | boolean |
  • True: the datastore is reached through a network connection.
  • False: the datastore is not reached through a network connection (local database)
  • | -| localID | text | ID of the datastore on the machine. Corresponds to the localId string given with the `Open datastore` command. Empty string ("") for main datastore. | +| プロパティ | タイプ | 説明 | +| ---------- | ------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| type | string |
  • "4D": main datastore, available through ds
  • "4D Server": remote datastore, open with Open datastore
  • | +| networked | boolean |
  • True: the datastore is reached through a network connection.
  • False: the datastore is not reached through a network connection (local database)
  • | +| localID | text | ID of the datastore on the machine. Corresponds to the localId string given with the `Open datastore` command. Empty string ("") for main datastore. | | connection | object | Object describing the remote datastore connection (not returned for main datastore). Available properties:

    プロパティタイプ説明
    hostnametextIP address or name of the remote datastore + ":" + port number
    tlsbooleanTrue if secured connection is used with the remote datastore
    idleTimeoutnumberSession inactivity timeout (in minutes)
    usertextUser authenticated on the remote datastore
    | * If the `.getInfo()` function is executed on a 4D Server or 4D single-user, `networked` is False. @@ -419,8 +420,8 @@ On a remote datastore: //"localID":"students", //"networked":true, //"connection":{hostname:"111.222.33.44:8044","tls":false,"idleTimeout":2880,"user":"marie"}} -``` - +``` + @@ -465,6 +466,39 @@ See Example 2 of [`.startRequestLog()`](#startrequestlog). + +## .makeSelectionsAlterable() + +

    履歴 +| バージョン | 内容 | +| ------ | -- | +| v18 R5 | 追加 | +
    + + +**.makeSelectionsAlterable()** + + +| 参照 | タイプ | | 説明 | +| -- | --- |::| ------------------------------- | +| | | | Does not require any parameters | + + + +#### 説明 + +The `.makeSelectionsAlterable()` function sets all entity selections as alterable by default in all the current application datastores (including [remote datastores](ORDA/remoteDatastores.md)). It is intended to be used once, for example in the `On Startup` database method. + +When this function is not called, new entity selections can be shareable, depending on the nature of their "parent", or [how they are created](ORDA/entities.md#shareable-or-non-shareable-entity-selections). + +> This function does not modify entity selections created by [`.copy()`](#copy) or `OB Copy` when the explicit `ck shared` option is used. + + +> **Compatibility**: This function must only be used in projects converted from 4D versions prior to 4D v18 R5 and containing [.add()](entitySelectionClass.md#add) calls. In this context, using `.makeSelectionsAlterable()` can save time by restoring instantaneously the previous 4D behavior in existing projects. On the other hand, using this method in new projects created in 4D v18 R5 and higher **is not recommended**, since it prevents entity selections to be shared, which provides greater performance and scalabitlity. + + + + ## .provideDataKey() @@ -525,7 +559,7 @@ If no *curPassphrase* or *curDataKey* is given, `.provideDataKey()` returns **nu #### 例題 -```4d +```4d var $keyStatus : Object var $passphrase : Text @@ -539,7 +573,7 @@ If no *curPassphrase* or *curDataKey* is given, `.provideDataKey()` returns **nu End if End if ``` - + @@ -587,7 +621,7 @@ For a description of the ORDA request log format, please refer to the [**ORDA cl You want to log ORDA client requests in a file and use the log sequence number: -```4d +```4d var $file : 4D.File var $e : cs.PersonsEntity @@ -604,7 +638,7 @@ You want to log ORDA client requests in a file and use the log sequence number: You want to log ORDA client requests in memory: -```4d +```4d var $es : cs.PersonsSelection var $log : Collection @@ -617,7 +651,7 @@ You want to log ORDA client requests in memory: $log:=ds.getRequestLog() ALERT("The longest request lasted: "+String($log.max("duration"))+" ms") ``` - + @@ -653,7 +687,7 @@ You can nest several transactions (sub-transactions). Each transaction or sub-tr #### 例題 -```4d +```4d var $connect; $status : Object var $person : cs.PersonsEntity var $ds : cs.DataStore @@ -683,13 +717,14 @@ You can nest several transactions (sub-transactions). Each transaction or sub-tr $ds.validateTransaction() End if ``` - + + ## .stopRequestLog() diff --git a/website/translated_docs/ja/API/entitySelectionClass.md b/website/translated_docs/ja/API/entitySelectionClass.md index 8677dc886a2205..26790eff6bd2d5 100644 --- a/website/translated_docs/ja/API/entitySelectionClass.md +++ b/website/translated_docs/ja/API/entitySelectionClass.md @@ -23,6 +23,7 @@ An entity selection is an object containing one or more reference(s) to [entitie | [](#extract)

        | | [](#first)

        | | [](#getdataclass)

        | +| [](#isalterable)

        | | [](#isordered)

        | | [](#last)

        | | [](#length)

        | @@ -43,6 +44,46 @@ An entity selection is an object containing one or more reference(s) to [entitie + +**Create entity selection** ( *dsTable* : Table { ; *settings* : Object } ) : 4D.EntitySelection + + +| 参照 | タイプ | | 説明 | +| -------- | ------------------ |:--:| ------------------------------------------------------------------------------------------- | +| dsTable | テーブル | -> | Table in the 4D database whose current selection will be used to build the entity selection | +| settings | オブジェクト | -> | Build option: context | +| 戻り値 | 4D.EntitySelection | <- | Entity selection matching the dataclass related to the given table | + + + +#### 説明 + +The `Create entity selection` command builds and returns a new, [alterable](ORDA/entities.md#shareable-or-alterable-entity-selections) entity selection related to the dataclass matching the given *dsTable*, according to the current selection of this table. + +If the current selection is sorted, an [ordered](ORDA/dsMapping.md#ordered-or-unordered-entity-selection) entity selection is created (the order of the current selection is kept). If the current selection is unsorted, an unordered entity selection is created. + +If the *dsTable* is not exposed in [`ds`](API/datastoreClass.md#ds), an error is returned. This command cannot be used with a Remote datastore. + +In the optional *settings* parameter, you can pass an object containing the following property: + +| プロパティ | タイプ | 説明 | +| ------- | ---- | ----------------------------------------------------------------------------------------------------------------- | +| context | テキスト | Label for the [optimization context](ORDA/entities.md#clientserver-optimization) applied to the entity selection. | + + +#### 例題 + +```4d +var $employees : cs.EmployeeSelection +ALL RECORDS([Employee]) +$employees:=Create entity selection([Employee]) +// The $employees entity selection now contains a set of reference +// on all entities related to the Employee dataclass +``` + +#### 参照 + +[`dataClass.newSelection()`](dataclassClass.md#newselection) ## [*index*] @@ -181,10 +222,10 @@ The resulting object is an entity selection of Employee with duplications remove ## .add()

    履歴 -| バージョン | 内容 | -| ------ | --------------------------------------------- | -| v18 R5 | Only supports non-shareable entity selections | -| v17 | 追加 | +| バージョン | 内容 | +| ------ | ----------------------------------------- | +| v18 R5 | Only supports alterable entity selections | +| v17 | 追加 |
    @@ -204,7 +245,7 @@ The resulting object is an entity selection of Employee with duplications remove The `.add()` function adds the specified *entity* to the entity selection and returns the modified entity selection. > This function modifies the original entity selection. -**Warning:** The entity selection must be *non-shareable*, i.e. it has been created for example by [`.newSelection()`](dataclassClass.md#newselection) or `Create entity selection`, otherwise `.add()` will return an error. Shareable entity selections do not accept the addition of entities. For more information, please refer to the [Shareable vs Non-shareable entity selections](ORDA/entities.md#shareable-or-non-shareable-entity-selections) section. +**Warning:** The entity selection must be *alterable*, i.e. it has been created for example by [`.newSelection()`](dataclassClass.md#newselection) or `Create entity selection`, otherwise `.add()` will return an error. Shareable entity selections do not accept the addition of entities. For more information, please refer to the [Shareable or alterable entity selections](ORDA/entities.md#shareable-or-alterable-entity-selections) section. * If the entity selection is ordered, *entity* is added at the end of the selection. If a reference to the same entity already belongs to the entity selection, it is duplicated and a new reference is added. @@ -482,9 +523,9 @@ The `.copy()` function returns > This function does not modify the original entity selection. -By default, if the *option* parameter is omitted, the function returns a new, non-shareable entity selection (even if the function is applied to a shareable entity selection). Pass the `ck shared` constant in the *option* parameter if you want to create a shareable entity selection. +By default, if the *option* parameter is omitted, the function returns a new, alterable entity selection (even if the function is applied to a shareable entity selection). Pass the `ck shared` constant in the *option* parameter if you want to create a shareable entity selection. -> For information on the shareable property of entity selections, please refer to the [Shareable vs Non-shareable entity selections](ORDA/entities.md#shareable-or-non-shareable-entity-selections) section. +> For information on the shareable property of entity selections, please refer to the [Shareable or alterable entity selections](ORDA/entities.md#shareable-or-alterable-entity-selections) section. #### 例題 @@ -806,6 +847,7 @@ There is, however, a difference between both statements when the selection is em **.getDataClass()** : 4D.DataClass + | 参照 | タイプ | | 説明 | | --- | ------------ |:--:| ------------------------------------------------------ | @@ -842,6 +884,47 @@ The following generic code duplicates all entities of the entity selection: + +## .isAlterable() + +
    履歴 + +| バージョン | 内容 | +| ------ | -- | +| v18 R5 | 追加 | + +
    + + +**.isAlterable()** : Boolean + + +| 参照 | タイプ | | 説明 | +| --- | --- |:--:| ---------------------------------------------------------- | +| 戻り値 | ブール | <- | True if the entity selection is alterable, False otherwise | + + +#### 説明 + +The `.isAlterable()` function returns True if the entity selection is alterable, and False if the entity selection is not alterable. + +For more information, please refer to [Shareable or alterable entity selections](ORDA/entities.md#shareable-or-alterable-entity-selections). + +#### 例題 + +You are about to display `Form.products` in a [list box](FormObjects/listbox_overview.md) to allow the user to add new products. You want to make sure it is alterable so that the user can add new products without error: + +```4d +If (Not(Form.products.isAlterable())) + Form.products:=Form.products.copy() +End if +... +Form.products.add(Form.product) +``` + + + + ## .isOrdered() @@ -988,6 +1071,7 @@ Entity selections always have a `.length` property. **.max**( *attributePath* : Text ) : any + | 参照 | タイプ | | 説明 | | ------------- | ---- |:--:| ------------------------------------------------ | @@ -1898,6 +1982,7 @@ Returns: "lastName": "Durham" } ] + ``` #### Example 4 @@ -2090,6 +2175,7 @@ Returns: }, { "firstName": "Gary", + "lastName": "Reichert", "directReports": [ { diff --git a/website/translated_docs/ja/Backup/overview.md b/website/translated_docs/ja/Backup/overview.md index 34f1097b300fb0..f8ec23dbc09154 100644 --- a/website/translated_docs/ja/Backup/overview.md +++ b/website/translated_docs/ja/Backup/overview.md @@ -1,22 +1,21 @@ --- id: overview -title: 概要 +title: Overview --- -4Dには、アプリケーションのフルバックアップと復元用のモジュールが組み込まれています。 +4D includes a full application backup and restore module. -このモジュールにより、現在使用中のアプリケーションを終了しなくても、そのバックアップを作成することができます。 各バックアップには、プロジェクトフォルダー、データファイルのほか、任意の追加ファイルやフォルダーを含められます。 これらのパラメーターの指定は、最初にストラクチャー設定にておこないます。 +This module allows backing up an application currently in use without having to exit it. Each backup can include the project folder, the data file and any additional files or folders. These parameters are first set in the Settings. -バックアップは手動で実行するか、またはユーザーが操作しなくても定期的に自動実行することができます。 特定のランゲージコマンドやデータベースメソッドを使用すると、独自のインタフェースにバックアップ機能を統合することができます。 +Backups can be started manually or automatically at regular intervals without any user intervention. Specific language commands, as well as specific database methods, allow integrating backup functions into a customized interface. -損傷したアプリケーションが開かれた場合には、自動的にアプリケーションを復元することができます。 +Applications can be restored automatically when a damaged application is opened. -また、この統合バックアップモジュールでは、[ログファイル](log.md) (.journal 拡張子のジャーナルファイル) を利用することができます。 このファイルは、データ上で実行された全操作の記録を保管し、2回のバックアップ間の安全性を完全に保証します。 使用中のアプリケーションに問題が発生した場合は、次回そのアプリケーションを開いたときに、データファイルから失われた操作が自動的に再統合されます。 ログファイルの内容はいつでも確認することができます。 +Also, the integrated backup module can take advantage of the .journal file ([database log file](log.md)). This file keeps a record of all operations performed on the data and also ensures total security between two backups. In case of problems with an application in use, any operations missing in the data file are automatically reintegrated the next time the application is opened. You can view the journal file contents at any time. -> バックアップを目的にデータを複製・同期することで、常に複数の完全一致するアプリケーションを管理したい場合には、他のソリューションを採用することもできます。 これらのソリューションは次のメカニズムや技術に基づいています: -> - 4D Serverを使い、(統合されたバックアップモジュールメカニズムを使用して) 論理ミラーを設定する -> - SQL による同期 -> - HTTP による同期 (/rest/url) +> You can also implement alternative solutions for replicating and synchronizing data in order to maintain identical versions of applications for backup purposes. These solutions can be based on the following mechanisms and technologies: +> - Setting up a logical mirror with 4D Server (using the integrated backup module mechanisms) +> - Synchronization using SQL - Synchronization using HTTP (/rest/url) -> 4Dのセキュリティ機能の概要については、[4D Security guide](https://blog.4d.com/4d-security-guide/) をご覧ください。 +> For a general overview of 4D's security features, see the [4D Security guide](https://blog.4d.com/4d-security-guide/). diff --git a/website/translated_docs/ja/Backup/restore.md b/website/translated_docs/ja/Backup/restore.md index 039fcebc5626ec..e1c690cc8faa88 100644 --- a/website/translated_docs/ja/Backup/restore.md +++ b/website/translated_docs/ja/Backup/restore.md @@ -1,56 +1,56 @@ --- id: restore -title: 復元 +title: Restore --- -問題が発生したときは、一連のアプリケーションファイル全体を復元することができます。 主に 2つのカテゴリの問題が発生する可能性があります: +4D allows you to restore entire sets of application data in case of any incidents, regardless of the cause of the incident. Two primary categories of incidents can occur: -- アプリケーションが使用中に予期せず終了された。 この問題は電力の切断、システムのエラー等により発生する可能性があります。 この場合、問題が発生した瞬間のデータキャッシュの状態により、アプリケーションの復旧には異なる手順が必要となります: - - キャッシュが空の場合、アプリケーションを問題なく開くことができます。 アプリケーションに対しておこなわれた変更はデータファイルに記録されています。 この場合には、特別な手順は必要ありません。 - - キャッシュに未保存の処理が含まれている場合、データファイルは損傷していませんが、カレントのログファイルを統合する必要があります。 - - キャッシュの内容をデータファイルに書き込み中だった場合、データファイルはおそらく損傷しています。 最新のバックアップから復元をおこない、カレントのログファイルを統合する必要があります。 +- The unexpected stoppage of an application while in use. This incident can occur because of a power outage, system element failure, etc. In this case, depending on the current state of the data cache at the moment of the incident, the restore of the application can require different operations: + - If the cache was empty, the application opens normally. Any changes made in the application were recorded. This case does not require any particular operation. + - If the cache contains operations, the data file is intact but it requires integrating the current log file. + - If the cache was in the process of being written, the data file is probably damaged. The last backup must be restored and the current log file must be integrated. -- アプリケーションファイルを失った。 この問題はアプリケーションが配置されたディスク上のセクターが読み書き不能になった、あるいはウィルス、操作ミス等により発生します。 最新のバックアップから復元をおこない、カレントのログファイルを統合する必要があります。 問題発生後にアプリケーションが損傷しているかどうかを見分けるには、4D でアプリケーションを起動します。 4Dは自己検証をおこない、必要な復元処理手順を示します。 自動モードの場合、この処理はユーザーのアクションなしで直接実行されます。 定期的なバックアップがおこなわれていれば、4D の復元ツールを使用して (ほとんどの場合) 問題が発生する直前の状態までアプリケーションを復旧することができます。 +- The loss of application file(s). This incident can occur because of defective sectors on the disk containing the application, a virus, manipulation error, etc. The last backup must be restored and then the current log file must be integrated. To find out if an application was damaged following an incident, simply relaunch the application using 4D. The program performs a self-check and details the necessary restore operations to perform. In automatic mode, these operations are performed directly without any intervention on the part of the user. If a regular backup strategy was put into place, the 4D restore tools will allow you to recover (in most cases) the application in the exact state it was in before the incident. -> 問題発生後に、自動で 4Dのアプリケーション復旧処理を起動することができます。 このメカニズムは、ストラクチャー設定の **バックアップ/バックアップ&復旧** ページで利用できるオプションを使用して管理します。 詳細は [自動復元](settings.md#自動復元) を参照してください。 -> 問題が、データに対しておこなわれた不適切な処理の結果引き起こされた場合 (たとえば誤ってレコードを削除した等)、ログファイルの "ロールバック" 機能を使用してデータファイルを復旧できます。 この機能は MSC の [ロールバック](MSC/rollback.md) ページから利用できます。 +> 4D can launch procedures automatically to recover applications following incidents. These mechanisms are managed using two options available on the **Backup/Backup & Restore** page of the Settings. For more information, refer to the [Automatic Restore](settings.md#automatic-restore) paragraph. +> If the incident is the result of an inappropriate operation performed on the data (deletion of a record, for example), you can attempt to repair the data file using the "rollback" function in the log file. This function is available on the [Rollback](MSC/rollback.md) page of the MSC. -## 手動でバックアップから復元する (標準ダイアログ) +## Manually restoring a backup (standard dialog) -バックアップモジュールを使用して生成されたアーカイブの内容を、手動で復元することができます。 手動による復元は、たとえばアーカイブ全体 (ストラクチャーファイルや添付されたファイル) を再生成したい場合や、アーカイブの内容を見たい場合などに必要となります。 手動復元の際に、カレントログファイルを統合することもできます。 +You can restore the contents of an archive generated by the backup module manually. A manual restore may be necessary, for instance, in order to restore the full contents of an archive (project files and enclosed attached files), or for the purpose of carrying out searches among the archives. The manual restore can also be performed along with the integration of the current log file. -バックアップの手動復元は、標準のファイルを開くダイアログボックス、あるいは Maintenance and Security Center (MSC) の [復元](MSC/restore) ページからおこなうことができます。 MSC を使用した復元では詳細なオプション設定をおこなったり、アーカイブの内容をプレビューしたりすることができます。 他方、開かれているアプリケーションに関連したアーカイブのみを復元できます。 +The manual restore of backups can be carried out either via the standard Open document dialog box, or via the [Restore](MSC/restore) page of the MSC. Restoring via the MSC provides more options and allows the archive contents to be previewed. On the other hand, only archives associated with the open application can be restored. -標準ダイアログボックスを使用してアプリケーションを手動復元するには: +To restore an application manually via a standard dialog box: -1. 4Dアプリケーションを開始し、**ファイル** メニューから **復元...** を選択します。 アプリケーションプロジェクトが開かれている必要はありません。 または
    4Dメソッドから `RESTORE` コマンドを実行します。 標準のファイルを開くダイアログボックスが表示されます。 -2. 復元するバックアップファイル (.4bk) またはログバックアップファイル (.4bl) を選択し、**開く** をクリックします。 復元したファイルを配置する場所を指定するために、以下のダイアログボックスが表示されます: デフォルトで 4Dは アーカイブと同階層にアーカイブ名と同じ名前 (拡張子なし) のフォルダーを作成し、ファイルを復元します。 場所が表示されているエリアをクリックして、パスを確認することができます: +1. Choose **Restore...** in the 4D application **File** menu. It is not mandatory that an application project be open. OR Execute the `RESTORE` command from a 4D method. A standard Open file dialog box appears. +2. Select a backup file (.4bk) or a log backup file (.4bl) to be restored and click **Open**. A dialog box appears, which allows you to specify the location where files will be restored. By default, 4D restores the files in a folder named *Archivename* (no extension) located next to the archive. You can display the path: ![](assets/en/Backup/backup07.png) -**[...]** ボタンをクリックして異なる場所を指定することもできます。 -3. **復元** ボタンをクリックします。 4D は指定されたすべてのバックアップファイルを展開します。 カレントログファイル、または、バックアップファイルと同じ番号を持つログバックアップファイルが同じフォルダーに存在する場合、4D はその内容を検証します。 データファイル中に無い処理がログファイルに含まれていれば、その処理を統合するかどうか 4D が尋ねてきます。 **データベースが完全でない場合、最新のログを統合する** オプションが選択されている場合、統合処理は自動でおこなわれます ([自動復元](settings.md#自動復元) 参照)。 +You can also click on the **[...]** button to specify a different location. +3. Click on the **Restore** button. 4D extracts all backup files from the specified location. If the current log file or a log backup file with the same number as the backup file is stored in the same folder, 4D examines its contents. If it contains operations not present in the data file, the program asks you if you want to integrate these operations. Integration is done automatically if the **Integrate last log file...** option is checked (see [Automatic Restore](settings.md#automatic-restore)). -4. (任意) **OK** をクリックして、復元したアプリケーションにログファイルを統合します。 復元と統合が正しく実行されると、4D は処理が成功したことを通知するダイアログを表示します。 -5. **OK** をクリックします。 +4.(Optional) Click **OK** to integrate the log file into the restored application. If the restore and integration were carried out correctly, 4D displays a dialog box indicating that the operation was successful. +5. Click **OK**. -保存先フォルダーが表示されます。 バックアップ時のファイルの位置にかかわらず、4D はすべてのバックアップファイルをこのフォルダーに配置します。 これにより、ファイルを探す手間が省けます。 +The destination folder is displayed. During the restore, 4D places all backup files in this folder, regardless of the position of the original files on the disk when the backup starts. This way your files will be easier to find. -> データファイルの関連要素 (ファイルや `Settings` フォルダー) は保存先フォルダー内の `Data` サブフォルダー内に自動的に復元されます。 +> Any content related to the data file (files and `Settings` folder) are automatically restored in a `Data` subfolder within the destination folder. -## 手動でバックアップから復元する (MSC) +## Manually restoring a backup (MSC) -Maintenance and Security Center (MSC) の [復元](MSC/restore.md)ページから、カレントアプリケーションのアーカイブを手動で復元できます。 +You can manually restore an archive of the current application using the [Restore page](MSC/restore.md) of the Maintenance and Security Center (MSC). -## 手動でログを統合する +## Manually integrating the log -MSC の復元ページでログファイルの自動統合を選択していない場合 ([複数のログファイルを連続して統合する](MSC/restore.md#successive-intergration-of-several-data-log-files) 参照)、データファイルに保存されていない処理がログファイル中に見つかると、4D はアプリケーションを開く際に警告ダイアログボックスを表示します。 +If you have not checked the option for the automatic integration of the log file on the Restore page of the MSC (see [Successive integration of several log files](MSC/restore.md#successive-intergration-of-several-data-log-files)), a warning dialog box appears during the opening of the application when 4D notices that the log file contains more operations than have been carried out in the data file. ![](assets/en/Backup/backup08.png) -> このメカニズムを機能させるために、4D はカレントの場所にあるログファイルにアクセスできなければなりません。 +> In order for this mechanism to work, 4D must be able to access the log file in its current location. -カレントログファイルを統合するかしないかを選択することができます。 カレントログファイルを統合しないことにより、データ中に作成されたエラーを再生成しないようにすることもできます。 \ No newline at end of file +You can choose whether or not to integrate the current log file. Not integrating the current log file allows you to avoid reproducing errors made in the data. \ No newline at end of file diff --git a/website/translated_docs/ja/Backup/settings.md b/website/translated_docs/ja/Backup/settings.md index 64cb91c80be2b8..44298ffb33ced2 100644 --- a/website/translated_docs/ja/Backup/settings.md +++ b/website/translated_docs/ja/Backup/settings.md @@ -1,126 +1,126 @@ --- id: settings -title: バックアップ設定 +title: Backup Settings --- -バックアップ設定の定義は、ストラクチャー設定ダイアログボックス内で 3ページにわたっています。 次の設定がおこなえます: +Backup settings are defined through three pages in the Settings dialog box. You can set: -- 自動バックアップ用のスケジューラー設定 -- 各バックアップに含めるファイル -- 自動タスクの実行を可能にする高度な設定 +- the scheduler for automatic backups +- the files to include in every backup +- the advanced features allowing to execute automatic tasks -> このダイアログボックスで定義された設定は *Backup.4DSettings* ファイルに書き込まれ、[Settings フォルダー](Project/architecture.md#settings-フォルダー) に保存されます。 +> Settings defined in this dialog box are written in the *Backup.4DSettings* file, stored in the [Settings folder](Project/architecture.md#settings-folder). -## スケジューラー +## Scheduler -4D や 4D Server で開かれているアプリケーションのバックアップを自動化することができます (クライアントマシンが接続されている必要はありません)。 これはバックアップ周期 (時間、日、週、月単位等) を設定することによりおこないます。現在のバックアップ設定に基づき、4D は自動でバックアップを実行します。 +You can automate the backup of applications opened with 4D or 4D Server (even when no client machines are connected). This involves setting a backup frequency (in hours, days, weeks or months); for each session, 4D automatically starts a backup using the current backup settings. -バックアップが実行されるべきときにアプリケーションが起動されていなかった場合には、次に起動されたとき 4D はバックアップが失敗したものと認識し、ストラクチャー設定の再試行設定を適用します ([バックアップ中に問題が発生した場合](backup.md#バックアップ中に問題が発生した場合) 参照)。 +If this application was not launched at the theoretical moment of the backup, the next time 4D is launched, it considers the backup as having failed and proceeds as set in the Settings (refer to [Handling backup issues](backup.md#handling-backup-issues)). -バックアップのスケジュール設定は、ストラクチャー設定の **バックアップ/スケジューラー** ページでおこないます: +The scheduler backup settings are defined on the **Backup/Scheduler** page of the Structure Settings: ![](assets/en/Backup/backup02.png) -このページにあるオプションを使用して、アプリケーションの自動バックアップのスケジュールを設定できます。 標準のクイック設定、または完全なカスタマイズを選択できます。 **自動バックアップ** メニューでの選択に基づき、さまざまなオプションが表示されます: +The options found on this tab let you set and configure scheduled automatic backups of the application. You can choose a standard quick configuration or you can completely customize it. Various options appear depending on the choice made in the **Automatic Backup** menu: -- **しない**: スケジュールに基づくバックアップは無効となります。 -- **毎時**: 次の時間以降、毎時間ごとに自動バックアップをおこないます。 -- **毎日**: 日に一回自動バックアップをおこないます。 バックアップを何時に開始するかを設定します。 -- **毎週**: 週に一回自動バックアップをおこないます。 バックアップを開始する曜日と時刻を入力するエリアが表示されます。 -- **毎月**: 月に一回自動バックアップをおこないます。 バックアップを開始する日付と時刻を入力するエリアが表示されます。 -- **カスタマイズ**: 自動バックアップを詳細にスケジュールする場合に使用します。 このオプションを選択すると、複数の入力エリアが表示されます: - + **X 時間ごと**: 時間単位でバックアップの間隔をスケジュールできます。 1から24までの値を設定できます。 - - **X 日ごと**: 日単位でバックアップの間隔をスケジュールできます。 たとえば、毎日バックアップをおこなうには 1 と設定します。 このオプションを選択した場合、バックアップが開始される時刻を設定しなければなりません。 - - **X 週ごと**: 週単位でバックアップの間隔をスケジュールできます。 たとえば、毎週バックアップをおこなうには 1 と設定します。 このオプションを選択した場合、バックアップを開始する曜日と時刻を設定しなければなりません。 複数の曜日を選択することもできます。 たとえば、毎週水曜日と金曜日にバックアップをするようプログラムできます。 - - **X 月ごと**: 月単位でバックアップの間隔をスケジュールできます。 たとえば、毎月バックアップをおこなうには 1 と設定します。 このオプションを選択した場合、バックアップを開始する日付と時刻を設定しなければなりません。 +- **Never**: The scheduled backup feature is disabled. +- **Every Hour**: Programs an automatic backup every hour, starting with the next hour. +- **Every Day**: Programs an automatic backup every day. You can then enter the time when the backup should start. +- **Every Week**: Programs an automatic backup every week. Two additional entry areas let you indicate the day and time when the backup should start. +- **Every Month**: Programs an automatic backup every month. Two additional entry areas let you indicate the day of the month and the time when the backup should start. +- **Personalized**: Used to configure "tailormade" automatic backups. When you select this option, several additional entry areas appear: + + **Every X hour(s)**: Allows programming backups on an hourly basis. You can enter a value between 1 and 24. + - **Every X day(s) at x**: Allows programming backups on a daily basis. For example, enter 1 if you want to perform a daily backup. When this option is checked, you must enter the time when the backup should start. + - **Every X week(s) day at x**: Allows programming backups on a weekly basis. Enter 1 if you want to perform a weekly backup. When this option is checked, you must enter the day(s) of the week and the time when the backup should start. You can select several days of the week, if desired. For example, you can use this option to set two weekly backups: one on Wednesday and one on Friday. + - **Every X month(s), Xth Day at x**: Allows programming backups on a monthly basis. Enter 1 if you want to perform a monthly backup. When this option is checked, you must indicate the day of the month and the time when the backup should start. -## バックアップ設定 +## Configuration -ストラクチャー設定のバックアップ/設定ページではバックアップやログファイルの有効化/無効化、および保存先を設定できます。 これらのパラメーターは、4D や 4D Server で開かれる各アプリケーションごとに設定されます。 +The Backup/Configuration page of the Structure Settings lets you set the backup files and their location, as well as that of the log file. These parameters are specific to each application opened by 4D or 4D Server. ![](assets/en/Backup/backup03.png) -> **4D Server**: これらのパラメーターは 4D Server マシン上でのみ設定できます。 +> **4D Server:** These parameters can only be set from the 4D Server machine. -### 内容 -このエリアでは、次回のバックアップ時にコピー対象とするファイルやフォルダーを指定します。 +### Content +This area allows you to set which files and/or folders to copy during the next backup. -- **データ**: アプリケーションのデータファイル。 このオプションが選択されている場合、次のものがデータとともにバックアップされます: - - データベースのカレントログファイル (あれば) - - [データファイルの隣に置かれた](Project/architecture.md#settings-フォルダー) `Settings` フォルダー (あれば)。これは *データファイル用のユーザー設定* を格納しています。 -- **ストラクチャー**: アプリケーションの Project フォルダーとファイル。 プロジェクトがコンパイルされている場合には、このオプションは .4dz ファイルをバックアップします。 このオプションがチェックされていると、[Project フォルダーと同階層に置かれた](Project/architecture.md#settings-フォルダー-1) `Settings` フォルダーが自動でバックアップされます。これは、*ユーザー設定* を格納しています。 -- **ユーザーストラクチャー(バイナリデータベースのみ)**: *廃止予定* -- **添付**: このエリアでは、アプリケーションと同時にバックアップの対象とするファイルやフォルダーを指定します。 ここではどのようなタイプのファイル (ドキュメントやプラグイン、テンプレート、ラベル、レポート、ピクチャーなど) でも指定できます。 個々のファイル、または丸ごとバックアップするフォルダーを個々に設定できます。 添付エリアには、設定されたファイルのパスが表示されます。 - - **削除**: 選択したファイルを添付エリアから取り除きます。 - - **フォルダー追加...**: バックアップに追加するフォルダーを選択するダイアログボックスを表示します。 復元の場合、フォルダーがその内容物とともに復元されます。 アプリケーションファイルを含むフォルダーを除き、すべてのフォルダーやマシンに接続されたボリュームを選択できます。 - - **ファイル追加...**: バックアップに追加するファイルを選択するダイアログボックスを表示します。 +- **Data**: Application data file. When this option is checked, the following elements are automatically backed up at the same time as the data: + - the current log file of the application (if it exists), + - the full `Settings` folder located [next to the data file](Project/architecture.md#settings-folder) (if it exists), i.e. the *user settings for data*. +- **Structure**: Application project folders and files. In cases where projects are compiled, this option allows you to backup the .4dz file. When this option is checked, the full `Settings` folder located [at the same level as the Project folder](Project/architecture.md#settings-folder-1), i.e. the *user settings*, is automatically backed up. +- **User Structure File (only for binary database)**: *deprecated feature* +- **Attachments**: This area allows you to specify a set of files and/or folders to be backed up at the same time as the application. These files can be of any type (documents or plug-in templates, labels, reports, pictures, etc.). You can set either individual files or folders whose contents will be fully backed up. Each attached element is listed with its full access path in the “Attachments” area. + - **Delete**: Removes the selected file from the list of attached files. + - **Add folder...**: Displays a dialog box that allows selecting a folder to add to the backup. In the case of a restore, the folder will be recovered with its internal structure. You can select any folder or volume connected to the machine, with the exception of the folder containing the application files. + - **Add file...**: Displays a dialog box that allows you to select a file to add to the backup. -### バックアップファイル保存先 +### Backup File Destination Folder -このエリアではバックアップファイルの格納場所を確認したり、変更したりできます。 +This area lets you view and change the location where backup files as well as log backup files (where applicable) will be stored. -エリアをクリックすると、ファイルの場所がポップアップで表示されます。 +To view the location of the files, click in the area in order to display their pathname as a pop-up menu. -バックアップファイルの格納場所を変更するには、**[...]** ボタンをクリックします。 選択ダイアログが表示され、バックアップファイルを配置するフォルダーやディスクを選択できます。 "使用状況" と "空き容量" エリアは、選択したフォルダーが存在するディスクの状態を自動で表示します。 +To modify the location where these files are stored, click the **...** button. A selection dialog box appears, which allows you to select a folder or disk where the backups will be placed. The "Used Space" and "Free Space" areas are updated automatically and indicate the remaining space on the disk of the selected folder. -### ログ管理 +### Log management -**ログを使用** オプションが選択されていると、アプリケーションはログファイルを使用します。 ログファイルの場所はオプションの下に表示されます。 このオプションが選択されている場合、ログファイルなしでアプリケーションを開くことはできません。 +The **Use Log** option, when checked, indicates that the application uses a log file. Its pathname is specified below the option. When this option is checked, it is not possible to open the application without a log file. -デフォルトでは、4D で作成されたすべてのプロジェクトでログファイルが使用されます (**環境設定** の **一般ページ** 内でチェックされている **ログを使用** オプションです)。 ログファイルには *data.journal* のように名前が付けられ、Data フォルダー内に置かれます。 +By default, any project created with 4D uses a log file (option **Use Log File** checked in the **General Page** of the **Preferences**). The log file is named *data.journal* and is placed in the Data folder. -> 新しいログファイルを有効にするには、その前にアプリケーションのデータをバックアップしなければなりません。 このオプションをチェックすると、バックアップが必要である旨の警告メッセージが表示されます: ログファイルの作成は延期され、実際には次のバックアップの後にログファイルが作成されます。 +> Activating a new log file requires the data of the application to be backed up beforehand. When you check this option, a warning message informs you that a backup is necessary. The creation of the log file is postponed and it will actually be created only after the next backup of the application. -## バックアップ&復旧 +## Backup & Restore -バックアップ&復旧の設定は必要に応じて変更します。 デフォルトの設定は、標準的なバックアップ動作をおこないます。 +Modifying backup and restore options is optional. Their default values correspond to a standard use of the function. ![](assets/en/Backup/backup04.png) -### 一般設定 +### General settings -- **最新のバックアップのみ保存 X バックアップファイル**: このパラメーターを有効にすると、指定された数の最新バックアップファイルだけが保持され、古いバックアップファイルは削除されます。 この機能は以下のように動作します: バックアップ処理が完了したら、アーカイブが作成されたのと同じ場所、同じ名前のもっとも古いアーカイブを削除します。ディスクスペースを確保するため、バックアップ前に削除するよう、削除のタイミングを変更することもできます。 たとえば、3世代のファイルを保持するよう設定している場合、最初の 3回のバックアップで MyBase-0001、MyBase-0002、MyBase-0003 が作成され、 4回目のバックアップで MyBase-0004 が作成されたのちに MyBase-0001 が削除されます。 この設定はデフォルトで有効になっており、4D は 3世代のバックアップを保持します。 このメカニズムを無効にするには、チェックボックスの選択を外します。 -> このパラメーターは、アプリケーションおよびログファイル両方のバックアップに影響します。 +- **Keep only the last X backup files**: This parameter activates and configures the mechanism used to delete the oldest backup files, which avoids the risk of saturating the disk drive. This feature works as follows: Once the current backup is complete, 4D deletes the oldest archive if it is found in the same location as the archive being backed up and has the same name (you can request that the oldest archive be deleted before the backup in order to save space). If, for example, the number of sets is set to 3, the first three backups create the archives MyBase-0001, MyBase-0002, and MyBase-0003 respectively. During the fourth backup, the archive MyBase-0004 is created and MyBase-0001 is deleted. By default, the mechanism for deleting sets is enabled and 4D keeps 3 backup sets. To disable the mechanism, simply deselect the option. +> This parameter concerns both application and log file backups. -- **データファイルが更新された場合のみバックアップを行う**: このオプションが選択された場合、前回のバックアップ以降にデータが追加・変更・削除された場合のみ、4D は定期的なバックアップを開始します。 そうでない場合、定期的なバックアップはキャンセルされ、次回のスケジュールまで延期されます。 エラーは生成されませんが、バックアップジャーナルにはバックアップが延期された旨記録されます。 このオプションを使用すれば、主に参照目的で使用されているアプリケーションのバックアップに消費されるマシン時間を節約できます。 ストラクチャーや添付ファイルに対して変更がおこなわれていても、データファイルの更新としては扱われない旨注意してください。 -> このパラメーターは、アプリケーションおよびログファイル両方のバックアップに影響します。 +- **Backup only if the data file has been modified**: When this option is checked, 4D starts scheduled backups only if data has been added, changed or deleted since the last backup. Otherwise, the scheduled backup is cancelled and put off until the next scheduled backup. No error is generated; however the backup journal notes that the backup has been postponed. This option also allows saving machine time for the backup of applications principally used for viewing purposes. Please note that enabling this option does not take any modifications made to the project files or attached files into account. +> This parameter concerns both application and log file backups. -- **最も古いバックアップファイルを削除**: このオプションは "最新のバックアップのみ保存 X バックアップファイル" が有効になっている場合のみ使用されます。 このオプションを使用して、最も古いバックアップファイルを削除するタイミングを設定します。選択肢は **バックアップ前**、あるいは **バックアップ後** です。 このオプションが機能するには、バックアップファイルが名称変更されたり、移動されたりしていてはなりません。 +- **Delete oldest backup file before/after backup**: This option is only used if the "Keep only the last X backup files" option is checked. It specifies whether 4D should start by deleting the oldest archive before starting the backup (**before** option) or whether the deletion should take place once the backup is completed (**after** option). In order for this mechanism to work, the oldest archive must not have been renamed or moved. -- **バックアップ失敗時**: このオプションを使用して、バックアップ失敗時の処理を設定できます。 バックアップが実行できなかった場合、4D では再試行することが可能です。 - - **次回の予定された日付と時刻に再試行する**: このオプションは、定期的な自動バックアップを設定されている場合にのみ意味があります。 失敗したバックアップはキャンセルされます。 エラーが生成されます。 - - **指定時間経過後に再試行**: このオプションが選択されていると、設定された待ち時間経過後にバックアップを再試行します。 このメカニズムを使用すると、バックアップをブロックするような特定の状況に対応することが可能となります。 秒、分、あるいは時間単位で待ち時間を設定できます。 次のバックアップ試行にも失敗するとエラーが生成され、ステータスエリアに失敗状況が表示され、バックアップジャーナルにも記録されます。 - - **操作をキャンセル X 試行後**: このパラメーターを使用して、バックアップ試行の失敗最大数を設定できます。 この最大数に達してもバックアップが正しく実行できなかった場合、バックアップはキャンセルされ、エラー 1401 ("バックアップ試行の最大数に達しました。自動バックアップは無効になります") が生成されます。 この場合、データベースを再起動するか、手動バックアップが成功するまで自動バックアップはおこなわれません。 このパラメーターは、人による介入が必要となるような問題があり、バックアップ試行が自動的に繰り返されることにより全体的なパフォーマンスに影響するようなケースで使用できます。 デフォルトでこのオプションは選択されていません。 +- **If backup fails**: This option allows setting the mechanism used to handle failed backups (backup impossible). When a backup cannot be performed, 4D lets you carry out a new attempt. + - **Retry at the next scheduled date and time**: This option only makes sense when working with scheduled automatic backups. It amounts to cancelling the failed backup. An error is generated. + - **Retry after X second(s), minute(s) or hour(s)**: When this option is checked, a new backup attempt is executed after the wait period. This mechanism allows anticipating certain circumstances that may block the backup. You can set a wait period in seconds, minutes or hours using the corresponding menu. If the new attempt also fails, an error is generated and the failure is noted in the status area of the last backup and in the backup journal file. + - **Cancel the operation after X attempts**: This parameter is used to set the maximum number of failed backup attempts. If the backup has not been carried out successfully after the maximum number of attempts set has been reached, it is cancelled and the error 1401 is generated ("The maximum number of backup attempts has been reached; automatic backup is temporarily disabled"). In this case, no new automatic backup will be attempted as long as the application has not been restarted, or a manual backup has been carried out successfully. This parameter is useful in order to avoid a case where an extended problem (requiring human intervention) that prevented a backup from being carried out would have led to the application repeatedly attempting the backup to the detriment of its overall performance. By default, this parameter is not checked. -> 定期的なバックアップが実行される予定時刻にアプリケーションが起動されていなかった場合、4D はバックアップが失敗したものとして扱います。 +> 4D considers a backup as failed if the application was not launched at the time when the scheduled automatic backup was set to be carried out. -### アーカイブ -これらのオプションはメインのバックアップファイルとログバックアップファイルに適用されます。 +### Archive +These options apply to main backup files and to log backup files. -- **セグメントサイズ (MB)**: 4Dではアーカイブをセグメントに分割できます。 この振る舞いにより、たとえばバックアップファイルを複数の異なるディスク (DVDやUSBデバイス等) に格納できます。 復元時、4D はセグメントを自動的に統合します。 各セグメントには MyApplication[xxxx-yyyy].4BK といった名称がつけられます (xxxx はバックアップ番号、yyyy はセグメント番号)。 たとえば、MyApplication のバックアップが 3つのセグメントに分割されると、次のような名前になります: MyApplication[0006-0001].4BK、MyApplication[0006-0002].4BK、MyApplication[0006-0003].4BK **セグメントサイズ** はコンボボックスであり、各セグメントのサイズを MB単位で設定できます。 メニューから定義済み値を選択するか、0~2048 の値を入力できます。 0 を指定するとセグメント化はされません (**なし** を指定したのと同じ)。 +- **Segment Size (Mb)** 4D allows you to segment archives, i.e., to cut it up into smaller sizes. This behavior allows, for example, the storing of a backup on several different disks (DVDs, usb devices, etc.). During restore, 4D will automatically merge the segments. Each segment is called MyApplication[xxxx-yyyy].4BK, where xxxx is the backup number and yyyy is the segment number. For example, the three segments of the MyApplication backup are called MyApplication[0006-0001].4BK, MyApplication[0006-0002].4BK and MyApplication[0006-0003].4BK. The **Segment Size** menu is a combo box that allows you to set the size in MB for each segment of the backup. You can choose one of the preset sizes or enter a specific size between 0 and 2048. If you pass 0, no segmentation occurs (this is the equivalent of passing **None**). -- **圧縮率**: デフォルトで 4D はバックアップファイルを圧縮し、ディスクスペースを節約します。 しかし大量のデータがある場合、ファイルの圧縮処理はバックアップにかかる時間を長くします。 **圧縮率** オプションを使用してファイルの圧縮モードを調整できます: - - **なし**: ファイルの圧縮はおこなわれません。 バックアップは早くおこなわれますが、ファイルサイズは大きくなります。 - - **速度** (デフォルト): このオプションはバックアップの速度とアーカイブサイズのバランスが考慮されたものです。 - - **圧縮率**: アーカイブに最大の圧縮率が適用されます。 アーカイブファイルはディスク上で最小のサイズとなりますが、バックアップの速度は低下します。 +- **Compression Rate** By default, 4D compresses backups to help save disk space. However, the file compression phase can noticeably slow down backups when dealing with large volumes of data. The **Compression Rate** option allows you to adjust file compression: + - **None:** No file compression is applied. The backup is faster but the archive files are considerably larger. + - **Fast** (default): This option is a compromise between backup speed and archive size. + - **Compact**: The maximum compression rate is applied to archives. The archive files take up the least amount of space possible on the disk, but the backup is noticeable slowed. -- **インターレース率と冗長率**: 4D は最適化 (インターレース) とセキュリティ (冗長) メカニズムに基づく特定のアルゴリズムを使用してアーカイブを生成します。 これらのメカニズムを必要に応じて設定できます。 これらのオプションのメニューには低・中・高・なし (デフォルト) の選択肢があります。 - - **インターレース率**: インターレースとはデータを連続しない領域に書き込むことにより、セクター損傷の際のリスクを低減させるものです。 率を上げることでリスクがより低減されますが、データの処理により多くのメモリが必要となります。 - - **冗長率**: 冗長は同じ情報を複数回繰り返すことで、ファイル中のデータを保護するものです。 冗長率を高くするとよりファイルが保護されます。しかし書き込みは遅くなり、ファイルサイズも増大します。 +- **Interlacing Rate and Redundancy Rate** 4D generates archives using specific algorithms that are based on optimization (interlacing) and security (redundancy) mechanisms. You can set these mechanisms according to your needs. The menus for these options contain rates of **Low**, **Medium**, **High** and **None** (default). + - **Interlacing Rate**: Interlacing consists of storing data in non-adjacent sectors in order to limit risks in the case of sector damage. The higher the rate, the higher the security; however, data processing will use more memory. + - **Redundancy Rate**: Redundancy allows securing data present in a file by repeating the same information several times. The higher the redundancy rate, the better the file security; however, storage will be slower and the file size will increase accordingly. -### 自動復元 +### Automatic Restore -- **データベースが壊れていたら、最新のバックアップから復元する**: このオプションが選択されていると、ファイル破損などの異常が検知された場合、4D は起動時にアプリケーションの有効な最新のバックアップからのデータの復旧を自動で開始します。 ユーザーによる介入は必要ありませんが、処理はバックアップジャーナルに記録されます。 +- **Restore last backup if database is damaged**: When this option is checked, the program automatically starts the restore of the data file of the last valid backup of the application, if an anomaly is detected (corrupted file, for example) during application launch. No intervention is required on the part of the user; however, the operation is logged in the backup journal. -- **データベースが完全でない場合、最新のログを統合する**: このオプションがチェックされると、プログラムはアプリケーションを開く際または復旧時に、自動でログファイルを統合します。 - - アプリケーションを開く際に、データファイルに保存されていない処理がログファイル中に見つかった場合、4D は自動でカレントログファイルを統合します。 このようなケースは、ディスクに書き込まれていないデータがまだキャッシュ中に存在する状態で、電力の切断が起きた場合に発生します。 - - アプリケーションの復元時、カレントログファイルや、バックアップファイルと同じ番号を持つログバックアップファイルが同じフォルダーに存在する場合、4D はその内容を検証します。 そしてデータファイルに書き込まれていない処理が見つかれば、自動で統合処理がおこなわれます。 +- **Integrate last log file if database is incomplete**: When this option is checked, the program automatically integrates the log file when opening or restoring the application. + - When opening an application, the current log file is automatically integrated if 4D detects that there are operations stored in the log file that are not present in the data. This situation arises, for example, if a power outage occurs when there are operations in the data cache that have not yet been written to the disk. + - When restoring an application, if the current log file or a log backup file having the same number as the backup file is stored in the same folder, 4D examines its contents. If it contains operations not found in the data file, the program automatically integrates it. -ユーザーにダイアログボックスが提示されることはありません。 処理は完全に自動です。 処理はバックアップジャーナルに記録されます。 +The user does not see any dialog box; the operation is completely automatic. The goal is to make use as easy as possible. The operation is logged in the backup journal. -> 自動復元の場合、復元されるのは次の要素に限られます:
    - .4DD ファイル
    - .4DIndx ファイル
    - .4DSyncData ファイル
    - .4DSyncHeader ファイル
    - External Data フォルダー +> In the case of an automatic restore, only the following elements are restored: - .4DD file - .4DIndx file - .4DSyncData file - .4DSyncHeader file - External Data folder > -> 添付ファイルやプロジェクトファイルを取得したい場合、[手動の復元](restore.md#手動でバックアップから復元する-標準ダイアログ) をおこなう必要があります。 +> If you wish to get the attached files or the project files, you must perform a [manual restore](restore.md#manually-restoring-a-backup-standard-dialog). diff --git a/website/translated_docs/ja/Concepts/about.md b/website/translated_docs/ja/Concepts/about.md index 14bb9fead17c1b..c68e64794a69c9 100644 --- a/website/translated_docs/ja/Concepts/about.md +++ b/website/translated_docs/ja/Concepts/about.md @@ -1,62 +1,62 @@ --- id: about -title: 4D ランゲージについて +title: About the 4D Language --- -4Dは独自のプログラミング言語を持っています。1300を超えるこのビルトインの言語により、4Dは Web、モバイル、およびデスクトップアプリケーションを作成する、パワフルな開発ツールとなっています。 単純な計算から複雑なカスタムインターフェースの作成まで、4D 言語は様々なタスクに使用することができます。 たとえば、以下のようなことが可能です: +The 4D built-in language, consisting of more than 1300 commands, makes 4D a powerful development tool for web, mobile, or desktop applications. You can use the 4D language for many different tasks—from performing simple calculations to creating complex custom user interfaces. For example, you can: -- クエリや並べ替えなどのレコード管理エディターにプログラムでアクセスする -- データベースの情報をもとに複雑なレポートやラベルを作成・印刷する -- 他のデバイスと通信する -- メールを送信する -- ドキュメントや Web サイトを管理する -- 4D アプリケーションと他のアプリケーションの間で、データの書き出しや読み込みをおこなう -- 4D のプログラミング言語に、他の言語で書かれたプロシージャーを組み込む +- Programmatically access any of the record management editors (order by, query, and so on), +- Create and print complex reports and labels with the information from the database, +- Communicate with other devices, +- Send emails, +- Manage documents and web pages, +- Import and export data between 4D applications and other applications, +- Incorporate procedures written in other languages into the 4D programming language. -4D のプログラミング言語は柔軟性とパワーを備え、あらゆるレベルのユーザーやデベロッパーにとって多種多様な情報管理業務を達成するための理想的なツールです。 初心者のユーザーであっても、計算処理を手早く実行できます。 ある程度コンピューターの知識を持っているユーザーであれば、プログラミング経験がなくてもアプリケーションをカスタマイズできます。 熟練したデベロッパーであれば、4D の強力なプログラミング言語を駆使して、ファイル転送や通信、モニタリングなどの高度な機能をアプリケーションに組み込むことができます。 他言語でプログラミング経験がある開発者は、独自のコマンドを 4D に追加することができます。 +The flexibility and power of the 4D programming language make it the ideal tool for all levels of users and developers to accomplish a complete range of information management tasks. Novice users can quickly perform calculations. Experienced users without programming experience can customize their applications. Experienced developers can use this powerful programming language to add sophisticated features and capabilities to their applications, including file transfer, communications, monitoring. Developers with programming experience in other languages can add their own commands to the 4D language. -## 4D ランゲージとは +## What is a Language? -4D ランゲージは、私たちが日ごろ話している言語とさして変わりありません。 アイデアの表現や、伝達、指示をおこなうためのコミュニケーションの一形態です。 話し言葉と同様に、4D は独自の語彙・文法・構文を持っています。このランゲージを使用して、アプリケーションやデータをどのように扱うのかを 4D に伝えます。 +The 4D language is not very different from the spoken language we use every day. It is a form of communication used to express ideas, inform, and instruct. Like a spoken language, 4D has its own vocabulary, grammar, and syntax; you use it to tell 4D how to manage your application and data. -4D を効果的に使用する目的では、ランゲージのすべてを知っている必要はありません。 言葉を交わすために言語のすべてを知る必要がないのと同じです。実際、少ない語彙でも雄弁に語ることはできるものです。 4D ランゲージも、創造性を発揮するのに必要となるのはほんの一部で、残りは必要に応じて覚えればよいのです。 +You do not need to know everything in the language in order to work effectively with 4D. In order to speak, you do not need to know the entire English language; in fact, you can have a small vocabulary and still be quite eloquent. The 4D language is much the same—you only need to know a small part of the language to become productive, and you can learn the rest as the need arises. -## なぜランゲージを使用するのか +## Why use a Language? -4D を使いはじめると、最初はプログラミング言語があまり必要ないように思えるかもしれません。 プログラミングせずとも広範囲のデータ管理タスクをおこなうことのできる自由度の高いツールを、4D はデザインモードにおいて提供しています。 データ入力やクエリ、並べ替え、レポート作成などの基本的なタスクは簡単に処理できます。 それだけでなく、データ検証や入力補助、グラフ作成、ラベルの生成など、多くの追加機能も提供されています。 +At first it may seem that there is little need for a programming language in 4D. In the Design environment, 4D provides flexible tools that require no programming to perform a wide variety of data management tasks. Fundamental tasks, such as data entry, queries, sorting, and reporting are handled with ease. In fact, many extra capabilities are available, such as data validation, data entry aids, graphing, and label generation. -では、なぜ 4D ランゲージが必要なのでしょうか。 たとえば、以下のような用途が考えられます: +Then why do we need a 4D language? Here are some of its uses: -- 自動的な繰り返しタスク: データの更新、複雑なレポートの生成、長い一連の操作などを全自動でおこなうことができます。 -- ユーザーインタフェースのコントロール: ウィンドウおよびメニューの管理、フォームやインタフェースオブジェクトの制御ができます。 -- 高度なデータ管理: トランザクション処理、複雑なデータ検証、マルチユーザー管理、セットや命名セレクションの処理などが含まれます。 -- コンピューターのコントロール: シリアルポート通信やドキュメント管理、エラー管理が可能です。 -- アプリケーションの作成: ダブルクリックで起動する、カスタマイズされたアプリケーションをビルドできます。 -- ビルトイン 4D Web サーバーの利用: データを反映させた動的な Web ページをビルドし、更新できます。 +- Automate repetitive tasks: These tasks include data modification, generation of complex reports, and unattended completion of long series of operations. +- Control the user interface: You can manage windows and menus, and control forms and interface objects. +- Perform sophisticated data management: These tasks include transaction processing, complex data validation, multi-user management, sets, and named selection operations. +- Control the computer: You can control serial port communications, document management, and error management. +- Create applications: You can create easy-to-use, customized applications that run stand-alone. +- Add functionality to the built-in 4D Web server: build and update dynamic web pages filled with your data. -ランゲージを使用すれば、アプリケーションのデザインや処理を完全に制御することができます。 4D はパワフルな汎用エディターを提供していますが、必要に応じてアプリケーションをカスタマイズするには 4D ランゲージが必要です。 +The language lets you take complete control over the design and operation of your application. 4D provides powerful “generic” editors, but the language lets you customize your application to whatever degree you require. -## データ制御 +## Taking Control of Your Data -4D ランゲージを使用すれば、パワフルでエレガントに、データをコントロールできます。 4D ランゲージは初心者にも使いやすく、経験豊かなデベロッパーの利用に耐えるほど高度です。 ランゲージの利用により、ビルトインのデータベース機能から、完全にカスタマイズされたアプリケーションにスムーズに移行できます。 +The 4D language lets you take complete control of your data in a powerful and elegant manner. The language is easy enough for a beginner, and sophisticated enough for an experienced application developer. It provides smooth transitions from built-in database functions to a completely customized application. -4D ランゲージのコマンドを使用して標準のレコード管理エディターにアクセスできます。 たとえば、デザインモードにおいて「クエリ」ツールバーボタンを使って開けるクエリエディターは、`QUERY` コマンドを使用することでも表示されます。 さらに、`QUERY` コマンドを使用すれば、エディターを開かなくても指定したデータを検索できるのです。 たとえば `QUERY ([People];[People]Last Name="Smith")` と記述すると、データベースから "Smith" という名前の人物をすべて検索します。 +The commands in the 4D language provide access to the standard record management editors. For example, when you use the `QUERY` command, you are presented with the Query Editor (which can be accessed in the Design mode using the Query command in the Records menu. You can tell the command to search for explicitly described data. For example, `QUERY([People];[People]Last Name="Smith")` will find all the people named Smith in your database. -4D ランゲージはとてもパワフルです。ひとつのコマンドが、従来のプログラム言語で書かれた数百行あるいは数千行にも及ぶコードに相当することもしばしばです。 このパワーを持ちながら、コマンドにはシンプルな英語の名称がつけられています。 例えばクエリを行うには `QUERY` コマンドを、レコードを追加するには `ADD RECORD` コマンドを使用します。 +The 4D language is very powerful—one command often replaces hundreds or even thousands of lines of code written in traditional computer languages. Surprisingly enough, with this power comes simplicity—commands have plain English names. For example, to perform a query, you use the `QUERY` command; to add a new record, you use the `ADD RECORD` command. -4D ランゲージは、ほとんどのタスクを簡単に実行できるようデザインされています。 レコードの追加、並べ替え、データの検索などの操作がシンプルなコマンドで提供されています。 さらにコマンドを使用してシリアルポートのコントロール、ディスク上のドキュメントの読み込み、高度なトランザクション処理等を行うこともできるのです。 +The language is designed for you to easily accomplish almost any task. Adding a record, sorting records, searching for data, and similar operations are specified with simple and direct commands. But the language can also control the serial ports, read disk documents, control sophisticated transaction processing, and much more. -4D ランゲージは非常に高度なタスクをも比較的簡単におこないます。 このようなタスクをランゲージなしでおこなうことはほとんど想像できません。 ランゲージのパワフルなコマンドを使用したとしても、タスクによっては複雑で難しいものとなることがあります。 ツール自身はタスクを処理しませんが、困難なタスクの処理を助けてくれます。 たとえば、ワープロを使用すれば早く簡単に文章を書くことができますが、ワープロ自体が文章を代わりに考えてくれるわけではありません。 4D ランゲージの使用はデータ管理を楽にし、複雑なタスクにも自信を持って取り掛かれるようにします。 +The 4D language accomplishes even the most sophisticated tasks with relative simplicity. Performing these tasks without using the language would be unimaginable for many. Even with the language’s powerful commands, some tasks can be complex and difficult. A tool by itself does not make a task possible; the task itself may be challenging and the tool can only ease the process. For example, a word processor makes writing a book faster and easier, but it will not write the book for you. Using the 4D language will make the process of managing your data easier and will allow you to approach complicated tasks with confidence. -## 4D ランゲージは従来のコンピュータ言語ですか +## Is it a “Traditional” Computer Language? -従来のコンピュータ言語に馴れ親しんでいる方は、本節を参照してください。 それ以外の方は、この章を読みとばしても構いません。 +If you are familiar with traditional computer languages, this section may be of interest. If not, you may want to skip it. -4D ランゲージは従来のコンピュータ言語とは異なります。 4D ランゲージは、今日のコンピュータで使用できる最も先進的で柔軟性のある言語の1つです。 4D ランゲージは、人が作業をおこなうように処理するよう設計されています。 +The 4D language is not a traditional computer language. It is one of the most innovative and flexible languages available on a computer today. It is designed to work the way you do, and not the other way around. -従来の言語を使用して開発を行う場合、まず念入りに計画を立てる必要があります。 実際、計画の立案は開発の重要な工程の1つです。 4D においては、プロジェクトのあらゆる部分でいつでもランゲージを使いはじめることができます。 たとえば、初めにフォームにメソッドを追加し、いくつかのメソッドをあとから追加することができます。 アプリケーションがより高度になったら、メニューから実行するプロジェクトメソッドを追加することもできます。 4D ランゲージは好きなだけ利用することができます。 他の多くのデータベースのような "すべてか無か" ではありません。 +To use traditional languages, you must do extensive planning. In fact, planning is one of the major steps in development. 4D allows you to start using the language at any time and in any part of your project. You may start by adding a method to a form, then later add a few more methods. As your application becomes more sophisticated, you might add a project method controlled by a menu. You can use as little or as much of the language as you want. It is not “all or nothing,” as is the case with many other databases. -従来の言語では、インターフェースオブジェクトをあらかじめ正式な記述法で宣言・定義しなければなりません。 しかし、4D ではボタンなどのオブジェクトを作成し、そのまま使用することができます。作成したオブジェクトは自動的に 4D によって管理されます。 たとえば、ボタンを使用するためには、ボタンをフォーム上に作成して名前を指定します。 ユーザーがボタンをクリックした時点で、ランゲージが自動的にメソッドに通知します。 +Traditional languages force you to define and pre-declare interface objects in formal syntactic terms. In 4D, you simply create an object, such as a button, and use it. 4D automatically manages the object for you. For example, to use a button, you draw it on a form and name it. When the user clicks the button, the language automatically notifies your methods. -従来の言語は、コマンドの記述方法を制限するなどして、融通性に欠けることが多いのに対し、 4D ランゲージは伝統に縛られることなく進化していきます。 \ No newline at end of file +Traditional languages are often rigid and inflexible, requiring commands to be entered in a very formal and restrictive style. The 4D language breaks with tradition, and the benefits are yours. \ No newline at end of file diff --git a/website/translated_docs/ja/Concepts/arrays.md b/website/translated_docs/ja/Concepts/arrays.md index d220248131698f..4c63e6e3ff1a4e 100644 --- a/website/translated_docs/ja/Concepts/arrays.md +++ b/website/translated_docs/ja/Concepts/arrays.md @@ -1,35 +1,35 @@ --- id: arrays -title: 配列 +title: Arrays --- -**配列** とは、同じタイプの **変数** を番号付きで並べたものです。 各変数は、配列の **要素** といいます。 配列のサイズとは、配列が持つ要素の数を指します。配列は作成時にサイズが与えられ、要素の追加・挿入・削除によって、または作成時に使用したコマンドの再使用によって、何度でもサイズを変更することができます。 配列要素には、1 から N の番号が付けられます (N は配列のサイズ)。 配列は必ず、特別な [要素ゼロ](#配列の要素ゼロ) を持ちます。 配列は 4D の変数です。 他の変数と同様、配列にもスコープがあり、4D ランゲージの規則に従いますが、他と異なるところがいくつかあります。 -> ほとんどの場合において、**配列** より **コレクション** の利用が推奨されます。 コレクションは配列より柔軟なだけでなく、たくさんの専用メソッドを持ちます。 詳細については、[コレクション](Concepts/dt_collection.md) を参照してください。 +An **array** is an ordered series of **variables** of the same type. Each variable is called an **element** of the array. An array is given its size when it is created; you can then resize it as many times as needed by adding, inserting, or deleting elements, or by resizing the array using the same command used to create it. Array elements are numbered from 1 to N, where N is the size of the array. An array always has a special [element zero](#using-the-element-zero-of-an-array). Arrays are 4D variables. Like any variable, an array has a scope and follows the rules of the 4D language, though with some unique differences. +> In most cases, it is recommended to use **collections** instead of **arrays**. Collections are more flexible and provide a wide range of dedicated methods. For more information, please refer to the [Collection](Concepts/dt_collection.md) section. -## 配列の作成 +## Creating Arrays -配列は、"配列" テーマの配列宣言コマンドのいずれかを使用して作成します。 配列宣言コマンドは、1次元または 2次元の配列の作成やサイズ変更をすることができます。 2次元配列の詳細については [二次元配列](#二次元配列) を参照してください。 +You create an array with one of the array declaration commands from the "Array" theme. Each array declaration command can create or resize one-dimensional or two-dimensional arrays. For more information about two-dimensional arrays, see the [two dimensional arrays](#two-dimensional-arrays) section. -次のコードは、10個の要素からなる整数配列を作成 (宣言) します: +The following line of code creates (declares) an Integer array of 10 elements: ```4d ARRAY INTEGER(aiAnArray;10) ``` -次のコードは、さきほど作成した配列を20要素にサイズ変更します: +Then, the following code resizes that same array to 20 elements: ```4d ARRAY INTEGER(aiAnArray;20) ``` -次のコードは、この配列を要素なしにサイズ変更します: +Then, the following code resizes that same array to no elements: ```4d ARRAY INTEGER(aiAnArray;0) ``` -## 配列要素への値の代入 +## Assigning values in arrays -配列中の要素は中カッコ ({…}) を使用して参照します。 中カッコの中には数字を入れて特定の要素を指定します。この数字を要素番号といいます。 次のコードは、5つの名前を atNames という配列に入れ、それらを警告ウィンドウに表示します: +You reference the elements in an array by using curly braces ({…}). A number is used within the braces to address a particular element; this number is called the element number. The following lines put five names into the array called atNames and then display them in alert windows: ```4d ARRAY TEXT(atNames;5) @@ -39,87 +39,87 @@ ARRAY INTEGER(aiAnArray;0) atNames{4}:="Jane" atNames{5}:="John" For($vlElem;1;5) - ALERT("要素番号 #"+String($vlElem)+" の値は "+atNames{$vlElem}+" です。") + ALERT("The element #"+String($vlElem)+" is equal to: "+atNames{$vlElem}) End for ``` -atNames{$vlElem} というシンタックスに注目してください。 atNames{3} のように数値リテラルを使うだけでなく、数値変数によって配列の要素番号を指定することができます。 ループ構造による反復を使用すると (`For...End for`, `Repeat...Until` または `While...End while`)、短いコードで配列の全要素、または一部の要素を対象とした処理をおこなうことができます。 +Note the syntax atNames{$vlElem}. Rather than specifying a numeric literal such as atNames{3}, you can use a numeric variable to indicate which element of an array you are addressing. Using the iteration provided by a loop structure (`For...End for`, `Repeat...Until` or `While...End while`), compact pieces of code can address all or part of the elements in an array. -**重要:** 代入演算子 (:=) と比較演算子 (=) とを混同しないように注意してください。 代入と比較は、まったく異なった性質の処理です。 +**Important:** Be careful not to confuse the assignment operator (:=) with the comparison operator, equal (=). Assignment and comparison are very different operations. -### 配列への配列の代入 -文字列やテキスト変数と違って、配列に配列を代入することはできません。 配列をそっくりそのまま別の配列にコピーするには `COPY ARRAY` コマンドを使います。 +### Assigning an array to another array +Unlike text or string variables, you cannot assign one array to another. To copy (assign) an array to another one, use `COPY ARRAY`. -## 配列の要素ゼロ +## Using the element zero of an array -配列は必ず、要素ゼロを持ちます。 ドロップダウンリストなどのフォームオブジェクトに配列が設定されていた場合、要素ゼロが表示されることはありませんが、ランゲージでの利用に制限はありません (*)。 +An array always has an element zero. While element zero is not shown when an array supports a form object, there is no restriction(*) in using it with the language. -例として、デフォルト値を指定せずにフォームオブジェクトを初期化したいとします。 このような場合に配列の要素ゼロが利用できます: +Here is another example: you want to initialize a form object with a text value but without setting a default value. You can use the element zero of the array: ```4d - // atName 配列と紐づいているコンボボックスまたはドロップダウンリストの - // フォームオブジェクトメソッドです + // method for a combo box or drop-down list + // bound to atName variable array Case of :(Form event code=On Load) - // 要素ゼロを含め - // 配列を初期化します + // Initialize the array (as shown further above) + // But use the element zero ARRAY TEXT(atName;5) - atName{0}:=選択してください" + atName{0}:=Please select an item" atName{1}:="Text1" atName{2}:="Text2" atName{3}:="Text3" atName{4}:="Text4" atName{5}:="Text5" - // 配列の選択要素を要素ゼロに設定します + // Position the array to element 0 atName:=0 End case ``` -(*) ひとつだけ例外があります。配列タイプのリストボックスでは、編集中の元の値を保持するため、内部的に配列の要素ゼロが使用されます。この特別なケースでは、開発者は 0番目の要素を利用できません。 +(*) However, there is one exception: in an array type List Box, the zero element is used internally to store the previous value of an element being edited, so it is not possible to use it in this particular context. -## 二次元配列 +## Two-dimensional Arrays -配列宣言コマンドはそれぞれ、1次元および 2次元の配列を作成、またはサイズ変更ができます。 例: +Each of the array declaration commands can create or resize one-dimensional or two-dimensional arrays. Example: ```4d - ARRAY TEXT(atTopics;100;50) // 100行と 50列からなるテキスト配列を作成します + ARRAY TEXT(atTopics;100;50) // Creates a text array composed of 100 rows of 50 columns ``` -2次元配列は、本質的にはランゲージオブジェクトであり、表示や印刷することはできません。 +Two-dimensional arrays are essentially language objects; you can neither display nor print them. -上のコードで作成した atTopics 配列について、次のことが言えます: +In the previous example: -- atTopics は、2次元配列です。 -- atTopics{8}{5} は、8行5列目の要素です。 -- atTopics{20} は 20行目を指し、それ自体が 1次元の配列です。 -- `Size of array(atTopics)` は、行数の 100を返します。 -- `Size of array(atTopics{17})` は、17行目の列数である50を返します。 +- atTopics is a two-dimensional array +- atTopics{8}{5} is the 5th element (5th column...) of the 8th row +- atTopics{20} is the 20th row and is itself a one-dimensional array +- `Size of array(atTopics)` returns 100, which is the number of rows +- `Size of array(atTopics{17})` returns 50, which the number of columns for the 17th row -以下の例では、データベースの各テーブルの各フィールドへのポインターが 2次元配列に格納されます: +In the following example, a pointer to each field of each table in the database is stored in a two-dimensional array: ```4d C_LONGINT($vlLastTable;$vlLastField) C_LONGINT($vlFieldNumber) - // テーブルと同じ数の空行 (つまり、列なし) を持つ配列作成します + // Create as many rows (empty and without columns) as there are tables $vlLastTable:=Get last table number - ARRAY POINTER(<>apFields;$vlLastTable;0) // X行 0列の 2D配列 - // テーブル毎に + ARRAY POINTER(<>apFields;$vlLastTable;0) //2D array with X rows and zero columns + // For each table For($vlTable;1;$vlLastTable) If(Is table number valid($vlTable)) $vlLastField:=Get last field number($vlTable) - // 全フィールドをチェックします + // Give value of elements $vlColumnNumber:=0 For($vlField;1;$vlLastField) If(Is field number valid($vlTable;$vlField)) $vlColumnNumber:=$vlColumnNumber+1 - // 当該テーブルの行にフィールドに対応する列を挿入していきます + //Insert a column in a row of the table underway INSERT IN ARRAY(<>apFields{$vlTable};$vlColumnNumber;1) - // 作成した "セル" にポインターを割り当てます + //Assign the "cell" with the pointer <>apFields{$vlTable}{$vlColumnNumber}:=Field($vlTable;$vlField) End if End for @@ -127,12 +127,12 @@ atNames{$vlElem} というシンタックスに注目してください。 atNam End for ``` -このように初期化された 2次元配列を使って、以下の方法で特定のテーブルが持つ全フィールドへのポインターを取得できます: +Provided that this two-dimensional array has been initialized, you can obtain the pointers to the fields for a particular table in the following way: ```4d - // 現在選択されているテーブルの、フィールドへのポインターを取得します: + // Get the pointers to the fields for the table currently displayed at the screen: COPY ARRAY(◊apFields{Table(Current form table)};$apTheFieldsIamWorkingOn) - // ブールと日付フィールドを初期化します + // Initialize Boolean and Date fields For($vlElem;1;Size of array($apTheFieldsIamWorkingOn)) Case of :(Type($apTheFieldsIamWorkingOn{$vlElem}->)=Is date) @@ -143,40 +143,40 @@ atNames{$vlElem} というシンタックスに注目してください。 atNam End for ``` -**注:** この例でわかるように、2次元配列の行の列数はそれぞれが同じサイズでも異なるサイズでも構いません。 +**Note:** As this example suggests, rows of a two-dimensional arrays can be the same size or different sizes. -## 配列とメモリ +## Arrays and Memory -テーブルやレコードを使用してディスク上に格納するデータと異なり、配列は常に全体がメモリに保持されます。 +Unlike the data you store on disk using tables and records, an array is always held in memory in its entirety. -たとえば、米国内の郵便番号がすべて [Zip Codes] テーブルに入力されている場合、約100,000件のレコードになります。 加えて、そのテーブルには郵便番号のほかに、対応する市・郡・州という複数のフィールドがあるとします。 カリフォルニアの郵便番号を選択した場合、4D データベースエンジンは [Zip Codes] テーブルから該当するレコードセレクションを作成して、必要な場合にのみ各レコードをロードします (たとえば表示や印刷時)。 つまり、4Dのデータベースエンジンによってディスクからメモリに部分的にロードされた (フィールドごとに同じタイプの) 順序づけられた一連の値で作業するということです。 +For example, if all US zip codes were entered in the [Zip Codes] table, it would contain about 100,000 records. In addition, that table would include several fields: the zip code itself and the corresponding city, county, and state. If you select only the zip codes from California, the 4D database engine creates the corresponding selection of records within the [Zip Codes] table, and then loads the records only when they are needed (i.e., when they are displayed or printed). In order words, you work with an ordered series of values (of the same type for each field) that is partially loaded from the disk into the memory by the database engine of 4D. -同じことを配列で実行するのは、次の理由で禁止すべきです: +Doing the same thing with arrays would be prohibitive for the following reasons: -- 4つの情報タイプ (郵便番号、市、郡、州) を維持するためには、4つの大きな配列をメモリ内で維持する必要があります。 -- 配列は、常に全体がメモリ内に維持されるため、常時使用しない場合でも、作業セッションの間すべてのデータをメモリに置いておく必要があります。 -- 配列全体が常にメモリ内に維持されることから、アプリケーションが開始されるたびに 4つの配列をディスクからロードして、終了時にはディスクに保存する必要があります。当該データが作業セッション中に使用・変更されない場合もこれを省略することができません。 +- In order to maintain the four information types (zip code, city, county, state), you would have to maintain four large arrays in memory. +- Because an array is always held in memory in its entirety, you would have to keep all the zip codes information in memory throughout the whole working session, even though the data is not always in use. +- Again, because an array is always held in memory in its entirety, each time the application is started and then quit, the four arrays would have to be loaded and then saved on the disk, even though the data is not used or modified during the working session. -**結論:** 配列は、ほどよい量のデータを短時間維持するためのものです。 他方、配列はメモリ内に置かれるため、扱いやすく高速操作が可能です。 +**Conclusion:** Arrays are intended to hold reasonable amounts of data for a short period of time. On the other hand, because arrays are held in memory, they are easy to handle and quick to manipulate. -しかし、状況によっては何百、何千という要素を持った配列で作業する必要があります。 次の表に、各配列タイプがメモリ上に占めるバイト数を求めるための計算式を示します: +However, in some circumstances, you may need to work with arrays holding hundreds or thousands of elements. The following table lists the formulas used to calculate the amount of memory used for each array type: -| 配列タイプ | メモリ使用量の計算式 (バイト単位) | -| ------ | ---------------------------------- | -| BLOB | (1+要素数) * 12 + 全BLOB要素の合計サイズ | -| ブール | (31+要素数) \ 8 | -| 日付 | (1+要素数) * 6 | -| 整数 | (1+要素数) * 2 | -| 倍長整数 | (1+要素数) * 4 | -| オブジェクト | (1+要素数) * 8 + 全オブジェクトの合計サイズ | -| ピクチャー | (1+要素数) * 8 + 全ピクチャーの合計サイズ | -| ポインター | (1+要素数) * 8 + 全ポインターの合計サイズ | -| 実数 | (1+要素数) * 8 | -| テキスト | (1+要素数) * 20 + (全テキストの合計サイズ) * 2 | -| 時間 | (1+要素数) * 4 | -| 2次元 | (1+要素数) * 16 + 配列サイズの合計 | +| Array Type | Formula for determining Memory Usage in Bytes | +| --------------- | -------------------------------------------------------------------- | +| Blob | (1+number of elements) * 12 + Sum of the size of each blob | +| Boolean | (31+number of elements)\8 | +| Date | (1+number of elements) * 6 | +| Integer | (1+number of elements) * 2 | +| Long Integer | (1+number of elements) * 4 | +| Object | (1+number of elements) * 8 + Sum of the size of each object | +| Picture | (1+number of elements) * 8 + Sum of the size of each picture | +| Pointer | (1+number of elements) * 8 + Sum of the size of each pointer | +| Real | (1+number of elements) * 8 | +| Text | (1+number of elements) * 20 + (Sum of the length of each text) * 2 | +| Time | (1+number of elements) * 4 | +| Two-dimensional | (1+number of elements) * 16 + Sum of the size of each array | -**注:** +**Notes:** -- メモリ中のテキストサイズは以下の式で計算されます: ((Length + 1) * 2) -- 選択した要素や要素数、配列自体の情報を保持するため、さらに数バイトを要します。 \ No newline at end of file +- The size of a text in memory is calculated using this formula: ((Length + 1) * 2) +- A few additional bytes are required to keep track of the selected element, the number of elements, and the array itself. \ No newline at end of file diff --git a/website/translated_docs/ja/Concepts/cf_branching.md b/website/translated_docs/ja/Concepts/cf_branching.md index 88bda254586612..ef48b8be0fc65f 100644 --- a/website/translated_docs/ja/Concepts/cf_branching.md +++ b/website/translated_docs/ja/Concepts/cf_branching.md @@ -1,14 +1,14 @@ --- id: branching -title: 分岐構造 +title: Branching structures --- -分岐構造は、条件をテストし、その結果に基づいて異なる流れにメソッドを導きます。 +A branching structure allows methods to test a condition and take alternative paths, depending on the result. ## If...Else...End if -`If...Else...End if` による制御フロー構造の正式な構文は以下のようになります: +The formal syntax of the `If...Else...End if` control flow structure is: ```4d If(Boolean_Expression) @@ -18,16 +18,16 @@ title: 分岐構造 End if ``` -`Else` 部分はオプションであり、省略して以下のように記述できます: +Note that the `Else` part is optional; you can write: ```4d If(Boolean_Expression) statement(s) End if ``` -`If...Else...End if` 構造は、条件 (ブール式) が true か false かによって、処理の選択肢を2つメソッドに与えます。 ブール式が true の場合は、テストのすぐ後のステートメントを実行し、 ブール式が FALSE の場合には、Else 文のすぐ後のステートメントを実行します。 任意の `Else` が省略されていた場合、`End if` のすぐ後のステートメント (あれば) へと実行が続行されます。 +The `If...Else...End if` structure lets your method choose between two actions, depending on whether a test (a Boolean expression) is TRUE or FALSE. When the Boolean expression is TRUE, the statements immediately following the test are executed. If the Boolean expression is FALSE, the statements following the Else statement are executed. The `Else` statement is optional; if you omit Else, execution continues with the first statement (if any) following the `End if`. -ブール式は常に全体が評価されるという点に注意してください。 たとえば、以下のような場合: +Note that the Boolean expression is always fully evaluated. Consider in particular the following test: ```4d If(MethodA & MethodB) @@ -35,7 +35,7 @@ title: 分岐構造 End if ``` -この場合、両方のメソッドが true である場合に限り、式は true になります。 しかしながら _MethodA_ が false であっても、4Dは_MethodB_ も評価するため、これは時間の無駄になります。 この場合には、以下のような構造を使用するほうが賢明といえます: +he expression is TRUE only if both methods are TRUE. However, even if _MethodA_ returns FALSE, 4D will still evaluate _MethodB_, which is a useless waste of time. In this case, it is more interesting to use a structure like: ```4d If(MethodA) @@ -45,21 +45,21 @@ title: 分岐構造 End if ``` -上記の結果はほぼ同じで、_MethodB_ は必要な場合にのみ評価されます。 +The result is similar and _MethodB_ is evaluated only if necessary. -### 例題 +### Example ```4d - // ユーザーに名前の入力を求めます - $Find:=Request("名前を入力してください") + // Ask the user to enter a name + $Find:=Request(Type a name) If(OK=1) QUERY([People];[People]LastName=$Find) Else - ALERT("名前が入力されませんでした") + ALERT("You did not enter a name.") End if ``` -**Tip:** 一方の条件に実行ステートメントがない分岐処理を書くこともできます。 下のようなコードはどちらも有効です: +**Tip:** Branching can be performed without statements to be executed in one case or the other. When developing an algorithm or a specialized application, nothing prevents you from writing: ```4d If(Boolean_Expression) @@ -67,7 +67,7 @@ title: 分岐構造 statement(s) End if ``` -または: +or: ```4d If(Boolean_Expression) @@ -78,7 +78,7 @@ title: 分岐構造 ## Case of...Else...End case -`Case of...Else...End case` による制御フロー構造の正式な構文は以下のようになります: +The formal syntax of the `Case of...Else...End case` control flow structure is: ```4d Case of :(Boolean_Expression) @@ -96,7 +96,7 @@ title: 分岐構造 End case ``` -`Else` 部分はオプションであり、省略して以下のように記述できます: +Note that the `Else` part is optional; you can write: ```4d Case of :(Boolean_Expression) @@ -111,85 +111,80 @@ title: 分岐構造 statement(s) End case ``` -`If...Else...End if` と同様に、`Case of...Else...End case` 構造も処理の選択肢をメソッドに与えます。 `If...Else...End` との違いは、`Case of...Else...End case` 構造が複数のブール式を評価し、その中から最初に true となるステートメントを実行することです。 +As with the `If...Else...End if` structure, the `Case of...Else...End case` structure also lets your method choose between alternative actions. Unlike the `If...Else...End` if structure, the `Case of...Else...End case` structure can test a reasonable unlimited number of Boolean expressions and take action depending on which one is TRUE. -ブール式の前にはそれぞれコロン (`:`) を付けます。 コロンとブール式の組み合わせをケースと呼びます。 例えば以下の行はケースです: +Each Boolean expression is prefaced by a colon (`:`). This combination of the colon and the Boolean expression is called a case. For example, the following line is a case: ```4d :(bValidate=1) ``` -最初に true になったケースに続く (次のケースまでの) ステートメントだけが実行されます。 true になるケースがない場合、どのステートメントも実行されません (`Else` 文が指定されていない場合) 。 +Only the statements following the first TRUE case (and up to the next case) will be executed. If none of the cases are TRUE, none of the statements will be executed (if no `Else` part is included). -最後のケースの後に Else 文を含むことができます。 すべてのケースが FALSE の場合に、`Else` 文の後のステートメントが実行されます。 +You can include an Else statement after the last case. If all of the cases are FALSE, the statements following the `Else` will be executed. -### 例題 +### Example -下記の例は数値変数を判定し、対応する数字をアラートボックスに表示します: +This example tests a numeric variable and displays an alert box with a word in it: ```4d Case of - :(vResult=1) // 数値が1の場合 - ALERT("一です。") // 1のアラートボックスを表示します - :(vResult=2) // 数値が2の場合 - ALERT("二です。") // 2のアラートボックスを表示します - :(vResult=3) // 数値が3の場合 - ALERT("三です。") // 3のアラートボックスを表示します - Else // 数値が1,2,3のいずれでもない場合 - ALERT("一、二、三のいずれでもありません。") + :(vResult=1) //Test if the number is 1 + ALERT("One.") //If it is 1, display an alert + :(vResult=2) //Test if the number is 2 + ALERT("Two.") //If it is 2, display an alert + :(vResult=3) //Test if the number is 3 + ALERT("Three.") //If it is 3, display an alert + Else //If it is not 1, 2, or 3, display an alert + ALERT("It was not one, two, or three.") End case ``` -比較するために、同じことを `If...Else...End if` 構文で記述すると以下のようになります。 +For comparison, here is the `If...Else...End if` version of the same method: ```4d - If(vResult=1) // 数値が1の場合 - ALERT("一です。") // 1のアラートボックスを表示します + If(vResult=1) //Test if the number is 1 + ALERT("One.") //If it is 1, display an alert Else - If(vResult=2) // 数値が2の場合 - ALERT("二です。") // 2のアラートボックスを表示します + If(vResult=2) //Test if the number is 2 + ALERT("Two.") //If it is 2, display an alert Else - If(vResult=3) // 数値が3の場合 - ALERT("三です。") // 3のアラートボックスを表示します - Else // 数値が1,2,3のいずれでもない場合 - ALERT("一、二、三のいずれでもありません。") + If(vResult=3) //Test if the number is 3 + ALERT("Three.") //If it is 3, display an alert + Else //If it is not 1, 2, or 3, display an alert + ALERT("It was not one, two, or three.") End if End if End if ``` -`Case of...Else...End case` 構造は、最初に true になったケースだけを実行します。 2つ以上のケースが true の場合は、最初に true になったケースのステートメントだけを実行します。 +Remember that with a `Case of...Else...End case` structure, only the first TRUE case is executed. Even if two or more cases are TRUE, only the statements following the first TRUE case will be executed. -したがって、階層的なテストを実行するときには、階層上で低い位置にある条件がテスト順序で先に記述されていることを確認する必要があります。 以下の例では、ケース2が true の場合、ケース1も必ず true であるため、ケース1は後に位置すべきです。 このままの順序では、ケース2のステートメントはけっして実行されません: +Consequently, when you want to implement hierarchical tests, you should make sure the condition statements that are lower in the hierarchical scheme appear first in the test sequence. For example, the test for the presence of condition1 covers the test for the presence of condition1&condition2 and should therefore be located last in the test sequence. For example, the following code will never see its last condition detected: ```4d Case of :(vResult=1) - ... - // ステートメントなど - :((vResult=1) & (vCondition#2)) // このケースが判定されることはありません - ... - // ステートメントなど + ... //statement(s) + :((vResult=1) & (vCondition#2)) //this case will never be detected + ... //statement(s) End case ``` -vResult = 1の判定により他の条件を見る前に分岐するので、第2のケースが判定されることはありません。 コードが正しく実行されるためには次のように書きます: +In the code above, the presence of the second condition is not detected since the test "vResult=1" branches off the code before any further testing. For the code to operate properly, you can write it as follows: ```4d Case of - :((vResult=1) & (vCondition#2)) // このケースが先に判定されます - ... - // ステートメントなど + :((vResult=1) & (vCondition#2)) //this case will be detected first + ... //statement(s) :(vResult=1) - ... - -// ステートメントなど + ... //statement(s) End case ``` -さらに階層的なテストを実行したい場合、コードも階層化する必要があります。 +Also, if you want to implement hierarchical testing, you may consider using hierarchical code. -**Tip:** 分岐構造において、ケースに続くステートメントの記述は必須ではありません。 下のようなコードはどちらも有効です: +**Tip:** Branching can be performed without statements to be executed in one case or another. When developing an algorithm or a specialized application, nothing prevents you from writing: ```4d Case of :(Boolean_Expression) @@ -203,7 +198,7 @@ vResult = 1の判定により他の条件を見る前に分岐するので、第 End case ``` -または: +or: ```4d Case of :(Boolean_Expression) @@ -217,7 +212,7 @@ vResult = 1の判定により他の条件を見る前に分岐するので、第 End case ``` -または: +or: ```4d Case of Else diff --git a/website/translated_docs/ja/Concepts/cf_looping.md b/website/translated_docs/ja/Concepts/cf_looping.md index 7f38dfeedb47d6..690d3d9879acad 100644 --- a/website/translated_docs/ja/Concepts/cf_looping.md +++ b/website/translated_docs/ja/Concepts/cf_looping.md @@ -1,58 +1,58 @@ --- id: looping -title: ループ構造 +title: Looping structures --- -ループ構造は、条件が満たされるまで、あるいは指定した回数まで、同じ処理を繰り返します。 +Looping structures repeat a sequence of statements until a condition is met or a number of times is reached. ## While...End while -`While...End while` による制御フロー構造の正式な構文は以下のようになります: +The formal syntax of the `While...End while` control flow structure is: ```4d While(Boolean_Expression) statement(s) End while ``` -`While...End while` ループは、ブール式が true である限り、ループ内のステートメントを実行し続けます。 ループの始めにブール式を評価し、ブール式が FALSE の場合にはループをおこないません。 +A `While...End while` loop executes the statements inside the loop as long as the Boolean expression is TRUE. It tests the Boolean expression at the beginning of the loop and does not enter the loop at all if the expression is FALSE. -一般に、`While...End while` ループに入る手前で、ブール式で判定する値を初期化しておきます。 通常はブール式が true になるように設定してからループに入ります。 +It is common to initialize the value tested in the Boolean expression immediately before entering the `While...End while` loop. Initializing the value means setting it to something appropriate, usually so that the Boolean expression will be TRUE and `While...End while` executes the loop. -ブール式は、ループ内の要素を使って設定されなければなりません。そうでなければ、ループは永久に続くでしょう。 以下の例では、_NeverStop_ がいつも true であるので、ループは永久に続きます。 +The Boolean expression must be set by something inside the loop or else the loop will continue forever. The following loop continues forever because _NeverStop_ is always TRUE: ```4d NeverStop:=True While(NeverStop) End while ``` -このようにメソッドの実行が制御不能になった場合には、トレース機能を使用し、ループを止めて、問題点を追跡することができます。 メソッドのトレース方法については、[エラー処理](error-handling.md) の章を見てください。 +If you find yourself in such a situation, where a method is executing uncontrolled, you can use the trace facilities to stop the loop and track down the problem. For more information about tracing a method, see the [Error handling](error-handling.md) page. -### 例題 +### Example ```4d - CONFIRM("新規レコードを追加しますか?") // ユーザーに確認します - While(OK=1) // 利用者が望む限りループします - ADD RECORD([aTable]) // 新規にレコードを追加します - End while // ループは必ず End while によって終わります + CONFIRM("Add a new record?") //The user wants to add a record? + While(OK=1) //Loop as long as the user wants to + ADD RECORD([aTable]) //Add a new record + End while //The loop always ends with End while ``` -この例では、まずループに入る前に `CONFIRM` コマンドによりシステム変数 `OK` がセットされます。 ユーザーがダイアログボックスで **OK** ボタンをクリックすると、システム変数 `OK` に1がセットされ、ループを開始します。 それ以外の場合はシステム変数 `OK` に0が設定され、ループをスキップします。 ループに入ると、`ADD RECORD` コマンドはループを続けます。これは、ユーザーがレコードを保存した時点で、システム変数 `OK` に1が設定されるからです。 ユーザーが最後のレコードを取り消した (保存しない) 時点で、システム変数 `OK` に0がセットされ、ループは終了します。 +In this example, the `OK` system variable is set by the `CONFIRM` command before the loop starts. If the user clicks the **OK** button in the confirmation dialog box, the `OK` system variable is set to 1 and the loop starts. Otherwise, the `OK` system variable is set to 0 and the loop is skipped. Once the loop starts, the `ADD RECORD` command keeps the loop going because it sets the `OK` system variable to 1 when the user saves the record. When the user cancels (does not save) the last record, the `OK` system variable is set to 0 and the loop stops. ## Repeat...Until -`Repeat...Until` による制御フロー構造の正式な構文は以下のようになります: +The formal syntax of the `Repeat...Until` control flow structure is: ```4d Repeat statement(s) Until(Boolean_Expression) ``` -`Repeat...Until` ループは、[While...End while](flow-control#whileend-while) ループと似ていますが、まずループの後でブール式を判定する点が異なります。 つまり、`Repeat...Until` ループは最低でも1回は必ずループを実行しますが、`While...End while` ループは最初のブール式が FALSE である場合には、ループを1回も実行しません。 +A `Repeat...Until` loop is similar to a [While...End while](flow-control#whileend-while) loop, except that it tests the Boolean expression after the loop rather than before. Thus, a `Repeat...Until` loop always executes the loop once, whereas if the Boolean expression is initially False, a `While...End while` loop does not execute the loop at all. -もう一つの `While...End while` ループとの相違点は、 `Repeat...Until` はブール式が true になるまでループを続行することです。 +The other difference with a `Repeat...Until` loop is that the loop continues until the Boolean expression is TRUE. -### 例題 +### Example -以下の例を、`While...End while` ループの例と比較してください。 ブール式を、初期化しておく必要がない点に注目してください。システム変数 `OK` を初期化する `CONFIRM` コマンドはありません。 +Compare the following example with the example for the `While...End while` loop. Note that the Boolean expression does not need to be initialized—there is no `CONFIRM` command to initialize the `OK` variable. ```4d Repeat @@ -62,7 +62,7 @@ title: ループ構造 ## For...End for -`For...End for` による制御フロー構造の正式な構文は以下のようになります: +The formal syntax of the `For...End for` control flow structure is: ```4d For(Counter_Variable;Start_Expression;End_Expression{;Increment_Expression}) @@ -70,186 +70,186 @@ title: ループ構造 End for ``` -`For...End for` ループは、カウンター変数によりループを制御します: +The `For...End for` loop is a loop controlled by a counter variable: -- カウンター変数 *Counter_Variable* は、数値変数 (実数または倍長整数) で、*Start_Expression* に指定した値に初期化されます。 -- ループを実行するたびに、任意の引数である *Increment_Expression* の値がカウンター変数に加算されます。 *Increment_Expression* を指定しない場合、増分値は1になります。 -- カウンターが *End_Expression* の値を超えた時点で、ループを停止します。 +- The counter variable *Counter_Variable* is a numeric variable (Real or Long Integer) that the `For...End for` loop initializes to the value specified by *Start_Expression*. +- Each time the loop is executed, the counter variable is incremented by the value specified in the optional value *Increment_Expression*. If you do not specify *Increment_Expression*, the counter variable is incremented by one (1), which is the default. +- When the counter variable passes the *End_Expression* value, the loop stops. -**重要:** *Start_Expression*、*End_Expression*、*Increment_Expression* の値は、ループの始めに一度だけ評価されます。 これらの数値が変数で指定されている場合、ループ内でその変数の値を変更してもループは影響を受けません。 +**Important:** The numeric expressions *Start_Expression*, *End_Expression* and *Increment_Expression* are evaluated once at the beginning of the loop. If these expressions are variables, changing one of these variables within the loop will not affect the loop. -**Tip:** 特別な目的のために、カウンター変数 *Counter_Variable* の値を変更することができます。ループ内でカウンター変数を変更すると、ループはその影響を受けます。 +**Tip:** However, for special purposes, you can change the value of the counter variable *Counter_Variable* within the loop; this will affect the loop. -- 通常、*Start_Expression* は *End_Expression* より小さい。 -- *Start_Expression* と *End_Expression* が等しい場合、1回だけループがおこなわれます。 -- *Start_Expression* が *End_Expression* より大きい場合、*Increment_Expression* に負の値を指定しない限り、ループはおこなわれません。 次に例を示します。 +- Usually *Start_Expression* is less than *End_Expression*. +- If *Start_Expression* and *End_Expression* are equal, the loop will execute only once. +- If *Start_Expression* is greater than *End_Expression*, the loop will not execute at all unless you specify a negative *Increment_Expression*. See the examples. -### 基本的な使用例 +### Basic examples -1. 以下の例は、100回の繰り返しをおこないます: +1. The following example executes 100 iterations: ```4d For(vCounter;1;100) - // なんらかの処理 + //Do something End for ``` -2. 以下の例は、配列 anArray の全要素に対して処理をおこないます: +2. The following example goes through all elements of the array anArray: ```4d For($vlElem;1;Size of array(anArray)) - // 各配列要素に対する処理 + //Do something with the element anArray{$vlElem}:=... End for ``` -3. テキスト変数 vtSomeText の文字を一つ一つループ処理します: +3. The following example goes through all the characters of the text vtSomeText: ```4d For($vlChar;1;Length(vtSomeText)) - // 文字がタブであれば + //Do something with the character if it is a TAB If(Character code(vtSomeText[[$vlChar]])=Tab) - // なんらかの処理をします + //... End if End for ``` -4. 以下の例は、テーブル [aTable] のカレントセクションの各レコードについて処理をおこないます: +4. The following example goes through the selected records for the table [aTable]: ```4d FIRST RECORD([aTable]) For($vlRecord;1;Records in selection([aTable])) - // 各レコードに対する処理 + //Do something with the record SEND RECORD([aTable]) //... - // 次レコードへ移動します + //Go to the next record NEXT RECORD([aTable]) End for ``` -プロジェクトで作成する大部分の `For...End for` ループは、上記例題のいずれかの形式になるでしょう。 +Most of the `For...End for` loops you will write in your projects will look like the ones listed in these examples. -### カウンター変数の減算 +### Decrementing variable counter -ループに際してカウンター変数を増加させるのではなく、減少させたい場合があります。 その場合、*Start_Expression* に *End_Expression* より大きい値を設定し、*Increment_Expression* に負の数を指定する必要があります。 次に挙げる例題は、前述の例と同じ処理を逆の順序でおこないます: +In some cases, you may want to have a loop whose counter variable is decreasing rather than increasing. To do so, you must specify *Start_Expression* greater than *End_Expression* and a negative *Increment_Expression*. The following examples do the same thing as the previous examples, but in reverse order: -5. 以下の例は、100回の繰り返しをおこないます: +5. The following example executes 100 iterations: ```4d For(vCounter;100;1;-1) - // なんらかの処理 + //Do something End for ``` -6. 以下の例は、配列 anArray の全要素に対して処理をおこないます: +6. The following example goes through all elements of the array anArray: ```4d For($vlElem;Size of array(anArray);1;-1) - // 各配列要素に対する処理 + //Do something with the element anArray{$vlElem}:=... End for ``` -7. テキスト変数 vtSomeText の文字を一つ一つループ処理します: +7. The following example goes through all the characters of the text vtSomeText: ```4d For($vlChar;Length(vtSomeText);1;-1) - // 文字がタブであれば + //Do something with the character if it is a TAB If(Character code(vtSomeText[[$vlChar]])=Tab) - // なんらかの処理をします + //... End if End for ``` -8. 以下の例は、テーブル [aTable] のカレントセクションの各レコードについて処理をおこないます: +8. The following example goes through the selected records for the table [aTable]: ```4d - FIRST RECORD([aTable]) + LAST RECORD([aTable]) For($vlRecord;Records in selection([aTable]);1;-1) - // 各レコードに対する処理 + //Do something with the record SEND RECORD([aTable]) //... - // 前レコードへ移動します + //Go to the previous record PREVIOUS RECORD([aTable]) End for ``` -### 1より大きな値によるカウンター変数の増加 +### Incrementing the counter variable by more than one -必要に応じて、*Increment_Expression* (正または負の値) に、その絶対値が1より大きな値を指定できます。 +If you need to, you can use an *Increment_Expression* (positive or negative) whose absolute value is greater than one. -9. 以下の例は、配列 anArray の偶数要素について処理を行います: +9. The following loop addresses only the even elements of the array anArray: ```4d For($vlElem;2;Size of array(anArray);2) - // 偶数要素 #2,#4...#2n に対する処理 + //Do something with the element #2,#4...#2n anArray{$vlElem}:=... End for ``` -### ループ構造の比較 +### Comparing looping structures -`For...End for` ループの例をもう一度見てみましょう。 以下の例は、100回の繰り返しをおこないます: +Let's go back to the first `For...End for` example. The following example executes 100 iterations: ```4d For(vCounter;1;100) - // なんらかの処理 + //Do something End for ``` -`While...End while` ループと `Repeat...Until` ループで、同じ処理を実行する方法を調べてみましょう。 以下は、同じ処理を実行する `While...End while` ループです: +It is interesting to see how the `While...End while` loop and `Repeat...Until` loop would perform the same action. Here is the equivalent `While...End while` loop: ```4d - $i:=1 // カウンターの初期化 - While($i<=100) // 100回のループ - // なんらかの処理 - $i:=$i+1 // カウンターの増分が必要 + $i:=1 //Initialize the counter + While($i<=100) //Loop 100 times + //Do something + $i:=$i+1 //Need to increment the counter End while ``` -同じことを `Repeat...Until` ループで記述すると以下のようになります: +Here is the equivalent `Repeat...Until` loop: ```4d - $i:=1 // カウンターの初期化 + $i:=1 //Initialize the counter Repeat - // なんらかの処理 - $i:=$i+1 // カウンターの増分が必要 - Until($i=100) // 100回のループ + //Do something + $i:=$i+1 //Need to increment the counter + Until($i=100) //Loop 100 times ``` -**Tip:** `For...End for` ループは、`While...End while` や `Repeat...Until` ループよりも高速です。これは4Dが内部的にカウンター変数のテストおよび増加を行うからです。 したがって、可能な限り `For...End for` ループの使用が推奨されます。 +**Tip:** The `For...End for` loop is usually faster than the `While...End while` and `Repeat...Until` loops, because 4D tests the condition internally for each cycle of the loop and increments the counter. Therefore, use the `For...End for` loop whenever possible. -### For...End for ループの最適化 +### Optimizing the execution of the For...End for loops -カウンター変数 (インタープロセス、プロセス、ローカル変数) には実数、または倍長整数タイプを使用します。 数多く繰り返されるループの場合、とくにコンパイルモードでは、倍長整数タイプのローカル変数を使用してください。 +You can use Real and Long Integer variables as well as interprocess, process, and local variable counters. For lengthy repetitive loops, especially in compiled mode, use local Long Integer variables. -10. 次に例を示します: +10. Here is an example: ```4d - C_LONGINT($vlCounter) // 倍長整数型のローカル変数を使用します + C_LONGINT($vlCounter) //use local Long Integer variables For($vlCounter;1;10000) - // なんらかの処理 + //Do something End for ``` -### For...End for の入れ子構造 +### Nested For...End for looping structures -制御構造は、必要に応じて入れ子にする (ネストする) ことができます。 `For...End for` ループも同じです。 誤りを避けるため、各ループ構造ごとに別のカウンター変数を使用してください。 +You can nest as many control structures as you (reasonably) need. This includes nesting `For...End for` loops. To avoid mistakes, make sure to use different counter variables for each looping structure. -次に例を示します: +Here are two examples: -11. 以下の例は二次元配列の全要素への処理です: +11. The following example goes through all the elements of a two-dimensional array: ```4d For($vlElem;1;Size of array(anArray)) //... - // 各行に対する処理 + //Do something with the row //... For($vlSubElem;1;Size of array(anArray{$vlElem})) - // 各要素に対する処理 + //Do something with the element anArray{$vlElem}{$vlSubElem}:=... End for End for ``` -12. 以下の例は、データベースのすべての日付フィールドに対するポインターの配列を作成します: +12. The following example builds an array of pointers to all the date fields present in the database: ```4d ARRAY POINTER($apDateFields;0) @@ -272,7 +272,7 @@ title: ループ構造 ## For each...End for each -`For each...End for each` による制御フロー構造の正式な構文は以下のようになります: +The formal syntax of the `For each...End for each` control flow structure is: ```4d For each(Current_Item;Expression{;begin{;end}}){Until|While}(Boolean_Expression)} @@ -280,43 +280,43 @@ title: ループ構造 End for each ``` -`For each...End for each` 構造は、*Expression* に含まれるすべての*Current_item* に対して処理を繰り返します。 *Current_item* の型は *Expression* の型に依存します。 `For each...End for each` ループは3種類の *Expression * を対象に反復処理をおこなうことができます: +The `For each...End for each` structure iterates a specified *Current_item* over all values of the *Expression*. The *Current_item* type depends on the *Expression* type. The `For each...End for each` loop can iterate through three *Expression* types: -- コレクション: コレクションの各要素をループします -- エンティティセレクション: 各エンティティをループします -- オブジェクト: 各オブジェクトプロパティをループします +- collections: loop through each element of the collection, +- entity selections: loop through each entity, +- objects: loop through each object property. -以下の表は、`For each...End for each` の3つのタイプを比較したものです: +The following table compares the three types of `For each...End for each`: -| | コレクション内のループ | エンティティセレクション内のループ | オブジェクト内のループ | -| ----------------------- | ------------------ | ----------------- | ------------- | -| Current_Item の型 | コレクション要素と同じ型の変数 | エンティティ | テキスト変数 | -| Expression の型 | (同じ型の要素を持つ) コレクション | エンティティセレクション | オブジェクト | -| ループ数 (デフォルト) | コレクションの要素数 | セレクション内のエンティティ数 | オブジェクトのプロパティ数 | -| begin / end パラメーターのサポート | ◯ | ◯ | × | +| | Loop through collections | Loop through entity selections | Loop through objects | +| --------------------------------- | ------------------------------------------------ | ----------------------------------- | --------------------------- | +| Current_Item type | Variable of the same type as collection elements | Entity | Text variable | +| Expression type | Collection (with elements of the same type) | Entity selection | Object | +| Number of loops (by default) | Number of collection elements | Number of entities in the selection | Number of object properties | +| Support of begin / end parameters | Yes | Yes | No | -- ループの数は開始時に評価され、処理中に変化することはありません。 ループ中に項目を追加・削除することは、繰り返しの不足・重複を引き起こすことがあるため、一般的には推奨されません。 -- デフォルトでは、内部の _statement(s)_ 部の処理は、*Expression* の各項目に対して実行されます。 しかしながら、ループの先頭 (`While`) あるいはループの終わり (`Until`) で条件をテストすることで、ループを抜け出すことは可能です。 -- 任意の *begin* および *end* パラメーターを指定することで、コレクションおよびエンティティセレクションに対してループの範囲を定義することができます。 -- `For each...End for each` ループは **共有コレクション** や **共有オブジェクト** に対して使用することもできます。 コレクションの要素またはオブジェクトのプロパティを変更する場合は、`Use...End use` 構文も追加で必要です。 `Use...End use` 構文の使い方は、つぎのように状況に応じて異なります: - - 整合性のため要素やプロパティを一括で処理しなくてはならない場合には、ループに入る前 (外側) に使います。 - - 要素やプロパティを個々に変更して差し支えない場合は、ループの中で使います。 +- The number of loops is evaluated at startup and will not change during the processing. Adding or removing items during the loop is usually not recommended since it may result in missing or redundant iterations. +- By default, the enclosed _statement(s)_ are executed for each value in *Expression*. It is, however, possible to exit the loop by testing a condition either at the begining of the loop (`While`) or at the end of the loop (`Until`). +- The *begin* and *end* optional parameters can be used with collections and entity selections to define boundaries for the loop. +- The `For each...End for each` loop can be used on a **shared collection** or a **shared object**. If your code needs to modify one or more element(s) of the collection or object properties, you need to use the `Use...End use` keywords. Depending on your needs, you can call the `Use...End use` keywords: + - before entering the loop, if items should be modified together for integrity reasons, or + - within the loop when only some elements/properties need to be modified and no integrity management is required. -### コレクション内のループ +### Loop through collections -`For each...End for each` が _Collection_ 型の _Expression_ に対して使用された場合、_Current_Item_ はコレクション要素と同じ型の変数です。 デフォルトでは、ループの回数はコレクションの要素数に基づいています。 +When `For each...End for each` is used with an _Expression_ of the _Collection_ type, the _Current_Item_ parameter is a variable of the same type as the collection elements. By default, the number of loops is based on the number of items of the collection. -コレクションの要素はすべて同じ型でなくてはなりません。そうでない場合には、_Current_Item_ 変数に別の型の値が代入されたときにエラーが生成されます。 +The collection must contain only elements of the same type, otherwise an error will be returned as soon as the _Current_Item_ variable is assigned the first mismatched value type. -各ループの繰り返しにおいて、_Current_Item_ 変数には、合致するコレクションの要素が自動的に代入されます。 このとき、以下の点に注意する必要があります: +At each loop iteration, the _Current_Item_ variable is automatically filled with the matching element of the collection. The following points must be taken into account: -- _Current_Item_ 変数がオブジェクト型あるいはコレクション型であった場合 (つまり _Expression_ がオブジェクトのコレクション、あるいはコレクションのコレクションであった場合)、この変数を変更すると自動的にコレクションの対応する要素も変更されます (オブジェクトとコレクションは同じ参照を共有しているからです)。 変数がスカラー型である場合、変数のみが変更されます。 -- _Current_Item_ 変数は、コレクション要素の型と合致している必要があります。 コレクション要素のどれか一つでも、変数と異なる型のものがあった場合、エラーが生成され、ループは停止します。 -- コレクションが **Null** 値の要素を格納していたとき、_Current_Item_ 変数の型が **Null** 値をサポートしない型 (倍長整数変数など) であった場合にはエラーが生成されます。 +- If the _Current_Item_ variable is of the object type or collection type (i.e. if _Expression_ is a collection of objects or of collections), modifying this variable will automatically modify the matching element of the collection (because objects and collections share the same references). If the variable is of a scalar type, only the variable will be modified. +- The _Current_Item_ variable must be of the same type as the collection elements. If any collection item is not of the same type as the variable, an error is generated and the loop stops. +- If the collection contains elements with a **Null** value, an error will be generated if the _Current_Item_ variable type does not support **Null** values (such as longint variables). -#### 例題 +#### Example -数値のコレクションを対象に、統計情報を計算します: +You want to compute some statistics for a collection of numbers: ```4d C_COLLECTION($nums) $nums:=New collection(10;5001;6665;33;1;42;7850) @@ -338,19 +338,19 @@ title: ループ構造 //$vUnder=4,$vOver=2 ``` -### エンティティセレクション内のループ +### Loop through entity selections -`For each...End for each` が _Entity selection_ 型の _Expression_ に対して使用された場合、_Current_Item_ は現在処理中のエンティティです。 +When `For each...End for each` is used with an _Expression_ of the _Entity selection_ type, the _Current_Item_ parameter is the entity that is currently processed. -ループの回数はエンティティセレクション内のエンティティの数に基づきます。 各ループの繰り返しにおいて、*Current_Item* には、処理の対象であるエンティティセレクション内のエンティティが自動的に代入されます。 +The number of loops is based on the number of entities in the entity selection. On each loop iteration, the *Current_Item* parameter is automatically filled with the entity of the entity selection that is currently processed. -**注:** エンティティセレクション内のエンティティが、途中で他のプロセスによって削除された場合、そのエンティティはループにおいて自動的にスキップされます。 +**Note:** If the entity selection contains an entity that was removed meanwhile by another process, it is automatically skipped during the loop. -カレントエンティティに対して適用された変更は、`entity.save( )` で明示的に保存する必要があることに注意してください。 +Keep in mind that any modifications applied on the current entity must be saved explicitly using `entity.save( )`. -#### 例題 +#### Example -Employees データクラスの中から、英国の従業員の給与を引き上げます: +You want to raise the salary of all British employees in an entity selection: ```4d C_OBJECT(emp) For each(emp;ds.Employees.query("country='UK'")) @@ -359,15 +359,15 @@ Employees データクラスの中から、英国の従業員の給与を引き End for each ``` -### オブジェクト内のループ +### Loop through object properties -`For each...End for each` が Object 型の *Expression* に対して使用された場合、*Current_Item* は現在処理中のプロパティ名が自動代入されたテキスト変数です。 +When `For each...End for each` is used with an *Expression* of the Object type, the *Current_Item* parameter is a text variable automatically filled with the name of the currently processed property. -オブジェクトのプロパティは作成順に処理されていきます。 ループ中、プロパティをオブジェクトに追加/削除することが可能ですが、その場合でも残りのループ回数は、オブジェクトの元のプロパティ数に基づいているため、変化しません。 +The properties of the object are processed according to their order of creation. During the loop, properties can be added to or removed from the object, without modifying the number of loops that will remain based on the original number of properties of the object. -#### 例題 +#### Example -下のオブジェクトに格納されている名前に関したプロパティの値をすべて大文字に変えます: +You want to switch the names to uppercase in the following object: ```4d { "firstname": "gregory", @@ -375,7 +375,7 @@ Employees データクラスの中から、英国の従業員の給与を引き "age": 20 } ``` -以下のように書くことができます: +You can write: ```4d For each(property;vObject) If(Value type(vObject[property])=Is text) @@ -390,23 +390,23 @@ Employees データクラスの中から、英国の従業員の給与を引き "age": 20 } ``` -### begin / end パラメーター +### begin / end parameters -任意の begin と end パラメーターを指定することで、繰り返しの範囲を定義することができます。 +You can define bounds to the iteration using the optional begin and end parameters. -**注:** *begin* と *end* パラメーターは、コレクションおよびエンティティセレクション型に対するループにおいてのみ使用することができます (オブジェクト型のときは無視されます)。 +**Note:** The *begin* and *end* parameters can only be used in iterations through collections and entity selections (they are ignored on object properties). -- *begin* には、*Expression* においてループを開始したい要素位置を渡します (このとき *begin* の値が指す要素はループに含まれます)。 -- *end* には、*Expression* においてループを終了する要素位置を渡します (このとき *end* の値が指す要素はループに含まれません)。 +- In the *begin* parameter, pass the element position in *Expression* at which to start the iteration (*begin* is included). +- In the *end* parameter, you can also pass the element position in *Expression* at which to stop the iteration (*end* is excluded). -*end* が省略されている、あるいは *end* が *Expression* の要素数より大きい場合、*begin* 引数の位置から最後の要素まで (含まれる) をループします。 *begin* と *end* が正の値の場合、それらは *Expression* 内の要素の実際の位置を表します。 *begin* 引数が負の値の場合、それは `begin:=begin+Expression のサイズ` として再計算されます (つまり、*Expression* の終端からのオフセットであるとみなされます)。 再計算された値も負の値だった場合、*begin* は0に設定されます。 **注:** *begin* が負の値だったとしても、繰り返しそのものは標準の順番で実行されます。 *end* が負の値だった場合、それは `end:=end+Expression のサイズ` として再計算されます。 +If *end* is omitted or if *end* is greater than the number of elements in *Expression*, elements are iterated from *begin* until the last one (included). If the *begin* and *end* parameters are positive values, they represent actual positions of elements in *Expression*. If *begin* is a negative value, it is recalculed as `begin:=begin+Expression size` (it is considered as the offset from the end of *Expression*). If the calculated value is negative, *begin* is set to 0. **Note:** Even if begin is negative, the iteration is still performed in the standard order. If *end* is a negative value, it is recalculed as `end:=end+Expression size` -たとえば: -- コレクションには 10の要素が格納されています (ナンバリングは #0から#9) -- begin=-4 -> begin=-4+10=6 -> ループは6番目の要素 (#5) から開始されます -- end=-2 -> end=-2+10=8 -> 繰り返しは8番目の要素 (#7) の前に終了します、つまり7番目 (#6) の要素の処理が最後のループとなります。 +For example: +- a collection contains 10 elements (numbered from 0 to 9) +- begin=-4 -> begin=-4+10=6 -> iteration starts at the 6th element (#5) +- end=-2 -> end=-2+10=8 -> iteration stops before the 8th element (#7), i.e. at the 7th element. -#### 例題 +#### Example ```4d C_COLLECTION($col;$col2) @@ -423,28 +423,28 @@ Employees データクラスの中から、英国の従業員の給与を引き //$col2=[1,2,3,"a","b","c","d"] ``` -### Until と While 条件 +### Until and While conditions -`For each...End for each` の実行は、`Until` あるいは `While` 条件を追加することでコントロールすることができます。 `Until(condition)` 条件がループに組み込まれた場合、condition の式が true に評価されるとループは停止します。`While(condition)` 条件の場合は逆に、condition の式が false になるとループが停止します。 +You can control the `For each...End for each` execution by adding an `Until` or a `While` condition to the loop. When an `Until(condition)` statement is associated to the loop, the iteration will stop as soon as the condition is evaluated to `True`, whereas when is case of a `While(condition)` statement, the iteration will stop when the condition is first evaluated to `False`. -使用する条件は状況に応じて選べます: +You can pass either keyword depending on your needs: -- `Until` 条件は各ループの終わりにテストされます。そのため、*Expression* が空あるいは null でないかぎり、ループは少なくとも1回は実行されます。 -- `While` 条件は各ループの始めにテストされます。そのため、評価の結果次第では、ループは一度も実行されないこともありえます。 +- The `Until` condition is tested at the end of each iteration, so if the *Expression* is not empty or null, the loop will be executed at least once. +- The `While` condition is tested at the beginning of each iteration, so according to the condition result, the loop may not be executed at all. -#### 例題 +#### Example ```4d $colNum:=New collection(1;2;3;4;5;6;7;8;9;10) $total:=0 - For each($num;$colNum)While($total<30) // 最初にテストされます + For each($num;$colNum)While($total<30) //tested at the beginning $total:=$total+$num End for each ALERT(String($total)) //$total = 36 (1+2+3+4+5+6+7+8) $total:=1000 - For each($num;$colNum)Until($total>30) // 最後にテストされます + For each($num;$colNum)Until($total>30) //tested at the end $total:=$total+$num End for each ALERT(String($total)) //$total = 1001 (1000+1) diff --git a/website/translated_docs/ja/Concepts/classes.md b/website/translated_docs/ja/Concepts/classes.md index 51dc4c296ba0cf..2bba6eff1a6482 100644 --- a/website/translated_docs/ja/Concepts/classes.md +++ b/website/translated_docs/ja/Concepts/classes.md @@ -4,113 +4,113 @@ title: Classes --- -## 概要 +## Overview -4D ランゲージでは **クラス** の概念がサポートされています。 プログラミング言語では、クラスを利用することによって、属性やメソッドなどを持つ特定のオブジェクト種を定義することができます。 +The 4D language supports the concept of **classes**. In a programming language, using a class allows you to define an object behaviour with associated properties and functions. -ユーザークラスが定義されていれば、そのクラスのオブジェクトをコード内で **インスタンス化** することができます。 各オブジェクトは、それ自身が属するクラスのインスタンスです。 クラスは、別のクラスを [継承](#class-extends-classname) することで、その [関数](#function) を受け継ぐことができます。 +Once a user class is defined, you can **instantiate** objects of this class anywhere in your code. Each object is an instance of its class. A class can [`extend`](#class-extends-classname) another class, and then inherits from its [functions](#function). -> 4D におけるクラスモデルは JavaScript のクラスに類似しており、プロトタイプチェーンに基づきます。 +> The class model in 4D is similar to classes in JavaScript, and based on a chain of prototypes. -たとえば、次のように `Person` クラスを定義した場合: +For example, you could create a `Person` class with the following definition: ```4d -// クラス: Person.4dm +//Class: Person.4dm Class constructor($firstname : Text; $lastname : Text) This.firstName:=$firstname This.lastName:=$lastname ``` -この "Person" のインスタンスをメソッド内で作成するには、以下のように書けます: +In a method, creating a "Person": ``` -var $o : cs.Person // Person クラスのオブジェクト +var $o : cs.Person //object of Person class $o:=cs.Person.new("John";"Doe") // $o:{firstName: "John"; lastName: "Doe" } ``` -## クラスの管理 +## Managing classes -### クラス定義 +### Class definition -4D においてユーザークラスとは、`/Project/Sources/Classes/` フォルダーに保存された専用のメソッドファイル (.4dm) によって定義されます。 ファイル名がクラス名になります。 +A user class in 4D is defined by a specific method file (.4dm), stored in the `/Project/Sources/Classes/` folder. The name of the file is the class name. -クラスを命名する際には、次のルールに留意してください: +When naming classes, you should keep in mind the following rules: -- クラス名は [プロパティ名の命名規則](Concepts/dt_object.md#オブジェクトプロパティ識別子) に準拠している必要があります。 -- 大文字と小文字が区別されること -- 競合防止のため、データベースのテーブルと同じ名前のクラスを作成するのは推奨されないこと +- A class name must be compliant with [property naming rules](Concepts/dt_object.md#object-property-identifiers). +- Class names are case sensitive. +- Giving the same name to a class and a database table is not recommended, in order to prevent any conflict. -たとえば、"Polygon" という名前のクラスを定義するには、次のファイルを作成する必要があります: +For example, if you want to define a class named "Polygon", you need to create the following file: -- Project フォルダー +- Project folder + Project * Sources - Classes + Polygon.4dm -### クラスの削除 +### Deleting a class -既存のクラスを削除するには: +To delete an existing class, you can: -- ディスク上で "Classes" フォルダーより .4dm クラスファイルを削除します。 -- 4D エクスプローラーでは、クラスを選択した状態で ![](assets/en/Users/MinussNew.png) をクリックするか、コンテキストメニューより **移動 > ゴミ箱** を選択します。 +- on your disk, remove the .4dm class file from the "Classes" folder, +- in the 4D Explorer, select the class and click ![](assets/en/Users/MinussNew.png) or choose **Move to Trash** from the contextual menu. -### 4D インターフェースの使用 +### Using 4D interface -**ファイル** メニューまたはエクスプローラーなど、4D インターフェースを介してクラスを作成した場合には、クラスファイルは自動的に適切な場所に保存されます。 +Class files are automatically stored at the appropriate location when created through the 4D interface, either via the **File** menu or the Explorer. -#### ファイルメニューとツールバー +#### File menu and toolbar -4D 開発の **ファイル** メニューまたはツールバーより **新規 > クラス...** を選択することで、開いているプロジェクトにクラスファイルを新規作成することができます。 +You can create a new class file for the project by selecting **New > Class...** in the 4D Developer **File** menu or from the toolbar. -**Ctrl+Shift+Alt+k** ショートカットも使用できます。 +You can also use the **Ctrl+Shift+Alt+k** shortcut. -#### エクスプローラー +#### Explorer -エクスプローラーの **メソッド** ページにおいて、クラスは **クラス** カテゴリに分類されています。 +In the **Methods** page of the Explorer, classes are grouped in the **Classes** category. -クラスを新規作成するには次の方法があります: +To create a new class, you can: -- **クラス** カテゴリを選択し、![](assets/en/Users/PlussNew.png) ボタンをクリックします。 -- エクスプローラーウィンドウの下部にあるアクションメニュー、またはクラスグループのコンテキストメニューから **新規クラス...** を選択します。 ![](assets/en/Concepts/newClass.png) -- エクスプローラーのホームページのコンテキストメニューより **新規 > クラス...** を選択します。 +- select the **Classes** category and click on the ![](assets/en/Users/PlussNew.png) button. +- select **New Class...** from the action menu at the bottom of the Explorer window, or from the contexual menu of the Classes group. ![](assets/en/Concepts/newClass.png) +- select **New > Class...** from the contexual menu of the Explorer's Home page. -#### クラスのコードサポート +#### Class code support -各種 4D 開発ウィンドウ (コードエディター、コンパイラー、デバッガー、ランタイムエクスプローラー) において、クラスコードは "特殊なプロジェクトメソッド" のように扱われます: +In the various 4D Developer windows (code editor, compiler, debugger, runtime explorer), class code is basically handled like a project method with some specificities: -- コードエディター: - - クラスは実行できません - - クラスメソッドはコードのブロックです - - オブジェクトメンバーに対する **定義に移動** 操作はクラスの Function 宣言を探します。例: "$o.f()" の場合、"Function f" を見つけます。 - - クラスのメソッド宣言に対する **参照箇所を検索** 操作は、そのメソッドがオブジェクトメンバーとして使われている箇所を探します。例: "Function f" の場合 "$o.f()" を見つけます。 -- ランタイムエクスプローラーおよびデバッガーにおいて、クラスメソッドは \ コンストラクターまたは \.\ 形式で表示されます。 +- In the code editor: + - a class cannot be run + - a class function is a code block + - **Goto definition** on an object member searches for class Function declarations; for example, "$o.f()" will find "Function f". + - **Search references** on class function declaration searches for the function used as object member; for example, "Function f" will find "$o.f()". +- In the Runtime explorer and Debugger, class functions are displayed with the \ constructor or \.\ format. -## クラスストア +## Class stores -定義されたクラスには、クラスストアよりアクセスすることができます。 クラスストアには次の二つが存在します: +Available classes are accessible from their class stores. Two class stores are available: -- `cs` - ユーザークラスストア -- `4D` - ビルトインクラスストア +- `cs` for user class store +- `4D` for built-in class store ### cs #### cs -> classStore -| 参照 | タイプ | | 説明 | -| ---------- | ------ | -- | --------------------------- | -| classStore | object | <- | プロジェクトまたはコンポーネントのユーザークラスストア | +| Parameter | Type | | Description | +| ---------- | ------ | -- | --------------------------------------------- | +| classStore | object | <- | User class store for the project or component | -`cs` コマンドは、カレントプロジェクトまたはコンポーネントのユーザークラスストアを返します。 これには、プロジェクトまたはコンポーネントにて [定義](#クラス定義) されている、すべてのユーザークラスが含まれます。 デフォルトでは、 [ORDAクラス](ORDA/ordaClasses.md) のみ利用可能です。 +The `cs` command returns the user class store for the current project or component. It returns all user classes [defined](#class-definition) in the opened project or component. By default, only project [ORDA classes](ORDA/ordaClasses.md) are available. -#### 例題 +#### Example -`myClass` オブジェクトの新規インスタンスを作成するには、次のように書きます: +You want to create a new instance of an object of `myClass`: ```4d $instance:=cs.myClass.new() @@ -120,15 +120,15 @@ $instance:=cs.myClass.new() #### 4D -> classStore -| 参照 | タイプ | | 説明 | -| ---------- | ------ | -- | -------- | -| classStore | object | <- | 4Dクラスストア | +| Parameter | Type | | Description | +| ---------- | ------ | -- | -------------- | +| classStore | object | <- | 4D class store | -`4D` コマンドは、ビルトイン 4Dクラスのクラスストアを返します。 [CryptoKey](API/cryptoKeyClass.md) などの専用 API へのアクセスを提供します。 +The `4D` command returns the class store for available built-in 4D classes. It provides access to specific APIs such as [CryptoKey](API/cryptoKeyClass.md). -#### 例題 +#### Example -`CryptoKey` クラスに新規キーを作成するには、次のように書きます: +You want to create a new key in the `CryptoKey` class: ```4d $key:=4D.CryptoKey.new(New object("type";"ECDSA";"curve";"prime256v1")) @@ -136,34 +136,34 @@ $key:=4D.CryptoKey.new(New object("type";"ECDSA";"curve";"prime256v1")) -## コード内のクラスの使用 +## Using classes in your code -### Class オブジェクト +### Class object -プロジェクトにおいてクラスが [定義](#クラス定義) されていれば、それは 4Dランゲージ環境に読み込まれます。 クラスとは、それ自身が ["Class" クラス](API/classClass.md) のオブジェクトです。 Class オブジェクトは次のプロパティや関数を持ちます: +When a class is [defined](#class-definition) in the project, it is loaded in the 4D language environment. A class is an object itself, of ["Class" class](API/classClass.md). A class object has the following properties and function: -- [`name`](API/classClass.md#name) 文字列 -- [`superclass`](API/classClass.md#superclass) オブジェクト (無い場合は null) -- [`new()`](API/classClass.md#new) 関数 (クラスオブジェクトをインスタンス化します) +- [`name`](API/classClass.md#name) string +- [`superclass`](API/classClass.md#superclass) object (null if none) +- [`new()`](API/classClass.md#new) function, allowing to instantiate class objects. -さらに、Class オブジェクトは次を参照できます: +In addition, a class object can reference: -- [`constructor`](#class-constructor) オブジェクト (任意), -- `prototype` オブジェクト: 名前付きの [関数](#function) オブジェクトを格納します (任意) +- a [`constructor`](#class-constructor) object (optional), +- a `prototype` object, containing named [function](#function) objects (optional). -Class オブジェクトは [共有オブジェクト](shared.md) です。したがって、異なる 4Dプロセスから同時にアクセスすることができます。 +A class object is a [shared object](shared.md) and can therefore be accessed from different 4D processes simultaneously. -### プロパティ検索とプロトタイプ +### Property lookup and prototype -4D のすべてのオブジェクトは、なんらかの Class オブジェクトに内部的にリンクしています。 あるプロパティがオブジェクト内で見つからない場合、4D はそのクラスのプロトタイプオブジェクト内を検索します。見つからない場合、4D はそのクラスのスーパークラスのプロトタイプオブジェクト内を探します。これは、スーパークラスが存在しなくなるまで続きます。 +All objects in 4D are internally linked to a class object. When 4D does not find a property in an object, it searches in the prototype object of its class; if not found, 4D continues searching in the prototype object of its superclass, and so on until there is no more superclass. -すべてのオブジェクトは、継承ツリーの頂点である "Object" クラスを継承します。 +All objects inherit from the class "Object" as their inheritance tree top class. ```4d -// クラス: Polygon +//Class: Polygon Class constructor($width : Integer; $height : Integer) This.area:=$width*$height @@ -177,41 +177,41 @@ Class constructor($width : Integer; $height : Integer) // true ``` -オブジェクトのプロパティを列挙する際には、当該クラスのプロトタイプは列挙されません。 したがって、`For each` ステートメントや `JSON Stringify` コマンドは、クラスプロトタイプオブジェクトのプロパティを返しません。 クラスのプロトタイプオブジェクトプロパティは、内部的な隠れプロパティです。 +When enumerating properties of an object, its class prototype is not enumerated. As a consequence, `For each` statement and `JSON Stringify` command do not return properties of the class prototype object. The prototype object property of a class is an internal hidden property. -## クラスキーワード +## Class keywords -クラス定義内では、専用の 4Dキーワードが使用できます: +Specific 4D keywords can be used in class definitions: -- `Function `: オブジェクトのメンバーメソッドを定義します。 -- `Class constructor`: オブジェクトのプロパティを定義します (プロトタイプ定義)。 -- `Class extends `: 継承を定義します。 +- `Function ` to define member methods of the objects. +- `Class constructor` to define the properties of the objects (i.e. the prototype). +- `Class extends ` to define inheritance. ### Function -#### シンタックス +#### Syntax ```4d Function ({$parameterName : type; ...}){->$parameterName : type} -// コード +// code ``` -クラス関数とは、当該クラスのプロトタイプオブジェクトのプロパティです。 また、クラス関数は "Function" クラスのオブジェクトでもあります。 +Class functions are properties of the prototype object of the owner class. They are objects of the "Function" class. -クラス定義ファイルでは、`Function` キーワードと関数名を使用して宣言をおこないます。 関数名は [プロパティ名の命名規則](Concepts/dt_object.md#オブジェクトプロパティ識別子) に準拠している必要があります。 +In the class definition file, function declarations use the `Function` keyword, and the name of the function. The function name must be compliant with [property naming rules](Concepts/dt_object.md#object-property-identifiers). -> **Tip:** アンダースコア ("_") 文字で関数名を開始すると、その関数は 4Dコードエディターの自動補完機能から除外されます。 たとえば、`MyClass` に `Function _myPrivateFunction` を宣言した場合、コードエディターにおいて `"cs.MyClass "` とタイプしても、この関数は候補として提示されません。 +> **Tip:** Starting the function name with an underscore character ("_") will exclude the function from the autocompletion features in the 4D code editor. For example, if you declare `Function _myPrivateFunction` in `MyClass`, it will not be proposed in the code editor when you type in `"cs.MyClass. "`. -関数名のすぐ後に、名前とデータ型を指定して [引数](#引数) を宣言します (戻り値の宣言も可)。 たとえば: +Immediately following the function name, [parameters](#parameters) for the function can be declared with an assigned name and data type, including the return parameter (optional). For example: ```4d Function computeArea($width : Integer; $height : Integer)->$area : Integer ``` -クラスメソッド内でオブジェクトインスタンスを参照するには `This` コマンドを使います。 たとえば: +Within a class function, the `This` command is used as the object instance. For example: ```4d Function setFullname($firstname : Text; $lastname : Text) @@ -222,42 +222,42 @@ Function getFullname()->$fullname : Text $fullname:=This.firstName+" "+Uppercase(This.lastName) ``` -クラス関数の場合には、`Current method name` コマンドは次を返します: "*\.\*" (例: "MyClass.myMethod")。 +For a class function, the `Current method name` command returns: "*\.\*", for example "MyClass.myMethod". -アプリケーションのコード内では、クラス関数はオブジェクトインスタンスのメンバーメソッドとして呼び出され、 **スレッドセーフに関する警告:** クラス関数がスレッドセーフではないのに、"プリエンプティブプロセスで実行可能" なメソッドから呼び出された場合: - 普通のメソッドの場合とは異なり、コンパイラーはエラーを生成しません。 - ランタイムにおいてのみ、4D はエラーを生成します。 +> **Thread-safety warning:** If a class function is not thread-safe and called by a method with the "Can be run in preemptive process" attribute: - the compiler does not generate any error (which is different compared to regular methods), - an error is thrown by 4D only at runtime. -#### 引数 +#### Parameters -関数の引数は、引数の名称とデータ型をコロンで区切って宣言します。 引数名は [プロパティ名の命名規則](Concepts/dt_object.md#オブジェクトプロパティ識別子) に準拠している必要があります。 複数のパラメーター (およびその型) を宣言する場合は、それらをセミコロン (;) で区切ります。 +Function parameters are declared using the parameter name and the parameter type, separated by a colon. The parameter name must be compliant with [property naming rules](Concepts/dt_object.md#object-property-identifiers). Multiple parameters (and types) are separated by semicolons (;). ```4d Function add($x; $y : Variant; $z : Integer; $xy : Object) ``` -> パラメーターの型が宣言されていない場合には、`バリアント型` として定義されます。 +> If the type is not stated, the parameter will be defined as `Variant`. -関数の戻り値を宣言するには (任意)、入力パラメーターリストに矢印 (->) と戻り値の定義を追加します。 XPath: /ul[5]/li[2]/ClassName/ClassName/FunctionName/p[22] たとえば: +You declare the return parameter (optional) by adding an arrow (->) and the return parameter definition after the input parameter(s) list. For example: ```4d Function add($x : Variant; $y : Integer)->$result : Integer ``` -戻り値は、コロン (:) 記号の後に戻り値のデータ型だけを指定して宣言することもできます。その場合は、自動的に $0 が使用されます。 たとえば: +You can also declare the return parameter only by adding `: type`, in which case it will automatically be available through $0. For example: ```4d Function add($x : Variant; $y : Integer): Integer $0:=$x+$y ``` -> メソッド内の引数宣言に使用される [従来の 4D シンタックス](parameters.md#sequential-parameters) を、クラス関数の引数宣言に使うこともできます。 両方のシンタックスは併用することができます。 たとえば: +> The [classic 4D syntax](parameters.md#sequential-parameters) for method parameters can be used to declare class function parameters. Both syntaxes can be mixed. For example: > > ```4d Function add($x : Integer) @@ -269,22 +269,22 @@ Function add($x : Integer) -#### 例題 +#### Example ```4d -// クラス: Rectangle -Class Constructor($width : Integer; $height : Integer) +// Class: Rectangle +Class constructor($width : Integer; $height : Integer) This.name:="Rectangle" This.height:=$height This.width:=$width -// 関数定義 +// Function definition Function getArea()->$result : Integer $result:=(This.height)*(This.width) ``` ```4d -// プロジェクトメソッドにて +// In a project method var $rect : cs.Rectangle var $area : Real @@ -294,36 +294,36 @@ $area:=$rect.getArea() //5000 -### Class Constructor +### Class constructor -#### シンタックス +#### Syntax ```4d -// クラス: MyClass +// Class: MyClass Class Constructor({$parameterName : type; ...}) -// コード +// code ``` -クラスコンストラクター関数を使って、ユーザークラスを定義することができます。このコンストラクターは [引数](#引数) を受け取ることができます。 +A class constructor function, which can accept [parameters](#parameters), can be used to define a user class. -クラスコンストラクターが定義されていると、`new()` クラスメンバーメソッドを呼び出したときに、当該コンストラクターが呼び出されます (引数を指定している場合は `new()` 関数に渡します)。 +In that case, when you call the `new()` class member method, the class constructor is called with the parameters optionally passed to the `new()` function. -クラスコンストラクターメソッドの場合には、`Current method name` コマンドは次を返します: "*\.constructor*" (例: "MyClass.constructor")。 +For a class constructor function, the `Current method name` command returns: "*\.constructor*", for example "MyClass.constructor". -#### 例題: +#### Example: ```4d -// クラス: MyClass -// MyClass のクラスコンストラクター +// Class: MyClass +// Class constructor of MyClass Class Constructor ($name : Text) This.name:=$name ``` ```4d -// プロジェクトメソッドにて -// オブジェクトをインスタンス化します +// In a project method +// You can instantiate an object var $o : cs.MyClass $o:=cs.MyClass.new("HelloWorld") // $o = {"name":"HelloWorld"} @@ -334,43 +334,43 @@ $o:=cs.MyClass.new("HelloWorld") ### Class extends \ -#### シンタックス +#### Syntax ```4d -// クラス: ChildClass +// Class: ChildClass Class extends ``` -クラス宣言において `Class extends` キーワードを使うと、別のユーザークラスの子ユーザークラスを作成することができます。 この子クラスは、親クラスのすべての機能を継承します。 +The `Class extends` keyword is used in class declaration to create a user class which is a child of another user class. The child class inherits all functions of the parent class. -クラス継承は次のルールに沿っている必要があります: +Class extension must respect the following rules: -- ユーザークラスはビルトインクラスを継承できません (例外は 4D.Object で、すべてのユーザークラスにデフォルトで継承されます) -- ユーザークラスは、別のプロジェクトやコンポーネントのユーザークラスを継承できません。 -- ユーザークラスは、自身を継承することはできません。 -- 間接的にも、自身を継承することはできません (例: "a" extends "b" かつ "b" extends "a")。 +- A user class cannot extend a built-in class (except 4D.Object which is extended by default for user classes) +- A user class cannot extend a user class from another project or component. +- A user class cannot extend itself. +- It is not possible to extend classes in a circular way (i.e. "a" extends "b" that extends "a"). -コードエディターやインタープリターは、これらのルールが破られていても検知することはできません。コンパイラーおよび "シンタックスチェック" のみがエラーを生成します。 +Breaking such a rule is not detected by the code editor or the interpreter, only the compiler and `check syntax` will throw an error in this case. -派生クラスは、[`Super`](#super) コマンドを使って親クラスのコンストラクターを呼び出すことができます。. +An extended class can call the constructor of its parent class using the [`Super`](#super) command. -#### 例題 +#### Example -`Polygon` クラスを継承した `Square` クラスを作成します。 +This example creates a class called `Square` from a class called `Polygon`. ```4d -// クラス: Square -// パス: Classes/Square.4dm +//Class: Square +//path: Classes/Square.4dm Class extends Polygon Class constructor ($side : Integer) - // 親クラスのコンストラクターを呼び出します - // 長方形の高さ・幅パラメーターに正方形の一辺の長さを引数として渡します + // It calls the parent class's constructor with lengths + // provided for the Polygon's width and height Super($side;$side) - // 派生クラスにおいては、'This' を使用するより先に - // Super を呼び出しておく必要があります + // In derived classes, Super must be called before you + // can use 'This' This.name:="Square" Function getArea() @@ -383,41 +383,41 @@ Class constructor ($side : Integer) #### Super {( param{;...;paramN} )} {-> Object} -| 引数 | 型 | | 説明 | -| ----- | ------ | -- | ---------------- | -| param | mixed | -> | 親コンストラクターに受け渡す引数 | -| 戻り値 | object | <- | 親オブジェクト | +| Parameter | Type | | Description | +| --------- | ------ | -- | ---------------------------------------------- | +| param | mixed | -> | Parameter(s) to pass to the parent constructor | +| Result | object | <- | Object's parent | -`Super` キーワードによってスーパークラス (親クラス) を呼び出すことができます。 +The `Super` keyword allows calls to the `superclass`, i.e. the parent class. -`Super` は次の2つの目的のために使います: +`Super` serves two different purposes: -- [コンストラクターコード](#class-constructor) 内において、 `Super` はスーパークラスのコンストラクターを呼び出すコマンドです。 コンストラクター内で使用する際には、`Super` コマンドは単独で使用され、また `This` キーワードよりも先に使用される必要があります。 - - 継承ツリーにおいて、すべてのクラスコンストラクターが正しく呼び出されていない場合には、エラー -10748 が生成されます。 呼び出しが有効であることを確認するのは、開発者の役目となります。 - - スーパークラスがコンストラクトされるより先に、`This` コマンドを使った場合には、エラー -10743 が生成されます。 +- inside a [constructor code](#class-constructor), `Super` is a command that allows to call the constructor of the superclass. When used in a constructor, the `Super` command appears alone and must be used before the `This` keyword is used. + - If all class constructors in the inheritance tree are not properly called, error -10748 is generated. It's 4D developer to make sure calls are valid. + - If the `This` command is called on an object whose superclasses have not been constructed, error -10743 is generated. - - `Super` を、オブジェクトのスコープ外で呼び出した場合、または、スーパークラスコンストラクターがすでに呼び出されたオブジェクトを対象に呼び出した場合には、エラー -10746 が生成されます。 + - If `Super` is called out of an object scope, or on an object whose superclass constructor has already been called, error -10746 is generated. ```4d -// myClass コンストラクター +// inside myClass constructor var $text1; $text2 : Text -Super($text1) // テキスト型引数をスーパークラスコンストラクターに渡します -This.param:=$text2 // 2番目の引数を使用します +Super($text1) //calls superclass constructor with a text param +This.param:=$text2 // use second param ``` -- [クラスメンバー関数](#function) 内において、`Super` はスーパークラスのプロトタイプを指し、スーパークラス階層のメンバーメソッドの呼び出しを可能にします。 +- inside a [class member function](#class-function), `Super` designates the prototype of the superclass and allows to call a function of the superclass hierarchy. ```4d -Super.doSomething(42) // スーパークラスにて宣言されている -// "doSomething" メンバーメソッドを呼び出します +Super.doSomething(42) //calls "doSomething" function +//declared in superclasses ``` -#### 例題 1 +#### Example 1 -クラスコンストレクター内で `Super` を使う例です。 `Rectangle` と `Square` クラス の共通要素がコンストラクター内で重複しないよう、このコマンドを呼び出します。 +This example illustrates the use of `Super` in a class constructor. The command is called to avoid duplicating the constructor parts that are common between `Rectangle` and `Square` classes. ```4d -// クラス: Rectangle +// Class: Rectangle Class constructor($width : Integer; $height : Integer) This.name:="Rectangle" This.height:=$height @@ -427,24 +427,24 @@ Class constructor($width : Integer; $height : Integer) Function sayName() ALERT("Hi, I am a "+This.name+".") -// 関数定義 +// Function definition Function getArea() var $0 : Integer $0:=(This.height)*(This.width) ``` ```4d -// クラス: Square +//Class: Square Class extends Rectangle Class constructor ($side : Integer) - // 親クラスのコンストラクターを呼び出します - // 長方形の高さ・幅パラメーターに正方形の一辺の長さを引数として渡します + // It calls the parent class's constructor with lengths + // provided for the Rectangle's width and height Super($side;$side) - // 派生クラスにおいては、'This' を使用するより先に - // Super を呼び出しておく必要があります + // In derived classes, Super must be called before you + // can use 'This' This.name:="Square" Function getArea() @@ -452,22 +452,22 @@ Function getArea() $0:=This.height*This.width ``` -#### 例題 2 +#### Example 2 -クラスメンバーメソッド内で `Super` を使う例です。 メンバーメソッドを持つ `Rectangle` クラスを作成します: +This example illustrates the use of `Super` in a class member method. You created the `Rectangle` class with a function: ```4d -// クラス: Rectangle +//Class: Rectangle Function nbSides() var $0 : Text $0:="I have 4 sides" ``` -`Square` クラスには、スーパークラスメソッドを呼び出すメンバーメソッドを定義します: +You also created the `Square` class with a function calling the superclass function: ```4d -// クラス: Square +//Class: Square Class extends Rectangle @@ -476,65 +476,65 @@ Function description() $0:=Super.nbSides()+" which are all equal" ``` -すると、プロジェクトメソッド内には次のように書けます: +Then you can write in a project method: ```4d var $square : Object var $message : Text $square:=cs.Square.new() -$message:=$square.description() // "I have 4 sides which are all equal" +$message:=$square.description() //I have 4 sides which are all equal ``` ### This #### This -> Object -| 引数 | 型 | | 説明 | -| --- | ------ | -- | ---------- | -| 戻り値 | object | <- | カレントオブジェクト | +| Parameter | Type | | Description | +| --------- | ------ | -- | -------------- | +| Result | object | <- | Current object | -`This` キーワードは、現在処理中のオブジェクトへの参照を返します。 `This` は、4Dにおいて [様々なコンテキスト](https://doc.4d.com/4Dv18/4D/18/This.301-4504875.ja.html) で使用することができます。 +The `This` keyword returns a reference to the currently processed object. In 4D, it can be used in [different contexts](https://doc.4d.com/4Dv18/4D/18/This.301-4504875.en.html). -`This` の値は、呼ばれ方によって決まります。 `This` の値は実行時に代入により設定することはできません。また、呼び出されるたびに違う値となりえます。 +In most cases, the value of `This` is determined by how a function is called. It can't be set by assignment during execution, and it may be different each time the function is called. -オブジェクトのメンバーメソッドとしてフォーミュラが呼び出された場合、`This` はメソッドの呼び出し元であるオブジェクトを指します。 たとえば: +When a formula is called as a member method of an object, its `This` is set to the object the method is called on. For example: ```4d $o:=New object("prop";42;"f";Formula(This.prop)) $val:=$o.f() //42 ``` -[クラスコンストラクター](#class-constructor) 関数が `new()` キーワードにより使用された場合、その内部の `This` はインスタンス化される新規オブジェクトを指します。 +When a [class constructor](#class-constructor) function is used (with the `new()` keyword), its `This` is bound to the new object being constructed. ```4d -// クラス: ob +//Class: ob Class Constructor - // This のプロパティを - // 代入によって作成します + // Create properties on This as + // desired by assigning to them This.a:=42 ``` ```4d -// 4Dメソッドにて +// in a 4D method $o:=cs.ob.new() $val:=$o.a //42 ``` -> コンストラクター内で [Super](#super) キーワードを使ってスーパークラスのコンストラクターを呼び出す場合、必ず `This` よりも先にスーパークラスのコンストラクターを呼ぶ必要があることに留意してください。順番を違えるとエラーが生成されます。 こちらの [例題](#例題-1) を参照ください。 +> When calling the superclass constructor in a constructor using the [Super](#super) keyword, keep in mind that `This` must not be called before the superclass constructor, otherwise an error is generated. See [this example](#example-1). -基本的に、`This` はメソッドの呼び出し元のオブジェクトを指します。 +In any cases, `This` refers to the object the method was called on, as if the method were on the object. ```4d -// クラス: ob +//Class: ob Function f() $0:=This.a+This.b ``` -この場合、プロジェクトメソッドには次のように書けます: +Then you can write in a project method: ```4d $o:=cs.ob.new() @@ -542,23 +542,23 @@ $o.a:=5 $o.b:=3 $val:=$o.f() //8 ``` -この例では、変数 $o に代入されたオブジェクトは *f* プロパティを持たないため、これをクラスより継承します。 *f* は $o のメソッドとして呼び出されるため、メソッド内の `This` は $o を指します。 +In this example, the object assigned to the variable $o doesn't have its own *f* property, it inherits it from its class. Since *f* is called as a method of $o, its `This` refers to $o. -## クラスコマンド +## Class commands -4D ランゲージには、クラス機能を扱う複数のコマンドがあります。 +Several commands of the 4D language allows you to handle class features. ### OB Class #### OB Class ( object ) -> Object | Null -`OB Class` は引数として渡したオブジェクトのクラスを返します。 +`OB Class` returns the class of the object passed in parameter. ### OB Instance of #### OB Instance of ( object ; class ) -> Boolean -`object` が `class`、またはその子クラスに属していれば、`OB Instance of` は `true` を返します。それ以外の場合は `false` を返します。 +`OB Instance of` returns `true` if `object` belongs to `class` or to one of its inherited classes, and `false` otherwise. diff --git a/website/translated_docs/ja/Concepts/components.md b/website/translated_docs/ja/Concepts/components.md index 00f907fbad41d5..9964d48045942f 100644 --- a/website/translated_docs/ja/Concepts/components.md +++ b/website/translated_docs/ja/Concepts/components.md @@ -1,67 +1,67 @@ --- id: components -title: コンポーネント +title: Components --- -4D のコンポーネントとは、他のアプリケーションにインストール可能な、1つ以上の機能を持つ 4D メソッドやフォームの一式です。 たとえば、メールの送受信をおこない、それらを 4D アプリケーションに格納するための機能を持ったコンポーネントを作成できます。 +A 4D component is a set of 4D methods and forms representing one or more functionalities that can be installed in different applications. For example, you can develop a 4D e-mail component that manages every aspect of sending, receiving and storing e-mails in 4D applications. -4D コンポーネントの作成とインストールは直接 4D を使用しておこないます。 4D では、コンポーネントは [プラグイン](Concepts/plug-ins.md) のように扱われ、以下の原則が適用されます: +Creating and installing 4D components is carried out directly from 4D. Basically, components are managed like [plug-ins](Concepts/plug-ins.md) according to the following principles: -- コンポーネントは、標準のアーキテクチャーまたはパッケージ (.4dbase 拡張子) の形をしたストラクチャーファイル ( コンパイルまたは非コンパイル) で構成されます。 -- アプリケーションプロジェクトにコンポーネントをインストールするには、プロジェクトの Project フォルダーと同階層の "Components" フォルダーにコンポーネントをコピーします。 -- コンポーネントは次の 4D の要素を呼び出すことができます: プロジェクトメソッド、プロジェクトフォーム、メニューバー、選択リスト、ライブラリピクチャーなど。 反面、コンポーネントが呼び出せないものは、データベースメソッドとトリガーです。 -- コンポーネント内で標準のテーブルやデータファイルを使用することはできません。 しかし、外部データベースのメカニズムを使用すればテーブルやフィールドを作成し、そこにデータを格納したり読み出したりすることができます。 外部データベースは、メインの 4D データベースとは独立して存在し、SQLコマンドでアクセスします。 +- A component consists of a regular structure file (compiled or not) having the standard architecture or in the form of a package (see .4dbase Extension). +- To install a component in an application project, you simply need to copy it into the "Components" folder of the project, at the same level as the Project folder. +- A component can call on most of the 4D elements: project methods, project forms, menu bars, choice lists, pictures from the library, and so on. It cannot call database methods and triggers. +- You cannot use standard tables or data files in 4D components. However, a component can create and/or use tables, fields and data files using mechanisms of external databases. These are separate 4D databases that you work with using SQL commands. -## 定義 +## Definitions -4D のコンポーネント管理メカニズムでは、以下の用語とコンセプトを使います: +The component management mechanisms in 4D require the implementation of the following terms and concepts: -- **マトリクスプロジェクト**: コンポーネント開発に使用する4D プロジェクト。 マトリクスプロジェクトは特別な属性を持たない標準のプロジェクトです。 マトリクスプロジェクトはひとつのコンポーネントを構成します。 マトリクスプロジェクトは、コンポーネントを使用するプロジェクト (ホストアプリケーションプロジェクト) の Components フォルダーにコピーして使います。コンパイルされていてもいなくてもかまいません。 -- **ホストプロジェクト**: コンポーネントがインストールされ、それを使用するアプリケーションプロジェクト。 -- **コンポーネント**: ホストアプリケーションによって使用される目的で、同アプリケーションの Components フォルダーにコピーされたマトリクスプロジェクト (コンパイル済みまたは非コンパイル)。 +- **Matrix Project**: 4D project used for developing the component. The matrix project is a standard project with no specific attributes. A matrix project forms a single component. The matrix project is intended to be copied, compiled or not, into the Components folder of the project that will be using the component (host application project). +- **Host Project**: Application project in which a component is installed and used. +- **Component**: Matrix project, compiled or not, copied into the Components folder of the host application and whose contents are used in the host applications. -プロジェクトは "マトリクス" にも "ホスト" にもなりえます。言い換えれば、マトリクスプロジェクト自体も1 つ以上のコンポーネントを使用できます。 しかしコンポーネントが "サブコンポーネント" を使用することはできません。 +It should be noted that a project can be both a “matrix” and a “host,” in other words, a matrix project can itself use one or more components. However, a component cannot use “sub-components” itself. -### コンポーネントの保護: コンパイル +### Protection of components: compilation -コンポーネントとしてインストールされたマトリクスプロジェクトのプロジェクトメソッドは、ホストプロジェクトからデフォルトでアクセス可能です。 特に: +By default, all the project methods of a matrix project installed as a component are potentially visible from the host project. In particular: -- エクスプローラーのメソッドページに存在する共有のプロジェクトメソッドは、ホストプロジェクトのメソッドから呼び出し可能です。 エクスプローラーのプレビューエリアでそれらの内容を選択してコピーすることが可能です。 また、その内容はデバッガーで見ることもできます。 しかし、それらをメソッドエディター上で開いたり編集したりすることはできません。 -- マトリクスプロジェクトの他のプロジェクトメソッドはエクスプローラーに現れません。しかし、ホストプロジェクトのデバッガーには内容が表示されます。 +- The shared project methods are found on the Methods Page of the Explorer and can be called in the methods of the host project. Their contents can be selected and copied in the preview area of the Explorer. They can also be viewed in the debugger. However, it is not possible to open them in the Method editor nor to modify them. +- The other project methods of the matrix project do not appear in the Explorer but they too can be viewed in the debugger of the host project. -コンポーネントのプロジェクトメソッドを効果的に保護するには、マトリクスプロジェクトをコンパイルして、インタプリターコードを含まない .4dz ファイルとして提供します。 コンパイルされたマトリクスプロジェクトがコンポーネントとしてインストールされると: +To protect the project methods of a component effectively, simply compile the matrix project and provide it in the form of a .4dz file. When a compiled matrix project is installed as a component: -- エクスプローラーのメソッドページに存在する共有のプロジェクトメソッドは、ホストプロジェクトのメソッドから呼び出し可能です。 しかし、その内容はプレビューエリアにもデバッガーにも表示されません。 -- マトリクスプロジェクトの他のプロジェクトメソッドは一切表示されません。 +- The shared project methods are shown on the Methods Page of the Explorer and can be called in the methods of the host project. However, their contents will not appear in the preview area nor in the debugger. +- The other project methods of the matrix project will never appear. -## プロジェクトメソッドの共有 -マトリクスプロジェクトのすべてのプロジェクトメソッドは 、コンポーネントに含まれます。つまり、マトリクスプロジェクトをコンポーネント化しても、これらのプロジェクトメソッドは同コンポーネントにて呼び出して実行することができます。 +## Sharing of project methods +All the project methods of a matrix project are by definition included in the component (the project is the component), which means that they can be called and executed by the component. -他方、デフォルトでは、これらのプロジェクトメソッドはホストプロジェクトに表示されず、呼び出すこともできません。 プロジェクトメソッドをホストプロジェクトと共有するには、 マトリクスプロジェクト側でそのメソッドをそのように明示的に設定しなければなりません。 設定することで、それらのプロジェクトメソッドはホストプロジェクトにて呼び出すことができるようになります (しかしホストプロジェクトのメソッドエディターで編集することはできません)。 これらのメソッドはコンポーネントの **エントリーポイント** となります。 +On the other hand, by default these project methods will not be visible, nor can they be called in the host projects. In the matrix project, you must explicitly designate the methods that you want to share with the host project. These project methods can be called in the code of the host project (but they cannot be modified in the Method editor of the host database). These methods form **entry points** in the component. -**注:** セキュリティのため、デフォルトでは、コンポーネントはホストプロジェクトのプロジェクトメソッドを実行することはできません。 特定の場合に、ホストプロジェクトのプロジェクトメソッドにコンポーネントがアクセスできるようにする必要があるかもしれません。 そうするには、ホストプロジェクトのプロジェクトメソッド側で、コンポーネントからのアクセスを可能にするよう明示的に指定しなければなりません。 +**Note:** Conversely, for security reasons, by default a component cannot execute project methods belonging to the host project. In certain cases, you may need to allow a component to access the project methods of your host project. To do this, you must explicitly designate the project methods of the host project that you want to make accessible to the components. ![](assets/en/Concepts/pict516563.en.png) -## 変数の渡し方 +## Passing variables -ローカル、プロセス、インタープロセス変数は、コンポーネントとホストプロジェクト間で共有されません。 ホストプロジェクトからコンポーネントの変数、またはその逆にアクセスする唯一の方法はポインターを使用することです。 +The local, process and interprocess variables are not shared between components and host projects. The only way to access component variables from the host project and vice versa is using pointers. -配列を使用した例: +Example using an array: ```4d -// ホストプロジェクト側: +//In the host project: ARRAY INTEGER(MyArray;10) AMethod(->MyArray) -// コンポーネント側で AMethod プロジェクトメソッドは以下の通りです: +//In the component, the AMethod project method contains: APPEND TO ARRAY($1->;2) ``` -変数を使用した例: +Examples using variables: ```4d C_TEXT(myvariable) @@ -71,42 +71,42 @@ title: コンポーネント ``` -ホストプロジェクトとコンポーネント間でポインターを使用して通信をおこなうには、以下の点を考慮する必要があります: +When you use pointers to allow components and the host project to communicate, you need to take the following specificities into account: -- `Get pointer` をコンポーネント内で使用した場合、このコマンドはホストプロジェクトの変数へのポインターを返しません。また逆にこのコマンドをホストプロジェクトで使用した場合も同様です。 +- The `Get pointer` command will not return a pointer to a variable of the host project if it is called from a component and vice versa. -- コンパイル済みプロジェクトでは、コンパイルされたコンポーネントしか使用できませんが、インタープリタープロジェクトの場合には、インタープリターおよびコンパイル済みコンポーネントを同時に使用することができます。 この場合、ポインターの利用は以下の原則を守らなければなりません: インタープリターモードでは、コンパイルモードにおいて作成されたポインターを解釈できます。逆にコンパイルモードでは、インタープリターモードにて作成されたポインターを解釈することはできません。 以下の例でこの原則を説明します: 同じホストプロジェクトにインストールされた 2つのコンポーネント C ( コンパイル済) と I ( インタープリタ) があります: - - コンポーネントC が定義する変数 `myCvar` があるとき、コンポーネントI はポインター `->myCvar` を使用して変数の値にアクセスすることができます。 - - コンポーネントI が定義する変数 `myIvar` があるとき、コンポーネントC はポインター `->myIvar` を使用しても変数の値にアクセスすることはできません。 このシンタックスは実行エラーを起こします。 +- The component architecture allows the coexistence, within the same interpreted project, of both interpreted and compiled components (conversely, only compiled components can be used in a compiled project). In order to use pointers in this case, you must respect the following principle: the interpreter can unpoint a pointer built in compiled mode; however, in compiled mode, you cannot unpoint a pointer built in interpreted mode. Let’s illustrate this principle with the following example: given two components, C (compiled) and I (interpreted), installed in the same host project. + - If component C defines the `myCvar` variable, component I can access the value of this variable by using the pointer `->myCvar`. + - If component I defines the `myIvar` variable, component C cannot access this variable by using the pointer `->myIvar`. This syntax causes an execution error. -- `RESOLVE POINTER` を使用したポインターの比較はお勧めできません。 変数の分離の原則により、ホストプロジェクトとコンポーネント (あるいは他のコンポーネント) で同じ名前の変数が存在することができますが、根本的にそれらは異なる内容を持ちます。 両コンテキストで、変数のタイプが違うことさえありえます。 ポインター `myptr1` と `myptr2` がそれぞれ変数を指すとき、以下の比較は正しくない結果となるかもしれません: +- The comparison of pointers using the `RESOLVE POINTER` command is not recommended with components since the principle of partitioning variables allows the coexistence of variables having the same name but with radically different contents in a component and the host project (or another component). The type of the variable can even be different in both contexts. If the `myptr1` and `myptr2` pointers each point to a variable, the following comparison will produce an incorrect result: ```4d RESOLVE POINTER(myptr1;vVarName1;vtablenum1;vfieldnum1) RESOLVE POINTER(myptr2;vVarName2;vtablenum2;vfieldnum2) If(vVarName1=vVarName2) - // 変数が異なっているにもかかわらず、このテストはtrue を返します + //This test returns True even though the variables are different ``` -このような場合には、ポインターを比較しなければなりません: +In this case, it is necessary to use the comparison of pointers: ```4d - If(myptr1=myptr2) // このテストはFalse を返します + If(myptr1=myptr2) //This test returns False ``` -## ホストプロジェクトのテーブルへのアクセス +## Access to tables of the host project -コンポーネントでテーブルを使用することはできませんが、ホストプロジェクトとコンポーネントはポインターを使用して通信を行うことができます。 たとえば、以下はコンポーネントで実行可能なメソッドです: +Although components cannot use tables, pointers can permit host projects and components to communicate with each other. For example, here is a method that could be called from a component: ```4d -// コンポーネントメソッドの呼び出し +// calling a component method methCreateRec(->[PEOPLE];->[PEOPLE]Name;"Julie Andrews") ``` -コンポーネント内の `methCreateRec` メソッドのコード: +Within the component, the code of the `methCreateRec` method: ```4d -C_POINTER($1) // ホストプロジェクトのテーブルへのポインター -C_POINTER($2) // ホストプロジェクトのフィールドへのポインター -C_TEXT($3) // 代入する値 +C_POINTER($1) //Pointer on a table in host project +C_POINTER($2) //Pointer on a field in host project +C_TEXT($3) // Value to insert $tablepointer:=$1 $fieldpointer:=$2 @@ -116,22 +116,22 @@ $fieldpointer->:=$3 SAVE RECORD($tablepointer->) ``` -## ランゲージコマンドのスコープ +## Scope of language commands -[使用できないコマンド](#使用できないコマンド) を除き、コンポーネントではすべての 4D ランゲージコマンドが使用できます。 +Except for [Unusable commands](#unusable-commands), a component can use any command of the 4D language. -コマンドがコンポーネントから呼ばれると、コマンドはコンポーネントのコンテキストで実行されます。ただし `EXECUTE METHOD` コマンドは除きます。このコマンドは、パラメーターにて指定されたメソッドのコンテキストを使用します。 また、ユーザー&グループテーマの読み出しコマンドはコンポーネントで使用することができますが、読み出されるのはホストプロジェクトのユーザー&グループ情報であることに注意してください (コンポーネントに固有のユーザー&グループはありません)。 +When commands are called from a component, they are executed in the context of the component, except for the `EXECUTE METHOD` command that uses the context of the method specified by the command. Also note that the read commands of the “Users and Groups” theme can be used from a component but will read the users and groups of the host project (a component does not have its own users and groups). -`SET DATABASE PARAMETER` と `Get database parameter` コマンドは例外となります: これらのコマンドのスコープはグローバルです。 これらのコマンドがコンポーネントから呼び出されると、結果はホストプロジェクトに適用されます。 +The `SET DATABASE PARAMETER` and `Get database parameter` commands are an exception: their scope is global to the application. When these commands are called from a component, they are applied to the host application project. -さらに、`Structure file` と `Get 4D folder` コマンドは、コンポーネントで使用するための設定ができるようになっています。 +Furthermore, specific measures have been specified for the `Structure file` and `Get 4D folder` commands when they are used in the framework of components. -`COMPONENT LIST` コマンドを使用して、ホストプロジェクトにロードされたコンポーネントのリストを取得できます。 +The `COMPONENT LIST` command can be used to obtain the list of components that are loaded by the host project. -### 使用できないコマンド +### Unusable commands -(読み込み専用モードで開かれるため) ストラクチャーファイルを更新する以下のコマンドは、コンポーネントで使用することができません。 コンポーネント中で以下のコマンドを実行すると、-10511, "CommandName コマンドをコンポーネントでコールすることはできません" のエラーが生成されます: +The following commands are not compatible for use within a component because they modify the structure file — which is open in read-only. Their execution in a component will generate the error -10511, “The CommandName command cannot be called from a component”: - `ON EVENT CALL` - `Method called on event` @@ -151,40 +151,40 @@ SAVE RECORD($tablepointer->) - `BLOB TO USERS` - `SET PLUGIN ACCESS` -**注:** +**Notes:** -- `Current form table` コマンドは、プロジェクトフォームのコンテキストで呼び出されると `Nil` を返します。 ゆえにこのコマンドをコンポーネントで使用することはできません。 -- SQLデータ定義言語のコマンド (`CREATE TABLE`、`DROP TABLE`等) をコンポーネントのフレームワークで使用することはできません。 ただし、外部データベースの場合は使用することができます (`CREATE DATABASE` SQL コマンド参照)。 +- The `Current form table` command returns `Nil` when it is called in the context of a project form. Consequently, it cannot be used in a component. +- SQL data definition language commands (`CREATE TABLE`, `DROP TABLE`, etc.) cannot be used on the component project. However, they are supported with external databases (see `CREATE DATABASE` SQL command). -## エラー処理 +## Error handling -`ON ERR CALL` コマンドによって実装された [エラー処理メソッド](Concepts/error-handling.md) は、実行中のプロジェクトに対してのみ適用されます。 コンポーネントによって生成されたエラーの場合、ホストプロジェクトの `ON ERR CALL` エラー処理メソッドは呼び出されず、その逆もまた然りです。 +An [error-handling method](Concepts/error-handling.md) installed by the `ON ERR CALL` command only applies to the running application. In the case of an error generated by a component, the `ON ERR CALL` error-handling method of the host project is not called, and vice versa. -## フォームの使用 +## Use of forms -- 特定のテーブルに属さない" プロジェクトフォーム" のみが、コンポーネント内で利用できます。 マトリクスプロジェクトのすべてのプロジェクトフォームをコンポーネントで使用することができます。 -- コンポーネントはホストプロジェクトのテーブルフォームを使用できます。 この場合、コンポーネントのコードでフォームを指定するにあたっては、テーブル名ではなく、テーブルへのポインターを使用しなければならないことに注意してください。 +- Only “project forms” (forms that are not associated with any specific table) can be used in a component. Any project forms present in the matrix project can be used by the component. +- A component can call table forms of the host project. Note that in this case it is necessary to use pointers rather than table names between brackets [] to specify the forms in the code of the component. -**注:** コンポーネントが `ADD RECORD` コマンドを使用すると、ホストプロジェクトのコンテキストで、ホストプロジェクトのカレントの入力フォームが表示されます。 したがって、その入力フォーム上に変数が含まれている場合、コンポーネントはその変数にアクセスできません。 +**Note:** If a component uses the `ADD RECORD` command, the current Input form of the host project will be displayed, in the context of the host project. Consequently, if the form includes variables, the component will not have access to it. -- コンポーネントフォームをホストプロジェクト内でサブフォームとして公開することができます。 これは具体的には、グラフィックオブジェクトを提供するコンポーネントを開発できることを意味します。 たとえば、4D社が提供するウィジェットはコンポーネントのサブフォーム利用に基づいています。 +- You can publish component forms as subforms in the host projects. This means that you can, more particularly, develop components offering graphic objects. For example, Widgets provided by 4D are based on the use of subforms in components. -## テーブルやフィールドの利用 +## Use of tables and fields -コンポーネントは、マトリクスプロジェクトのストラクチャーで定義されたテーブルやフィールドを使用することはできません。 しかし外部データベースを作成し、そのテーブルやフィールドを必要に応じ利用することはできます。 外部データベースの作成と管理は SQL を用いておこないます。 外部データベースは、メインの4Dプロジェクトから独立している別の 4Dプロジェクトですが、メインプロジェクトから操作が可能です。 外部データベースの利用は、そのデータベースを一時的にカレントデータベースに指定することです。言い換えれば、4Dが実行する SQL クエリのターゲットデータベースとして外部データベースを指定します。 外部データベースの作成は SQL の `CREATE DATABASE` コマンドを使用します。 +A component cannot use the tables and fields defined in the 4D structure of the matrix project. However, you can create and use external databases, and then use their tables and fields according to your needs. You can create and manage external databases using SQL. An external database is a 4D project that is independent from the main 4D project, but that you can work with from the main 4D project. Using an external database means temporarily designating this database as the current database, in other words, as the target database for the SQL queries executed by 4D. You create external databases using the SQL `CREATE DATABASE` command. -### 例題 +### Example -以下のコードはコンポーネントに実装されており、外部データベースに対して3つの基本的なアクションをおこないます: +The following code is included in a component and performs three basic actions with an external database: -- 外部データベースを作成します (存在しない場合) -- 外部データベースにデータを追加します -- 外部データベースからデータを読み込みます +- creates the external database if it does not already exist, +- adds data to the external database, +- reads data from the external database. -外部データベースの作成: +Creating the external database: ```4d -<>MyDatabase:=Get 4D folder+"\MyDB" // (Windows) データを許可されているディレクトリに保存します +<>MyDatabase:=Get 4D folder+"\MyDB" // (Windows) stores the data in an authorized directory Begin SQL CREATE DATABASE IF NOT EXISTS DATAFILE :[<>MyDatabase]; USE DATABASE DATAFILE :[<>MyDatabase]; @@ -204,10 +204,10 @@ SAVE RECORD($tablepointer->) End SQL ``` -外部データベースへのデータ書き込み: +Writing in the external database: ```4d - $Ptr_1:=$2 // ホストプロジェクトへのデータアクセスはポインターを通じておこないます + $Ptr_1:=$2 // retrieves data from the host project through pointers $Ptr_2:=$3 $Ptr_3:=$4 $Ptr_4:=$5 @@ -226,10 +226,10 @@ SAVE RECORD($tablepointer->) End SQL ``` -外部データベースからデータを読み込み: +Reading from an external database: ```4d - $Ptr_1:=$2 // ホストプロジェクトへのデータアクセスはポインターを通じておこないます + $Ptr_1:=$2 // accesses data of the host project through pointers $Ptr_2:=$3 $Ptr_3:=$4 $Ptr_4:=$5 @@ -248,17 +248,17 @@ SAVE RECORD($tablepointer->) End SQL ``` -## リソースの使用 +## Use of resources -コンポーネントはリソースを使用することができます。 リソース管理の原則に従い、コンポーネントが .4dbase 形式の場合 (推奨されるアーキテクチャー)、Resources フォルダーは .4dbase フォルダーの中に置かれます。 +Components can use resources. In conformity with the resource management principle, if the component is of the .4dbase architecture (recommended architecture), the Resources folder must be placed inside this folder. -これによって自動メカニズムが有効となり、コンポーネントの Resources フォルダー内で見つかった XLIFF ファイルは、 同コンポーネントによってロードされます。 +Automatic mechanisms are operational: the XLIFF files found in the Resources folder of a component will be loaded by this component. -1つ以上のコンポーネントを含むホストプロジェクトでは、ホストプロジェクトと同様にそれぞれのコンポーネントも固有のリソースチェーンを持っています。 リソースは異なるプロジェクト間で分離されます。コンポーネントA のリソースにコンポーネントB やホストプロジェクトからアクセスすることはできません。 +In a host project containing one or more components, each component as well as the host projects has its own “resources string.” Resources are partitioned between the different projects: it is not possible to access the resources of component A from component B or the host project. -## コンポーネントのオンラインヘルプ -コンポーネントにオンラインヘルプを追加できるように、専用のメカニズムが実装されています。 原理は 4D プロジェクトに提供されているものと同じです: +## On-line help for components +A specific mechanism has been implemented in order to allow developers to add on-line help to their components. The principle is the same as that provided for 4D projects: -- コンポーネントヘルプは拡張子が .htm, .html または (Windows のみ) .chm で提供されます。 -- ヘルプファイルはコンポーネントのストラクチャーファイルと同階層に置かれ、ストラクチャーと同じ名前でなくてはなりません。 -- このファイルは自動的にアプリケーションのヘルプメニューに、" ヘルプ: ヘルプファイル名" のタイトルでロードされます。 \ No newline at end of file +- The component help must be provided as a file suffixed .htm, .html or (Windows only) .chm, +- The help file must be put next to the structure file of the component and have the same name as the structure file, +- This file is then automatically loaded into the Help menu of the application with the title “Help for...” followed by the name of the help file. \ No newline at end of file diff --git a/website/translated_docs/ja/Concepts/data-types.md b/website/translated_docs/ja/Concepts/data-types.md index 82494a94ede6c6..fc193816671011 100644 --- a/website/translated_docs/ja/Concepts/data-types.md +++ b/website/translated_docs/ja/Concepts/data-types.md @@ -1,84 +1,84 @@ --- id: data-types -title: データタイプの概要 +title: Data types overview --- -4D においてデータは、主にデータベースフィールドと 4D ランゲージという2つの場所で、そのタイプに応じて扱われます。 - -この2つはおおよそ同じものですが、データベースレベルで提供されているいくつかのデータタイプはランゲージにおいては直接利用可能ではなく、自動的に適宜変換されます。 同様に、いくつかのデータタイプはランゲージでしか利用できません。 各場所で利用可能なデータタイプと、ランゲージでの宣言の仕方の一覧です: - -| データタイプ | データベース | ランゲージ | [`var` 宣言](variables.md#using-the-var-keyword) | [`C_` または `ARRAY` 宣言](variables.md#using-a-c_-directive) | -| ------------------------------------- | ------- | ------- | ---------------------------------------------- | -------------------------------------------------------- | -| [文字列](dt_string.md) | ◯ | テキストに変換 | - | - | -| [テキスト](Concepts/dt_string.md) | ◯ | ◯ | テキスト | `C_TEXT`, `ARRAY TEXT` | -| [日付](Concepts/dt_date.md) | ◯ | ◯ | 日付 | `C_DATE`, `ARRAY DATE` | -| [時間](Concepts/dt_time.md) | ◯ | ◯ | 時間 | `C_TIME`, `ARRAY TIME` | -| [ブール](Concepts/dt_boolean.md) | ◯ | ◯ | ブール | `C_BOOLEAN`, `ARRAY BOOLEAN` | -| [整数](Concepts/dt_number.md) | ◯ | 倍長整数に変換 | 整数 | `ARRAY INTEGER` | -| [倍長整数](Concepts/dt_number.md) | ◯ | ◯ | 整数 | `C_LONGINT`, `ARRAY LONGINT` | -| [64ビット整数](Concepts/dt_number.md) | ◯ (SQL) | 実数に変換 | - | - | -| [実数](Concepts/dt_number.md) | ◯ | ◯ | 実数 | `C_REAL`, `ARRAY REAL` | -| [未定義](Concepts/dt_null_undefined.md) | - | ◯ | - | - | -| [Null](Concepts/dt_null_undefined.md) | - | ◯ | - | - | -| [ポインター](Concepts/dt_pointer.md) | - | ◯ | ポインター | `C_POINTER`, `ARRAY POINTER` | -| [ピクチャー](Concepts/dt_picture.md) | ◯ | ◯ | ピクチャー | `C_PICTURE`, `ARRAY PICTURE` | -| [BLOB](Concepts/dt_blob.md) | ◯ | ◯ | BLOB | `C_BLOB`, `ARRAY BLOB` | -| [オブジェクト](Concepts/dt_object.md) | ◯ | ◯ | オブジェクト | `C_OBJECT`, `ARRAY OBJECT` | -| [コレクション](Concepts/dt_collection.md) | - | ◯ | コレクション | `C_COLLECTION` | -| [バリアント](Concepts/dt_variant.md)(2) | - | ◯ | バリアント | `C_VARIANT` | - -(1) ORDA では、オブジェクト (エンティティ) を介してデータベースフィールドを扱うため、オブジェクトにおいて利用可能なデータタイプのみがサポートされます。 詳細については [オブジェクト](Concepts/dt_object.md) のデータタイプの説明を参照ください。 - -(2) バリアントは実際のところ *データ* タイプではなく、あらゆるデータタイプの値を格納することのできる *変数* タイプです。 - -## デフォルト値 - -コンパイラ支持子によって変数の型が決まるとき、変数はデフォルトの値を受け取り、割り当てがされない限りセッションの間はその値を保ち続けます。 - -デフォルトの値は、変数の型とカテゴリ、その実行コンテキスト (インタープリターかコンパイルか) に加え、コンパイルモードではデータベース設定のコンパイラーページで定義されたコンパイルオプションによって決まります: - -- プロセス変数およびインタープロセス変数は常に "ゼロにする" に設定されます。つまり、型によって、"0"、空の文字列、空のBlob、Nilポインター、空の日付 (00-00-00)、ということです。 -- ローカル変数は以下の様に設定されます: - - インタープリタモード: ゼロにする - - コンパイルモードにおいては、データベース設定の**ローカル変数初期化オプション**によって異なります: - - "ゼロにする" が選択されている場合にはゼロになります。 - - "ランダム値にする" が選択されている場合には、数値と時間については0x72677267、ブールについては常に true、他のものについては "ゼロにする" の場合と同じです。 - - "なし" が選択されている場合には、変数は初期化されず、メモリにある値が採用されます。それは、別の変数に以前使われた値かもしれません。 **注:** 4D では "ゼロにする" の設定を推奨しています。 - -以下の表はこれらのデフォルトの値をあらわしたものです: - -| タイプ | インタープロセス変数 / プロセス変数 / インタープリターモードのローカル変数 / コンパイルモードで "ゼロにする" のローカル変数 | コンパイルモードで "ランダム値にする" のローカル変数 | コンパイルモードで "なし" のローカル変数 | -| ------ | -------------------------------------------------------------------- | ---------------------------- | --------------------------- | -| ブール | False | True | True (場合による) | -| 日付 | 00-00-00 | 00-00-00 | 00-00-00 | -| 倍長整数 | 0 | 1919382119 | 909540880 (場合による) | -| 時間 | 00:00:00 | 533161:41:59 | 249345:34:24 (場合による) | -| ピクチャー | ピクチャーサイズ=0 | ピクチャーサイズ=0 | ピクチャーサイズ=0 | -| 実数 | 0 | 1.250753659382e+243 | 1.972748538022e-217 (場合による) | -| ポインター | Nil=true | Nil=true | Nil=true | -| テキスト | "" | "" | "" | -| BLOB | Blob サイズ=0 | Blob サイズ=0 | Blob サイズ=0 | -| オブジェクト | null | null | null | -| コレクション | null | null | null | -| バリアント | 未定義 | 未定義 | 未定義 | - - -## データタイプの変換 - -4D ランゲージには、データタイプ間の変換をおこなう演算子やコマンドがあります。 4D ランゲージはデータタイプをチェックします。 たとえば、"abc"+0.5+!12/25/96!-?00:30:45?のように記述することはできません。 これは、シンタックス (構文) エラーになります。 - -次の表は、基本のデータタイプ、変換できるデータタイプ、それを実行する際に使用するコマンドを示しています: - -| データタイプ | 文字列に変換 | 数値に変換 | 日付に変換 | 時間に変換 | ブールに変換 | -| ------- | ------ | ----- | ----- | ----- | ------ | -| 文字列 (1) | | Num | 日付 | 時間 | Bool | -| 数値 (2) | String | | | | Bool | -| 日付 | String | | | | Bool | -| 時間 | String | | | | Bool | -| ブール | | Num | | | | - -(1) JSON形式の文字列は `JSON Parse` コマンドを使ってスカラーデータ、オブジェクト、あるいはコレクションに変換することができます。 - -(2) 時間は数値として扱うことができます。 - -**注:** この表に示すデータ変換の他に、演算子と他のコマンドを組み合せることで、より洗練されたデータ変換を実行することができます。 +In 4D, data are handled according to their type in two places: database fields and the 4D language. + +Although they are usually equivalent, some data types available at the database level are not directly available in the language and are automatically converted. Conversely, some data types can only be handled through the language. The following table lists all available data types and how they are supported/declared: + +| Data Types | Database support(1) | Language support | [`var` declaration](variables.md#using-the-var-keyword) | [`C_` or `ARRAY` declaration](variables.md#using-a-c_-directive) | +| ------------------------------------------ | ------------------- | -------------------- | ------------------------------------------------------- | ---------------------------------------------------------------- | +| [Alphanumeric](dt_string.md) | Yes | Converted to text | - | - | +| [Text](Concepts/dt_string.md) | Yes | Yes | Text | `C_TEXT`, `ARRAY TEXT` | +| [Date](Concepts/dt_date.md) | Yes | Yes | Date | `C_DATE`, `ARRAY DATE` | +| [Time](Concepts/dt_time.md) | Yes | Yes | Time | `C_TIME`, `ARRAY TIME` | +| [Boolean](Concepts/dt_boolean.md) | Yes | Yes | Boolean | `C_BOOLEAN`, `ARRAY BOOLEAN` | +| [Integer](Concepts/dt_number.md) | Yes | Converted to longint | Integer | `ARRAY INTEGER` | +| [Longint](Concepts/dt_number.md) | Yes | Yes | Integer | `C_LONGINT`, `ARRAY LONGINT` | +| [Longint 64 bits](Concepts/dt_number.md) | Yes (SQL) | Converted to real | - | - | +| [Real](Concepts/dt_number.md) | Yes | Yes | Real | `C_REAL`, `ARRAY REAL` | +| [Undefined](Concepts/dt_null_undefined.md) | - | Yes | - | - | +| [Null](Concepts/dt_null_undefined.md) | - | Yes | - | - | +| [Pointer](Concepts/dt_pointer.md) | - | Yes | Pointer | `C_POINTER`, `ARRAY POINTER` | +| [Picture](Concepts/dt_picture.md) | Yes | Yes | Picture | `C_PICTURE`, `ARRAY PICTURE` | +| [BLOB](Concepts/dt_blob.md) | Yes | Yes | Blob | `C_BLOB`, `ARRAY BLOB` | +| [Object](Concepts/dt_object.md) | Yes | Yes | Object | `C_OBJECT`, `ARRAY OBJECT` | +| [Collection](Concepts/dt_collection.md) | - | Yes | Collection | `C_COLLECTION` | +| [Variant](Concepts/dt_variant.md)(2) | - | Yes | Variant | `C_VARIANT` | + +(1) Note that ORDA handles database fields through objects (entities) and thus, only supports data types available to these objects. For more information, see the [Object](Concepts/dt_object.md) data type description. + +(2) Variant is actually not a *data* type but a *variable* type that can contain a value of any other data type. + +## Default values + +When variables are typed by means of a compiler directive, they receive a default value, which they will keep during the session as long as they have not been assigned. + +The default value depends on the variable type and category, its execution context (interpreted or compiled), as well as, for compiled mode, the compilation options defined on the Compiler page of the Database settings: + +- Process and interprocess variables are always set "to zero" (which means, depending on the case, "0", an empty string, an empty Blob, a Nil pointer, a blank date (00-00-00), etc.) +- Local variables are set: + - in interpreted mode: to zero + - in compiled mode, depending on the **Initialize local variables** option of the Database settings: + - "to zero": to zero (see above), + - "to a random value": 0x72677267 for numbers and times, always True for Booleans, the same as "to zero" for the others, + - "no": no initialization, meaning whatever is in RAM is used for the variables, like values used before for other variables. **Note:** 4D recommends to use "to zero". + +The following table illustrates these default values: + +| Type | Interprocess/Process (interpreted/compiled), Local (interpreted/compiled "to zero") | Local compiled "random" | Local compiled "no" | +| ---------- | ----------------------------------------------------------------------------------- | ----------------------- | ---------------------------- | +| Booleen | False | True | True (varies) | +| Date | 00-00-00 | 00-00-00 | 00-00-00 | +| Longint | 0 | 1919382119 | 909540880 (varies) | +| Time | 00:00:00 | 533161:41:59 | 249345:34:24 (varies) | +| Picture | picture size=0 | picture size=0 | picture size=0 | +| Real | 0 | 1.250753659382e+243 | 1.972748538022e-217 (varies) | +| Pointer | Nil=true | Nil=true | Nil=true | +| Text | "" | "" | "" | +| Blob | Blob size=0 | Blob size=0 | Blob size=0 | +| Object | null | null | null | +| Collection | null | null | null | +| Variant | undefined | undefined | undefined | + + +## Converting data types + +The 4D language contains operators and commands to convert between data types, where such conversions are meaningful. The 4D language enforces data type checking. For example, you cannot write: "abc"+0.5+!12/25/96!-?00:30:45?. This will generate syntax errors. + +The following table lists the basic data types, the data types to which they can be converted, and the commands used to do so: + +| Data Type to Convert | to String | to Number | to Date | to Time | to Boolean | +| -------------------- | --------- | --------- | ------- | ------- | ---------- | +| String (1) | | Num | Date | Time | Bool | +| Number (2) | String | | | | Bool | +| Date | String | | | | Bool | +| Time | String | | | | Bool | +| Boolean | | Num | | | | + +(1) Strings formatted in JSON can be converted into scalar data, objects, or collections, using the `JSON Parse` command. + +(2) Time values can be treated as numbers. + +**Note:** In addition to the data conversions listed in this table, more sophisticated data conversions can be obtained by combining operators and other commands. diff --git a/website/translated_docs/ja/Concepts/dt_blob.md b/website/translated_docs/ja/Concepts/dt_blob.md index 96e55978332032..37a7c3940c0df2 100644 --- a/website/translated_docs/ja/Concepts/dt_blob.md +++ b/website/translated_docs/ja/Concepts/dt_blob.md @@ -3,65 +3,61 @@ id: blob title: BLOB --- -BLOB (Binary Large OBjects) フィールド・変数・式とは、連続した可変長バイトであり、各バイトを個々にアドレス指定可能な 1つのまとまったオブジェクトとして取り扱うことができます。 サポートされている BLOB のサイズは空 (長さがNULL) から、最大 2,147,483,647 バイト (2GB) までです。 +A BLOB (Binary Large OBjects) field, variable or expression is a contiguous series of bytes which can be treated as one whole object or whose bytes can be addressed individually. A BLOB can be empty (null length) or can contain up to 2147483647 bytes (2 GB). -BLOB は全体がメモリにロードされます。 BLOB 変数はメモリ内にだけ保持され、存在します。 BLOB フィールドは、レコードの他フィールドと同様に、ディスクからメモリにロードされます。 +A BLOB is loaded into memory in its entirety. A BLOB variable is held and exists in memory only. A BLOB field is loaded into memory from the disk, like the rest of the record to which it belongs. -大量のデータを保持できる他のフィールドタイプ (ピクチャーなど) と同様に、レコードを更新してもBLOBフィールドはメモリに複製されません。 したがって、`Old` および `Modified` コマンドをBLOBフィールドに適用しても、返される結果は意味を持ちません。 +Like the other field types that can retain a large amount of data (such as the Picture field type), BLOB fields are not duplicated in memory when you modify a record. Consequently, the result returned by the `Old` and `Modified` commands is not significant when applied to a BLOB field. -## 引数渡し、ポインター、および戻り値 +## Parameter passing, Pointers and function results -4D の BLOB は、4D コマンドまたは 4D プラグインの引数として渡すことができます。 また、BLOB はユーザーメソッドのパラメーターに渡したり、関数の戻り値にすることもできます。 +4D BLOBs can be passed as parameters to 4D commands or plug-in routines that expect BLOB parameters. BLOBS can also be passed as parameters to a user method or be returned as a function result. -ポインターを使用して、BLOB をメソッドに渡すことも出来ます。その場合は BLOB へのポインターを定義し、そのポインターをパラメーターとして渡します。 +To pass a BLOB to your own methods, you can also define a pointer to the BLOB and pass the pointer as parameter. -**例: ** +**Examples:** ```4d - // BLOB タイプの変数を定義します + ` Declare a variable of type BLOB C_BLOB(anyBlobVar) - -// 4Dコマンドに引数として BLOB を渡します + ` The BLOB is passed as parameter to a 4D command SET BLOB SIZE(anyBlobVar;1024*1024) - -// プラグインに BLOB を引数として渡します + ` The BLOB is passed as parameter to an external routine $errCode:=Do Something With This BLOB(anyBlobVar) - -// BLOB を引数として渡し、戻り値をBLOBで受け取ります + ` The BLOB is passed as a parameter to a method that returns a BLOB C_BLOB(retrieveBlob) retrieveBlob:=Fill_Blob(anyBlobVar) - -// BLOB のポインターをメソッドに渡します + ` A pointer to the BLOB is passed as parameter to a user method COMPUTE BLOB(->anyBlobVar) ``` -**プラグイン開発にあたっての注意:** BLOB 引数は “&O” (数字の0ではなく、アルファベットの"O") として宣言します。 +**Note for Plug-in developers:** A BLOB parameter is declared as “&O” (the letter “O”, not the digit “0”). -## 代入 +## Assignment operator -BLOB は相互に代入することができます。 +You can assign BLOBs to each other. -**例: ** +**Example:** ```4d - // BLOB 型の変数を二つ宣言します + ` Declare two variables of type BLOB C_BLOB(vBlobA;vBlobB) -// 一つ目の BLOB に10K のサイズを割り当てます + ` Set the size of the first BLOB to 10K SET BLOB SIZE(vBlobA;10*1024) -// 一つ目の BLOB を二つ目の BLOB に代入します + ` Assign the first BLOB to the second one vBlobB:=vBlobA ``` -ただし、BLOB に演算子を適用することはできません。 +However, no operator can be applied to BLOBs. -## BLOB のアドレス指定 +## Addressing BLOB contents -中カッコ {...} を使用し、BLOB の各バイトを個別にアドレス指定することができます。 BLOB 内では、各バイトに 0 から N-1 の番号が割り当てられています。N は BLOB のサイズです。 例: +You can address each byte of a BLOB individually using the curly brackets symbols {...}. Within a BLOB, bytes are numbered from 0 to N-1, where N is the size of the BLOB. Example: ```4d - // BLOB を定義します + ` Declare a variable of type BLOB C_BLOB(vBlob) -// BLOB のサイズを 256バイトに設定します + ` Set the size of the BLOB to 256 bytes SET BLOB SIZE(vBlob;256) -// 次のループは、BLOB の 256バイトをゼロに初期化します + ` The loop below initializes the 256 bytes of the BLOB to zero For(vByte;0;BLOB size(vBlob)-1) vBlob{vByte}:=0 End for ``` -BLOB の各バイトはすべて個別にアドレス指定できるため、BLOB フィールドまたは変数には実際のところ何でも格納できます。 +Because you can address all the bytes of a BLOB individually, you can actually store whatever you want in a BLOB field or variable. diff --git a/website/translated_docs/ja/Concepts/dt_boolean.md b/website/translated_docs/ja/Concepts/dt_boolean.md index 88f2af4ff272bb..e4c9e5e15c7902 100644 --- a/website/translated_docs/ja/Concepts/dt_boolean.md +++ b/website/translated_docs/ja/Concepts/dt_boolean.md @@ -1,46 +1,46 @@ --- id: boolean -title: ブール +title: Boolean --- -ブールのフィールド、変数、式は、true(真)またはfalse(偽)のいずれかになります。 +A boolean field, variable or expression can be either TRUE or FALSE. -## ブール関数 +## Boolean functions -4Dにはブール演算に使用することのできる、ブール関数があります: `True`, `False`, `Not`。 詳細については、これらのコマンドの説明を参照ください。 +4D provides the Boolean functions `True`, `False`, and `Not` in the dedicated **Boolean** theme. For more information, see the descriptions of these commands -### 例題 +### Example -ボタンの値に基づいて、ブール変数に値を設定します。 myButton ボタンがクリックされたら myBoolean に true を、クリックされていなければ false を設定します。 ボタンがクリックされるとボタン変数の値は1になります。 +This example sets a Boolean variable based on the value of a button. It returns True in myBoolean if the myButton button was clicked and False if the button was not clicked. When a button is clicked, the button variable is set to 1. ```4d - If(myButton=1) // ボタンがクリックされたら - myBoolean:=True // myBoolean を true に設定 - Else // ボタンがクリックされていなければ - myBoolean:=False // myBoolean を false に設定 + If(myButton=1) //If the button was clicked + myBoolean:=True //myBoolean is set to True + Else //If the button was not clicked, + myBoolean:=False //myBoolean is set to False End if ``` -上のコードは以下のように一行で書くこともできます。 +The previous example can be simplified into one line. ```4d myBoolean:=(myButton=1) ``` -## 論理演算子 +## Logical operators -4Dは、ブール式に対して機能する次の論理演算子をサポートしています: 論理積 (AND) と論理和 (OR)。 論理積 (AND) は両方の式が true である場合に true を返します。 論理和 (OR) は少なくとも一方の式が true の時に true を返します。 次の表に、論理演算子を示します: +4D supports two logical operators that work on Boolean expressions: conjunction (AND) and inclusive disjunction (OR). A logical AND returns TRUE if both expressions are TRUE. A logical OR returns TRUE if at least one of the expressions is TRUE. The following table shows the logical operators: -| 演算子 | シンタックス | 戻り値 | 式 | 結果 | -| --- | -------------- | --- | ---------------------------- | ----- | -| AND | ブール & ブール | ブール | ("A" = "A") & (15 # 3) | True | -| | | | ("A" = "B") & (15 # 3) | False | -| | | | ("A" = "B") & (15 = 3) | False | -| OR | ブール | ブール | ブール | ("A" = "A") | (15 # 3) | True | -| | | | ("A" = "B") | (15 # 3) | True | -| | | | ("A" = "B") | (15 = 3) | False | +| Operation | Syntax | Returns | Expression | Value | +| --------- | ----------------------- | ------- | ---------------------------- | ----- | +| AND | Boolean & Boolean | Boolean | ("A" = "A") & (15 # 3) | True | +| | | | ("A" = "B") & (15 # 3) | False | +| | | | ("A" = "B") & (15 = 3) | False | +| OR | Boolean | Boolean | Boolean | ("A" = "A") | (15 # 3) | True | +| | | | ("A" = "B") | (15 # 3) | True | +| | | | ("A" = "B") | (15 = 3) | False | -論理演算子 (AND) の真偽表を示します: +The following is the truth table for the AND logical operator: | Expr1 | Expr2 | Expr1 & Expr2 | | ----- | ----- | ------------- | @@ -49,7 +49,7 @@ myBoolean:=(myButton=1) | False | True | False | | False | False | False | -論理演算子 (OR) の真偽表を示します: +The following is the truth table for the OR logical operator: | Expr1 | Expr2 | Expr1 | Expr2 | | ----- | ----- | ------------------ | @@ -58,7 +58,7 @@ myBoolean:=(myButton=1) | False | True | True | | False | False | False | -**Tip:** 式1と式2の排他的結合子演算を実行する必要がある場合、次の評価式を使用します: +**Tip:** If you need to calculate the exclusive disjunction between Expr1 and Expr2, evaluate: ```4d (Expr1|Expr2) & Not(Expr1 & Expr2) diff --git a/website/translated_docs/ja/Concepts/dt_collection.md b/website/translated_docs/ja/Concepts/dt_collection.md index cc909f40e2514b..38d7c194d5b9cb 100644 --- a/website/translated_docs/ja/Concepts/dt_collection.md +++ b/website/translated_docs/ja/Concepts/dt_collection.md @@ -1,35 +1,35 @@ --- id: collection -title: コレクション +title: Collection --- -コレクションとは、類似または混在した型 (テキスト、数値、日付、オブジェクト、ブール、コレクション、null) の値が順番に並べられたリストです。 +Collections are ordered lists of values of similar or mixed types (text, number, date, object, boolean, collection, or null). -コレクション型の変数を扱うには、オブジェクト記法を使用します ([オブジェクト記法の使用](Concepts/dt_object.md#オブジェクト記法の使用) 参照)。 +Collection type variables are managed using object notation (see [Syntax basics](Concepts/dt_object.md#syntax-basics)). -コレクション要素にアクセスするには、大カッコ内に要素番号を渡します: +To access a collection element, you need to pass the element number inside square brackets: ```4d collectionRef[expression] ``` -*expression* には正の整数を返す有効な 4D式であればどんなものでも渡すことができます。 例: +You can pass any valid 4D expression which returns a positive integer in *expression*. Examples: ```4d - myCollection[5] // コレクションの6番目の要素にアクセス + myCollection[5] //access to 6th element of the collection myCollection[$var] ``` -**注:** コレクション要素は0 番から始まるということに注意してください。 +**Warning:** Collection elements are numbered from 0. -コレクションの要素に値を代入したり、コレクション要素の値を取得したりすることができます: +You can assign a value to a collection element or get a collection element value: ```4d myCol[10]:="My new element" $myVar:=myCol[0] ``` -コレクションの最後の要素を超える要素番号 (インデックス) を指定した場合、コレクションは自動的にリサイズされ、途中のすべての値には null 値が割り当てられらます: +If you assign an element's index that surpasses the last existing element of the collection, the collection is automatically resized and all new intermediary elements are assigned a null value: ```4d var myCol : Collection @@ -40,56 +40,56 @@ collectionRef[expression] //myCol[4]=null ``` -## 初期化 +## Initialization -`New collection` コマンドを使うなどして、コレクションはあらかじめ初期化しておく必要があります。初期化しない場合、要素の取得や変更はシンタックスエラーとなります。 +Collections must have been initialized, for example using the `New collection` command, otherwise trying to read or modify their elements will generate a syntax error. -例: +Example: ```4d var $colVar : Collection //creation of collection type 4D variable $colVar:=New collection //initialization of the collection and assignment to the 4D variable ``` -### 通常コレクションと共有コレクション +### Regular or shared collection -二種類のコレクションを作成することができます: +You can create two types of collections: -- [`New collection`](API/collectionClass.md#new-collection) コマンドを使用して作成する通常 (非共有) コレクション。 通常のコレクションは特別なアクセスコントロールをせずに編集可能ですが、プロセス間で共有することはできません。 -- [`New shared collection`](API/collectionClass.md#new-shared-collection) コマンドを使用して作成する共有コレクション。 共有コレクションはプロセス間 (プリエンティブ・スレッド含む) で共有可能なコレクションです。 共有コレクションへのアクセスは [`Use...End use`](Concepts/shared.md#useend-use) 構造によって管理されています。 +- regular (non-shared) collections, using the [`New collection`](API/collectionClass.md#new-collection) command. These collections can be edited without any specific access control but cannot be shared between processes. +- shared collections, using the [`New shared collection`](API/collectionClass.md#new-shared-collection) command. These collections can be shared between processes, including preemptive threads. Access to these collections is controlled by [`Use...End use`](Concepts/shared.md#useend-use) structures. -詳細な情報については、[共有オブジェクトと共有コレクション](Concepts/shared.md) を参照ください。 +For more information, refer to the [Shared objects and collections](Concepts/shared.md) section. -## コレクション関数 +## Collection functions -4D コレクションへの参照は、コレクションの *メンバー関数* と呼ばれる特別なクラス関数を利用することができます。 コレクション関数は [クラス API リファレンス](API/collectionClass.md) にまとめられています。 +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. -たとえば: +For example: ```4d -$newCol:=$col.copy() // $col を $newCol にディープ・コピー -$col.push(10;100) // 10 と 100 をコレクションに追加 +$newCol:=$col.copy() //deep copy of $col to $newCol +$col.push(10;100) //add 10 and 100 to the collection ``` -一部の関数は元のコレクションを変更して返すので、つぎのように連続して呼び出すことが可能です: +Some functions return the original collection after modification, so that you can run the calls in a sequence: ```4d $col:=New collection(5;20) - $col2:=$col.push(10;100).sort() // $col2=[5,10,20,100] + $col2:=$col.push(10;100).sort() //$col2=[5,10,20,100] ``` -### propertyPath 引数 +### propertyPath parameter -いくつかのコレクション関数は引数として _propertyPath_ を受け入れます。 この引数は以下のように用いることができます: +Several functions accept a _propertyPath_ as parameter. This parameter stands for: -- オブジェクトプロパティ名、 例えば "lastName" -- オブジェクトプロパティパス (ドット文字で繋げられたサブプロパティの階層シーケンスなど)。例: "employee.children.firstName" +- either an object property name, for example "lastName" +- or an object property path, i.e. a hierarchical sequence of sub-properties linked with dot characters, for example "employee.children.firstName". -**警告:** 関数に propertyPath 引数を渡す場合、そのプロパティ名には "." (ドット)、"[ ]" (大カッコ)、あるいは " " (スペース) を使えません。これらを使用するとパスを正しく解析できなくなります: +**Warning:** When using functions and propertyPath parameters, you cannot use ".", "[ ]", or spaces in property names since it will prevent 4D from correctly parsing the path: ```4d - $vmin:=$col.min("My.special.property") // undefined - $vmin:=$col.min(["My.special.property"]) // エラー + $vmin:=$col.min("My.special.property") //undefined + $vmin:=$col.min(["My.special.property"]) //error ``` \ No newline at end of file diff --git a/website/translated_docs/ja/Concepts/dt_date.md b/website/translated_docs/ja/Concepts/dt_date.md index f1247cc668ff27..8e6aa46d6587a5 100644 --- a/website/translated_docs/ja/Concepts/dt_date.md +++ b/website/translated_docs/ja/Concepts/dt_date.md @@ -1,17 +1,17 @@ --- id: date -title: 日付 +title: Date --- -日付フィールド、変数、式として認識できる範囲は、100/1/1 から 32,767/12/31 までです。(日本語版の 4D を使用した場合、日付の順序は年/月/日の順になります。) +A Date field, variable or expression can be in the range of 1/1/100 to 12/31/32,767. -C_DATE によって宣言された日付は 32767年までの範囲に対応していますが、システムを経由する処理によっては上限にさらなる制限が課せられます。 +Although the representation mode for dates by can work with dates up to the year 32 767, certain operations passing through the system impose a lower limit. -**注:** 4D ランゲージリファレンスでは、コマンド説明における日付引数はとくに明記されていない限り、「日付」と表記されています。 +**Note:** In the 4D Language Reference manual, Date parameters in command descriptions are denoted as Date, except when marked otherwise. -## 日付リテラル +## Date literals -日付リテラル定数は、エクスクラメーションマーク (! ... !) で囲んで表します。 日付は ISOフォーマット (!YYYY-MM-DD!) を使って記述します。 下記に、日付定数の例を示します: +A date literal constant is enclosed by exclamation marks (!…!). A date must be structured using the ISO format (!YYYY-MM-DD!). Here are some examples of date constants: ```4d !1976-01-01! @@ -19,31 +19,31 @@ C_DATE によって宣言された日付は 32767年までの範囲に対応し !2015-12-31! ``` -空の日付は、 _!00-00-00!_ のように指定します。 - -**Tip:** メソッドエディターでは空の日付を入力するためのショートカットが提供されています。 空の日付を入力するには、エクスクラメーションマーク (!) の入力後に Enterキーを押します。 - -**注:** - -- 互換性の理由から、4D は二桁の年次の入力を受け付けます。 数字が 30以上の場合は 20世紀 (1900年代)、30未満の場合は 21世紀 (2000年代) であると認識します (ただしデフォルト設定が `SET DEFAULT CENTURY` コマンドを使用して変更されていない場合に限ります)。 -- "地域特有のシステム設定を使う" オプション ([メソッドページ](https://doc.4d.com/4Dv18/4D/18/Methods-Page.300-4575690.ja.html) 参照) にチェックがされている場合、システムで定義されている日付フォーマットを使用する必要があります。 一般的に、US環境においては、日付は月/日/年の形式で入力され、値はスラッシュ "/" で区切られます。 - -## 日付演算子 - -| 演算子 | シンタックス | 戻り値 | 式 | 結果 | -| ----- | ---------- | --- | ---------------------------- | ------------ | -| 日付の差 | 日付 - 日付 | 数値 | !2017-01-20! - !2017-01-01! | 19 | -| 日付の加算 | 日付 + 数値 | 日付 | !2017-01-20! + 9 | !2017-01-29! | -| 日付の減算 | 日付 - 数値 | 日付 | !2017-01-20! - 9 | !2017-01-11! | -| 等しい | 日付 = 日付 | ブール | !2017-01-01! =!2017-01-01! | True | -| | | | !2017-01-20! = !2017-01-01! | False | -| 異なる | 日付 # 日付 | ブール | !2017-01-20! # !2017-01-01! | True | -| | | | !2017-01-20! # !2017-01-20! | False | -| 大きい | 日付 > 日付 | ブール | !2017-01-20! > !2017-01-01! | True | -| | | | !2017-01-20! > !2017-01-20! | False | -| 小さい | 日付 < 日付 | ブール | !2017-01-01! < !2017-01-20! | True | -| | | | !2017-01-20! < !2017-01-20! | False | -| 以上 | 日付 >= 日付 | ブール | !2017-01-20! >=!2017-01-01! | True | -| | | | !2017-01-01!>=!2017-01-20! | False | -| 以下 | 日付 \<= 日付 | ブール | !2017-01-01!\<=!2017-01-20! | True | -| | | | !2017-01-20!\<=!2017-01-01! | False | +A null date is specified by _!00-00-00!_. + +**Tip:** The Method Editor includes a shortcut for entering a null date. To type a null date, enter the exclamation (!) character and press Enter. + +**Notes:** + +- For compatibility reasons, 4D accepts two-digit years to be entered. A two-digit year is assumed to be in the 20th or 21st century based on whether it is greater or less than 30, unless this default setting has been changed using the `SET DEFAULT CENTURY` command. +- If you have checked the "Use regional system settings" option (see Methods Page), you must use the date format defined in your system. Generally, in a US environment, dates are entered in the form month/day/year, with a slash "/" separating the values. + +## Date operators + +| Operation | Syntax | Returns | Expression | Value | +| ------------------------ | -------------- | ------- | ---------------------------- | ------------ | +| Date difference | Date – Date | Number | !2017-01-20! - !2017-01-01! | 19 | +| Day addition | Date + Number | Date | !2017-01-20! + 9 | !2017-01-29! | +| Day subtraction | Date – Number | Date | !2017-01-20! - 9 | !2017-01-11! | +| Equality | Date = Date | Boolean | !2017-01-01! =!2017-01-01! | True | +| | | | !2017-01-20! = !2017-01-01! | False | +| Inequality | Date # Date | Boolean | !2017-01-20! # !2017-01-01! | True | +| | | | !2017-01-20! # !2017-01-20! | False | +| Greater than | Date > Date | Boolean | !2017-01-20! > !2017-01-01! | True | +| | | | !2017-01-20! > !2017-01-20! | False | +| Less than | Date < Date | Boolean | !2017-01-01! < !2017-01-20! | True | +| | | | !2017-01-20! < !2017-01-20! | False | +| Greater than or equal to | Date >= Date | Boolean | !2017-01-20! >=!2017-01-01! | True | +| | | | !2017-01-01!>=!2017-01-20! | False | +| Less than or equal to | Date \<= Date | Boolean | !2017-01-01!\<=!2017-01-20! | True | +| | | | !2017-01-20!\<=!2017-01-01! | False | diff --git a/website/translated_docs/ja/Concepts/dt_null_undefined.md b/website/translated_docs/ja/Concepts/dt_null_undefined.md index c55f08e4942d6e..e68c37206daaa5 100644 --- a/website/translated_docs/ja/Concepts/dt_null_undefined.md +++ b/website/translated_docs/ja/Concepts/dt_null_undefined.md @@ -1,27 +1,27 @@ --- id: null-undefined -title: Null と 未定義 +title: Null and Undefined --- -Null および未定義は、式の値が未知のケースを扱うデータ型です。 +Null and Undefined are data types that handle cases where the value of an expression is not known. ## Null -Null は **null** の値のみをとることのできる特殊なデータタイプです。 この値は、値を持たない式によって返されます。 +Null is a special data type with only one possible value: **null**. This value is returned by an expression that does not contain any value. -4D ランゲージやオブジェクトフィールド属性においては、`Null` 関数を使ってnull値を扱います。 この関数をつぎの式と組み合わせて使うことで、null値の設定や比較をおこなうことができます: +In the 4D language and for object field attributes, null values are managed through the `Null` function. This function can be used with the following expressions for setting or comparing the null value: -- オブジェクトの属性 -- コレクションの要素 -- オブジェクト型、コレクション型、ポインター型、ピクチャー型、バリアント型の変数 +- object attributes +- collection elements +- variables of the object, collection, pointer, picture, or variant type. -## 未定義 +## Undefined -未定義 (undefined) は、実際にはデータタイプではありません。 未定義は、まだ定義されていない変数を示します。 関数 (結果を返すプロジェクトメソッド) は、メソッド内で戻り値 ($0) に未定義式が代入されている場合、未定義値を返すことがあります。未定義式とは、未定義の変数を一つ以上使っている式のことです。 フィールドは、未定義にはできません (フィールドの場合、`Undefined` コマンドは常に False を返します)。 バリアント型変数は **undefined** がデフォルト値となっています。 +Undefined is not actually a data type. It denotes a variable that has not yet been defined. A function (a project method that returns a result) can return an undefined value if, within the method, the function result ($0) is assigned an undefined expression (an expression calculated with at least one undefined variable). A field cannot be undefined (the `Undefined` command always returns False for a field). A variant variable has **undefined** as default value. -## 例題 +## Examples -オブジェクトプロパティを対象に、`Undefined` および `Null` コマンドを使用した場合の結果の例です: +Here are the different results of the `Undefined` command as well as the `Null` command with object properties, depending on the context: ```4d C_OBJECT($vEmp) @@ -29,12 +29,12 @@ $vEmp:=New object $vEmp.name:="Smith" $vEmp.children:=Null -$undefined:=Undefined($vEmp.name) // false -$null:=($vEmp.name=Null) //false +$undefined:=Undefined($vEmp.name) // False +$null:=($vEmp.name=Null) //False -$undefined:=Undefined($vEmp.children) // false -$null:=($vEmp.children=Null) //true +$undefined:=Undefined($vEmp.children) // False +$null:=($vEmp.children=Null) //True -$undefined:=Undefined($vEmp.parent) // true -$null:=($vEmp.parent=Null) //true +$undefined:=Undefined($vEmp.parent) // True +$null:=($vEmp.parent=Null) //True ``` diff --git a/website/translated_docs/ja/Concepts/dt_number.md b/website/translated_docs/ja/Concepts/dt_number.md index 05724d14541126..bc06230b8a7019 100644 --- a/website/translated_docs/ja/Concepts/dt_number.md +++ b/website/translated_docs/ja/Concepts/dt_number.md @@ -1,24 +1,24 @@ --- id: number -title: 数値 (実数、倍長整数、整数) +title: Number (Real, Longint, Integer) --- -数値とは、以下を示す総称です: +Number is a generic term that stands for: -- 実数のフィールド、変数、または式。 実数データタイプの範囲は、±1.7e±308 (有効数字13桁) です。 -- 倍長整数のフィールド、変数、または式。 倍長整数 (4バイト整数) データタイプの範囲は、-2^31..(2^31)-1です。 -- 整数のフィールド、変数、または式。 整数 (2バイト整数) データタイプの範囲は、-32,768..32,767 (2^15..(2^15)-1)です。 +- Real field, variable or expression. The range for the Real data type is ±1.7e±308 (13 significant digits). +- Long Integer field, variable or expression. The range for the Long Integer data type (4-byte Integer) is -2^31..(2^31)-1. +- Integer field, array or expression. The range for the Integer data type (2-byte Integer) is -32,768..32,767 (2^15..(2^15)-1). -**注:** 整数フィールドの値は、4D ランゲージで使用される際には自動的に倍長整数に変換されます。 +**Note:** Integer field values are automatically converted in Long integers when used in the 4D Language. -数値データタイプは、異なる数値データタイプに代入することができます。このとき、4Dが必要に応じて変換、切り捨て、丸め処理をおこないます。 ただし、値が範囲外の場合には、変換は正しい値を返しません。 数値データタイプは式の中に混在させて使用することができます。 +You can assign any Number data type to another; 4D does the conversion, truncating or rounding if necessary. However, when values are out of range, the conversion will not return a valid value. You can mix Number data types in expressions. -**注:** 4D ランゲージリファレンスでは、実際のデータタイプに関わらず、コマンド説明における実数、整数、倍長整数の引数はとくに明記されていない限り、数値と表記されています。 +**Note:** In the 4D Language Reference manual, no matter the actual data type, the Real, Integer, and Long Integer parameters in command descriptions are denoted as number, except when marked otherwise. -## 数値リテラル +## Number literals -数値リテラル定数は、実数として記述します。 下記に数値定数の例をいくつか示します: +A numeric literal constant is written as a real number. Here are some examples of numeric constants: ```4d 27 @@ -26,9 +26,9 @@ title: 数値 (実数、倍長整数、整数) 0.0076 ``` -> デフォルトの小数点はシステム言語に関係なくピリオド (.) です。 "地域特有のシステム設定を使う" オプション ([メソッドページ](https://doc.4d.com/4Dv18/4D/18/Methods-Page.300-4575690.ja.html) 参照) にチェックがされている場合、システムで定義されている小数点を使用する必要があります。 +> The default decimal separator is a period (.), regardless of the system language. If you have checked the "Use regional system settings" option in the Methods Page of the Preferences, you must use the separator defined in your system. -負の数値は、マイナス記号 (-) を付けて指定します。 たとえば: +Negative numbers are specified with the minus sign (-). For example: ```4d -27 @@ -36,107 +36,107 @@ title: 数値 (実数、倍長整数、整数) -0.0076 ``` -## 数値演算子 - -| 演算子 | シンタックス | 戻り値 | 式 | 結果 | -| --------- | -------- | --- | -------- | ----- | -| 加算 (足し算) | 数値 + 数値 | 数値 | 2 + 3 | 5 | -| 減算 (引き算) | 数値 - 数値 | 数値 | 3 – 2 | 1 | -| 乗算 (かけ算) | 数値 * 数値 | 数値 | 5 * 2 | 10 | -| 除算 (割り算) | 数値 / 数値 | 数値 | 5 / 2 | 2.5 | -| 倍長整数を返す除算 | 数値 \ 数値 | 数値 | 5 \ 2 | 2 | -| モジューロ | 数値 % 数値 | 数値 | 5 % 2 | 1 | -| 指数 | 数値 ^ 数値 | 数値 | 2 ^ 3 | 8 | -| 等しい | 数値 = 数値 | ブール | 10 = 10 | True | -| | | | 10 = 11 | False | -| 異なる | 数値 # 数値 | ブール | 10 # 11 | True | -| | | | 10 # 10 | False | -| 大きい | 数値 > 数値 | ブール | 11 > 10 | True | -| | | | 10 > 11 | False | -| 小さい | 数値 < 数値 | ブール | 10 < 11 | True | -| | | | 11 < 10 | False | -| 以上 | 数値 >= 数値 | ブール | 11 >= 10 | True | -| | | | 10 >= 11 | False | -| 以下 | 数値 <= 数値 | ブール | 10 <= 11 | True | -| | | | 11 <= 10 | False | - -モジューロ演算子 % は最初の数値を 2番目の数値で除算し、その余りの整数を返します。 次に例を示します: - -- 10 % 2は、0を返します。10 は 2 で割り切れるからです。 -- 10 % 3は、1を返します。余りが 1 だからです。 -- 10.5 % 2は、0を返します。余りが整数ではない (0.25) からです。 - -**警告:** -- モジューロ演算子 % は倍長整数の範囲内 (-2^31 から (2^31)-1 まで) の数値に対して有効な値を返します。 この範囲外の数値のモジューロ演算を実行するには、`Mod` コマンドを使用します。 -- 倍長整数を返す除算演算子 \ は、整数値の有効値を返します。 - -### 優先順位 - -式を評価する順番を優先順位と呼びます。 4D における優先順位は厳密に左から右で、代数的順序は採用されていません。 たとえば: +## Number operators + +| Operation | Syntax | Returns | Expression | Value | +| ------------------------ | ---------------- | ------- | ---------- | ----- | +| Addition | Number + Number | Number | 2 + 3 | 5 | +| Subtraction | Number - Number | Number | 3 – 2 | 1 | +| Multiplication | Number * Number | Number | 5 * 2 | 10 | +| Division | Number / Number | Number | 5 / 2 | 2.5 | +| Longint division | Number \ Number | Number | 5 \ 2 | 2 | +| Modulo | Number % Number | Number | 5 % 2 | 1 | +| Exponentiation | Number ^ Number | Number | 2 ^ 3 | 8 | +| Equality | Number = Number | Boolean | 10 = 10 | True | +| | | | 10 = 11 | False | +| Inequality | Number # Number | Boolean | 10 #11 | True | +| | | | 10 # 10 | False | +| Greater than | Number > Number | Boolean | 11 > 10 | True | +| | | | 10 > 11 | False | +| Less than | Number < Number | Boolean | 10 < 11 | True | +| | | | 11 < 10 | False | +| Greater than or equal to | Number >= Number | Boolean | 11 >= 10 | True | +| | | | 10 >= 11 | False | +| Less than or equal to | Number <= Number | Boolean | 10 <= 11 | True | +| | | | 11 <= 10 | False | + +The modulo operator % divides the first number by the second number and returns a whole number remainder. Here are some examples: + +- 10 % 2 returns 0 because 10 is evenly divided by 2. +- 10 % 3 returns 1 because the remainder is 1. +- 10.5 % 2 returns 0 because the remainder is not a whole number. + +**WARNING:** +- The modulo operator % returns significant values with numbers that are in the Long Integer range (from minus 2^31 to 2^31 minus one). To calculate the modulo with numbers outside of this range, use the `Mod` command. +- The longint division operator \ returns significant values with integer numbers only. + +### Precedence + +The order in which an expression is evaluated is called precedence. 4D has a strict left-to-right precedence, in which algebraic order is not observed. For example: ```4d 3+4*5 ``` -これは 35 を返します。最初に式 3+4 の結果 7 を求め、それに 5 を乗じるので、結果は 35 になります。 +returns 35, because the expression is evaluated as 3 + 4, yielding 7, which is then multiplied by 5, with the final result of 35. -左から右の優先順位を変更するには、必ずカッコを使用します。 たとえば: +To override the left-to-right precedence, you MUST use parentheses. For example: ```4d 3+(4*5) ``` -この式は、23 を返します。カッコがあるため、最初に式 (4*5) の結果 20 を求め、 それに 3 を加えて、結果は 23 になります。 +returns 23 because the expression (4 * 5) is evaluated first, because of the parentheses. The result is 20, which is then added to 3 for the final result of 23. -カッコは、他のカッコの組の内側にネストすることができます。 式の評価が正しくおこなわれるように、必ず各左カッコに対応する右カッコを指定してください。 カッコの不足または誤用は、予測できない結果や、式の無効化につながります。 またコンパイルする場合は、左カッコと右カッコは同じ数でなければなりません。組になっていないカッコはシンタックスエラーとして検出されます。 +Parentheses can be nested inside other sets of parentheses. Be sure that each left parenthesis has a matching right parenthesis to ensure proper evaluation of expressions. Lack of, or incorrect use of parentheses can cause unexpected results or invalid expressions. Furthermore, if you intend to compile your applications, you must have matching parentheses—the compiler detects a missing parenthesis as a syntax error. -## ビットワイズ演算子 +## Bitwise operators -ビットワイズ演算子は、**倍長整数** 式や値に対して演算をおこないます。 +The bitwise operators operates on **Long Integer** expressions or values. -> ビットワイズ演算子に整数値または実数値を渡すと、4Dは値を倍長整数値として評価してから、ビットワイズ演算子を使用した式を計算します。 +> If you pass an Integer or a Real value to a bitwise operator, 4D evaluates the value as a Long Integer value before calculating the expression that uses the bitwise operator. -ビットワイズ演算子を使用する場合、倍長整数値を32ビットの配列と考える必要があります。 これらのビットには、右から左に0~31の番号が付けられます。 +While using the bitwise operators, you must think about a Long Integer value as an array of 32 bits. The bits are numbered from 0 to 31, from right to left. -それぞれのビットは0か1なので、倍長整数値は32のブール値を格納できる値と考えることもできます。 1に等しいビットは **true**、0に等しいビットは **false** を意味します。 +Because each bit can equal 0 or 1, you can also think about a Long Integer value as a value where you can store 32 Boolean values. A bit equal to 1 means **True** and a bit equal to 0 means **False**. -ビットワイズ演算子を使用する式は倍長整数値を返します。Bit Test 演算子の場合、式は例外的にブール値を返します。 次の表にビットワイズ演算子とそのシンタックスを示します: +An expression that uses a bitwise operator returns a Long Integer value, except for the Bit Test operator, where the expression returns a Boolean value. The following table lists the bitwise operators and their syntax: -| 演算子 | 演算子 | シンタックス | 戻り値 | -| ---------------------- | --------- | ------------------- | ---------------- | -| Bitwise AND | & | Long & Long | Long | -| Bitwise OR (inclusive) | | | Long | Long | Long | -| Bitwise OR (exclusive) | \^| | Long \^| Long | Long | -| Left Bit Shift | << | Long << Long | Long (注記1 参照) | -| Right Bit Shift | >> | Long >> Long | Long (注記1 参照) | -| Bit Set | ?+ | Long ?+ Long | Long (注記2 参照) | -| Bit Clear | ?- | Long ?- Long | Long (注記2 参照) | -| Bit Test | ?? | Long ?? Long | Boolean (注記2 参照) | +| Operation | Operator | Syntax | Returns | +| ---------------------- | --------- | ------------------- | -------------------- | +| Bitwise AND | & | Long & Long | Long | +| Bitwise OR (inclusive) | | | Long | Long | Long | +| Bitwise OR (exclusive) | \^| | Long \^| Long | Long | +| Left Bit Shift | << | Long << Long | Long (see note 1) | +| Right Bit Shift | >> | Long >> Long | Long (see note 1) | +| Bit Set | ?+ | Long ?+ Long | Long (see note 2) | +| Bit Clear | ?- | Long ?- Long | Long (see note 2) | +| Bit Test | ?? | Long ?? Long | Boolean (see note 2) | -#### 注記 +#### Notes -1. `Left Bit Shift` および `Right Bit Shift` 演算では、2番目のオペランドは、結果値において1番目のオペランドのビットがシフトされるビット数を示します。 したがって、この2番目のオペランドは、0~31の間でなければなりません。 0ビットシフトするとその値がそのまま返されます。また、31ビットより多くシフトするとすべてのビットがなくなるので、0x00000000が返されます。 それ以外の値を2番目のオペランドとして渡した場合、結果は意味のない値になります。 -2. `Bit Set`、`Bit Clear`、`Bit Test` 演算では、2番目のオペランドは、作用の対象となるビット番号を示します。 したがって、この2番目のオペランドは0 ~ 31の間です。そうでない場合、式の結果は意味のないものになります。 +1. For the `Left Bit Shift` and `Right Bit Shift` operations, the second operand indicates the number of positions by which the bits of the first operand will be shifted in the resulting value. Therefore, this second operand should be between 0 and 31. Note however, that shifting by 0 returns an unchanged value and shifting by more than 31 bits returns 0x00000000 because all the bits are lost. If you pass another value as second operand, the result is non-significant. +2. For the `Bit Set`, `Bit Clear` and `Bit Test` operations , the second operand indicates the number of the bit on which to act. Therefore, this second operand must be between 0 and 31; otherwise, the result of the expression is non-significant. -次の表は、ビットワイズ演算子とその効果を示します: +The following table lists the bitwise operators and their effects: -| 演算子 | 説明 | -| ---------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| Bitwise AND | それぞれの結果ビットは2つのオペランドのビットの論理ANDです。

    下記は、論理ANDの真偽表です:

  • 1 & 1 --> 1
  • 0 & 1 --> 0
  • 1 & 0 --> 0
  • 0 & 0 --> 0

    すなわち、両オペランドのビットが 1 の場合、結果ビットが 1 になり、その他の場合は結果ビットが 0 になります。 | -| Bitwise OR (inclusive) | それぞれの結果ビットは2つのオペランドのビットの論理ORです。

    下記は、論理ORの真偽表です:

  • 1 | 1 --> 1
  • 0 | 1 --> 1
  • 1 | 0 --> 1
  • 0 | 0 --> 0

    すなわち、いずれかのオペランドのビットが 1 の場合、結果ビットが 1 になり、その他の場合は結果ビットが 0 になります。 | -| Bitwise OR (exclusive) | それぞれの結果ビットは2つのオペランドのビットの排他的論理ORです。

    下記は、排他的論理ORの真偽表です:

  • 1 \^| 1 --> 0
  • 0 \^| 1 --> 1
  • 1 \^| 0 --> 1
  • 0 \^| 0 --> 0

    すなわち、オペランドのビットのいずれか一方だけが 1 の場合、結果ビットが 1 になり、その他の場合は結果ビットが 0 になります。 | -| Left Bit Shift | 最初のオペランド値が結果値に設定され、次に結果ビットが2番目のオペランドで示されたビット数だけ左にシフトします。 左側のビットがなくなり、右側の新しいビットは0に設定されます。

    **注記:** 正の数だけを考えると、Nビット左にシフトすることは、2^Nを掛けることと同じです。 | -| Right Bit Shift | 最初のオペランド値が結果値に設定され、次に結果ビットが2番目のオペランドで示されたビット数だけ右にシフトします。 右側のビットがなくなり、左側の新しいビットは0に設定されます。

    **注記:** 正の数だけを考えると、Nビット右にシフトすることは、2^Nで割ることと同じです。 | -| Bit Set | 最初のオペランド値が結果値に設定され、次に結果ビットのうち2番目のオペランドで示されたビットが1に設定されます。 他のビットはそのままです。 | -| Bit Clear | 最初のオペランド値が結果値に設定され、次に結果ビットのうち2番目のオペランドで示されたビットが0に設定されます。 他のビットはそのままです。 | -| Bit Test | 最初のオペランドのうち、2番目のビットで示されたビットが1の場合、trueが返されます。 最初のオペランドのうち、2番目のビットで示されたビットが0の場合、falseが返されます。 | +| Operation | Description | +| ---------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| Bitwise AND | Each resulting bit is the logical AND of the bits in the two operands.

    Here is the logical AND table:

  • 1 & 1 --> 1
  • 0 & 1 --> 0
  • 1 & 0 --> 0
  • 0 & 0 --> 0

    In other words, the resulting bit is 1 if the two operand bits are 1; otherwise the resulting bit is 0. | +| Bitwise OR (inclusive) | Each resulting bit is the logical OR of the bits in the two operands.

    Here is the logical OR table:

  • 1 | 1 --> 1
  • 0 | 1 --> 1
  • 1 | 0 --> 1
  • 0 | 0 --> 0

    In other words, the resulting bit is 1 if at least one of the two operand bits is 1; otherwise the resulting bit is 0. | +| Bitwise OR (exclusive) | Each resulting bit is the logical XOR of the bits in the two operands.

    Here is the logical XOR table:

  • 1 \^| 1 --> 0
  • 0 \^| 1 --> 1
  • 1 \^| 0 --> 1
  • 0 \^| 0 --> 0

    In other words, the resulting bit is 1 if only one of the two operand bits is 1; otherwise the resulting bit is 0. | +| Left Bit Shift | The resulting value is set to the first operand value, then the resulting bits are shifted to the left by the number of positions indicated by the second operand. The bits on the left are lost and the new bits on the right are set to 0.

    **Note:** Taking into account only positive values, shifting to the left by N bits is the same as multiplying by 2^N. | +| Right Bit Shift | The resulting value is set to the first operand value, then the resulting bits are shifted to the right by the number of position indicated by the second operand. The bits on the right are lost and the new bits on the left are set to 0.

    **Note:** Taking into account only positive values, shifting to the right by N bits is the same as dividing by 2^N. | +| Bit Set | The resulting value is set to the first operand value, then the resulting bit, whose number is indicated by the second operand, is set to 1. The other bits are left unchanged. | +| Bit Clear | The resulting value is set to the first operand value, then the resulting bit, whose number is indicated by the second operand, is set to 0. The other bits are left unchanged. | +| Bit Test | Returns True if, in the first operand, the bit whose number is indicated by the second operand is equal to 1. Returns False if, in the first operand, the bit whose number is indicated by the second operand is equal to 0. | -### 例題 +### Examples -| 演算子 | 例題 | 戻り値 | +| Operation | Example | Result | | ---------------------- | ------------------------------- | ---------- | | Bitwise AND | 0x0000FFFF & 0xFF00FF00 | 0x0000FF00 | | Bitwise OR (inclusive) | 0x0000FFFF | 0xFF00FF00 | 0xFF00FFFF | diff --git a/website/translated_docs/ja/Concepts/dt_object.md b/website/translated_docs/ja/Concepts/dt_object.md index ed95f9c9aa8d94..d9bde1947c5c1c 100644 --- a/website/translated_docs/ja/Concepts/dt_object.md +++ b/website/translated_docs/ja/Concepts/dt_object.md @@ -1,101 +1,101 @@ --- id: object -title: オブジェクト +title: Object --- -オブジェクト型の変数・フィールド・式にはさまざまなデータを格納することができます。 4D のネイティブなオブジェクトの構造は、よくある「プロパティ/値」(または「属性/値」) というペア (連想配列) に基づいています。 これらオブジェクトの記法は JSON をもとにしていますが、完全に同じというわけではありません。 +Variables, fields or expressions of the Object type can contain various types of data. The structure of "native" 4D objects is based on the classic principle of "property/value" pairs. The syntax of these objects is based on JSON notation: -- プロパティ名は必ずテキストで表現されます。 +- A property name is always a text, for example "Name". -- プロパティ値は以下のどれかの型で表現されます: - - 数値 (実数、整数、等) +- A property value can be of the following type: + - number (Real, Integer, etc.) - text - null - - ブール - - ポインター (`JSON Stringify` コマンドの使用、またはコピーの際に評価されます) - - 日付 (日付型あるいは ISO日付フォーマット文字列) - - オブジェクト (オブジェクトは入れ子にすることができます) - - ピクチャー (*) + - Boolean + - pointer (stored as such, evaluated using the `JSON Stringify` command or when copying), + - date (date type or ISO date format string) + - object (objects can be nested on several levels) + - picture(*) - collection -(*) デバッガー内でテキストとして表示したり、JSON へと書き出されたりした場合、ピクチャー型のオブジェクトプロパティは "[object Picture]" と表されます。 +(*)When exposed as text in the debugger or exported to JSON, picture object properties print "[object Picture]". -**警告:** 属性名は大文字と小文字を区別するという点に注意してください。 +**Warning:** Keep in mind that attribute names differentiate between upper and lower case. -オブジェクト型の変数・フィールド・式を操作するには **オブジェクト (ランゲージ)** テーマのコマンドを使用するか、オブジェクト記法 ([オブジェクト記法の使用](Concepts/dt_object.md#オブジェクト記法の使用) 参照)を用います。 オブジェクト型フィールドに対して処理をおこなうには `QUERY BY ATTRIBUTE`、`QUERY SELECTION BY ATTRIBUTE` や `ORDER BY ATTRIBUTE` など、クエリテーマの特定のコマンドも使用することができます。 +You manage Object type variables, fields or expressions using the commands available in the **Objects (Language)** theme or through the object notation (see [Syntax basics](Concepts/dt_object.md#syntax-basics)). 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. -オブジェクト記法を使ってアクセスされたそれぞれのプロパティ値は式とみなされます。 4D内で式が期待される場所であれば、どこでもこのような値を使用することができます: +Each property value accessed through the object notation is considered an expression. You can use such values wherever 4D expressions are expected: -- 4Dコード内。メソッド (メソッドエディター) に書いても、外部化(フォーミュラ、PROCESS 4D TAGS あるいは Web Server によって処理される 4D tags ファイル、4D Write Proドキュメントなど) しても使用可能です。 -- デバッガー及びランタイムエクスプローラーの式エリア内。 -- フォームエディターにおいて、フォームオブジェクトのプロパティリスト内。変数あるいは式フィールド内の他、様々なセレクションリストボックス及びカラムの式 (データソース、背景色、スタイル、フォントカラー等) において使用可能です。 +- in 4D code, either written in the methods (Method editor) or externalized (formulas, 4D tags files processed by PROCESS 4D TAGS or the Web Server, export files, 4D Write Pro documents...), +- 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). -## 初期化 +## Initialization -`New object` コマンドを使うなどして、オブジェクトはあらかじめ初期化しておく必要があります。初期化しない場合、プロパティ値の取得や変更はシンタックスエラーとなります。 +Objects must have been initialized, for example using the `New object` command, otherwise trying to read or modify their properties will generate a syntax error. -例: +Example: ```4d - C_OBJECT($obVar) // オブジェクト型の変数の作成 - $obVar:=New object // オブジェクトの初期化と変数への代入 + C_OBJECT($obVar) //creation of an object type 4D variable + $obVar:=New object //initialization of the object and assignment to the 4D variable ``` -### 通常オブジェクトと共有オブジェクト +### Regular or shared object -二種類のオブジェクトを作成することができます: +You can create two types of objects: -- `New object` コマンドを使用して作成する通常 (非共有) コレクション。 通常のオブジェクトは特別なアクセスコントロールをせずに編集可能ですが、プロセス間で共有することはできません。 -- `New shared object` コマンドを使用して作成する共有コレクション。 共有オブジェクトはプロセス間 (プリエンティブ・スレッド含む) で共有可能なオブジェクトです。 共有オブジェクトへのアクセスは `Use...End use` 構造によって管理されています。 詳細な情報については、[共有オブジェクトと共有コレクション](Concepts/shared.md) を参照ください。 +- regular (non-shared) objects, using the `New object` command. These objects can be edited without any specific access control but cannot be shared between processes. +- shared objects, using the `New shared object` command. These objects can be shared between processes, including preemptive threads. Access to these objects is controlled by `Use...End use` structures. For more information, refer to the [Shared objects and collections](Concepts/shared.md) section. -## オブジェクト記法の使用 +## Syntax basics -オブジェクト記法を使うと、トークンのチェーンを通してオブジェクトのプロパティ値にアクセスすることができます。 +Object notation can be used to access object property values through a chain of tokens. -### オブジェクトプロパティ +### Object properties -オブジェクト記法では、オブジェクトプロパティは二通りの方法でアクセスすることができます: +With object notation, object properties can be accessed in two ways: -- "ドット"記号を使用する方法: > object.propertyName +- using a "dot" symbol: > object.propertyName -例: +Example: ```4d employee.name:="Smith" ``` -- 大カッコ内の文字列を使用する方法: > object["propertyName"] +- using a string within square brackets: > object["propertyName"] -例: +Examples: ```4d $vName:=employee["name"] - // または: + //or also: $property:="name" $vName:=employee[$property] ``` -オブジェクトプロパティ値には、オブジェクトやコレクションも設定することが可能です。これらのサブプロパティにアクセスするため、オブジェクト記法では連続した字句を受け入れることができます: +Since an object property value can be an object or a collection, object notation accepts a sequence of symbols to access sub-properties, for example: ```4d $vAge:=employee.children[2].age ``` -オブジェクトを格納、あるいは返すあらゆるランゲージ要素に対してオブジェクト記法を使用できます。たとえば: +Object notation is available on any language element that can contains or returns an object, i.e: -- **オブジェクト** 自身 (変数、フィールド、オブジェクトプロパティ、オブジェクト配列、コレクション要素などに保存されているもの) 例: +- **Objects** themselves (stored in variables, fields, object properties, object arrays, or collection elements). Examples: ```4d - $age:=$myObjVar.employee.age // 変数 - $addr:=[Emp]data_obj.address // フィールド - $city:=$addr.city // オブジェクトプロパティ - $pop:=$aObjCountries{2}.population // オブジェクト配列 - $val:=$myCollection[3].subvalue // コレクション要素 + $age:=$myObjVar.employee.age //variable + $addr:=[Emp]data_obj.address //field + $city:=$addr.city //property of an object + $pop:=$aObjCountries{2}.population //object array + $val:=$myCollection[3].subvalue //collection element ``` -- オブジェクトを返す **4D コマンド** 例: +- **4D commands** that return objects. Example: ```4d $measures:=Get database measures.DB.tables ``` -- オブジェクトを返す **プロジェクトメソッド** 例: +- **Project methods** that return objects. Example: ```4d // MyMethod1 @@ -106,25 +106,25 @@ title: オブジェクト $result:=MyMethod1.a //10 ``` -- **コレクション** 例: +- **Collections** Example: ```4d - myColl.length // コレクションの長さ + myColl.length //size of the collection ``` -### ポインター +### Pointers -**注:** オブジェクトは常に参照として渡されるため、通常はポインターを使用する必要はありません。 オブジェクトを引数として渡す際、4D 内部では自動的にポインターに類似したメカニズムを使うことでメモリの消費を最小限に抑え、引数を編集して返すことを可能にします。 つまり、ポインターは必要ないということです。 それでもポインターを使用したい場合には、プロパティ値はポインターを通してアクセスすることができます。 +**Preliminary Note:** Since objects are always passed by reference, there is usually no need to use pointers. While just passing the object, internally 4D automatically uses a mechanism similar to a pointer, minimizing memory need and allowing you to modify the parameter and to return modifications. As a result, you should not need to use pointers. However, in case you want to use pointers, property values can be accessed through pointers. -ポインターを使ってオブジェクトプロパティにアクセスするには、直接オブジェクトを使用する場合と方法が似ていますが、"ドット" 記号は省略する必要があります。 +Using object notation with pointers is very similar to using object notation directly with objects, except that the "dot" symbol must be omitted. -- オブジェクト記法によるアクセス: +- Direct access: > pointerOnObject->propertyName -- 大カッコを使用する方法: +- Access by name: > pointerOnObject->["propertyName"] -例: +Example: ```4d C_OBJECT(vObj) @@ -135,49 +135,50 @@ title: オブジェクト x:=vPtr->a //x=10 ``` -### Null 値 +### Null value -オブジェクト記法を使用する場合、**null** 値は **Null** コマンドを通してサポートされています。 このコマンドを使用すると、null 値をオブジェクトプロパティやコレクション要素に割り当てたり、それらと比較したりすることができます。例: +When using the object notation, the **null** value is supported though the **Null** command. This command can be used to assign or compare the null value to object properties or collection elements, for example: ```4d myObject.address.zip:=Null If(myColl[2]=Null) ``` -詳細については、`Null` コマンドの説明を参照してください。 +For more information, please refer to the `Null` command description. -### 未定義の値 +### Undefined value -オブジェクトプロパティを評価した結果、未定義の値が生成されることがあります。 未定義の式を読み込んだ、または割り当てようとしたときに 4D は通常、エラーを生成します。 ただし以下の場合には生成されません: +Evaluating an object property can sometimes produce an undefined value. Typically when trying to read or assign undefined expressions, 4D will generate errors. This does not happen in the following cases: -- 未定義のオブジェクトやプロパティ値を読み込むと未定義 (undefined) が返されます。未定義の値を (配列を除く) 変数に割り当てることは、`CLEAR VARIABLE` コマンドを使うのと同じ効果があります: +- Reading a property of an undefined object or value returns undefined; assigning an undefined value to variables (except arrays) has the same effect as calling `CLEAR VARIABLE` with them: ```4d C_OBJECT($o) C_LONGINT($val) $val:=10 //$val=10 - $val:=$o.a // $o.a は未定義 (エラーなし) なため、この値を代入すると変数が初期化されます - // $val=0 + $val:=$o.a //$o.a is undefined (no error), and assigning this value clears the variable + //$val=0 ``` -- 未定義のコレクションの **length** プロパティは 0 を返します: +- Reading the **length** property of an undefined collection produces 0: ```4d - C_COLLECTION($c) // 変数は作成されたが、コレクションは未定義 $size:=$c.length // $size = 0 + C_COLLECTION($c) //variable created but no collection is defined + $size:=$c.length //$size = 0 ``` -- 未定義の値を引数としてプロジェクトメソッドに渡した場合、宣言された引数の型に応じて、0 あるいは "" (空の文字列) へと自動変換されます。 +- An undefined value passed as parameter to a project method is automatically converted to 0 or "" according to the declared parameter type. ```4d C_OBJECT($o) - mymethod($o.a) // 未定義の引数を渡すと + mymethod($o.a) //pass an undefined parameter - // mymethod メソッド内では - C_TEXT($1) // 引数の型はテキスト - // $1 の中身は"" + //In mymethod method + C_TEXT($1) //parameter type is text + // $1 contains "" ``` -- 条件式で、If あるいは Case of キーワードで未定義と評価された場合には、自動的にfalse へと変換されます: +- A condition expression is automatically converted to false when evaluating to undefined with the If and Case of keywords: ```4d C_OBJECT($o) @@ -188,95 +189,95 @@ title: オブジェクト End case ``` -- 未定義の値を既存のオブジェクトプロパティに代入した場合、その値は型に応じて初期化、あるいは消去されます: - - オブジェクト、コレクション、ポインター: Null - - ピクチャー: 空のピクチャー - - ブール: False - - 文字列: "" - - 数値: 0 - - 日付: "オブジェクトではISO日付フォーマットの代わりに日付型を使用する" 設定が有効化されている場合は !00-00-00!、それ以外の場合には "" - - 時間: 0 (ミリ秒単位) - - 未定義、Null: 変化なし +- Assigning an undefined value to an existing object property reinitializes or clears its value, depending on its type: + - Object, collection, pointer: Null + - Picture: Empty picture + - Boolean: False + - String: "" + - Number: 0 + - Date: !00-00-00! if "Use date type instead of ISO date format in objects" setting is enabled, otherwise "" + - Time: 0 (number of ms) + - Undefined, Null: no change ```4d C_OBJECT($o) $o:=New object("a";2) - $o.a:=$o.b // $o.a=0 + $o.a:=$o.b //$o.a=0 ``` -- 未定義の値を存在しないオブジェクトのプロパティへと代入した場合は、何も起こりません。 +- Assigning an undefined value to a non existing object property does nothing. -4Dコード内の式に対して特定の型であることが要求される場合、その式を適切な 4Dキャストコマンド (`String`, `Num`, `Date`, `Time`, `Bool`) で囲うことで、たとえ未定義に評価されたとしても正しい型を確実に得ることができます。 これらのコマンドは式が未定義と評価された場合に、指定された型の空の値を返します。 たとえば: +When expressions of a given type are expected in your 4D code, you can make sure they have the correct type even when evaluated to undefined by surrounding them with the appropriate 4D cast command: `String`, `Num`, `Date`, `Time`, `Bool`. These commands return an empty value of the specified type when the expression evaluates to undefined. For example: ```4d - $myString:=Lowercase(String($o.a.b)) // 未定義の場合でもコード内でエラーが起きないように - // 文字列の値が得られるようにします + $myString:=Lowercase(String($o.a.b)) //make sure you get a string value even if undefined + //to avoid errors in the code ``` -## オブジェクトプロパティ識別子 +## Object property identifiers -トークンメンバー名 (つまり、オブジェクト記法を使用してアクセスしたオブジェクトプロパティ名) には、[標準の 4Dオブジェクト名](identifiers.md) より厳格な規制があります。 プロパティ名は JavaScriptの字句文法に則ってなければなりません ([ECMA Script standard](https://www.ecma-international.org/ecma-262/5.1/#sec-7.6) 参照): +Token member names (i.e., object property names accessed using the object notation) are more restrictive than [standard 4D object names](identifiers.md). They must comply with JavaScript Identifier Grammar (see [ECMA Script standard](https://www.ecma-international.org/ecma-262/5.1/#sec-7.6)): -- 1文字目は、文字、アンダースコア(_)、あるいはドル記号 ($) でなければなりません。 -- その後の文字には、文字、数字、アンダースコア、またはドル記号を使用することができます (スペース文字は使用することはできません)。 -- 大文字・小文字は区別されます。 +- the first character must be a letter, an underscore (_), or a dollar sign ($), +- subsequent characters may be any letter, digit, an underscore or dollar sign (space characters are NOT allowed), +- they are case sensitive. -**注:** +**Note:** -- テーブルフィールドをコレクションインデックスとして使用すること (例: a.b[[Table1]Id] ) は許可されていません。 この場合には媒介として変数を使用する必要があります。 -- 大カッコでくくった文字列を使用してオブジェクト属性を作成すると、ECMAスクリプトのルールを無視することができます。 たとえば、`$o["My Att"]` という属性はスペースを含みますが、4D において有効です。 しかしながらこの場合、この属性に対してドット記法や自動補完機能を使用することは不可能です。 +- Using a table field as a collection index, for example a.b[[Table1]Id], is not allowed. You must use an intermediary variable. +- Creating object attributes using a string in square brackets allows you to override the ECMA Script rules. For example, the `$o["My Att"]` attribute is valid in 4D, despite the space. In this case, however, it will not be possible to use dot notation and autocomplete features with this attribute. -## 例題 +## Examples -オブジェクト記法を使用すると、オブジェクトを扱う際の 4Dコードを単純化することができます。 同時に、コマンドベースの記法も引き続き完全にサポートされています。 +Using object notation simplifies the 4D code while handling objects. Note however that the command-based notation is still fully supported. -- オブジェクトの読み書き (この例題ではオブジェクト記法とコマンド記法を比較します): +- Writing and reading objects (this example compares object notation and command notation): ```4d - // オブジェクト記法を使用 - C_OBJECT($myObj) // 4Dオブジェクト変数を宣言 - $myObj:=New object // オブジェクト作成し、変数に代入 + // Using the object notation + C_OBJECT($myObj) //declares a 4D variable object + $myObj:=New object //creates an object and assigns to the variable $myObj.age:=56 - $age:=$myObj.age // 56 + $age:=$myObj.age //56 - // コマンド記法を使用 - C_OBJECT($myObj2) // 4Dオブジェクト変数を宣言 - OB SET($myObj2;"age";42) // オブジェクトを作成し、ageプロパティを追加 - $age:=OB Get($myObj2;"age") // 42 + // Using the command notation + C_OBJECT($myObj2) //declares a 4D variable object + OB SET($myObj2;"age";42) //creates an object and adds the age property + $age:=OB Get($myObj2;"age") //42 - // もちろん両方の記法を混用することもできます + // Of course, both notations can be mixed C_OBJECT($myObj3) OB SET($myObj3;"age";10) - $age:=$myObj3.age // 10 + $age:=$myObj3.age //10 ``` -- プロパティの作成と、オブジェクトを含む値の代入: +- Create a property and assign values, including objects: ```4d C_OBJECT($Emp) $Emp:=New object - $Emp.city:="London" // cityプロパティを作成し、その値を"London"に設定します - $Emp.city:="Paris" // cityプロパティを変更します + $Emp.city:="London" //creates the city property and sets its value to "London" + $Emp.city:="Paris" //modifies the city property $Emp.phone:=New object("office";"123456789";"home";"0011223344") - // phoneプロパティを作成し、その値にオブジェクトを設定します + //creates the phone property and sets its value to an object ``` -- オブジェクト記法を使用すると、サブオブジェクトの値を簡単に取得できます: +- Get a value in a sub-object is very simple using the object notation: ```4d - $vCity:=$Emp.city // "Paris" - $vPhone:=$Emp.phone.home // "0011223344" + $vCity:=$Emp.city //"Paris" + $vPhone:=$Emp.phone.home //"0011223344" ``` -- 大カッコ [ ] を使用すると文字列を使ってプロパティにアクセスできます: +- You can access properties as strings using the [ ] operator ```4d - $Emp["city"]:="Berlin" // city プロパティを変更 - // これは変数を通してプロパティを作成する場合に便利です + $Emp["city"]:="Berlin" //modifies the city property + //this can be useful for creating properties through variables C_TEXT($addr) $addr:="address" For($i;1;4) $Emp[$addr+String($i)]:="" End for - // $Emp object には4つの空のプロパティ "address1...address4" が作成されました + // creates 4 empty properties "address1...address4" in the $Emp object ``` diff --git a/website/translated_docs/ja/Concepts/dt_picture.md b/website/translated_docs/ja/Concepts/dt_picture.md index 221b60b2b5782e..965814ec29924b 100644 --- a/website/translated_docs/ja/Concepts/dt_picture.md +++ b/website/translated_docs/ja/Concepts/dt_picture.md @@ -1,119 +1,119 @@ --- -id: ピクチャー -title: ピクチャー +id: picture +title: Picture --- -ピクチャーのフィールド・変数・式に格納されるデータは、任意の Windows または Macintosh の画像です。 これらの画像には、ペーストボード上に置いたり、4Dコマンドやプラグインコマンド (`READ PICTURE FILE` など) を使用してディスクから読み出すことのできる画像を含みます。 +A Picture field, variable or expression can be any Windows or Macintosh picture. In general, this includes any picture that can be put on the pasteboard or read from the disk using 4D commands such as `READ PICTURE FILE`. -4D は Windows と macOS の両方においてネイティブな API を使用してフィールドや変数のピクチャーをエンコード (書き込み) およびデコード (読み込み) します。 これらの実装は現在デジタルカメラで使用されている RAW フォーマット含め、数多くのネイティブなフォーマットへのアクセスを提供します。 +4D uses native APIs to encode (write) and decode (read) picture fields and variables under both Windows and macOS. These implementations provide access to numerous native formats, including the RAW format, currently used by digital cameras. -* Windows では、4DはWIC (Windows Imaging Component) を使用します。 -* macOS では、4D は ImageIO を使用します。 +* on Windows, 4D uses WIC (Windows Imaging Component). +* on macOS, 4D uses ImageIO. -WIC および ImageIO はピクチャー内のメタデータの書き込みを許可しています。 `SET PICTURE METADATA` および `GET PICTURE METADATA` コマンドを使用することで、それらのメタデータを開発に役立てることができます。 +WIC and ImageIO permit the use of metadata in pictures. Two commands, `SET PICTURE METADATA` and `GET PICTURE METADATA`, let you benefit from metadata in your developments. -## ピクチャー Codec ID +## Picture Codec IDs -4D は多様な [ピクチャーフォーマット](FormEditor/pictures.md#native-formats-supported) をネイティブにサポートします: .jpeg, .png, .svg 等。 +4D supports natively a wide set of [picture formats](FormEditor/pictures.md#native-formats-supported), such as .jpeg, .png, or .svg. -4D が認識するピクチャーフォーマットは `PICTURE CODEC LIST` コマンドからピクチャー Codec IDとして返されます。 これは以下の形式で返されます: +Picture formats recognized by 4D are returned by the `PICTURE CODEC LIST` command as picture Codec IDs. They can be returned in the following forms: -* 拡張子 (例: “.gif”) -* MIME タイプ (例: “image/jpeg”) +* As an extension (for example “.gif”) +* As a MIME type (for example “image/jpeg”) -それぞれのピクチャーフォーマットに対して返される形式は、当該 Codec が OS レベルで記録されている方法に基づきます。 エンコーディング (書き込み) 用コーデックにはライセンスが必要な場合があるため、利用できるコーデックの一覧は、読み込み用と書き込み用で異なる可能性があることに注意してください。 +The form returned for each format will depend on the way the Codec is recorded at the operating system level. Note that the list of available codecs for reading and writing can be different since encoding codecs may require specific licenses. -多くの [4D ピクチャー管理コマンド](https://doc.4d.com/4Dv18/4D/18/Pictures.201-4504337.ja.html) は Codec ID を引数として受けとることができます。 したがって、`PICTURE CODEC LIST` から返されるシステムIDを使用しなければなりません。 4D が認識するピクチャーフォーマットは `PICTURE CODEC LIST` コマンドによって返されます。 +Most of the [4D picture management commands](https://doc.4d.com/4Dv18/4D/18/Pictures.201-4504337.en.html) can receive a Codec ID as a parameter. It is therefore imperative to use the system ID returned by the `PICTURE CODEC LIST` command. Picture formats recognized by 4D are returned by the `PICTURE CODEC LIST` command. -## ピクチャー演算子 +## Picture operators -| 演算子 | シンタックス | 戻り値 | 動作 | -| ------ | ------------------ | ----- | ------------------------------------------------------------------------------------------------------------------ | -| 水平連結 | Pict1 + Pict2 | ピクチャー | Pict1 の右側に Pict2 を追加します | -| 垂直連結 | Pict1 / Pict2 | ピクチャー | Pict1 の下側に Pict2 を追加します | -| 排他的論理和 | Pict1 & Pict2 | ピクチャー | Pict1 の前面に Pict2 を重ねます (Pict2 が前面) `COMBINE PICTURES(pict3;pict1;Superimposition;pict2)` と同じ結果になります。 | -| 包括的論理和 | Pict1 | Pict2 | ピクチャー | Pict1 と Pict2 を重ね、そのマスクした結果を返します (両ピクチャーとも同じサイズである必要があります) `$equal:=Equal pictures(Pict1;Pict2;Pict3)` と同じ結果になります。 | -| 水平移動 | ピクチャー + 数値 | ピクチャー | 指定ピクセル分、ピクチャーを横に移動します。 | -| 垂直移動 | ピクチャー / 数値 | ピクチャー | 指定ピクセル分、ピクチャーを縦に移動します。 | -| サイズ変更 | ピクチャー * 数値 | ピクチャー | 割合によってピクチャーをサイズ変更します。 | -| 水平スケール | ピクチャー *+ 数値 | ピクチャー | 割合によってピクチャー幅をサイズ変更します。 | -| 垂直スケール | ピクチャー *| 数値 | ピクチャー | 割合によってピクチャー高さをサイズ変更します。 | +| Operation | Syntax | Returns | Action | +| ------------------------- | ---------------------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| Horizontal concatenation | Pict1 + Pict2 | Picture | Add Pict2 to the right of Pict1 | +| Vertical concatenation | Pict1 / Pict2 | Picture | Add Pict2 to the bottom of Pict1 | +| Exclusive superimposition | Pict1 & Pict2 | Picture | Superimposes Pict2 on top of Pict1 (Pict2 in foreground). Produces the same result as `COMBINE PICTURES(pict3;pict1;Superimposition;pict2)` | +| Inclusive superimposition | Pict1 | Pict2 | Picture | Superimposes Pict2 on Pict1 and returns resulting mask if both pictures are the same size. Produces the same result as `$equal:=Equal pictures(Pict1;Pict2;Pict3)` | +| Horizontal move | Picture + Number | Picture | Move Picture horizontally Number pixels | +| Vertical move | Picture / Number | Picture | Move Picture vertically Number pixels | +| Resizing | Picture * Number | Picture | Resize Picture by Number ratio | +| Horizontal scaling | Picture *+ Number | Picture | Resize Picture horizontally by Number ratio | +| Vertical scaling | Picture *| Number | Picture | Resize Picture vertically by Number ratio | -**注:** +**Notes :** -- | 演算子を使用するためには、Pict1 と Pict2 が完全に同一のサイズでなければなりません。 二つのピクチャーサイズに違いがある場合、Pict1 | Pict2 は空のピクチャーを生成します。 -- `COMBINE PICTURES` コマンドは、それぞれのソースピクチャーの特性を結果ピクチャーに保持しつつ、ピクチャーの重ね合わせをおこないます。 -- `TRANSFORM PICTURE` コマンドを使って、さらなる画像処理をおこなうことができます。 -- ピクチャー用の比較演算子はありませんが、`Equal picture` コマンドを使って 2つのピクチャーを比較することができます。 +- In order to use the | operator, Pict1 and Pict2 must have exactly the same dimension. If both pictures are a different size, the operation Pict1 | Pict2 produces a blank picture. +- The `COMBINE PICTURES` command can be used to superimpose pictures while keeping the characteristics of each source picture in the resulting picture. +- Additional operations can be performed on pictures using the `TRANSFORM PICTURE` command. +- There is no comparison operators on pictures, however 4D proposes the `Equal picture` command to compare two pictures. -### 例題 +### Examples -水平連結 +Horizontal concatenation ```4d - circle+rectangle // circle の右に rectangle が追加されます。 - rectangle+circle // rectangle の右に circle が追加されます。 + circle+rectangle //Place the rectangle to the right of the circle + rectangle+circle //Place the circle to the right of the rectangle ``` ![](assets/en/Concepts/concatHor.en.png) ![](assets/en/Concepts/concatHor2.en.png) -垂直連結 +Vertical concatenation ```4d - circle/rectangle // circle の下に rectangle が追加されます。 - rectangle/circle // rectangle の下に circle が追加されます。 + circle/rectangle //Place the rectangle under the circle + rectangle/circle //Place the circle under the rectangle ``` ![](assets/en/Concepts/concatVer.en.png) ![](assets/en/Concepts/concatVer2.en.png) -排他的論理和 +Exclusive superimposition ```4d -Pict3:=Pict1 & Pict2 // Pict1 の上に Pict2 を重ねます。 +Pict3:=Pict1 & Pict2 // Superimposes Pict2 on top of Pict1 ``` ![](assets/en/Concepts/superimpoExc.fr.png) -包括的論理和 +Inclusive superimposition ```4d -Pict3:=Pict1|Pict2 // 同じサイズの二つのピクチャーを重ね合わせた上でそのマスクの結果を返します。 +Pict3:=Pict1|Pict2 // Recovers resulting mask from superimposing two pictures of the same size ``` ![](assets/en/Concepts/superimpoInc.fr.png) -水平移動 +Horizontal move ```4d -rectangle+50 // rectangle を右に 50ピクセル移動します。 -rectangle-50 // rectangle を左に 50ピクセル移動します。 +rectangle+50 //Move the rectangle 50 pixels to the right +rectangle-50 //Move the rectangle 50 pixels to the left ``` ![](assets/en/Concepts/hormove.en.png) -垂直移動 +Vertical move ```4d -rectangle/50 // rectangle を下に 50ピクセル移動します。 -rectangle/-20 // rectangle を上に 20ピクセル移動します。 +rectangle/50 //Move the rectangle down by 50 pixels +rectangle/-20 //Move the rectangle up by 20 pixels ``` ![](assets/en/Concepts/vertmove.en.png)![](assets/en/Concepts/vertmove2.en.png) -拡大 +Resize ```4d -rectangle*1.5 // rectangle を 50%拡大します。 -rectangle*0.5 // rectangle を 50%縮小します。 +rectangle*1.5 //The rectangle becomes 50% bigger +rectangle*0.5 //The rectangle becomes 50% smaller ``` ![](assets/en/Concepts/resize.en.png)![](assets/en/Concepts/resisze2.en.png) -水平スケール +Horizontal scaling ```4d -circle*+3 // circle の幅を 3倍に広げます。 -circle*+0.25 // circle の幅を 25%に縮めます。 +circle*+3 //The circle becomes 3 times wider +circle*+0.25 //The circle's width becomes a quarter of what it was ``` ![](assets/en/Concepts/Horscaling.en.png)![](assets/en/Concepts/Horscaling2.en.png) -垂直スケール +Vertical scaling ```4d -circle*|2 // circle の高さを 2倍に伸ばします。 -circle*|0.25 // circle の高さを 25%に縮めます。 +circle*|2 //The circle becomes twice as tall +circle*|0.25 //The circle's height becomes a quarter of what it was ``` ![](assets/en/Concepts/vertscaling.en.png)![](assets/en/Concepts/veticalscaling2.en.png) diff --git a/website/translated_docs/ja/Concepts/dt_pointer.md b/website/translated_docs/ja/Concepts/dt_pointer.md index 7115cfe32e8f72..1bf5c2050c7e4b 100644 --- a/website/translated_docs/ja/Concepts/dt_pointer.md +++ b/website/translated_docs/ja/Concepts/dt_pointer.md @@ -1,188 +1,188 @@ --- id: pointer -title: ポインター +title: Pointer --- -ポインターの変数や式は、別の変数 (配列、配列要素を含む) 、テーブル、またはフィールドへの参照です。 ポインタータイプのフィールドは、存在しません。 +A Pointer variable or expression is a reference to another variable (including arrays and array elements), table, field, or object. There is no field of type Pointer. -ポインターは、(プログラミングにおける) データを参照するための高度な方法を提供します。 4D ランゲージ使用時にテーブル・フィールド・変数・配列等にアクセスするには、単純に名前を用います。 ですが、名前を使用しないでデータを参照する、またはアクセスした方が便利な場合もあります。 ポインターを使うとこれが実現できます。 +Pointers provide an advanced way (in programming) to refer to data. When you use the language, you access various objects—in particular, tables, fields, variables, objects, and arrays—by simply using their names. However, it is often useful to refer to these elements and access them without knowing their names. This is what pointers let you do. -ポインターの背景にある概念は、日常生活でもよく使われています。 対象物を正確に知らないまま、それを示すことがあります。 たとえば、友人に対して "登録番号123ABDの車に乗ろう" と言わずに "君の車に乗ろう" と言う場合です。 つまり、"登録番号123ABDの車" を "君の車" で示したわけです。 この場合、"登録番号123ABDの車" はオブジェクトの名前で、"君の車" はオブジェクトを参照するためのポインターと考えることができます。 +The concept behind pointers is not that uncommon in everyday life. You often refer to something without knowing its exact identity. For example, you might say to a friend, “Let’s go for a ride in your car” instead of “Let’s go for a ride in the car with license plate 123ABD.” In this case, you are referencing the car with license plate 123ABD by using the phrase “your car.” The phrase “car with license plate 123ABD” is like the name of an object, and using the phrase “your car” is like using a pointer to reference the object. -対象物を明示しないで参照できると、非常に便利です。 たとえば、友人が新しい車に買い替えても、同じく "君の車" と言うことができます。 ポインターも同じように機能します。 たとえば、同じポインターがある時は数値フィールド "Age" を参照し、別の時には数値変数 "Old Age" を参照することもできます。 いずれの場合にもポインターは数値データを参照しており、それは計算に使用することができます。 +Being able to refer to something without knowing its exact identity is very useful. In fact, your friend could get a new car, and the phrase “your car” would still be accurate—it would still be a car and you could still take a ride in it. Pointers work the same way. For example, a pointer could at one time refer to a numeric field called Age, and later refer to a numeric variable called Old Age. In both cases, the pointer references numeric data that could be used in a calculation. -テーブル・フィールド・変数・配列・配列要素・オブジェクトを参照するためにポインターを使用することができます。 以下の表に、各タイプの例を示します: +You can use pointers to reference tables, fields, variables, arrays, array elements, and objects. The following table gives an example of each data type: -| タイプ | 参照時 | 使用時 | 代入時 | -| ------ | ----------------------- | ------------------------ | ------------------------ | -| テーブル | vpTable:=->[Table] | DEFAULT TABLE(vpTable->) | n/a | -| フィールド | vpField:=->[Table]Field | ALERT(vpField->) | vpField->:="John" | -| 変数 | vpVar:=->Variable | ALERT(vpVar->) | vpVar->:="John" | -| 配列 | vpArr:=->Array | SORT ARRAY(vpArr->;>) | COPY ARRAY (Arr;vpArr->) | -| 配列要素 | vpElem:=->Array{1} | ALERT (vpElem->) | vpElem->:="John" | -| オブジェクト | vpObj:=->myObject | ALERT (vpObj->myProp) | vpObj->myProp:="John" | +| Type | To Reference | To Use | To Assign | +| ------------- | ----------------------- | ------------------------ | ------------------------ | +| Table | vpTable:=->[Table] | DEFAULT TABLE(vpTable->) | n/a | +| Field | vpField:=->[Table]Field | ALERT(vpField->) | vpField->:="John" | +| Variable | vpVar:=->Variable | ALERT(vpVar->) | vpVar->:="John" | +| Array | vpArr:=->Array | SORT ARRAY(vpArr->;>) | COPY ARRAY (Arr;vpArr->) | +| Array element | vpElem:=->Array{1} | ALERT (vpElem->) | vpElem->:="John" | +| Object | vpObj:=->myObject | ALERT (vpObj->myProp) | vpObj->myProp:="John" | -## ポインターの基本 +## Using a pointer: Basic example -ポインターの使用方法について例題を用いて説明します。 以下の例は、ポインターを通して変数にアクセスする方法を示します。 まず、変数を作成します: +It is easiest to explain the use of pointers through an example. This example shows how to access a variable through a pointer. We start by creating a variable: ```4d $MyVar:="Hello" ``` -$MyVar は、文字列 "Hello" を含む変数です。 $MyVar に対するポインターを作成します: +$MyVar is now a variable containing the string “Hello.” We can now create a pointer to $MyVar: ```4d C_POINTER($MyPointer) $MyPointer:=->$MyVar ``` -ポインター記号 (->) は、"・・・に対するポインターを求める" ことを意味します。 この記号は、"ダッシュ" (-) の後に "大なり" (>) を付けて構成されます。 ここでは、$MyVar を参照するポインターを取得します。 このポインターは、代入演算子 (:=) で $MyPointer に対して割り当てられます。 +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 は、$MyVar に対するポインターを格納する変数です。 $MyPointer は、"Hello" という $MyVar の値を含みませんが、その値を参照することはできます。 以下の式は $MyVar の値を返します: +$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-> ``` -前述の式は、"Hello" という文字列を返します。 ポインター記号 (->) をポインターの後につけると、参照先の値を取得することができます。 これをデリファレンス (参照外し) と呼びます。 +In this case, it returns the string “Hello”. The -> symbol, when it follows a pointer, references the object pointed to. This is called dereferencing. -ポインター記号 (->) を後につけたポインターは、その参照先を直接使うのと同義であることを理解することが重要です。 つまり、変数 $MyVar を使用することと、$MyPointer-> を使用することは、まったく同じ意味になります。 たとえば、以下のステートメントはアラートボックスに文字列 "Hello" を表示します: +It is important to understand that you can use a pointer followed by the -> symbol anywhere that you could have used the object that the pointer points to. This means that you could use the expression $MyPointer-> anywhere that you could use the original $MyVar variable. For example, the following line displays an alert box with the word Hello in it: ```4d ALERT($MyPointer->) ``` -$MyPointer を使用して $MyVar の値を変更することもできます。 下記のステートメントは、変数 $MyVar に文字列 "Goodbye" を代入します: +You can also use $MyPointer to change the data in $MyVar. For example, the following statement stores the string "Goodbye" in the variable $MyVar: ```4d $MyPointer->:="Goodbye" ``` -この2つの $MyPointer-> を使用した例のとおり、$MyVar を使用するのとまったく同じ動作が実行されます。 以下の2つのステートメントも、同一の動作を実行します。両方とも、変数 $MyVar の現在の値をアラートボックスに表示します: +If you examine the two uses of the expression $MyPointer->, you will see that it acts just as if you had used $MyVar instead. In summary, the following two lines perform the same action—both display an alert box containing the current value in the variable $MyVar: ```4d ALERT($MyPointer->) ALERT($MyVar) ``` -以下の2つのステートメントも、同一の動作を実行します。両方とも $MyVar に、文字列 "Goodbye" を代入します: +The following two lines perform the same action— both assign the string "Goodbye" to $MyVar: ```4d $MyPointer->:="Goodbye" $MyVar:="Goodbye" ``` -## ポインター演算子 +## Pointer operators -前提: +With: ```4d - // vPtrA と vPtrB は同じ対象を参照します + ` vPtrA and vPtrB point to the same object vPtrA:=->anObject vPtrB:=->anObject - // vPtrC は別の対象を参照します + ` vPtrC points to another object vPtrC:=->anotherObject ``` -| 演算子 | シンタックス | 戻り値 | 式 | 結果 | -| --- | ------------- | --- | ------------- | ----- | -| 等しい | ポインター = ポインター | ブール | vPtrA = vPtrB | True | -| | | | vPtrA = vPtrC | False | -| 異なる | ポインター # ポインター | ブール | vPtrA # vPtrC | True | -| | | | vPtrA # vPtrB | False | +| Operation | Syntax | Returns | Expression | Value | +| ---------- | ----------------- | ------- | ------------- | ----- | +| Equality | Pointer = Pointer | Boolean | vPtrA = vPtrB | True | +| | | | vPtrA = vPtrC | False | +| Inequality | Pointer # Pointer | Boolean | vPtrA # vPtrC | True | +| | | | vPtrA # vPtrB | False | -## ポインターの使用例 -### テーブルへのポインター -テーブルの代わりにデリファレンスしたポインターを使用することができます。 以下のようなステートメントで、テーブルのポインターを作成します: +## 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] ``` -あるいは、以下のように `Table` コマンドを使用してテーブルのポインターを得ることができます: +You can also get a pointer to a table by using the `Table` command: ```4d $TablePtr:=Table(20) ``` -取得したポインターは、以下のようにデリファレンスしてコマンドに渡すことができます: +You can use the dereferenced pointer in commands, like this: ```4d DEFAULT TABLE($TablePtr->) ``` -### フィールドへのポインター -フィールドの代わりにデリファレンスしたポインターを使用することができます。 以下のようなステートメントで、フィールドのポインターを作成します: +### Pointers to fields +Anywhere that the language expects to see a field, you can use a dereferenced pointer to reference the field. You create a pointer to a field by using a line like this: ```4d $FieldPtr:=->[aTable]ThisField ``` -あるいは、以下のように `Field` コマンドを使用してフィールドのポインターを得ることができます: +You can also get a pointer to a field by using the `Field` command, for example: ```4d $FieldPtr:=Field(1;2) ``` -取得したポインターは、以下のようにデリファレンスしてコマンドに渡すことができます: +You can use the dereferenced pointer in commands, like this: ```4d OBJECT SET FONT($FieldPtr->;"Arial") ``` -### 変数へのポインター +### Pointers to local variables -プロセス変数またはローカル変数のポインターを使う場合、参照される変数はポインターが使用される時点ですでに定義されていなければなりません。 ローカル変数は、それらを作成したメソッドの実行が終わると破棄され、プロセス変数もそれを作成したプロセスの終了時に削除される点に留意してください。 存在しない変数をポインターで呼び出そうとすると、インタープリターモードでは (「変数が設定されていません」という内容の) シンタックスエラーが起きます。コンパイルモードでは、さらに重大なエラーが発生する可能性があります。 +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. -ローカル変数のポインターを使用すると、プロセス変数の使用を控えることができます。 ローカル変数へのポインターは、同じプロセス内でのみ使用することができます。 デバッガーにおいて、別のメソッドで宣言されたローカル変数へのポインターを表示すると、ポインターの後ろの括弧内にそのメソッド名が表示されます。 例として、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) ``` -Method2 実行中のデバッガーは $1 を次のように表示します: +In Method2, the debugger will display $1 as follows: | $1 | ->$MyVar (Method1) | | -- | ------------------ | | | | -$1 の値は、次のようになります: +The value of $1 will be: | $MyVar (Method1) | "Hello world" | | ---------------- | ------------- | | | | -### 配列要素へのポインター -配列要素に対するポインターを作成することができます。 以下の例は配列を作成し、配列の最初の要素を指し示すポインターを変数 $ElemPtr に割り当てます: +### Pointers to array elements +You can create a pointer to an array element. For example, the following lines create an array and assign a pointer to the first array element to a variable called $ElemPtr: ```4d -ARRAY REAL($anArray;10) // 配列を作成 -$ElemPtr:=->$anArray{1} // 配列要素へのポインターを作成 +ARRAY REAL($anArray;10) //Create an array +$ElemPtr:=->$anArray{1} //Create a pointer to the array element ``` -以下のように、ポインターの参照先である配列要素に値を代入することができます: +You could use the dereferenced pointer to assign a value to the element, like this: ```4d $ElemPtr->:=8 ``` -### 配列へのポインター -配列に対するポインターを作成することができます。 以下の例は配列を作成し、配列を指し示すポインターを変数 $ArrPtr に割り当てます: +### Pointers to arrays +You can create a pointer to an array. For example, the following lines create an array and assign a pointer to the array to a variable called $ArrPtr: ```4d -ARRAY REAL($anArray;10) // 配列を作成 -$ArrPtr:=->$anArray // 配列へのポインターを作成 +ARRAY REAL($anArray;10) //Create an array +$ArrPtr:=->$anArray //Create a pointer to the array ``` -ポインターの参照先はあくまでも配列であり、配列要素ではないことを理解することが重要です。 たとえば、デリファレンスしたポインターを以下のように使用できます: +It is important to understand that the pointer points to the array; it does not point to an element of the array. For example, you can use the dereferenced pointer from the preceding lines like this: ```4d -SORT ARRAY($ArrPtr->;>) // 配列の並べ替え +SORT ARRAY($ArrPtr->;>) //Sort the array ``` -配列の4番目の要素にアクセスするのに配列のポインターを使う場合は、以下のように記述します: +If you need to refer to the fourth element in the array by using the pointer, you do this: ```4d ArrPtr->{4}:=84 ``` -### メソッドの引数としてのポインター -ポインターは引数としてメソッドに渡すことができます。 メソッド内で、ポインターの参照先の値を変更することができます。 たとえば、以下のメソッド `takeTwo` は、2つのポインターを引数として受け取ります。 そして、最初の引数の参照先を大文字に変換し、2つめの引数の参照先を小文字に変換します。 当該プロジェクトメソッドのコードです: +### 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 プロジェクトメソッド - //$1 – 文字列フィールドまたは変数へのポインター。 これを大文字に変換します。 - //$2 – 文字列フィールドまたは変数へのポインター。 これを小文字に変換します。 + //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->) ``` -以下のステートメントではメソッド `takeTwo` を使用し、フィールドの値を大文字に、変数の値を小文字に変換します: +The following line uses the `takeTwo` method to change a field to uppercase characters and to change a variable to lowercase characters: ``` takeTwo(->[myTable]myField;->$MyVar) ``` -このフィールド [myTable]myField の値が "jones" であれば、"JONES" に変更されます。 他方、変数 $MyVar の値が "HELLO" であれば、"hello" に変更されます。 +If the field [myTable]myField contained the string "jones", it would be changed to the string "JONES". If the variable $MyVar contained the string "HELLO", it would be changed to the string "hello". -メソッド takeTwo で宣言されている引数の型と、引数として渡したポインターの参照先のデータタイプが一致していることが重要です。 この例では、ポインターの参照先は必ず文字列またはテキスト型でなければなりません。 +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" $PointerOne:=->$MyVar @@ -190,24 +190,24 @@ takeTwo(->[myTable]myField;->$MyVar) ($PointerTwo->)->:="Goodbye" ALERT(($PointerTwo->)->) ``` -この例はアラートボックスに "Goodbye" を表示します。 +It displays an alert box with the word “Goodbye” in it. -各行について見ていきましょう: +Here is an explanation of each line of the example: -- $MyVar:="Hello" --> この行は、変数 $MyVar に "Hello" という文字列を代入しています。 -- $PointerOne:=->$MyVar --> 変数 $PointerOne に、変数 $MyVar へのポインターを代入します。 -- $PointerTwo:=->$PointerOne --> 新たな変数 $PointerTwo に、$MyVar を参照する $PointerOne へのポインターを代入します。 -- ($PointerTwo->)->:="Goodbye" --> $PointerTwo-> は $PointerOne を示し、$PointerOne は $MyVarを示します。 つまり、($PointerTwo->)-> は、$MyVar を示しています。 結果として、文字列 "Goodbye" が $MyVar に代入されます。 -- ALERT (($PointerTwo->)->) --> 先の説明と同様に $PointerTwo-> は $PointerOne を示し、$PointerOne は $MyVarを示しています。 つまり、($PointerTwo->)-> は、$MyVar を示しています。 結果としてアラートボックスには $MyVar の内容が表示されます。 +- $MyVar:="Hello" --> This line puts the string "Hello" into the variable $MyVar. +- $PointerOne:=->$MyVar --> $PointerOne now contains a pointer to $MyVar. +- $PointerTwo:=->$PointerOne --> $PointerTwo (a new variable) contains a pointer to $PointerOne, which in turn points to $MyVar. +- ($PointerTwo->)->:="Goodbye" --> $PointerTwo-> references the contents of $PointerOne, which in turn references $MyVar. Therefore ($PointerTwo->)-> references the contents of $MyVar. So in this case, $MyVar is assigned "Goodbye". +- ALERT (($PointerTwo->)->) --> Same thing: $PointerTwo-> references the contents of $PointerOne, which in turn references $MyVar. Therefore ($PointerTwo->)-> references the contents of $MyVar. So in this case, the alert box displays the contents of $MyVar. -以下の例では、$MyVar に "Hello" が代入されます: +The following line puts "Hello" into $MyVar: ```4d ($PointerTwo->)->:="Hello" ``` -以下のステートメントは、$NewVar に $MyVar の値である "Hello" が代入されます: +The following line gets "Hello" from $MyVar and puts it into $NewVar: ``` $NewVar:=($PointerTwo->)-> ``` -**重要:** デリファレンスを複数おこなうには括弧が必要です。 +**Important:** Multiple dereferencing requires parentheses. diff --git a/website/translated_docs/ja/Concepts/dt_string.md b/website/translated_docs/ja/Concepts/dt_string.md index c9a6bc3b5aa36c..3c9e5d4f18fe96 100644 --- a/website/translated_docs/ja/Concepts/dt_string.md +++ b/website/translated_docs/ja/Concepts/dt_string.md @@ -3,95 +3,94 @@ id: string title: String --- -文字列とは、以下を示す総称です: +String is a generic term that stands for: -- テキストフィールドまたは変数: テキストフィールド、変数、または式には 0~2 GB のテキストを格納することができます。 -- 文字フィールド: 文字フィールドには 0~255 文字までの文字を格納することができます (上限はフィールドが定義されたときに設定されます)。 +- Text fields or variables: a Text field, variable, or expression may contain from 0 to 2 GB of text. +- Alphanumeric fields: an Alphanumeric field may contain from 0 to 255 characters (limit set when field is defined). -## 文字列リテラル +## String literals -文字列リテラル定数は、次のように二重引用符 ("...") で囲んで表します。 文字列定数の例を次に示します: +A string literal is enclosed in double, straight quotation marks ("..."). Here are some examples of string literals: ```4d -"レコード追加" -"レコードが見つかりません" -"送り状" -``` - -空の文字列は、2つの引用符の間に何も入れない状態 ("") で表します。 - -### エスケープシーケンス -以下のエスケープシーケンスを文字列内で使用できます: - -| エスケープシーケンス | 意味する文字 | -| ---------- | ------------- | -| \n | LF (行送り) | -| \t | HT (タブ) | -| \r | CR (改行) | -| \\\ | \ (バックスラッシュ) | -| \\" | " (引用符) | - -**注:** \ (バックスラッシュ) は Windows でパス名の区切り文字として使用されています。 通常 4D はメソッドエディターに入力されたバックスラッシュを自動で "\\\" に置き換えることで、これを正しく解釈します。例えば "C:\Folder" と入力すると "C:\\\Folder" に変換されます。しかし “C:\MyDocuments\New” と入力した場合、4Dは二番目のバックスラッシュは "\N" (行送り) と解釈してしまい、“C:\\\MyDocuments\New”を表示します。このようなケースでは開発者がバックスラッシュを2つ入力するようにしなければなりません。
    さらに正規表現のパターン定義でもバックスラッシュがエスケープシーケンスとして使用されます。正規表現パターン "\\\" を4Dのメソッドエディターに記述する場合は "\\\\\" となる点に注意してください。 - -## 文字列演算子 - -| 演算子 | シンタックス | 戻り値 | 式 | 結果 | -| -------- | ----------- | ------ | ----------------------- | -------- | -| 連結 (結合) | 文字列 + 文字列 | String | "abc" + "def" | "abcdef" | -| 繰り返し | 文字列 * 数値 | String | "ab" * 3 | "ababab" | -| 等しい | 文字列 = 文字列 | ブール | "abc" = "abc" | True | -| | | | "abc" = "abd" | False | -| 異なる | 文字列 # 文字列 | ブール | "abc" # "abd" | True | -| | | | "abc" # "abc" | False | -| 大きい | 文字列 > 文字列 | ブール | "abd" > "abc" | True | -| | | | "abc" > "abc" | False | -| 小さい | 文字列 < 文字列 | ブール | "abc" < "abd" | True | -| | | | "abc" < "abc" | False | -| 以上 | 文字列 >= 文字列 | ブール | "abd" >= "abc" | True | -| | | | "abc" >= "abd" | False | -| 以下 | 文字列 <= 文字列 | ブール | "abc" <= "abd" | True | -| | | | "abd" <= "abc" | False | -| キーワードを含む | 文字列 % 文字列 | ブール | "Alpha Bravo" % "Bravo" | True | -| | | | "Alpha Bravo" % "ravo" | False | -| | ピクチャー % 文字列 | ブール | Picture_expr % "Mer" | True (*) | - -(*) キーワード "Mer" がピクチャー式 (フィールドまたは変数) に格納されたピクチャーの IPTC/Keywords メタデータに含まれている場合。 - -## 文字列比較の詳細 - -- 文字列は文字ごとに比較されます (後述の [キーワード](dt_string.md#キーワード) による検索の場合を除きます)。 -- 文字列が比較されるとき文字の大小文字は無視されます。したがって、"a"="A"は `true` を返します。 大文字と小文字を区別して比較するには、文字コードで比較してください。 例えば次の式は `FALSE` です: +"Add Records" +"No records found." +"Invoice" +``` + +An empty string is specified by two quotation marks with nothing between them (""). + +### Escape sequences +The following escape sequences can be used within strings: + +| Escape sequence | Character replaced | +| --------------- | -------------------- | +| \n | LF (Line feed) | +| \t | HT (Tab) | +| \r | CR (Carriage return) | +| \\\ | \ (Backslash) | +| \\" | " (Quotation marks) | + +**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"). + +## String operators + +| Operation | Syntax | Returns | Expression | Value | +| ------------------------ | ---------------- | ------- | ----------------------- | -------- | +| Concatenation | String + String | String | "abc" + "def" | "abcdef" | +| Repetition | String * Number | String | "ab" * 3 | "ababab" | +| Equality | String = String | Boolean | "abc" = "abc" | True | +| | | | "abc" = "abd" | False | +| Inequality | String # String | Boolean | "abc" # "abd" | True | +| | | | "abc" # "abc" | False | +| Greater than | String > String | Boolean | "abd" > "abc" | True | +| | | | "abc" > "abc" | False | +| Less than | String < String | Boolean | "abc" < "abd" | True | +| | | | "abc" < "abc" | False | +| Greater than or equal to | String >= String | Boolean | "abd" >= "abc" | True | +| | | | "abc" >= "abd" | False | +| Less than or equal to | String <= String | Boolean | "abc" <= "abd" | True | +| | | | "abd" <= "abc" | False | +| Contains keyword | String % String | Boolean | "Alpha Bravo" % "Bravo" | True | +| | | | "Alpha Bravo" % "ravo" | False | +| | Picture % String | Boolean | Picture_expr % "Mer" | True (*) | + +(*) If the keyword "Mer" is associated with the picture stored in the picture expression (field or variable). + +## String comparisons + +- Strings are compared on a character-by-character basis (except in the case of searching by [keywords](dt_string.md#keywords), see below). +- When strings are compared, the case of the characters is ignored; thus, "a"="A" returns `TRUE`. To test if the case of two characters is different, compare their character codes. For example, the following expression returns `FALSE`: ```4d -Character code("A")=Character code("a") -// Character code("A") は 65 -// Character code("a") は 97 +Character code("A")=Character code("a") // because 65 is not equal to 97 ``` -- 文字列が比較される場合、アクセント等の発音区別符号は無視されます。 たとえば、日本語においては以下の式は `true` を返します: +- When strings are compared, diacritical characters are taken into account. For example, the following expressions return `TRUE`: ```4d - "あ"="ア" - "ア"="ア" - "1"="1" + "n"="ñ" + "n"="Ñ" + "A"="å" + // and so on ``` -**注:** 文字列比較にあたっては、**4D のデータファイルに定義された** 言語の特性が考慮されます。これは、システムの使用言語とは異なる場合がありえます。 +**Note:** String comparison takes into account specificities of the language **defined for the 4D data file** (which is not always the same as the language defined for the system). -### ワイルドカード記号 (@) +### Wilcard character (@) -4D ランゲージでは **@** をワイルドカード記号として使用します。 ワイルドカードは、すべての文字列の比較に使用することができ、ワイルドカードによって置き換わる文字の数は指定されません。 たとえば、次の式は `true` になります: +The 4D language supports **@** as a wildcard character. This character can be used in any string comparison to match any number of characters. For example, the following expression is `TRUE`: ```4d "abcdefghij"="abc@" ``` -ただし、複数の文字を比較する目的のワイルドカード記号は、比較演算子の右側の式で使用しなければなりません。 比較演算子の左側の式においては、"@" は単なる文字であると解釈されます。たとえば、次の式は `FALSE` です: +The wildcard character must be used within the second operand (the string on the right side) in order to match any number of characters. The following expression is `FALSE`, because the @ is considered only as a one character in the first operand: ```4d "abc@"="abcdefghij" ``` -ワイルドカードは “0文字以上” を意味します。 以下の式はすべて `true` です: +The wildcard means "one or more characters or nothing". The following expressions are `TRUE`: ```4d "abcdefghij"="abcdefghij@" @@ -101,51 +100,51 @@ Character code("A")=Character code("a") "abcdefghij"="@abcde@fghij@" ``` -一方、どのような場合でも、ワイルドカードを 2つ連続して使用した文字列比較は常に `FALSE` を返します。 次の式は `FALSE` になります: +On the other hand, whatever the case, a string comparison with two consecutive wildcards will always return `FALSE`. The following expression is `FALSE`: ```4d "abcdefghij"="abc@@fg" ``` -比較演算子が < あるいは > 記号である、あるいはこれらを含む場合、演算子の右側の式の終りに置かれた1つのワイルドカードのみサポートされています: +When the comparison operator is or contains a < or > symbol, only comparison with a single wildcard located at the end of the operand is supported: ```4d - "abcd"<="abc@" // 有効な比較です - "abcd"<="abc@ef" // 有効な比較ではありません + "abcd"<="abc@" // Valid comparison + "abcd"<="abc@ef" //Not a valid comparison ``` -文字列の比較または検索において、@ をワイルドカードではなく一般の文字として扱いたい場合、`Character code (At sign)` 指示を使用します。 たとえば、文字列が @ 文字で終わっているかどうかを知りたいとします。 以下の式は ($vsValue が空でなければ) 常に `true` です: +If you want to execute comparisons or queries using @ as a character (and not as a wildcard), you need to use the `Character code(At sign)` instruction. Imagine, for example, that you want to know if a string ends with the @ character. The following expression (if $vsValue is not empty) is always `TRUE`: ```4d ($vsValue[[Length($vsValue)]]="@") ``` -以下のようにすると、式は意図したように評価されます: +The following expression will be evaluated correctly: ```4d -(Character code($vsValue[[Length($vsValue)]])=64) +(Character code($vsValue[[Length($vsValue)]])#64) ``` -**注:** ストラクチャー設定のデータベースページには、文字列に @ 記号が含まれているとき、それをどう解釈するかを指定するオプションが提供されています。 +**Note:** A 4D option in the Design environment allows you to define how the @ character is interpreted when it is included in a character string. -### キーワード +### Keywords -他の文字列比較と異なり、"%" 記号を使ったキーワードによる検索はテキスト中の単語を検索します: 単語は一つのまとまりとして個々に扱われます。 複数の単語や、音節など単語の一部を検索するような場合、**%** 演算子は常に `false` を返します。 区切り文字 (スペースや句読点など) に囲まれた文字列が単語として認識されます。 “Today's” のようにアポストロフィを含む単語は、通常それを含めた 1つの単語として扱われますが、特定の場合には無視されます (以下の注記を参照ください)。 数字も検索できます。小数点は区切り文字ではなく、数字の一部として扱われます。 ただし、通貨や温度などを表す記号は無視されます。 +Unlike other string comparisons, searching by keywords looks for "words" in "texts": words are considered both individually and as a whole. The **%** operator always returns `False` if the query concerns several words or only part of a word (for example, a syllable). The “words” are character strings surrounded by “separators,” which are spaces and punctuation characters and dashes. An apostrophe, like in “Today's”, is usually considered as part of the word, but will be ignored in certain cases (see the rules below). Numbers can be searched for because they are evaluated as a whole (including decimal symbols). Other symbols (currency, temperature, and so on) will be ignored. ```4d - "Alpha Bravo Charlie"%"Bravo" // true - "Alpha Bravo Charlie"%"vo" // false - "Alpha Bravo Charlie"%"Alpha Bravo" // false - "Alpha,Bravo,Charlie"%"Alpha" // true - "Software and Computers"%"comput@" // true + "Alpha Bravo Charlie"%"Bravo" // Returns True + "Alpha Bravo Charlie"%"vo" // Returns False + "Alpha Bravo Charlie"%"Alpha Bravo" // Returns False + "Alpha,Bravo,Charlie"%"Alpha" // Returns True + "Software and Computers"%"comput@" // Returns True ``` -> **注:**
    - 4Dは、<>=# 演算子を使った文字列比較や、キーワードの検出にICUライブラリを使用しています。 実装されているルールの詳細に関しては、以下のアドレスを参照して下さい: [http://www.unicode.org/unicode/reports/tr29/#Word_Boundaries](http://www.unicode.org/unicode/reports/tr29/#Word_Boundaries)
    - 日本語版の 4Dでは、ICU の代わりにデフォルトで Mecab が使用されています。詳細な情報に関しては、 [Mecab のサポート(日本語版)](https://doc.4d.com/4Dv18/4D/18/DatabaseData-storage-page.300-4575463.ja.html#1334024) を参照してください。 +> **Notes:** - 4D uses the ICU library for comparing strings (using <>=# operators) and detecting keywords. For more information about the rules implemented, please refer to the following address: http://www.unicode.org/unicode/reports/tr29/#Word_Boundaries. - In the Japanese version, instead of ICU, 4D uses Mecab by default for detecting keywords. -## 文字参照記号 -文字参照記号: [[...]] +## Character Reference Symbols +The character reference symbols: [[...]] -文字参照記号は、文字列から一文字のみを参照するのに使用します。 この構文は、テキストおよび文字列型の変数やフィールドの任意の位置の文字を指し示します。 +These symbols are used to refer to a single character within a string. This syntax allows you to individually address the characters of a text variable, string variable, or field. -文字参照記号が代入演算子 (:=) の左側にある場合、文字列の指定した位置に一文字を代入します。 以下の例は、vsName が空の文字列ではない場合に、vsName の最初の文字を大文字にします。 +If the character reference symbols appear on the left side of the assignment operator (:=), a character is assigned to the referenced position in the string. For example, if vsName is not an empty string, the following line sets the first character of vsName to uppercase: ```4d If(vsName#"") @@ -153,17 +152,17 @@ If(vsName#"") End if ``` -それ以外の場合には、式内で使用される文字列参照記号は、参照する文字を1文字の独立した文字列として返します。 たとえば: +Otherwise, if the character reference symbols appear within an expression, they return the character (to which they refer) as a 1-character string. For example: ```4d -// 以下の例は vtText の最後の文字が "@" であるかをテストします。 +//The following example tests if the last character of vtText is an At sign "@" If(vtText#"") If(Character code(Substring(vtText;Length(vtText);1))=At sign) //... End if End if - // 文字参照記号を使用し、よりシンプルに記述できます: + //Using the character reference syntax, you would write in a simpler manner: If(vtText#"") If(Character code(vtText[[Length(vtText)]])=At sign) // ... @@ -171,33 +170,33 @@ End if End if ``` -### 無効な文字列参照に関する注意 +### Advanced note about invalid character reference -文字列参照記号を使用する際、配列に存在する要素を指定するのと同じ要領で、文字列内に存在する文字を指定しなければなりません。 たとえば、文字列変数の20番目の文字を参照する場合、この変数は必ず、少なくとも20文字以上の長さがなくてはなりません。長さが足りない場合: +When you use the character reference symbols, you must address existing characters in the string in the same way you address existing elements of an array. For example if you address the 20th character of a string variable, this variable MUST contain at least 20 characters. -- インタープリターモードでは構文エラーは発生しません。 -- コンパイルモードで範囲チェックオプションを無効にしている場合には、メモリ領域を破壊するおそれがあります。 -- コンパイルモードで範囲チェックオプションを有効にしている場合には、エラーが発生します。 たとえば、次のように文字列やテキストの終点を超えた位置に文字を書き込むコードを実行すると: +- Failing to do so, in interpreted mode, does not cause a syntax error. +- Failing to do so, in compiled mode (with no options), may lead to memory corruption, if, for instance, you write a character beyond the end of a string or a text. +- Failing to do so, in compiled mode, causes an error with the option Range Checking On. For example, executing the following code: ``` -// 真似をしないでください +//Very bad and nasty thing to do, boo! vsAnyText:="" vsAnyText[[1]]:="A" ``` -ランタイムにおいてエラーがトリガーされます: +will trigger the Runtime Error shown here: ![alt-text](assets/en/Concepts/Syntax_Error.en.png) -### 例題 +### Example -以下のプロジェクトメソッドは、文字列内の各単語の先頭文字を大文字に変換し、結果の文字列を返します。 +The following project method capitalizes the first character of each word of the text received as parameter and returns the resulting capitalized text: ```4d - // Capitalize_text プロジェクトメソッド - // Capitalize_text ( Text ) -> Text - // Capitalize_text ( Source text ) -> Capitalized Text + //Capitalize_text project method + //Capitalize_text ( Text ) -> Text + //Capitalize_text ( Source text ) -> Capitalized text $0:=$1 $vlLen:=Length($0) @@ -211,12 +210,12 @@ End if End if ``` -使用例: +For example, the line: ```4d ALERT(Capitalize_text("hello, my name is jane doe and i'm running for president!")) ``` -以下のように表示されます: +displays the alert shown here: ![alt-text](assets/en/Concepts/Jane_doe.en.png) diff --git a/website/translated_docs/ja/Concepts/dt_time.md b/website/translated_docs/ja/Concepts/dt_time.md index 211043b44f5b84..2652487fc8a9ba 100644 --- a/website/translated_docs/ja/Concepts/dt_time.md +++ b/website/translated_docs/ja/Concepts/dt_time.md @@ -1,89 +1,89 @@ --- id: time -title: 時間 +title: Time --- -時間のフィールド・変数・式の範囲は 00:00:00 から 596,000:00:00 までです。 +A Time field, variable or expression can be in the range of 00:00:00 to 596,000:00:00. -時間は 24時間制です。 +Times are in 24-hour format. -時間の値は数値として扱うことができます。 時間から返される数値は、その時間が表す総秒数です。 +A time value can be treated as a number. The number returned from a time is the number of seconds since midnight (00:00:00) that time represents. -**注:** *4Dランゲージリファレンス* マニュアルでは、コマンド説明における時間引数は特に明記されていない限り、「時間」と表記されています。 +**Note:** In the *4D Language Reference* manual, Time parameters in command descriptions are denoted as Time, except when marked otherwise. -## 時間リテラル +## Time literals -時間リテラル定数は、疑問符 (? ... ?) で囲んで表します。 +A time literal constant is enclosed by question marks (?...?). -時間は、“時:分:秒” の順で表し、それぞれをコロン (:) で区切ります。 時間は24時間制で指定します。 +A time literal constant is ordered hour:minute:second, with a colon (:) setting off each part. Times are specified in 24-hour format. -時間定数の例を次に示します: +Here are some examples of time literals: ```4d -?00:00:00? // 午前0時 -?09:30:00? // 午前9時30分 -?13:01:59? // 午後1時1分59秒 +?00:00:00? ` midnight +?09:30:00? ` 9:30 am +?13:01:59? ` 1 pm, 1 minute, and 59 seconds ``` -空の時間は、?00.00.00? のように指定します。 - -**Tip:** メソッドエディターでは空の時間を入力するためのショートカットが提供されています。 空の時間を入力するには、疑問符 (?) の入力後に Enter キーを押します。 - -## 時間演算子 - -| 演算子 | シンタックス | 戻り値 | 式 | 結果 | -| --------- | -------- | --- | ----------------------- | ---------- | -| 加算 (足し算) | 時間 + 時間 | 時間 | ?02:03:04? + ?01:02:03? | ?03:05:07? | -| 減算 (引き算) | 時間 - 時間 | 時間 | ?02:03:04? – ?01:02:03? | ?01:01:01? | -| 加算 (足し算) | 時間 + 数値 | 数値 | ?02:03:04? + 65 | 7449 | -| 減算 (引き算) | 時間 - 数値 | 数値 | ?02:03:04? – 65 | 7319 | -| 乗算 (かけ算) | 時間 * 数値 | 数値 | ?02:03:04? * 2 | 14768 | -| 除算 (割り算) | 時間 / 数値 | 数値 | ?02:03:04? / 2 | 3692 | -| 倍長整数を返す除算 | 時間 \ 数値 | 数値 | ?02:03:04? \ 2 | 3692 | -| モジューロ | 時間 % 時間 | 時間 | ?20:10:00? % ?04:20:00? | ?02:50:00? | -| モジューロ | 時間 % 数値 | 数値 | ?02:03:04? % 2 | 0 | -| 等しい | 時間 = 時間 | ブール | ?01:02:03? = ?01:02:03? | True | -| | | | ?01:02:03? = ?01:02:04? | False | -| 異なる | 時間 # 時間 | ブール | ?01:02:03? # ?01:02:04? | True | -| | | | ?01:02:03? # ?01:02:03? | False | -| 大きい | 時間 > 時間 | ブール | ?01:02:04? > ?01:02:03? | True | -| | | | ?01:02:03? > ?01:02:03? | False | -| 小さい | 時間 < 時間 | ブール | ?01:02:03? < ?01:02:04? | True | -| | | | ?01:02:03? < ?01:02:03? | False | -| 以上 | 時間 >= 時間 | ブール | ?01:02:03? >=?01:02:03? | True | -| | | | ?01:02:03? >=?01:02:04? | False | -| 以下 | 時間 <= 時間 | ブール | ?01:02:03? <=?01:02:03? | True | -| | | | ?01:02:04? <=?01:02:03? | False | - -### 例題 1 - -時間式を数値と組み合わせた式から時間式を取得するには、`Time` コマンドと `Time string` コマンドを使用します。 - -`Time` または `Current time` コマンドを使用する際に、時間型と数値型の式を組み合わせることができます: +A null time is specified by ?00:00:00? + +**Tip:** The Method Editor includes a shortcut for entering a null time. To type a null time, enter the question mark (?) character and press Enter. + +## Time operators + +| Operation | Syntax | Returns | Expression | Value | +| ------------------------ | -------------- | ------- | ----------------------- | ---------- | +| Addition | Time + Time | Time | ?02:03:04? + ?01:02:03? | ?03:05:07? | +| Subtraction | Time – Time | Time | ?02:03:04? – ?01:02:03? | ?01:01:01? | +| Addition | Time + Number | Number | ?02:03:04? + 65 | 7449 | +| Subtraction | Time – Number | Number | ?02:03:04? – 65 | 7319 | +| Multiplication | Time * Number | Number | ?02:03:04? * 2 | 14768 | +| Division | Time / Number | Number | ?02:03:04? / 2 | 3692 | +| Longint division | Time \ Number | Number | ?02:03:04? \ 2 | 3692 | +| Modulo | Time % Time | Time | ?20:10:00? % ?04:20:00? | ?02:50:00? | +| Modulo | Time % Number | Number | ?02:03:04? % 2 | 0 | +| Equality | Time = Time | Boolean | ?01:02:03? = ?01:02:03? | True | +| | | | ?01:02:03? = ?01:02:04? | False | +| Inequality | Time # Time | Boolean | ?01:02:03? # ?01:02:04? | True | +| | | | ?01:02:03? # ?01:02:03? | False | +| Greater than | Time > Time | Boolean | ?01:02:04? > ?01:02:03? | True | +| | | | ?01:02:03? > ?01:02:03? | False | +| Less than | Time < Time | Boolean | ?01:02:03? < ?01:02:04? | True | +| | | | ?01:02:03? < ?01:02:03? | False | +| Greater than or equal to | Time >= Time | Boolean | ?01:02:03? >=?01:02:03? | True | +| | | | ?01:02:03? >=?01:02:04? | False | +| Less than or equal to | Time <= Time | Boolean | ?01:02:03? <=?01:02:03? | True | +| | | | ?01:02:04? <=?01:02:03? | False | + +### Example 1 + +To obtain a time expression from an expression that combines a time expression with a number, use the commands `Time` and `Time string`. + +You can combine expressions of the time and number types using the `Time` or `Current time` functions: ```4d - // 以下の行は $vlSeconds に、深夜0時から現在の - // 1時間後までに経過した秒数を代入します。 + //The following line assigns to $vlSeconds the number of seconds + //that will be elapsed between midnight and one hour from now $vlSeconds:=Current time+3600 - // 以下の行は $vHSoon に 1時間後の時刻を代入します。 + //The following line assigns to $vHSoon the time it will be in one hour $vhSoon:=Time(Current time+3600) ``` -2番目の行はより簡単に記述することができます: +The second line could be written in a simpler way: ```4d - // 以下の行は $vHSoon に1時間後の時刻を代入します。 + // The following line assigns to $vHSoon the time it will be in one hour $vhSoon:=Current time+?01:00:00? ``` -### 例題 2 +### Example 2 -モジューロ演算子を使用できます。とくに24時間フォーマットを考慮した時間の追加に便利です: +The Modulo operator can be used, more specifically, to add times that take the 24-hour format into account: ```4d -$t1:=?23:00:00? // これは午後11:00です - // 2時間30分を追加します -$t2:=$t1 +?02:30:00? // 単純な追加を行うと $t2 は ?25:30:00? になります。 -$t2:=($t1 +?02:30:00?)%?24:00:00? // $t2 は ?01:30:00? と なります。 (翌朝) +$t1:=?23:00:00? // It is 23:00 p.m. + // We want to add 2 and a half hours +$t2:=$t1 +?02:30:00? // With a simple addition, $t2 is ?25:30:00? +$t2:=($t1 +?02:30:00?)%?24:00:00? // $t2 is ?01:30:00? and it is 1:30 a.m. the next morning ``` diff --git a/website/translated_docs/ja/Concepts/dt_variant.md b/website/translated_docs/ja/Concepts/dt_variant.md index ba54da7420ad5a..4f26667396cb4e 100644 --- a/website/translated_docs/ja/Concepts/dt_variant.md +++ b/website/translated_docs/ja/Concepts/dt_variant.md @@ -1,29 +1,29 @@ --- id: variant -title: バリアント +title: Variant --- -バリアント型は、サポートしている型の任意のデータを受け取ることができる変数型です。 一般的には、返したり受け取ったりする値の型が未定である汎用的なコードを書くためにこの変数型が使用されます。 これは、たとえばオブジェクトの属性を扱うようなコードがそれに該当します。 +Variant is a variable type which allows encapsulating data of any valid regular type in a variable. Typically, this variable type can be used to write generic code returning or receiving values for which the type is not known. This is the case for example for code handling object attributes. -バリアント型の変数は以下のデータタイプの値を格納することができます: +A variant type variable can contain a value of the following data types: - BLOB - boolean - collection - date -- 倍長整数 +- longint - object -- ピクチャー +- picture - pointer -- 実数 +- real - text - time - null -- 未定義 +- undefined -> バリアント型変数に配列を格納することはできません。 +> Arrays cannot be stored in variant variables. -インタープリターモード、コンパイルモードのどちらにおいても、一つのバリアント型変数に異なる型のコンテンツを代入することができます。 固定されている型の変数とは異なり、バリアント型変数の中身は変数自身の型 (つまり、バリアント型) と同一ではありません。 たとえば: +In both interpreted and in compiled modes, a same variant variable can be assigned contents of different types. Unlike regular variable types, the variant variable content type is different from the variant variable type itself. For example: ```4d C_VARIANT($variant) @@ -37,18 +37,18 @@ $vtype:=Type($variant) // 12 (Is variant) $vtypeVal:=Value type($variant) // 1 (Is real) ``` -変数が期待されるところであれば、どこでもバリアント型変数を使用することができます。ただし、変数の中身のデータ型は予期される型でなくてはなりません。 また、バリアント型変数を使う場合、その時点で変数に格納されている値のみが実質的に使われます。 たとえば: +You can use variant variables wherever variables are expected, you only need to make sure than the variable content data type is of the expected type. When accessing variant variables, only their current value is taken into account. For example: ```4d C_VARIANT($v) $v:="hello world" -$v2:=$v // バリアント型変数を、型未指定の変数に代入します +$v2:=$v //assign variable to another variable -$t:=Type($v) // 12 (Is variant) 代入元の変数はバリアント型ですが -$t2:=Type($v2) // 2 (Is text) 代入先の変数はテキスト型です +$t:=Type($v) // 12 (Is variant) +$t2:=Type($v2) // 2 (Is text) ``` -バリアント型は、様々なタイプになりうるメソッドの引数 ($0, $1,...) を宣言するのに使用できます。 この場合、引数の値の型の確認作業が必要になります: +Variant can be used to declare method parameters ($0, $1,...) that can be of various types. In this case, you can build your code by testing the parameter value type, for example: ```4d C_VARIANT($1) @@ -60,4 +60,4 @@ Case of End case ``` -> バリアント型変数が必要ではない場合 (つまりデータタイプが分かっている場合)、型が固定された変数を使用することが推奨されます。 固定型変数の方がパフォーマンスやコードの可読性も良く、予期せぬデータタイプを見過ごしてしまうようなバグを防げるため、コンパイラーにも優しいといえます。 \ No newline at end of file +> When variant variables are not necessary (i.e. when the data type is known), it is recommended to use regular typed variables. Regular typed variables provide better performance, make code more clear and are helpful for the compiler to prevent bugs related to passing unexpected data types. \ No newline at end of file diff --git a/website/translated_docs/ja/Concepts/error-handling.md b/website/translated_docs/ja/Concepts/error-handling.md index e30142850e19a2..f2dd669ff2d8ef 100644 --- a/website/translated_docs/ja/Concepts/error-handling.md +++ b/website/translated_docs/ja/Concepts/error-handling.md @@ -1,102 +1,102 @@ --- id: error-handling -title: エラー処理 +title: Error handling --- -エラー処理とは、アプリケーション内で発生する可能性のあるエラーに備え、対処することです。 ランタイムにおけるエラーのキャッチや報告、またそれらの条件を検証するため、4Dは包括的なサポートを提供しています。 +Error handling is the process of anticipating and responding to errors that might occur in your application. 4D provides a comprehensive support for catching and reporting errors at runtime, as well as for investigating their conditions. -エラー処理は次の2つの要望に応えます: +Error handling meets two main needs: -- 開発フェーズにおいて、問題となりうるコードのエラーやバグを発見して修正したい。 -- 運用フェーズにおいて、予期しないエラーを検知して回復したい。とくに、システムエラーダイアログ (ディスクが一杯、ファイルがない、など) を独自のインターフェースに置換できます。 -> 4D Server 上で実行されるコードのため、4D Server にはエラー処理メソッドを実装しておくことが強く推奨されます。 このメソッドによって、サーバーマシンにおいて予期せぬダイアログが表示されることを防ぎ、エラーの調査に必要なログを専用ファイルにとることができます。 +- finding out and fixing potential errors and bugs in your code during the development phase, +- catching and recovering from unexpected errors in deployed applications; in particular, you can replace system error dialogs (disk full, missing file, etc.) with you own interface. +> It is highly recommended to install an error-handling method on 4D Server, for all code running on the server. This method would avoid unexpected dialog boxes to be displayed on the server machine, and could log errors in a dedicated file for further analyses. -## エラー/ステータス +## Error or status -`entity.save()` や `transporter.send()` など、おおくの 4D クラス関数は *status* オブジェクトを返します。 ランタイムにおいて "想定される"、プログラムの実行を停止させないエラー (無効なパスワード、ロックされたエンティティなど) がこのオブジェクトに格納されます。 これらのエラーへの対応は、通常のコードによっておこなうことができます。 +Many 4D class functions, such as `entity.save()` or `transporter.send()`, return a *status* object. This object is used to store "predictable" errors in the runtime context, e.g. invalid password, locked entity, etc., that do not stop program execution. This category of errors can be handled by regular code. -ディスク書き込みエラーやネットワークの問題などのイレギュラーな中断は "想定されない" エラーです。 これらのエラーは例外を発生させ、エラー処理メソッドを介して対応する必要があります。 +Other "unpredictable" errors include disk write error, network failure, or in general any unexpected interruption. This category of errors generates exceptions and needs to be handled through an error-handling method. -## エラー処理メソッドの実装 +## Installing an error-handling method -4D においては、エラー専用のプロジェクトメソッドである **エラー処理** (または **エラーキャッチ**) メソッド内ですべてのエラーをキャッチし、処理することができます。 +In 4D, all errors can be catched and handled in a specific project method, the **error-handling** (or **error-catching**) method. -このプロジェクトメソッドはカレントプロセスに対して実装 (インストール) され、インタープリターモードかコンパイルモードかにかかわらず、プロセス内で発生するすべてのエラーの際に自動で呼び出されます。 このプロジェクトメソッドを *実装* するには、`ON ERR CALL` コマンドをコールし、コマンドに当該プロジェクトメソッド名を引数として渡します。 たとえば: +This project method is installed for the current process and will be automatically called for any error that occurs in the process, in interpreted or compiled mode. To *install* this project method, you just need to call the `ON ERR CALL` command with the project method name as parameter. For example: ```4d -ON ERR CALL("IO_ERRORS") // エラー処理メソッドを実装します +ON ERR CALL("IO_ERRORS") //Installs the error-handling method ``` -エラーの検知を中止するには、空の文字列を指定して再度 `ON ERR CALL` コマンドをコールします: +To stop catching errors and give back hand to 4D, call `ON ERR CALL` with an empty string: ```4d -ON ERR CALL("") // エラーの検知を中止します +ON ERR CALL("") //gives back control to 4D ``` -`Method called on error` コマンドは、`ON ERR CALL` によってカレントプロセスにインストールされているエラー処理メソッド名を返します。 このコマンドは汎用的なコードでとくに有用です。エラー処理メソッドを一時的に変更し、後で復元することができます: +The `Method called on error` command allows to know the name of the method installed by `ON ERR CALL` for the current process. It is particularly useful in the context of generic code because it enables you to temporarily change and then restore the error-catching method: ```4d $methCurrent:=Method called on error ON ERR CALL("NewMethod") - // ドキュメントを開くことができなければエラーが生成されます + //If the document cannot be opened, an error is generated $ref:=Open document("MyDocument") - // 前のエラー処理メソッドに戻します + //Reinstallation of previous method ON ERR CALL($methCurrent) ``` -### スコープとコンポーネント +### Scope and components -アプリケーションにおいて一つのエラーキャッチメソッドを使うやり方もあれば、アプリケーションのモジュールごとに違うメソッドを定義する方法もあります。 ただし、一つのプロセスにつき実装できるのは一つのメソッドのみです。 +You can define a single error-catching method for the whole application or different methods per application module. However, only one method can be installed per process. -`ON ERR CALL` コマンドによって実装されたエラー処理メソッドは実行中のアプリケーションにしか適用されません。 つまり、**コンポーネント** によってエラーが生成されても、ホストアプリケーションにおいて `ON ERR CALL` で実装されたエラー処理メソッドは反応しませんし、逆もまた然りです。 +An error-handling method installed by the `ON ERR CALL` command only applies to the running application. In the case of an error generated by a **component**, the `ON ERR CALL` error-handling method of the host application is not called, and vice versa. -### メソッド内でのエラー処理 +### Handling errors within the method -独自に作成してエラー処理メソッド内では、エラーを調査するための情報がいくつか提供されています: +Within the custom error method, you have access to several information that will help you identifying the error: -- 専用のシステム変数 (*): +- dedicated system variables(*): - - `Error` (倍長整数): エラーコード - - `Error method` (テキスト): エラーを生成したメソッドの名称 - - `Error line` (倍長整数): エラーを生成したメソッドの行番号 - - `Error formula` (テキスト): エラーの元となった 4D コードのフォーミュラ (テキスト) + - `Error` (longint): error code + - `Error method` (text): name of the method that triggered the error + - `Error line` (longint): line number in the method that triggered the error + - `Error formula` (text): formula of the 4D code (raw text) which is at the origin of the error. -(*) 4D は、いくつかの **システム変数** と呼ばれる専用の変数を自動的に管理しています。 詳細については [4D ランゲージマニュアル](https://doc.4d.com/4Dv18/4D/18/System-Variables.300-4505547.ja.html) を参照ください。 +(*) 4D automatically maintains a number of variables called **system variables**, meeting different needs. See the *4D Language Reference manual*. -- `GET LAST ERROR STACK` コマンドは、4Dアプリケーションの現在のエラースタックに関する情報を返します。 -- `Get call chain` コマンドは、カレントプロセス内における、メソッド呼び出しチェーンの各ステップを詳細に説明するオブジェクトのコレクションを返します。 +- the `GET LAST ERROR STACK` command that returns information about the current stack of errors of the 4D application. +- the `Get call chain` command that returns a collection of objects describing each step of the method call chain within the current process. -#### 例題 +#### Example -簡単なエラー処理システムの例です: +Here is a simple error-handling system: ```4d -// エラー処理メソッドをインストールします +//installing the error handling method ON ERR CALL("errorMethod") - //... コードの実行 - ON ERR CALL("") // エラーの検知を中止します + //... executing code + ON ERR CALL("") //giving control back to 4D ``` ```4d -// errorMethod プロジェクトメソッド - If(Error#1006) // これはユーザーによる割り込みではありません - ALERT("エラー "+String(Error)+" が発生しました。 問題となったコードはこちらです: \""+Error formula+"\"") +// errorMethod project method + If(Error#1006) //this is not a user interruption + ALERT("The error "+String(Error)+" occurred". The code in question is: \""+Error formula+"\"") End if ``` -### 空のエラー処理メソッド +### Using an empty error-handling method -標準のエラーダイアログを表示させないようにするには、空のエラー処理メソッドを実装するだけで実現できます。 `Error` システム変数はエラー処理メソッド以外のメソッドでも確認することができます: +If you mainly want the standard error dialog box to be hidden, you can install an empty error-handling method. The `Error` system variable can be tested in any method, i.e. outside of the error-handling method: ```4d -ON ERR CALL("emptyMethod") // emptyMethod は空のエラー処理メソッドです +ON ERR CALL("emptyMethod") //emptyMethod exists but is empty $doc:=Open document( "myFile.txt") If (Error=-43) - ALERT("ファイルが見つかりません。") + ALERT("File not found.") End if ON ERR CALL("") ``` diff --git a/website/translated_docs/ja/Concepts/flow-control.md b/website/translated_docs/ja/Concepts/flow-control.md index 608d810afd7f15..d91514dc381e4d 100644 --- a/website/translated_docs/ja/Concepts/flow-control.md +++ b/website/translated_docs/ja/Concepts/flow-control.md @@ -1,16 +1,16 @@ --- id: control-flow -title: 制御フロー +title: Control flow overview --- -メソッドが単純か複雑かに関係なく、開発者は3つのプログラミング構造のうち、1つ以上を常に使用します。 プログラミング構造は、メソッド内でステートメントが実行される順序を決定する実行フローをコントロールします。 3つのタイプの構造があります: +Regardless of the simplicity or complexity of a method, you will always use one or more of three types of programming structures. Programming structures control the flow of execution, whether and in what order statements are executed within a method. There are three types of structures: -- **シーケンシャル**: シーケンシャル構造は単純な線形構造です。 シーケンスとは、4Dが最初から最後まで次々に実行する一連のステートメントです。 オブジェクトメソッドで頻繁に使用される1行から成るルーチンはもっとも簡単なシーケンシャル構造の例です。 例: `[People]lastName:=Uppercase([People]lastName)` -- **[分岐](Concepts/cf_branching.md)**: 分岐構造は、条件をテストし、その結果に基づいて異なる流れにメソッドを導きます。 条件は true または false に評価されるブール式です。 `If...Else...End if` 構文は分岐構造の一例で、処理フローを二つに分岐します。 `Case of...Else...End case` 構文も分岐構造の一つで、処理フローをもっとたくさん分岐することができます。 -- **[ループ](Concepts/cf_looping.md)**: メソッドの作成にあたって、何度も同じ処理を繰り返すことがあります。 これに実現するために、4Dは以下のループ構造を備えています: +- **Sequential**: a sequential structure is a simple, linear structure. A sequence is a series of statements that 4D executes one after the other, from first to last. A one-line routine, frequently used for object methods, is the simplest case of a sequential structure. For example: `[People]lastName:=Uppercase([People]lastName)` +- **[Branching](Concepts/cf_branching.md)**: A branching structure allows methods to test a condition and take alternative paths, depending on the result. The condition is a Boolean expression, an expression that evaluates TRUE or FALSE. One branching structure is the `If...Else...End if` structure, which directs program flow along one of two paths. The other branching structure is the `Case of...Else...End case` structure, which directs program flow to one of many paths. +- **[Looping](Concepts/cf_looping.md)**: When writing methods, it is very common to find that you need a sequence of statements to repeat a number of times. To deal with this need, the 4D language provides the following looping structures: - `While...End while` - `Repeat...Until` - `For...End for` - - `For each...End for each`
    ルー プを制御する方法には、条件が満たされるまでループする方法と、指定した回数だけループする方法の2通りがあります。 各ループ構造はいずれの方法にも用いることができますが、`While` ループと `Repeat` ループは条件が満たされるまで繰り返す場合に、`For` ループは指定した回数だけループする場合の利用に適切です。 `For each...End for each` ループは両方を組み合わせることが可能で、オブジェクトやコレクション内でループするために設計されています。 + - `For each...End for each`
    The loops are controlled in two ways: either they loop until a condition is met, or they loop a specified number of times. Each looping structure can be used in either way, but `While` loops and `Repeat` loops are more appropriate for repeating until a condition is met, and `For` loops are more appropriate for looping a specified number of times. `For each...End for each` allows mixing both ways and is designed to loop within objects and collections. -**注:** 4Dはプログラム構造 (If/While/For/Caes of/Repeat/For each) を512レベルまで入れ子で記述できます。 +**Note:** 4D allows you to embed programming structures up to a "depth" of 512 levels. diff --git a/website/translated_docs/ja/Concepts/identifiers.md b/website/translated_docs/ja/Concepts/identifiers.md index f55de16b7ad9c7..d588b84521df38 100644 --- a/website/translated_docs/ja/Concepts/identifiers.md +++ b/website/translated_docs/ja/Concepts/identifiers.md @@ -1,72 +1,72 @@ --- id: identifiers -title: 識別子の命名規則 +title: Identifiers --- -この章では、4D ランゲージにおけるさまざまな要素 (変数、テーブル、オブジェクト、フォームなど) の命名規則について説明します。 +This section describes the conventions and rules for naming various elements in the 4D language (variables, tables, objects, forms, etc.). -## 基本ルール +## Basic Rules -以下の命名規則は 4D フレームワークにおいて全般的に適用されます: +The following rules apply for all 4D frameworks. -- 識別子の 1文字目は、半角アルファベット、アンダースコア ("_")、あるいはドル記号 ("$") で始めます。 -- その後の文字には、半角アルファベット文字・数字・スペース・アンダースコアを使用ができます。 -- ピリオド (".") および大カッコ ("[ ]") は、テーブル・フィールド・メソッド・変数の名称に使用できません。 -- カンマ (,)・スラッシュ(/)・引用符(")・コロン(:) の使用は禁止されています。 -- 演算子として用いられる記号 ("*" や "+" など) の使用は禁止されています。 -- 予約語を使用しないでください。予約語にはコマンド名 (`Date`, `Time` 等)、キーワード (If, For 等)、そして定数が含まれます。 -- 名前の最後につけたスペースは無視されます。 +- A name must begin with an alphabetic character, an underscore, or a dollar ("$") (note that a dollar sign can denote a local element, see below). +- Thereafter, the name can include alphabetic characters, numeric characters, the space character, and the underscore character ("_"). +- Periods (".") and brackets ("[ ]") are not allowed in table, field, method, or variable names. +- Commas, slashes, quotation marks, and colons are not allowed. +- Characters reserved for use as operators, such as * and +, are not allowed. +- Do not use reserved names, i.e. 4D command names (`Date`, `Time`, etc), keywords (If, For, etc.), and constants. +- Any trailing spaces are ignored. -### ORDA やオブジェクトプロパティに適用される追加ルール +### Additional rules for object property and ORDA names -- スペースは使えません。 -- ピリオド (".") および大カッコ ("[ ]") は使用できません。 -- 大文字・小文字は区別されます。 +- Space characters are not allowed. +- Periods (".") and brackets ("[ ]") are not allowed. +- Names are case sensitive. -### SQL で処理する場合の追加ルール +### Additional rules for SQL -- 文字 _0123456789abcdefghijklmnopqrstuvwxyz のみを使用できます。 -- 名前に SQLキーワード (コマンド、属性 等) が含まれていてはなりません。 +- Only the characters _0123456789abcdefghijklmnopqrstuvwxyz are accepted +- Names must not include any SQL keywords (command, attribute, etc.). -**注:** ストラクチャーエディターのインスペクター下部にある ”SQL” エリアには、テーブル名やフィールド名として許可されない文字があると警告が表示されます。 +**Note:** The "SQL" area of the Inspector in the Structure editor automatically indicates any unauthorized characters in the name of a table or field. -## 配列 +## Arrays -配列は、配列作成時に配列宣言コマンド (ARRAY LONGINT 等) に渡す名前でもって表されます。 配列は変数であり、配列名はスコープ記号を除いて31文字まで指定することができます。スコープに基づいて次の3種類があります: +You designate an array by using its name, which is the name you pass to an array declaration (such as ARRAY LONGINT) when you create the array. Arrays are variables, and like variables, the name of an array can be up to 31 characters, not including the scope symbols, and there are three different types of arrays: -- 配列名がドル記号 ($) で始まるものは、**ローカル** 配列です。 -- (<>記号や$記号から始まらない) 名前を使用して、**プロセス** 配列を表します。 -- **インタープロセス** 配列の名前は、先頭にインタープロセス記号 (<>) が付きます。 +- The name of a **local** array is preceded by the dollar sign ($). +- The name of a **process** array cannot start with the <> symbols nor the dollar sign $). +- The name of an **interprocess** array is preceded by the symbols (<>) — a “less than” sign followed by a “greater than” sign. -例: +Examples: ```4d -ARRAY TEXT($atSubjects;Records in table([Topics])) // ローカル配列 -SORT ARRAY(asKeywords;>) // プロセス配列 -ARRAY BOOLEAN(<>settings;Records in table([MySettings])) // インタープロセス配列 +ARRAY TEXT($atSubjects;Records in table([Topics])) //local array +SORT ARRAY(asKeywords;>) //process array +ARRAY BOOLEAN(<>settings;Records in table([MySettings])) //interprocess array ``` -### 配列の要素 -中カッコ ("{ }") を使用して、インタープロセス配列、プロセス配列、ローカル配列の要素を参照します。 参照される配列要素は数式で表されます。 +### Elements of arrays +You reference an element of an interprocess, process or local array by using the curly braces("{ }"). The element referenced is denoted by a numeric expression. -例: +Examples: ```4d - // ローカル配列の特定要素にアクセスする例 + //Addressing an element of a local array If($asKeywords{1}="Stop") $atSubjects{$vlElem}:=[Topics]Subject $viNextValue:=$aiBigArray{Size of array($aiBigArray)} ``` -### 二次元配列の要素 -中カッコ ("{ }") を2回使用して、2次元配列の要素を参照します 。 参照される要素は2組の中カッコ内の2つの数式で表されます。 +### Elements of two-dimensional arrays +You reference an element of a two-dimensional array by using the curly braces ({…}) twice. The element referenced is denoted by two numeric expressions in two sets of curly braces. -例: +Examples: ```4d - // 二次元配列の特定要素にアクセスする例 + //Addressing an element of a two-dimensional process array If(asKeywords{$vlNextRow}{1}="Stop") atSubjects{10}{$vlElem}:=[Topics]Subject $viNextValue:=aiBigArray{$vlSet}{Size of array(aiBigArray{$vlSet})} @@ -74,81 +74,81 @@ $viNextValue:=aiBigArray{$vlSet}{Size of array(aiBigArray{$vlSet})} ## Classes -クラス名は標準的な [プロパティ名の命名規則](Concepts/dt_object.md#ORDA-やオブジェクトプロパティに適用される追加ルール) に準拠している必要があります。 大文字・小文字は区別されます。 競合防止のため、[データベーステーブル](#tables) と同じ名前のクラスを作成するのは推奨されないこと +A class name must be compliant with standard [property naming rules](#additional-rules-for-object-property-and-orda-names). They are case sensitive. Giving the same name to a class and a [database table](#tables) is not recommended, in order to prevent any conflict. -## フィールド +## Fields -フィールドが属するテーブルを最初に指定することで、フィールドを表します。 フィールド名はテーブル名のすぐ後に続けます。 フィールド名は31文字以内で指定します。 +You designate a field by first specifying the table to which it belongs. The field name immediately follows the table name. A field name can contain up to 31 characters. -例: +Examples: ```4d [Orders]Total:=Sum([Line]Amount) QUERY([Clients];[Clients]Name="Smith") [Letters]Text:=Capitalize text([Letters]Text) ``` -## フォームオブジェクト +## Form objects -フォームオブジェクトを引数としてコマンドに渡すには、文字列の名称の前に、任意パラメーターである * 記号を使います。 オブジェクト名には最大で255バイトまで含めることができます。 +You designate a form object by passing its name as a string, preceded by the * parameter. A form object name can contain up to 255 characters. -例: +Example: ```4d OBJECT SET FONT(*;"Binfo";"Times") ``` -**注:** フォームオブジェクト (ボタン、リストボックス、入力可能な変数など) と 4Dランゲージのオブジェクト型を混同しないようにしてください。 4Dランゲージのオブジェクト型はオブジェクト記法と専用のコマンドを使用して作成し、管理されます。 +**Note:** Do not confuse form objects (buttons, list boxes, variables that can be entered, etc.) and objects in the 4D language. 4D language objects are created and manipulated via object notation or dedicated commands. ## Forms -フォームの名前は文字列を使用して表します。 フォーム名は31文字以内で指定します。 +You designate a form by using a string expression that represents its name. A form name can contain up to 31 characters. -例: +Examples: ```4d FORM SET INPUT([People];"Input") FORM SET OUTPUT([People];"Output") DIALOG([Storage];"Note box"+String($vlStage)) ``` -## 関数 +## Functions -関数名は標準的な [プロパティ名の命名規則](Concepts/dt_object.md#ORDA-やオブジェクトプロパティに適用される追加ルール) に準拠している必要があります。 +Function names must be compliant with standard [property naming rules](#additional-rules-for-object-property-and-orda-names). -> Tip: アンダースコア ("_") 文字で関数名を開始すると、その関数は 4Dコードエディターの自動補完機能から除外されます。 +> Tip: Starting the function name with an underscore character ("_") will exclude the function from the autocompletion features in the 4D code editor. -## 命名セレクション +## Named Selections -命名セレクション名は、スコープ記号を除いて255文字以内で指定します。 +A named selection name can contain up to 255 characters, not including scope character(s). -- **プロセス** 命名セレクションの名前を表す文字列式を使用してプロセスセットを表します (<>記号も$記号も名前の先頭につきません) 。 -- **インタープロセス** 命名セレクションの名前は、先頭にインタープロセス記号 (<>) が付きます。 +- You denote a **process** named selection by using a string expression that represents its name (which cannot start with the <> symbols nor the dollar sign $). +- You denote an **interprocess** named selection if its name is preceded by the symbols (<>) — a “less than” sign followed by a “greater than” sign. -例: +Examples: ```4d -USE NAMED SELECTION([Customers];"Closed")// プロセス命名セレクション -USE NAMED SELECTION([Customers];"<>ByZipcode") // インタープロセス命名セレクション +USE NAMED SELECTION([Customers];"Closed")//Process Named Selection +USE NAMED SELECTION([Customers];"<>ByZipcode") //Interprocess Named Selection ``` -## オブジェクト属性 +## Object attributes -ドット (".") をオブジェクト名と属性名の間に置くことでオブジェクト属性 (オブジェクトプロパティとも呼びます) を指定します。 属性名は255文字以内の文字列で指定し、また大文字と小文字を区別することに注意してください。 +You designate an object attribute (also called object property) by placing a point (".") between the name of the object and the name of the attribute. An attribute name can contain up to 255 characters and is case sensitive. -例: +Examples: ```4d myObject.myAttribute:="10" $value:=$clientObj.data.address.city ``` -**注:** オブジェクト属性名にはさらにルールが適用されます (オブジェクト属性は ECMAScript の仕様に沿う必要があります)。 詳細については、[上述の追加ルール](#ORDA-やオブジェクトプロパティに適用される追加ルール) および [オブジェクトプロパティ識別子](Concepts/dt_object.md#オブジェクトプロパティ識別子) を参照ください。 +**Note:** Additional rules apply to object attribute names (they must comply with the ECMAScript specification). For more information, see [additional rules above](#additional-rules-for-object-property-and-orda-names) and [Object property identifiers](Concepts/dt_object.md#object-property-identifiers). -## 引数 +## Parameters -引数名は必ず `$` 文字で始まり、[プロパティ名の命名規則](Concepts/dt_object.md#ORDA-やオブジェクトプロパティに適用される追加ルール) に準拠している必要があります。 +Parameter names must start with a `$` character and be compliant with [property naming rules](#additional-rules-for-object-property-and-orda-names). -例: +Examples: ```4d Function getArea($width : Integer; $height : Integer)-> $area : Integer @@ -156,172 +156,172 @@ Function getArea($width : Integer; $height : Integer)-> $area : Integer #DECLARE ($i : Integer ; $param : Date) -> $myResult : Object ``` -## プラグインコマンド +## Plug-In Commands -プラグインにより定義された名前を使用して、プラグインコマンドを表します。 プラグインコマンド名は 31文字以内で指定します。 +You designate a plug-in command by using its name as defined by the plug-in. A plug-in command name can contain up to 31 characters. -例: +Example: ```4d $error:=SMTP_From($smtp_id;"henry@gmail.com") ``` -## プロセス +## Processes -ローカルプロセス名は、スコープ記号を除いて255文字以内で指定します。 +A process name can contain up to 255 characters, not including scope character. -シングルユーザー版およびクライアント/サーバー版のクライアント側において、**グローバル** と **ローカル** という2種類のプロセススコープがあります。 +In the single-user version, or in Client/Server on the Client side, there are two process scopes: **global** or **local**. -- $記号以外から始まる文字列を使用して **グローバル** プロセスの名前を表します。 -- 名前の前にドル記号 ($) をつけて **ローカル** プロセスを表します。 +- You denote a **global** process by using a string expression that represents its name (which cannot start with the dollar sign $). +- You denote a **local** process if the name of the process is preceded by a dollar ($) sign. -例: +Examples: ```4d - // グローバルプロセス "Add Customers" を開始します + //Starting the global process "Add Customers" $vlProcessID:=New process("P_ADD_CUSTOMERS";48*1024;"Add Customers") - // ローカルプロセス "$Follow Mouse Moves" を開始します + //Starting the local process "$Follow Mouse Moves" $vlProcessID:=New process("P_MOUSE_SNIFFER";16*1024;"$Follow Mouse Moves") ``` -## プロジェクトメソッド +## Project methods -プロジェクトメソッド (プロシージャーおよび関数) は名前によって表されます。 メソッド名は31文字以内で指定します。 +You designate a project method (procedure or function) by using its name. A method name can contain up to 31 characters. -**注:** 結果を返さないプロジェクトメソッドはプロシージャーとも呼ばれます。 結果を返すプロジェクトメソッドを関数と呼びます。 +**Note:** A project method that does not return a result is also called a procedure. A project method that returns a result is also called a function. -例: +Examples: ```4d If(New client) DELETE DUPLICATED VALUES APPLY TO SELECTION([Employees];INCREASE SALARIES) ``` -**Tip:** 4Dのビルトインコマンドと同じ命名規約を利用することは良いプログラミングテクニックです。 メソッド名には大文字を使用しますが、メソッドが関数の場合には最初の文字だけを大文字にします。 このように命名することにより、数ヶ月後に保守のためプロジェクトを再度開いたときに、エクスプローラーウィンドウでその名前を見ただけで、メソッドが結果を返すかどうかがわかります。 +**Tip:** It is a good programming technique to adopt the same naming convention as the one used by 4D for built-in methods. Use uppercase characters for naming your methods; however if a method is a function, capitalize the first character of its name. By doing so, when you reopen a project for maintenance after a few months, you will already know if a method returns a result by simply looking at its name in the Explorer window. -**注:** メソッドを呼び出すには、そのメソッド名を入力します。 しかし `ON EVENT CALL` など一部の 4Dのビルトインコマンドやプラグインコマンドにメソッド名を引数として渡す場合には文字列 (ダブルクォートで括る) として渡します。 例: +**Note:** When you call a method, you just type its name. However, some 4D built-in commands, such as `ON EVENT CALL`, as well as all the Plug-In commands, expect the name of a method as a string when a method parameter is passed. Examples: ```4d - // このコマンドはメソッド (関数) またはフォーミュラを受け取ります + //This command expects a method (function) or formula QUERY BY FORMULA([aTable];Special query) - // このコマンドはメソッド (プロシージャ) またはステートメントを受け取ります + //This command expects a method (procedure) or statement APPLY TO SELECTION([Employees];INCREASE SALARIES) - // このコマンドはメソッド名を文字列で受け取ります + //But this command expects a method name ON EVENT CALL("HANDLE EVENTS") ``` -プロジェクトメソッドには引数を渡すことができます。 メソッドに引数を渡す場合は、メソッド名の後の括弧 () に引数を入れ、 セミコロン (;) で区切ります。 引数は受け取り側のメソッドにて、受け取り順に番号が付けられたローカル変数 ($1, $2, ...$n) に格納されます。 さらに、複数の連続する引数は、${n}というシンタックスを用いて使用できます。nは数値で引数の番号を示します。 +Project methods can accept parameters (arguments). The parameters are passed to the method in parentheses, following the name of the method. Each parameter is separated from the next by a semicolon (;). The parameters are available within the called method as consecutively numbered local variables: $1, $2,…, $n. In addition, multiple consecutive (and last) parameters can be addressed with the syntax ${n}where n, numeric expression, is the number of the parameter. -関数の戻り値は、ローカル変数 $0 に代入することで指定します。 +Inside a function, the $0 local variable contains the value to be returned. -例: +Examples: ```4d - // DROP SPACES メソッド内で、$1 はフィールド [People]Name へのポインターです + //Within DROP SPACES $1 is a pointer to the field [People]Name DROP SPACES(->[People]Name) - // Calc creator メソッド内で、 - //- $1 は数値の 1 - //- $2 は数値の 5 - //- $3 テキストまたは文字列の "Nice" - //- 戻り値は $0 に代入されます + //Within Calc creator: + //- $1 is numeric and equal to 1 + //- $2 is numeric and equal to 5 + //- $3 is text or string and equal to "Nice" + //- The result value is assigned to $0 $vsResult:=Calc creator(1;5;"Nice") - // Dump メソッド内で、 - //- 3つの引数はテキストまたは文字列です - //- これらの引数は $1, $2, $3 で参照できます - //- また、これらの引数を ${$vlParam} で間接的に参照することもできます ($vlParamは1, 2, 3) - //- 戻り値は $0 に代入されます + //Within Dump: + //- The three parameters are text or string + //- They can be addressed as $1, $2 or $3 + //- They can also be addressed as, for instance, ${$vlParam} where $vlParam is 1, 2 or 3 + //- The result value is assigned to $0 vtClone:=Dump("is";"the";"it") ``` -## セット +## Sets -セット名は、スコープ記号を除いて255文字以内で指定します。 +A set name can contain up to 255 characters, not including scope character()s). -- セットの名前を表す文字列を使用して **プロセス** セットを表します (<>記号も$記号も名前の先頭につきません) 。 -- **インタープロセス** セットの名前は、先頭にインタープロセス記号 (<>) が付きます。 -- 4D サーバー上において **クライアント** セット名は、先頭にドル記号 ($) を指定します。 クライアントセット名は、ドル記号を除いて255文字以内で指定します。 +- You denote a **process** set by using a string expression that represents its name (which cannot start with the <> symbols or the dollar sign $). +- You denote an **interprocess** set if the name of the set is preceded by the symbols (<>) — a “less than” sign followed by a “greater than” sign. +- On 4D Server, the name of a **client** set is preceded by the dollar sign ($). A client set name can contain up to 255 characters, not including the dollar sign. -> セットはサーバーマシン上で保守されます。 効率や特殊目的のために、クライアントマシン上でローカルにセットを使用したい場合があります。 このような場合にクライアントセットを使用します。 +> Sets are maintained on the Server machine. In certain cases, for efficiency or special purposes, you may need to work with sets locally on the Client machine. To do so, you use client sets. -例: +Examples: ```4d -CREATE SET([Customers];"Customer Orders")// プロセスセット -USE SET("<>Deleted Records") // インタープロセスセット -If(Records in set("$Selection"+String($i))>0) // クライアントセット +CREATE SET([Customers];"Customer Orders")//Process set +USE SET("<>Deleted Records") //Interprocess set +If(Records in set("$Selection"+String($i))>0) //Client set ``` -## テーブル +## Tables -大カッコ内 (\[...]) に名前を入れることで、テーブルを表します。 テーブル名は、31文字以内で指定します。 競合防止のため、[クラス](#クラス) と同じ名前のテーブルを作成するのは推奨されません。 +You designate a table by placing its name between brackets: \[...]. A table name can contain up to 31 characters. Giving the same name to a table and a [class](#classes) is not recommended, in order to prevent any conflict. -例: +Examples: ```4d DEFAULT TABLE([Orders]) FORM SET INPUT([Clients];"Entry") ADD RECORD([Letters]) ``` -## 変数 +## Variables -変数名は、スコープ記号を除いて最大31文字以内で指定することができます。 +The name of a variable can be up to 31 characters, not including the scope symbols. -- ドル記号 ($) を名前の先頭につけて **ローカル** 変数を表します。 -- (<>記号や$記号から始まらない) 名前を使用して、**プロセス** 変数を表します。 -- 名前の先頭にインタープロセス記号 (<>) を付けることによって、**インタープロセス** 変数を表します。 +- You designate a **local** variable by placing a dollar sign ($) before the variable name. +- You designate a **process** variable by using its name (which cannot start with the <> symbols nor the dollar sign $) +- You designate an **interprocess** variable by preceding the name of the variable with the symbols (<>) — a “less than” sign followed by a “greater than” sign. -例: +Examples: ```4d -For($vlRecord;1;100) // ローカル変数 -$vsMyString:="Hello there" // ローカル変数 -If(bValidate=1) // プロセス変数 -<>vlProcessID:=Current process // インタープロセス変数 +For($vlRecord;1;100) //local variable +$vsMyString:="Hello there" //local variable +If(bValidate=1) //process variable +<>vlProcessID:=Current process //interprocess variable ``` -## 識別子の一覧 +## Summary of Identifiers -次の表は、4Dの命名規則についてまとめています。 +The following table summarizes 4D naming conventions. -| 識別子 | 最大 長 | 例題 | -| ---------------- | -------- | -------------------------- | -| テーブル | 31 | [Invoices] | -| フィールド | 31 | [Employees]Last Name | -| インタープロセス変数/配列 | <> + 31 | <>vlNextProcessID | -| プロセス変数/配列 | 31 | vsCurrentName | -| ローカル変数/配列 | $ + 31 | $vlLocalCounter | -| オブジェクト属性 | 255 | $o.myAttribute | -| フォーム | 31 | "My Custom Web Input" | -| フォームオブジェクト | 255 | "MyButton" | -| プロジェクトメソッド | 31 | M_ADD_CUSTOMERS | -| プラグインコマンド | 31 | PDF SET ROTATION | -| インタープロセスセット | <> + 255 | "<>Records to be Archived" | -| プロセスセット | 255 | "Current selected records" | -| クライアントセット | $ + 255 | "$Previous Subjects" | -| 命名セレクション | 255 | "Employees A to Z" | -| インタ-プロセス命名セレクション | <> + 255 | "<>Employees Z to A" | -| ローカルプロセス | $ + 255 | "$Follow Events" | -| グロ-バルプロセス | 255 | "*P_INVOICES_MODULE*" | -| セマフォー | 255 | "mysemaphore" | +| Identifier | Max. Length | Example | +| ---------------------------- | ----------- | -------------------------- | +| Table | 31 | [Invoices] | +| Field | 31 | [Employees]Last Name | +| Interprocess Variable/Array | <> + 31 | <>vlNextProcessID | +| Process Variable/Array | 31 | vsCurrentName | +| Local Variable/Array | $ + 31 | $vlLocalCounter | +| Object attribute | 255 | $o.myAttribute | +| Form | 31 | "My Custom Web Input" | +| Form object | 255 | "MyButton" | +| Project method | 31 | M_ADD_CUSTOMERS | +| Plug-in Routine | 31 | PDF SET ROTATION | +| Interprocess Set | <> + 255 | "<>Records to be Archived" | +| Process Set | 255 | "Current selected records" | +| Client Set | $ + 255 | "$Previous Subjects" | +| Named Selection | 255 | "Employees A to Z" | +| Interprocess Named Selection | <> + 255 | "<>Employees Z to A" | +| Local Process | $ + 255 | "$Follow Events" | +| Global Process | 255 | "*P_INVOICES_MODULE*" | +| Semaphore | 255 | "mysemaphore" | -**注:** 非ローマ文字 (日本語など) が識別子に使用された場合、その最大長は短かくなることがあります。 +**Note:** If non-Roman characters are used in the names of the identifiers, their maximum length may be smaller. -## 名前が重複する場合 +## Resolving Naming Conflicts -プロジェクト内の要素に対して、ぞれぞれ重複しない名前を使用するようにしてください。 特定の要素が別タイプの要素と同じ名前を持つ場合 (たとえばフィールドが Person という名前で、変数も Person という名前の場合)、4Dは優先順位システムを使用します。 +Be sure to use unique names for the different elements in your project. If a particular element has the same name as another element of a different type (for example, if a field is named Person and a variable is also named Person), 4D uses a priority system. -4Dは、メソッドで使用される名前を次の順位で識別します: +4D identifies names used in procedures in the following order: -1. フィールド -2. コマンド +1. Fields +2. Commands 3. Methods -4. プラグインコマンド -5. 定義済み定数 -6. 変数 +4. Plug-in routines +5. Predefined constants +6. Variables. -たとえば、4Dには `Date` というビルトインコマンドがあります。 メソッドに *Date* という名前を付けても、4Dはビルトインコマンドの `Date` として認識し、メソッドとしては認識しません。 つまり、そのメソッドの呼び出しはできないということです。 しかしながら、フィールドを "Date" と命名した場合には、4Dは `Date` コマンドの代わりにフィールドとしての使用を試みます。 +For example, 4D has a built-in command called `Date`. If you named a method *Date*, 4D would recognize it as the built-in `Date` command, and not as your method. This would prevent you from calling your method. If, however, you named a field “Date”, 4D would try to use your field instead of the `Date` command. diff --git a/website/translated_docs/ja/Concepts/interpreted.md b/website/translated_docs/ja/Concepts/interpreted.md index 29ce454e590bda..523905cd50ff31 100644 --- a/website/translated_docs/ja/Concepts/interpreted.md +++ b/website/translated_docs/ja/Concepts/interpreted.md @@ -1,62 +1,62 @@ --- id: interpreted-compiled -title: インタープリターモードとコンパイル済みモード +title: Interpreted and Compiled modes --- -4D アプリケーションは **インタープリター** または **コンパイル済み** モードで実行することができます: +4D applications can work in **interpreted** or **compiled** mode: -- インタープリターモードにおいて、コードは実行時に読み込まれてマシン語に翻訳されます。 コードはいつでも追加・変更することができ、アプリケーションは自動的に更新されます。 -- コンパイル済みモードにおいては、コンパイル時にすべてのコードが一括で読み込まれて翻訳されます。 コンパイル後のアプリケーションにはアセンブリレベルの指示のみが残され、コード編集はできません。 +- in interpreted mode, statements are read and translated in machine language at the moment of their execution. You can add or modify the code whenever you need to, the application is automatically updated. +- in compiled mode, all methods are read and translated once, at the compilation step. Afterwards, the application only contains assembly level instructions are available, it is no longer possible to edit the code. -コンパイルには以下のようなメリットがあります: +The advantages of the compilation are: -- **速度**: アプリケーションの実行速度を3倍から1000倍速くします。 -- **コードチェック**: アプリケーションコードの整合性をチェックし、 論理的矛盾や構文的矛盾を検出します。 -- **保護**: アプリケーションをコンパイルすると、インタープリターコードを削除できます。 コンパイルされたアプリケーションは、故意的にも不注意からもストラクチャーやメソッドの表示・修正ができないこと以外は、オリジナルのアプリケーションと同じに動作します。 -- **ダブルクリックで起動するアプリケーション**: コンパイル後のアプリケーションは、独自のアイコンを持つスタンドアロンアプリケーション (.EXEファイル) に作り変えることもできます。 -- **プリエンプティブモードでの実行**: プリエンプティブプロセスとして実行できるのは、コンパイルされたコードに限られます。 +- **Speed**: Your application can run from 3 to 1,000 times faster. +- **Code checking**: Your application is scanned for the consistency of code. Both logical and syntactical conflicts are detected. +- **Protection**: Once your application is compiled, you can delete the interpreted code. Then, the compiled application is functionally identical to the original, except that the structure and methods cannot be viewed or modified, deliberately or inadvertently. +- **Stand-alone double-clickable applications**: compiled applications can also be transformed into stand-alone applications (.EXE files) with their own icon. +- **Preemptive mode**: only compiled code can be executed in preemptive processes. -## インタープリターコードとコンパイル済みコードの違い -アプリケーションの動作は同じであっても、インタープリターモードとコンパイル済みモードにはいくつかの相違点があり、コンパイルされるコードを書くにあたってはこれらを意識しておく必要があります。 基本的に、4D のインタープリターはコンパイラーより柔軟です。 +## Differences between interpreted and compiled code +Although application will work the same way in interpreted and compiled modes, there are some differences to know when you write code that will be compiled. The 4D interpreter is usually more flexible than the compiler. -| コンパイル済みコード | インタープリターコード | -| ---------------------------------------------------------------------------------------- | -------------------------------- | -| 変数名とメソッド名が被ってはいけません。 | エラーは生成されませんが、メソッドが優先されます。 | -| コンパイラ指示子 (例: `C_LONGINT`) によって、またはコンパイル時にコンパイラーによって、すべての変数は型指定されなければなりません。 | 変数の型は実行中に決定していくことができます (推奨されません) | -| 変数や配列のデータタイプは変更できません。 | 変数や配列のデータタイプは変更可能です (推奨されません) | -| 1次元配列を2次元配列に、また2次元配列を1次元配列に変更することはできません。 | 可能です。 | -| コンパイラーにより変数のタイプ定義はおこなわれますが、フォーム上の変数のようにデータタイプが明確でない場合は、コンパイラー指示子を使用して変数のデータタイプを指定するべきです。 | | -| `Undefined` 関数は、常に False を返します。 変数は常に定義されています。 | | -| メソッドの "プリエンプティブプロセスで実行可能" プロパティにチェックを入れていた場合、コードは他のスレッドアンセーフなコマンドやメソッドを呼び出してはいけません。 | プリエンプティブプロセスプロパティは無視されます。 | -| 特定のループの場合、割り込みを可能にするには `IDLE` コマンドが必要です。 | いつでも割り込み可能です。 | +| Compiled | Interpreted | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------ | +| You cannot have a method with the same name as a variable. | No error is generated, but priority is given to the method | +| All variables must by typed, either through a compiler directive (ex: `C_LONGINT`), or by the compiler at compilation time. | Variables can be typed on-the-fly (not recommended) | +| You cannot change the data type of any variable or array. | Changing the data type of a variable or an array is possible (not recommended) | +| You cannot change a one-dimensional array to a two-dimensional array, or change a two-dimensional array to a one-dimensional array. | Possible | +| Although the compiler will type the variable for you, you should specify the data type of a variable by using compiler directives where the data type is ambiguous, such as in a form. | | +| The `Undefined` function always returns False for variables. Variables are always defined. | | +| If you have checked the "Can be run in preemptive processes" property for the method, the code must not call any thread-unsafe commands or other thread-unsafe methods. | Preemptive process properties are ignored | +| The `IDLE` command is necessary to call 4D in specific loops | It is always possible to interrupt 4D | -## インタープリターでコンパイラー指示子を使用する場合 +## Using Compiler Directives with the Interpreter -コンパイルしないアプリケーションには、コンパイラー命令は必須ではありません。 インタープリターは、各ステートメントにおける変数の使い方に準じて自動的に変数の型を設定し、アプリケーションプロジェクト内の変数の型を変えることができます。 +Compiler directives are not required for uncompiled applications. The interpreter automatically types each variable according to how it is used in each statement, and a variable can be freely retyped throughout the application project. -インタープリターがこのように柔軟に対応するので、インタープリターモードとコンパイル済みモードでは、アプリケーションの動作が異なることがあります。 +Because of this flexibility, it is possible that an application can perform differently in interpreted and compiled modes. -たとえば、あるところでは次のように記述して: +For example, if you write: ```4d C_LONGINT(MyInt) ``` -プロジェクトの他の場所では、下記のように記述した場合: +and elsewhere in the project, you write: ```4d MyInt:=3.1416 ``` -この例では、コンパイラー指示子が代入ステートメントより *先に* 解釈されれば、インタープリターでもコンパイル後でも `Myint` には同じ値 (3) が代入されます。 +In this example, `MyInt` is assigned the same value (3) in both the interpreted and compiled modes, provided the compiler directive is interpreted *prior* to the assignment statement. -4D のインタープリターは、コンパイラー指示子を使用して変数の型を定義します。 コード内でコンパイラー指示子が検出されると、インタープリターはそれに従って変数の型を定義します。 それ以降のステートメントで間違った値を代入しようとすると (たとえば、数値変数に文字を割り当てるなど)、代入はおこなわれず、エラーが生成されます。 +The 4D interpreter uses compiler directives to type variables. When the interpreter encounters a compiler directive, it types the variable according to the directive. If a subsequent statement tries to assign an incorrect value (e.g., assigning an alphanumeric value to a numeric variable) the assignment will not take place and will generate an error. -コンパイラーにとっては、この2つのステートメントのどちらが先に表示されても問題ではありません。はじめにプロジェクト全体を調べてコンパイラー指示子を探すからです。 しかし、インタープリターは系統立てて処理するわけではなく、 実行される順にステートメントを解釈します。 ユーザーが何をおこなうかによって、この順序は当然異なります。 したがって、常にコンパイラー指示子によって型定義してから変数を使用するようプロジェクトを計画することが肝心です。 +The order in which the two statements appear is irrelevant to the compiler, because it first scans the entire project for compiler directives. The interpreter, however, is not systematic. It interprets statements in the order in which they are executed. That order, of course, can change from session to session, depending on what the user does. For this reason, it is important to design your project so that your compiler directives are executed prior to any statements containing declared variables. -## ポインターの使用で型の矛盾を避ける +## Using pointers to avoid retyping -変数の型は変更することができません。 しかし、ポインターを活用して異なるデータ型の変数を参照することはできます。 たとえば、次のコードはインタープリターおよびコンパイル済みモードの両方で動作します: +A variable cannot be retyped. However, it is possible to use a pointer to refer to variables of different data types. For example, the following code is allowed in both interpreted and compiled modes: ```4d C_POINTER($p) @@ -66,19 +66,19 @@ C_LONGINT($age) $name:="Smith" $age:=50 -$p:=->$name // テキストへのポインター -$p->:="Wesson" // テキストの代入 +$p:=->$name //text target for the pointer +$p->:="Wesson" //assigns a text value $p:=->$age -// 数値へのポインターに変更 -$p->:=55 // 数値の代入 +// new target of different type for the pointer +$p->:=55 //assigns a number value ``` -値の型に関わらず、その値の長さ (文字の数) を返す関数を考えてみましょう: +Imagine a function that returns the length (number of charaters) of values that can be of any type. ```4d - // Calc_Length 文字の数を返す関数 - // $1 = 数値、テキスト、時間、ブール型の変数へのポインター + // Calc_Length (how many characters) + // $1 = pointer to flexible variable type, numeric, text, time, boolean C_POINTER($1) C_TEXT($result) @@ -87,7 +87,7 @@ $result:=String($1->) $0:=Length($result) ``` -この関数は次のように使えます: +Then this method can be called: ```4d $var1:="my text" $var2:=5.3 @@ -96,5 +96,5 @@ $var4:=True $vLength:=Calc_Length(->$var1)+Calc_Length(->$var2)+Calc_Length (->$var3)+Calc_Length(->$var4) -ALERT("長さの合計: "+String($vLength)) +ALERT("Total length: "+String($vLength)) ``` diff --git a/website/translated_docs/ja/Concepts/methods.md b/website/translated_docs/ja/Concepts/methods.md index abd0b252757700..3856cf2de4b042 100644 --- a/website/translated_docs/ja/Concepts/methods.md +++ b/website/translated_docs/ja/Concepts/methods.md @@ -4,143 +4,143 @@ title: Methods --- -メソッドとは、1つ以上の動作を実行するコードのことです。 メソッドは、一つ以上のステートメントで構成されます。ステートメントとは、メソッドの1行のことで1つの命令を実行します。 ステートメントは単純な場合もあれば、複雑な場合もあります。 各ステートメントは常に 1行ですが最大 32,000文字まで使用することができます。 +A method is basically a piece of code that executes one or several actions. A method is composed of statements; each statement consists of one line in the method. A statement performs an action, and may be simple or complex. Although a statement is always one line, that one line can be as long as needed (up to 32,000 characters, which is probably enough for most tasks). -メソッドは最大 2GBのテキストまたは、32000行まで記述できます。 +The maximum size of a method is limited to 2 GB of text or 32,000 lines of code. -## メソッドタイプ +## Method Types -4D ランゲージにおいて、数種類のメソッドが存在します。 その呼び出し方によって、メソッドは区別されます: +In the 4D Language, there are several categories of methods. The category depends on how they can be called: -| タイプ | 自動呼び出しのコンテキスト | 引数の受け取り | 説明 | -| ------------------------ | --------------------------------------------------------- | ------- | ------------------------------------------------------------------------------------------------ | -| **プロジェクトメソッド** | 呼び出しに応じて ([プロジェクトメソッドの呼び出し](#calling-project-methods) 参照) | ◯ | 任意のアクションを実行するためのコードです。 作成されたプロジェクトメソッドは、そのプロジェクトのランゲージの一部となります。 | -| **オブジェクト (ウィジェット) メソッド** | メソッドが設定されたフォームオブジェクトに関連したイベント発生時に | × | フォームオブジェクト (ウィジェットとも呼びます) のプロパティです。 | -| **フォームメソッド** | メソッドが設定されたフォームに関連したイベント発生時に | × | フォームのプロパティです。 フォームメソッドを使用してデータとオブジェクトを管理することができます。ただし、これら目的には、オブジェクトメソッドを使用する方が通常は簡単であり、より効果的です。 | -| **トリガー** (別名 *テーブルメソッド*) | テーブルのレコード操作 (追加・削除・修正) の度に | × | テーブルのプロパティです。 トリガーは、データベースのレコードに対して「不正な」操作がおこなわれることを防ぎます。 | -| **データベースメソッド** | 作業セッションのイベント発生時に | ○ (既定) | 4D には 16のデータベースメソッドがあります。 詳細はデータベースメソッドの項を参照ください。 | +| Type | Calling context | Accepts parameters | Description | +| -------------------------------- | ----------------------------------------------------------------------------------------------------------- | ------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| **Project method** | On demand, when the project method name is called (see [Calling project methods](#calling-project-methods)) | Yes | Can contain any code to execute any custom actions. Once a project method is created, it becomes part of the language of the project. | +| **Object (widget) method** | Automatic, when an event involves the object to which the method is attached | No | Property of a form object (also called widget) | +| **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. See Database methods section | -> 4D ランゲージは **クラス関数** もサポートしています。クラス関数は、オブジェクトインスタンスのコンテキストにおいて呼び出されます。 クラス関数にはビルトインのものと (*例: * `collection.orderBy()` や `entity.save()`)、[開発者によって作成されるもの](classes.md#function)があります。 +> The 4D Language also supports **Class functions**, that can be called in the context of an object instance. Class functions can be built-in (*e.g.* `collection.orderBy()` or `entity.save()`), or [created by the 4D developer](classes.md#class-function). -## プロジェクトメソッドの呼び出し +## Calling Project Methods -その実行方法や使用方法に応じて、プロジェクトメソッドは次のような役割を果たします: +A project method can have one of the following roles, depending on how it is executed and used: -- サブルーチン -- オブジェクトフォーミュラ -- メニューメソッド -- プロセスメソッド -- イベントまたはエラー処理メソッド +- Subroutine +- Object formula +- Menu method +- Process method +- Event or Error catching method -### サブルーチン +### Subroutines -サブルーチンは、処理の下請け的なプロジェクトメソッドです。 他のメソッドから呼ばれて、要求された処理を実行します。 関数は、呼び出し元のメソッドに値を返すサブルーチンのことです。 +A subroutine is a project method that can be thought of as a servant. It performs those tasks that other methods request it to perform. A function is a subroutine that returns a value to the method that called it. -プロジェクトメソッドを作成すると、それは同データベースのランゲージの一部となります。 プロジェクトメソッドは、4Dのビルトインコマンドと同様に、ほかのメソッド (プロジェクトメソッドやオブジェクトメソッド) から呼び出すことができます。 このように使用されるプロジェクトメソッドをサブルーチンと呼びます。 +When you create a project method, it becomes part of the language of the project in which you create it. You can then call the project method from another method (project method, object method...) in the same way that you call 4D’s built-in commands. A project method used in this way is called a subroutine. -サブルーチンは、以下のような目的で使います: +You use subroutines to: -- 重複コードの削減 -- メソッドの役割の明確化 -- メソッド改変の容易化 -- コードのモジュール化 +- Reduce repetitive coding +- Clarify your methods +- Facilitate changes to your methods +- Modularize your code -たとえば、顧客データベースがあるとします。 プロジェクトをカスタマイズしていくうちに、顧客を検索してレコードを修正するという一連の作業を繰り返しおこなっていることに気づいたとします。 そのコーディングは以下のようになっています: +For example, let’s say you have a project of customers. As you customize the project, you find that there are some tasks that you perform repeatedly, such as finding a customer and modifying his or her record. The code to do this might look like this: ```4d - // 顧客を検索します + // Look for a customer QUERY BY EXAMPLE([Customers]) - // 入力フォームを選択します + // Select the input form FORM SET INPUT([Customers];"Data Entry") - // 顧客レコードを修正します + // Modify the customer's record MODIFY RECORD([Customers]) ``` -サブルーチンを使用しなければ、顧客レコード修正のたびにコードを作成しなければなりません。 プロジェクトの 10箇所で同じ処理が必要であれば、同じコーディングを 10回も書かねばなりません。 サブルーチンを使用すれば 1回コーディングするだけですみます。 これがコーディングの重複を減らすというサブルーチンの第一の利点です。 +If you do not use subroutines, you will have to write the code each time you want to modify a customer’s record. If there are ten places in your project where you need to do this, you will have to write the code ten times. If you use subroutines, you will only have to write it once. This is the first advantage of subroutines—to reduce the amount of code. -先ほど説明したコードが `MODIFY_CUSTOMER` と呼ばれるメソッドであるとすれば、他のメソッド内でそのメソッド名を使うことで実行できます。 たとえば、顧客のレコードを修正し、それからレコードをプリントするために、以下のようなメソッドを書くことができます: +If the previously described code was a method called `MODIFY_CUSTOMER`, you would execute it simply by using the name of the method in another method. For example, to modify a customer’s record and then print the record, you would write this method: ```4d MODIFY_CUSTOMER PRINT SELECTION([Customers]) ``` -この機能はメソッドを劇的にに簡素化します。 さきほどの例で言えば、`MODIFY_CUSTOMER` メソッドがどのように動作するかは知る必要がなく、何をおこなうかだけ知っていればよいのです。 これはメソッドをサブルーチン化することの2番目の理由、役割の明確化です。 このように、作成されたメソッドは 4Dランゲージを拡張します。 +This capability simplifies your methods dramatically. In the example, you do not need to know how the `MODIFY_CUSTOMER` method works, just what it does. This is the second reason for using subroutines—to clarify your methods. In this way, your methods become extensions to the 4D language. -このプロジェクトの例で顧客の検索方法を変える場合、10箇所ではなく、たった1つのメソッドを変更するだけですみます。 これがサブルーチンを使うもう一つの理由、改変の容易化です。 +If you need to change your method of finding customers in this example project, you will need to change only one method, not ten. This is the next reason to use subroutines—to facilitate changes to your methods. -また、サブルーチンの利用はコードをモジュール化します。 これはコードをモジュール (サブルーチン) に分割することを意味し、それぞれは論理的な処理を実行します。 小切手振り出し口座のプロジェクトから、以下のコードを見てみましょう: +Using subroutines, you make your code modular. This simply means dividing your code into modules (subroutines), each of which performs a logical task. Consider the following code from a checking account project: ```4d - FIND_CLEARED_CHECKS // 決済された小切手の検索 - RECONCILE_ACCOUNT // 口座の照合 - PRINT_CHECK_BOOK_REPORT // レポートの印刷 + FIND_CLEARED_CHECKS //Find the cleared checks + RECONCILE_ACCOUNT //Reconcile the account + PRINT_CHECK_BOOK_REPORT //Print a checkbook report ``` -プロジェクトの詳細を知らない人でも、このプログラムが何をしているかはわかります。 各サブルーチンの処理手順を知る必要はありません。 各サブルーチンは長く、複雑な処理で構成されていることもありますが、それらが何を実行するのかだけを知っていれば十分なのです。 プログラムを論理的な処理単位やモジュールにできるだけ分割することをお勧めします。 +Even for someone who doesn’t know the project, it is clear what this code does. It is not necessary to examine each subroutine. Each subroutine might be many lines long and perform some complex operations, but here it is only important that it performs its task. We recommend that you divide your code into logical tasks, or modules, whenever possible. -### オブジェクトフォーミュラ +### Object formulas -プロジェクトメソッドは、**フォーミュラ** オブジェクトにカプセル化して、オブジェクトから呼び出すことができます。 +You can encapsulate your project methods in **formula** objects and call them from your objects. -`Formula` または `Formula from string` コマンドを使用すると、オブジェクトプロパティに格納可能な、ネイティブなフォーミュラオブジェクトを作成することができます: つまり、カスタムなオブジェクトメソッドを実装することが可能です。 +The `Formula` or `Formula from string` commands allow you to create native formula objects that you can encapsulate in object properties. It allows you to implement custom object methods. -オブジェクトプロパティに保存されているメソッドを実行するには、プロパティ名のあとに **( )** をつけます。 たとえば: +To execute a method stored in an object property, use the **( )** operator after the property name. For example: ```4d -// myAlert プロジェクトメソッド +//myAlert ALERT("Hello world!") ``` -この `myAlert` プロジェクトメソッドを任意のオブジェクトに格納し、呼び出すことができます: +Then `myAlert` can be encapsulated in any object and called: ```4d C_OBJECT($o) $o:=New object("custom_Alert";Formula(myAlert)) -$o.custom_Alert() // "Hello world!" と表示します +$o.custom_Alert() //displays "Hello world!" ``` -大カッコを使用したシンタックスもサポートされます: +Syntax with brackets is also supported: ```4d -$o["custom_Alert"]() // "Hello world!" と表示します +$o["custom_Alert"]() //displays "Hello world!" ``` -4D プロジェクトメソッドのように、$1, $2, .... を使用して呼び出すことで、フォーミュラに [引数を渡す](Concepts/parameters.md) こともできます: +You can also [pass parameters](Concepts/parameters.md) to your formula when you call it by using $1, $2… just like with 4D project methods: ```4d -//fullName メソッド +//fullName method C_TEXT($0;$1;$2) $0:=$1+" "+$2 ``` -`fullName` メソッドをオブジェクトに格納し、呼び出します: +You can encapsulate `fullName` in an object: ```4d C_OBJECT($o) $o:=New object("full_name";Formula(fullName)) $result:=$o.full_name("John";"Smith") //$result = "John Smith" -// $result:=fullName("param1";"param2") と同義です +// equivalent to $result:=fullName("param1";"param2") ``` -`This` 関数と組み合わせることで、オブジェクトメソッドを利用した汎用的なコードを書くことができます。 たとえば: +Combined with the `This`function, such object methods allow writing powerful generic code. For example: ```4d -//fullName2 メソッド +//fullName2 method C_TEXT($0) $0:=This.firstName+" "+This.lastName ``` -このメソッドをオブジェクトに格納すると、オブジェクトの新しい計算属性のように使えます: +Then the method acts like a new, calculated attribute that can be added to other attributes: ```4d C_OBJECT($o) $o:=New object("firstName";"Jim";"lastName";"Wesson") -$o.fullName:=Formula(fullName2) // メソッドをオブジェクトに追加します +$o.fullName:=Formula(fullName2) //add the method $result:=$o.fullName() //$result = "Jim Wesson" @@ -148,45 +148,45 @@ $result:=$o.fullName() -たとえ引数を受け取らなかったとしても、オブジェクトメソッドを実行するためにはカッコ () をつけて呼び出す必要があるという点に注意してください。 オブジェクトプロパティのみを呼び出した場合、フォーミュラへの新しい参照が返されます (そしてフォーミュラは実行はされません): +Note that, even if it does not have parameters, an object method to be executed must be called with ( ) parenthesis. Calling only the object property will return a new reference to the formula (and will not execute it): ```4d -$o:=$f.message // $o にはフォーミュラオブジェクトが返されます +$o:=$f.message //returns the formula object in $o ``` -### メニューメソッド -メニューメソッドは、カスタムメニューから呼び出されるプロジェクトメソッドです。 メニューエディターまたは "メニュー" テーマのコマンドを使用して、メニューにメソッドを割り当てます。 メニューが選択されると、それに対応するメニューメソッドが実行されます。 特定の処理を実行するメニューメソッドを割り当てたカスタムメニューを作成することで、デスクトップアプリケーションのユーザーインターフェースをカスタマイズすることができます。 +### Menu Methods +A menu method is invoked when you select the custom menu command to which it is attached. You assign the method to the menu command using the Menu editor or a command of the "Menus" theme. The method executes when the menu command is chosen. By creating custom menus with menu methods that perform specific actions, you create custom interfaces for your desktop applications. -メニューメソッドにより、単一または複数の処理を実行することができます。 たとえば、データ入力のメニューに、以下の2つの処理を実行するメソッドを割り当てられます。まず適切な入力フォームを表示し、次にユーザーがキャンセルするまでの間 `ADD RECORD` コマンドによるデータ入力を繰り返します。 +Custom menu commands can cause one or more activities to take place. For example, a menu command for entering records might call a method that performs two tasks: displaying the appropriate input form, and calling the `ADD RECORD` command until the user cancels the data entry activity. -連続した処理の自動化は、プログラミング言語の強力な機能の 1つです。 カスタムメニューを使用することで処理を自動化することができ、アプリケーションのユーザーにより多くのガイダンスを提供することができます。 +Automating sequences of activities is a very powerful capability of the programming language. Using custom menus, you can automate task sequences and thus provide more guidance to users of the application. -### プロセスメソッド +### Process Methods -**プロセスメソッド** とは、プロセスの開始時に呼び出されるプロジェクトメソッドのことです。 ワーカープロセスの場合を除いて、プロセスはプロセスメソッドが実行されている間だけ存続します。 メニューに属するメニューメソッドのプロパティとして *新規プロセス開始* をチェックしている場合、そのメニューメソッドは新規プロセスのプロセスメソッドでもあります。 +A **process method** is a project method that is called when a process is started. The process lasts only as long as the process method continues to execute, except if it is a Worker process. Note that a menu method attached to a menu command with *Start a New Process* property is also the process method for the newly started process. -### イベント・エラー処理メソッド -**イベント処理メソッド** は、イベントを処理するプロセスメソッドとして、分離されたプロセス内で実行されます。 通常、開発者はイベント管理の大部分を 4Dに任せます。 たとえば、データ入力中にキーストロークやクリックを検出した 4Dは、正しいオブジェクトとフォームメソッドを呼び出します。このため開発者は、これらのメソッド内でイベントに対し適切に応答できるのです。 詳細については `ON EVENT CALL` コマンドの説明を参照してください。 +### Event and Error catching Methods +An **event catching method** runs in a separate process as the process method for catching events. Usually, you let 4D do most of the event handling for you. For example, during data entry, 4D detects keystrokes and clicks, then calls the correct object and form methods so you can respond appropriately to the events from within these methods. For more information, see the description of the command `ON EVENT CALL`. -**エラー処理メソッド** は、割り込みを実行するプロジェクトメソッドです。 エラーや例外が起こる度に、エラー処理メソッドは自身がインストールされたプロセス内で実行されます。 詳細については `ON ERR CALL` コマンドの説明を参照してください。 +An **error catching method** is an interrupt-based project method. Each time an error or an exception occurs, it executes within the process in which it was installed. For more information, see the description of the command `ON ERR CALL`. -## プロジェクトメソッドの再帰呼び出し +## Recursive Project Methods -プロジェクトメソッドは、自分自身を呼び出すことができます。 たとえば: +Project methods can call themselves. For example: -- メソッドAがメソッドBを呼び出し、メソッドBはメソッドAを呼び出します。 -- メソッドAは自身を呼び出すことができます。 +- The method A may call the method B which may call A, so A will call B again and so on. +- A method can call itself. -これは再帰呼び出しと呼ばれています。 4D ランゲージは再帰呼び出しを完全にサポートしています。 +This is called recursion. The 4D language fully supports recursion. -次に例を示します。 以下のフィールドから成る `[Friends and Relatives]` テーブルがあります: +Here is an example. Let’s say you have a `[Friends and Relatives]` table composed of this extremely simplified set of fields: - `[Friends and Relatives]Name` - `[Friends and Relatives]ChildrensName` -この例題では、フィールドの値は重複しない、つまり同じ名前の人間はいないとします。 名前を指定することで、以下のような文を作成します: “A friend of mine, John who is the child of Paul who is the child of Jane who is the child of Robert who is the child of Eleanor, does this for a living!”: +For this example, we assume the values in the fields are unique (there are no two persons with the same name). Given a name, you want to build the sentence “A friend of mine, John who is the child of Paul who is the child of Jane who is the child of Robert who is the child of Eleanor, does this for a living!”: -1. この文を以下のように作成できます: +1. You can build the sentence in this way: ```4d $vsName:=Request("Enter the name:";"John") @@ -208,7 +208,7 @@ $o:=$f.message // $o にはフォーミュラオブジェクトが返されま End if ``` -2. 以下の方法でも作成できます: +2. You can also build it this way: ```4d $vsName:=Request("Enter the name:";"John") @@ -220,10 +220,10 @@ $o:=$f.message // $o にはフォーミュラオブジェクトが返されま End if ``` -再帰関数 `Genealogy of` は以下の通りです: +with the recursive function `Genealogy of` listed here: ```4d - ` Genealogy of プロジェクトメソッド + ` Genealogy of project method ` Genealogy of ( String ) -> Text ` Genealogy of ( Name ) -> Part of sentence @@ -234,15 +234,15 @@ $o:=$f.message // $o にはフォーミュラオブジェクトが返されま End if ``` -`Genealogy of` メソッドが自分自身を呼び出していることに注目してください。 +Note the `Genealogy of` method which calls itself. -最初に挙げた方法は **反復性のアルゴリズム** です。 2番目に挙げた方法は **再帰呼び出しのアルゴリズム** です。 +The first way is an **iterative algorithm**. The second way is a **recursive algorithm**. -前述の例題のようなコードを実装する場合、反復性や再帰呼び出しを使用してメソッドを書くことができるということに留意してください。 再帰呼び出しは一般的に、より明瞭で読みやすく、維持しやすいコードを提供します。ただし、この使用は必須ではありません。 +When implementing code for cases like the previous example, it is important to note that you can always write methods using iteration or recursion. Typically, recursion provides more concise, readable, and maintainable code, but using it is not mandatory. -4D内での再帰呼び出しの代表的な使用方法は以下のとおりです: +Some typical uses of recursion in 4D are: -- 例題と同じく、互いに関連するテーブル内でのレコードの取り扱い。 -- `FOLDER LIST` と `DOCUMENT LIST` コマンドを使用して、ディスク上にあるドキュメントとフォルダーをブラウズする。 フォルダーにはフォルダーとドキュメントが含まれており、サブフォルダーはまたフォルダーとドキュメントを含むことができます。 +- Treating records within tables that relate to each other in the same way as in the example. +- Browsing documents and folders on your disk, using the commands `FOLDER LIST` and `DOCUMENT LIST`. A folder may contain folders and documents, the subfolders can themselves contain folders and documents, and so on. -**重要:** 再帰呼び出しは、必ずある時点で終了する必要があります。 たとえば、`Genealogy of` メソッドが自身の呼び出しを止めるのは、クエリがレコードを返さないときです。 この条件のテストをしないと、メソッドは際限なく自身を呼び出します。 (メソッド内で使用される引数やローカル変数の蓄積を含む) 再帰呼び出しによって容量が一杯になると、最終的に 4Dは “スタックがいっぱいです” エラーを返します 。 +**Important:** Recursive calls should always end at some point. In the example, the method `Genealogy of` stops calling itself when the query returns no records. Without this condition test, the method would call itself indefinitely; eventually, 4D would return a “Stack Full” error becuase it would no longer have space to “pile up” the calls (as well as parameters and local variables used in the method). diff --git a/website/translated_docs/ja/Concepts/parameters.md b/website/translated_docs/ja/Concepts/parameters.md index 43a2f5c69e4aff..fc92eb85aad037 100644 --- a/website/translated_docs/ja/Concepts/parameters.md +++ b/website/translated_docs/ja/Concepts/parameters.md @@ -1,56 +1,56 @@ --- id: parameters -title: 引数 +title: Parameters --- -メソッドや関数にデータを渡す必要がしばしば発生します。 これは引数によって容易にできます。 +You'll often find that you need to pass data to your methods and functions. This is easily done with parameters. -## 概要 +## Overview -**引数** (または **パラメーター**) とは、メソッドや関数が処理に必要とするデータのことです。 *引数* と *パラメーター* は厳密には違うものですが、このマニュアルでは同義語として使用されています。 引数は、ビルトインの 4Dコマンドにも渡されます。 以下の例は、“Hello” という文字列を引数としてビルトインの `ALERT` コマンドへ渡します: +**Parameters** (or **arguments**) are pieces of data that a method or a class function needs in order to perform its task. The terms *parameter* and *argument* are used interchangeably throughout this manual. Parameters are also passed to built-in 4D commands. In this example, the string “Hello” is an argument to the `ALERT` built-in command: ```4d ALERT("Hello") ``` -メソッドやクラス関数に引数を渡す場合も同様におこないます。 たとえば、`getArea()` クラス関数が 2つの引数を受け取る場合、このクラス関数を呼び出すには以下のように書きます: +Parameters are passed to methods or class functions in the same way. For example, if a class function named `getArea()` accepts two parameters, a call to the class function might look like this: ``` $area:=$o.getArea(50;100) ``` -また、プロジェクトメソッド `DO SOMETHING` が3つの引数を受け取る場合、このメソッドを呼び出すには以下のように書きます: +Or, if a project method named `DO_SOMETHING` accepts three parameters, a call to the method might look like this: ```4d DO_SOMETHING($WithThis;$AndThat;$ThisWay) ``` -入力引数は、セミコロン (;) で区切ります。 +The input parameters are separated by semicolons (;). -メソッドを実行する専用コマンドを利用するときも、同じ原則で引数を渡します。 +The same principles are used when methods are executed through dedicated commands, for example: ```4d EXECUTE METHOD IN SUBFORM("Cal2";"SetCalendarDate";*;!05/05/20!) -// サブフォーム "Cal2" のコンテキストにおいて SetCalendarDate を実行し -// その際に引数として日付リテラル !05/05/20! を渡します +//pass the !05/05/20! date as parameter to the SetCalendarDate +//in the context of a subform ``` -メソッドやクラス関数からデータを **返す** こともできます。 以下は、文字列のデータ長を返すビルトインの `Length` コマンドを用いたステートメントです。 このステートメントでは、`Length` 関数が *MyLength* という変数に値を返します。 +Data can also be **returned** from methods and class functions. For example, the following line is a statement that uses the built-in command, `Length`, to return the length of a string. The statement puts the value returned by `Length` in a variable called *MyLength*. Here is the statement: ```4d MyLength:=Length("How did I get here?") ``` -どのようなサブルーチンでも値を返すことができます。 各メソッドやクラス関数につき、定義できる戻り値は一つだけです。 +Any subroutine can return a value. Only one single output parameter can be declared per method or class function. -入力および出力値は呼び出し時に [評価](#引数の渡し方-値か参照か) され、その値はそれぞれ自動的にサブルーチン (呼び出されたメソッドまたはクラス関数) 内のローカル変数に格納されます。 呼び出されるメソッドにおいて、これらのローカル変数を宣言するには次の 2つのシンタックスが利用できます: +Input and output values are [evaluated](#values-or-references) at the moment of the call and copied into local variables within the called class function or method. Two syntaxes are proposed to declare variable parameters in the called code: -- [名前付き変数](#名前付き引数) (ほとんどの場合に推奨) -- [受け渡し順に番号が付けられた変数](#位置引数) (位置引数) +- [named variables](#named-parameters) (recommended in most cases) or +- [sequentially numbered variables](#sequential-parameters). -> 引数の宣言にあたって、[名前付き引数](#名前付き引数) と [位置引数](#位置引数) のシンタックスは制限なく併用することができます。 たとえば: +> Both [named](#named-parameters) and [sequential](#sequential-parameters) variables syntaxes can be mixed with no restriction to declare parameters. For example: > > ```4d Function add($x : Integer) @@ -61,68 +61,68 @@ Function add($x : Integer) -## 名前付き引数 +## Named parameters -呼び出されたメソッドやクラス関数において、引数の値はローカル変数に代入されます。 引数は **パラメーター名** とその **データ型** をコロン (:) で区切って宣言することができます。 +Inside called methods or class functions, parameter values are assigned to local variables. You can declare parameters using a **parameter name** along with a **parameter type**, separated by colon. -- クラス関数の場合、引数は `Function` キーワードとともに宣言されます。 -- メソッドの場合 (プロジェクトメソッド、フォームオブジェクトメソッド、データベースメソッド、トリガー)、引数はメソッドコード先頭の `#DECLARE` キーワードを使って宣言されます。 +- For class functions, parameters are declared along with the `Function` keyword. +- For methods (project methods, form object methods, database methods, and triggers), parameters are declared using the `#DECLARE` keyword at the beginning of the method code. -例: +Examples: ```4d Function getArea($width : Integer; $height : Integer) -> $area : Integer ``` ```4d - // myProjectMethod + //myProjectMethod #DECLARE ($i : Integer) -> $myResult : Object ``` The following rules apply: -- 宣言文はメソッドや関数のコードの先頭に位置していなければなりません。宣言文より前に置けるのはコメントと改行のみであり、それ以外の場合にはエラーが表示されます。 +- The declaration line must be the first line of the method or function code, otherwise an error is displayed (only comments or line breaks can precede the declaration). - Parameter names must start with a `$` character and be compliant with [property naming rules](dt_object.md#object-property-identifiers). -- 複数のパラメーター (およびその型) を宣言する場合は、それらをセミコロン (;) で区切ります。 -- 複数行シンタックスがサポートされています ("\\" 文字を使用)。 +- Multiple parameters (and types) are separated by semicolons (;). +- Multiline syntaxes are supported (using "\\" character). -たとえば、`getArea()` 関数に 2つの引数を渡して呼び出す場合: +For example, when you call a `getArea()` function with two parameters: ``` $area:=$o.getArea(50;100) ``` -クラス関数において、引数の値はそれぞれ対応するパラメーターに代入されます: +In the class function code, the value of each parameter is copied into the corresponding declared parameter: ```4d -// クラス: Polygon +// Class: Polygon Function getArea($width : Integer; $height : Integer)-> $area : Integer $area:=$width*$height ``` -> パラメーターの型が宣言されていない場合には、`バリアント` 型として定義されます。 +> If the type is not defined, the parameter will be defined as `Variant`. -データベースメソッドを含むすべての 4Dメソッドにおいて `#DECLARE` キーワードの使用がサポートされています。 たとえば、`On Web Authentication` データベースメソッドにおいて、次のように名前付き引数を宣言できます: +All 4D method kinds support the `#DECLARE` keyword, including database methods. For example, in the `On Web Authentication` database method, you can declare named parameters: ```4d - // On Web Authentication データベースメソッド + // On Web Authentication database method #DECLARE ($url : Text; $header : Text; \ $BrowserIP : Text; $ServerIP : Text; \ $user : Text; $password : Text) \ -> $RequestAccepted : Boolean $entitySelection:=ds.User.query("login=:1"; $user) -// ハッシュパスワードを確認... +// Check hash password... ``` -### 戻り値 +### Returned value -関数の戻り値は、入力パラメーターリストに矢印 (->) を追加し、それに続けて宣言します。 たとえば: +You declare the return parameter of a function by adding an arrow (->) and the parameter definition after the input parameter(s) list. For example: ```4d Function add($x : Variant; $y : Integer) -> $result : Integer ``` -矢印と出力変数名を省略して、コロン (:) 記号の後に戻り値のデータ型だけを指定した場合は、自動的に `$0` が使用されます。([受け渡し順シンタックス](#戻り値-1) 参照)。 たとえば: +You can also declare the return parameter only by adding `: type`, in which case it will automatically be available through `$0` ([see sequential syntax below](#returned-value-1)). For example: ```4d Function add($x : Variant; $y : Integer): Integer @@ -130,9 +130,9 @@ Function add($x : Variant; $y : Integer): Integer ``` -### サポートされているデータ型 +### Supported data types -名前付き引数の場合、[`var` キーワードでサポートされている](variables.md#var-キーワードによる宣言) データ型 (クラスオブジェクト含む) を使用できます。 たとえば: +With named parameters, you can use the same data types as those which are [supported by the `var` keyword](variables.md#using-the-var-keyword), including class objects. For example: ```4d Function saveToFile($entity : cs.ShapesEntity; $file : 4D.File) @@ -142,82 +142,81 @@ Function saveToFile($entity : cs.ShapesEntity; $file : 4D.File) -## 位置引数 +## Sequential parameters -[名前付き引数](#名前付き引数) シンタックスを使用するほかにも、引数は受け渡し順に番号が付けられた変数を使って宣言することができます: **$1**, **$2**, **$3**, ...。 ローカル変数の番号は、引数の順序を表わします。 +As an alternative to [named parameters](#named-parameters) syntax, you can declare parameters using sequentially numbered variables: **$1**, **$2**, **$3**, and so on. The numbering of the local variables represents the order of the parameters. -> このシンタックスはクラス関数の場合もサポートされていますが、[名前付き引数](#名前付き引数) を使ったシンタックスの方が推奨されます。 +> Although this syntax is supported by class functions, it is recommended to use [named parameters](#named-parameters) syntax in this case. -たとえば、プロジェクトメソッド `DO SOMETHING` が3つの引数を受け取る場合、このメソッドを呼び出すには以下のように書きます: +For example, when you call a `DO_SOMETHING` project method with three parameters: ```4d DO_SOMETHING($WithThis;$AndThat;$ThisWay) ``` -呼び出されるメソッドにおいて、それぞれの引数の値は自動的に、順に番号が付けられたローカル変数 ($1, $2, $3...) に格納されます: +In the method code, the value of each parameter is automatically copied into $1, $2, $3 variables: ```4d - // DO_SOMETHING メソッド - // すべての引数はテキスト型です + //Code of the method DO_SOMETHING + //Assuming all parameters are of the text type C_TEXT($1;$2;$3) - ALERT($1+" と "+$2+" と "+$3+" を受け取りました。") - //$1 には $WithThis の値が代入されます - //$2 には $AndThat の値が代入されます - //$3 には $ThisWay の値が代入されます + ALERT("I received "+$1+" and "+$2+" and also "+$3) + //$1 contains the $WithThis parameter + //$2 contains the $AndThat parameter + //$3 contains the $ThisWay parameter ``` -### 戻り値 +### Returned value -戻り値は自動的に、ローカル変数 `$0` に格納します。 +The value to be returned is automatically put into the local variable `$0`. -たとえば、`Uppercase4` という以下のメソッドは、始めの 4文字を大文字に変換した文字列を返します: +For example, the following method, called `Uppercase4`, returns a string with the first four characters of the string passed to it in uppercase: ```4d -// Uppercase4 メソッド $0:=Uppercase(Substring($1;1;4))+Substring($1;5) ``` -以下は、Uppercase4 をメソッドとして使用する例です: +The following is an example that uses the Uppercase4 method: ```4d $NewPhrase:=Uppercase4("This is good.") ``` -変数 *$NewPhrase* には“THIS is good.” が格納されます。 +In this example, the variable *$NewPhrase* gets “THIS is good.” -戻り値 `$0` はサブルーチン内のローカル変数です。 したがって、サブルーチン内で通常のローカル変数のように使用できます。 たとえば: +The returned value, `$0`, is a local variable within the subroutine. It can be used as such within the subroutine. For example, you can write: ```4d -// Do_something メソッド +// Do_something $0:=Uppercase($1) ALERT($0) ``` -この例において、`$0` は大文字に変換した引数 `$1` の値を割り当てられ、その後 `ALERT` コマンドに引数として渡されました。 このように、サブルーチン内の他のローカル変数と同じように `$0` を使うことができます。 サブルーチン終了時に、その時点での `$0` の値を呼び出し元のメソッドに戻すのは 4Dがおこないます。 +In this example, `$0` is first assigned the value of `$1`, then used as parameter to the `ALERT` command. Within the subroutine, you can use `$0` in the same way you would use any other local variable. It is 4D that returns the value of `$0` (as it is when the subroutine ends) to the called method. -### サポートされているデータ型 +### Supported data types You can use any [expression](quick-tour.md#expression-types) as sequential parameter, except: -- テーブル +- tables - arrays Tables or array expressions can only be passed [as reference using a pointer](dt_pointer.md#pointers-as-parameters-to-methods). -### 引数の間接参照 +### Parameter indirection -プロジェクトメソッドが受け取る引数は直接的に $1, $2, ... などと指定する以外にも、間接的に ${ 数値変数 } という形で指定することができます。 これを **引数の間接参照** といいます。 同じ型の不定数の引数を受け取るメソッドの場合、`Count parameters` コマンドと組み合わせることで、これらの引数を `For...End for` ループと引数関節参照シンタックスで操作することができます。 +4D project methods accept a variable number of parameters of the same type, starting from the right. This principle is called **parameter indirection**. Using the `Count parameters` command you can then address those parameters with a `For...End for` loop and the parameter indirection syntax. -> 引数の間接参照は [受け渡し順](#位置引数) シンタックスでのみ使用できます。 +> Parameter indirection can only be used with the [sequential](#sequential-parameters) syntax. -次の例では `SEND PACKETS` プロジェクトメソッドは第1パラメーターに時間を受け取り、第2パラメーター以降は1以上のテキストを受け取ります: +In the following example, the project method `SEND PACKETS` accepts a time parameter followed by a variable number of text parameters: ```4d - //SEND PACKETS プロジェクトメソッド - //SEND PACKETS ( 時間 ; テキスト { ; テキスト2... ; テキストN } ) + //SEND PACKETS Project Method + //SEND PACKETS ( Time ; Text { ; Text2... ; TextN } ) //SEND PACKETS ( docRef ; Data { ; Data2... ; DataN } ) C_TIME($1) @@ -229,20 +228,20 @@ Tables or array expressions can only be passed [as reference using a pointer](dt End for ``` -引数の間接参照は以下の条件を守ることにより、正しく動作します: 引数の一部のみを間接参照する場合、直接参照する引数の後に間接参照引数を配置するようにします。 メソッド内で、間接参照は${$i}のように表示します。$iは数値変数です。 ${$i}を **ジェネリックパラメータ** (generic parameter) と呼びます。 +Parameter indirection is best managed if you respect the following convention: if only some of the parameters are addressed by indirection, they should be passed after the others. Within the method, an indirection address is formatted: ${$i}, where $i is a numeric variable. ${$i} is called a **generic parameter**. -以下は間接参照の例です。引数の数値を合計した結果を、引数として渡された表示形式で返すような関数を考えてみましょう。 合計される数値の数は、メソッドが呼ばれるたびに変わります。 このメソッドでは数値と表示形式を引数としてメソッドに渡さなければなりません。 +For example, consider a function that adds values and returns the sum formatted according to a format that is passed as a parameter. Each time this method is called, the number of values to be added may vary. We must pass the values as parameters to the method and the format in the form of a character string. The number of values can vary from call to call. -この関数は、以下のようにして呼び出します: +This function is called in the following manner: ```4d Result:=MySum("##0.00";125,2;33,5;24) ``` -この場合、数値を合計し、指定した形式に編集された文字列 "182.70" が返されます。 関数の引数は正しい順序で渡す必要があります。最初に表示形式、次に数値です。 +In this case, the calling method will get the string “182.70”, which is the sum of the numbers, formatted as specified. The function's parameters must be passed in the correct order: first the format and then the values. -以下は `MySum` 関数です: +Here is the function, named `MySum`: ```4d $Sum:=0 For($i;2;Count parameters) @@ -251,7 +250,7 @@ Tables or array expressions can only be passed [as reference using a pointer](dt $0:=String($Sum;$1) ``` -この関数は様々な呼び出し方ができます: +This function can now be called in various ways: ```4d Result:=MySum("##0.00";125,2;33,5;24) @@ -259,41 +258,41 @@ Tables or array expressions can only be passed [as reference using a pointer](dt ``` -他のローカル変数と同様、ジェネリックパラメーターはコンパイラーに指示する必要はありません。 ただし、曖昧になりそうな場合や最適化のために必要な場合は コンパイラ支持子に ${N} を渡す、以下のシンタックスを使用することができます (N は最初のジェネリックパラメーターの番号です): +As with other local variables, it is not mandatory to declare generic parameters by compiler directive. However, it is recommended to avoid any ambiguity. To declare these parameters, you use a compiler directive to which you pass ${N} as a parameter, where N specifies the first generic parameter. ```4d C_LONGINT(${4}) ``` -このコマンドは、4番目以降に間接参照されるすべての引数のデータ型が倍長整数であることを意味します。 $1、$2、$3には、いかなるデータ型も使用できますが、 $2を間接参照した場合には、間接参照の型宣言の影響を受けます。 このため、たとえば $2 が実数であっても、間接参照されれば倍長整数と見なされます。 +This command means that starting with the fourth parameter (included), the method can receive a variable number of parameters of longint type. $1, $2 and $3 can be of any data type. However, if you use $2 by indirection, the data type used will be the generic type. Thus, it will be of the data type Longint, even if for you it was, for instance, of the data type Real. -> 宣言に使用する数値は変数ではなく、定数でなくてはなりません。 +> The number in the declaration has to be a constant and not a variable. -### コンパイルモード用のパラメーター宣言 +### Declaring parameters for compiled mode Even if it is not mandatory in [interpreted mode](interpreted.md), you must declare each parameter in the called methods or functions to prevent any trouble. -[名前付き引数シンタックス](#名前付き引数) を利用している場合には、それらの引数は `#DECLARE` キーワードまたは `Function` プロトタイプによって自動的に宣言されます。 たとえば: +When using the [named variable syntax](#named-parameters), parameters are automatically declared through the `#DECLARE` keyword or `Function` prototype. For example: ```4d Function add($x : Variant; $y : Integer)-> $result : Integer - // すべての引数はデータ型とともに宣言されます + // all parameters are declared with their type ``` -受け渡し順シンタックスを利用している場合には、引数がそれぞれ適切に宣言されていることを確認する必要があります。 次の例では `Capitalize` プロジェクトメソッドは第1パラメーターにテキスト型の引数を受け取り、戻り値としてテキスト型の値を返します: +When using the sequential variable syntax, you need to make sure all parameters are properly declared. In the following example, the `Capitalize` project method accepts a text parameter and returns a text result: ```4d - // Capitalize プロジェクトメソッド - // Capitalize ( Text ) -> テキスト - // Capitalize ( Source string ) -> 大文字の文字列 + // Capitalize Project Method + // Capitalize ( Text ) -> Text + // Capitalize ( Source string ) -> Capitalized string C_TEXT($0;$1) $0:=Uppercase(Substring($1;1;1))+Lowercase(Substring($1;2)) ``` -`New process` コマンドなどでプロセスメソッドを呼び出す場合にも、そのメソッドが引数を受け取るのであれば、それらは明示的に宣言されていなくてはなりません。 たとえば: +Using commands such as `New process` with process methods that accept parameters also require that parameters are explicitely declared in the called method. For example: ```4d C_TEXT($string) @@ -303,7 +302,7 @@ C_OBJECT($obj) $idProc:=New process("foo_method";0;"foo_process";$string;$int;$obj) ``` -"foo_method" において各パラメーターが適切に宣言されている場合のみ、コンパイルモードで上のコードを実行することができます: +This code can be executed in compiled mode only if "foo_method" declares its parameters: ```4d //foo_method @@ -313,27 +312,27 @@ C_OBJECT($3) ... ``` -> プロジェクトメソッドのパラメーター宣言は、コンパイルモード用にまとめて、"Compiler" で始まる名称の専用メソッドにておこなうことができます。 専用メソッド内で各メソッドのパラメーターをあらかじめ宣言する場合は、次のように書きます: +> For compiled mode, you can group all local variable parameters for project methods in a specific method with a name starting with "Compiler". Within this method, you can predeclare the parameters for each method, for example: ```4d // Compiler_method C_REAL(OneMethodAmongOthers;$1) ``` See [Interpreted and compiled modes](interpreted.md) page for more information. -パラメーターの宣言は次のコンテキストにおいても必須となります (これらのコンテキストは "Compiler" メソッドによる一括宣言をサポートしません)。 +Parameter declaration is also mandatory in the following contexts (these contexts do not support declaration in a "Compiler" method): -- データベースメソッド - たとえば、`On Web Connection データベースメソッド` は 6つのテキスト型の引数 $1 〜 $6 を受け取ります。 たとえすべての引数を使用しない場合でも、データベースメソッドの先頭で次のように宣言しなくてはなりません: +- Database methods - For example, the `On Web Connection Database Method` receives six parameters, $1 to $6, of the data type Text. At the beginning of the database method, you must write (even if all parameters are not used): ```4d // On Web Connection C_TEXT($1;$2;$3;$4;$5;$6) ``` -> `#DECLARE` キーワードを使用して、[名前付き引数](#名前付き引数) を使うこともできます。 +> You can also use [named parameters](#named-parameters) with the `#DECLARE` keyword. -- トリガー - トリガーの結果である $0 パラメーター (倍長整数) は、明確に定義されていなければコンパイラーによって型指定されます。 定義する場合は、トリガーの中でおこなう必要があります。 +- Triggers - The $0 parameter (Longint), which is the result of a trigger, will be typed by the compiler if the parameter has not been explicitly declared. Nevertheless, if you want to declare it, you must do so in the trigger itself. -- `On Drag Over` フォームイベントを受け入れるフォームオブジェクト - `On Drag Over` フォームイベントの結果である $0 パラメーター (倍長整数) は、明確に定義されていなければコンパイラーが型を決定します。 定義する場合は、オブジェクトメソッドの中でおこなう必要があります。 **注:** コンパイラーは $0 を初期化しません。 したがって、`On Drag Over` フォームイベントを使用したら、直ちに $0 を初期化しなければなりません。 たとえば: +- Form objects that accept the `On Drag Over` form event - The $0 parameter (Longint), which is the result of the `On Drag Over` form event, is typed by the compiler if the parameter has not been explicitly declared. Nevertheless, if you want to declare it, you must do so in the object method. **Note:** The compiler does not initialize the $0 parameter. So, as soon as you use the `On Drag Over` form event, you must initialize $0. For example: ```4d C_LONGINT($0) @@ -350,97 +349,97 @@ C_TEXT($1;$2;$3;$4;$5;$6) -## オブジェクトプロパティを名前付き引数として使用する +## Using object properties as named parameters -引数としてオブジェクトを渡すことによって **名前付き引数** を扱うことができます。 このプログラミング方法はシンプルかつ柔軟なだけでなく、コードの可読性も向上させます。 +Using objects as parameters allow you to handle **named parameters**. This programming style is simple, flexible, and easy to read. -たとえば、`CreatePerson` メソッドを例にとると: +For example, using the `CreatePerson` method: ```4d - // CreatePerson メソッド + //CreatePerson var $person : Object $person:=New object("Name";"Smith";"Age";40) ChangeAge($person) ALERT(String($person.Age)) ``` -`ChangeAge` メソッドを次のように書けます: +In the `ChangeAge` method you can write: ```4d - // ChangeAge メソッド + //ChangeAge var $1; $para : Object $para:=$1 $para.Age:=$para.Age+10 - ALERT($para.Name+" は "+String($para.Age)+" 歳です。") + ALERT($para.Name+" is "+String($para.Age)+" years old.") ``` -これは [任意パラメーター](#任意パラメーター) を指定するにあたって非常に便利な方法です (後述参照)。 この場合、引数の不足は次のように対処できます: -- `Null` 値と比較することで、必要な引数がすべて提供されているかをチェックします -- 引数の値をプリセットします -- 渡されていない引数は空値として扱います +This provides a powerful way to define [optional parameters](#optional-parameters) (see also below). To handle missing parameters, you can either: +- check if all expected parameters are provided by comparing them to the `Null` value, or +- preset parameter values, or +- use them as empty values. -上述の `ChangeAge` メソッドの例では、Age およびName プロパティはどちらも必須であるため、引数オブジェクトに含まれていなければエラーが発生します。 これを避けるには、次のように記述することができます: +In the `ChangeAge` method above, both Age and Name properties are mandatory and would produce errors if they were missing. To avoid this case, you can just write: ```4d - // ChangeAge メソッド + //ChangeAge var $1; $para : Object $para:=$1 $para.Age:=Num($para.Age)+10 - ALERT(String($para.Name)+" は "+String($para.Age)+"歳です。") + ALERT(String($para.Name)+" is "+String($para.Age)+" years old.") ``` -すると、引数が不足してもエラーは生成されず、両方が欠落した場合の結果は " is 10 years old" となってしまうにせよ、いずれの引数も任意となります。 +Then both parameters are optional; if they are not filled, the result will be " is 10 years old", but no error will be generated. -名前付き引数を利用すると、アプリケーションの保守やリファクタリングが簡単かつ安全におこなえます。 さきほどの例で、加算する年数を場合に応じて変えたほうが適切であると、あとから気づいたとします。 メソッドのパラメーターとして、加算年数を追加しなくてはなりません。 この場合、次のように書けます: +Finally, with named parameters, maintaining or refactoring applications is very simple and safe. Imagine you later realize that adding 10 years is not always appropriate. You need another parameter to set how many years to add. You write: ```4d $person:=New object("Name";"Smith";"Age";40;"toAdd";10) ChangeAge($person) -// ChangeAge メソッド +//ChangeAge var $1;$para : Object $para:=$1 If ($para.toAdd=Null) $para.toAdd:=10 End if $para.Age:=Num($para.Age)+$para.toAdd -ALERT(String($para.Name)+" は "+String($para.Age)+" 歳です。") +ALERT(String($para.Name)+" is "+String($para.Age)+" years old.") ``` -このように、既存のコードを変える必要はありません。 変更後のコードは変更前と同じように動作しますが、引数によって加算年数に数値を指定することもできるようになりました。 +The power here is that you will not need to change your existing code. It will always work as in the previous version, but if necessary, you can use another value than 10 years. -名前付き引数を使うと、すべてのパラメーターを任意にすることができます。 上の例ではすべてのパラメーターが任意で、いずれを指定しても順序はありません。 +With named variables, any parameter can be optional. In the above example, all parameters are optional and anyone can be given, in any order. -## 入力 / 出力変数 +## Input/Output variables -これらの引数 ($1, $2...) はサブルーチン内で他のローカル変数と同様に使用できます。 しかしながら、引数として渡した変数の値を変更するコマンドをサブルーチン内で使用する場合 (例: `Find in field`)、$1, $2などを直接渡すことはできません。 まず標準のローカル変数等にコピーする必要があります (例: $myvar:=$1)。 +Within the subroutine, you can use the parameters $1, $2... in the same way you would use any other local variable. However, in the case where you use commands that modify the value of the variable passed as parameter (for example `Find in field`), the parameters $1, $2, and so on cannot be used directly. You must first copy them into standard local variables (for example: `$myvar:=$1`). -## 任意パラメーター +## Optional parameters -*4D ランゲージリファレンス* において、コマンドシンタックス中の { } 文字 (中括弧) はその引数が省略可能であることを示します。 たとえば、`ALERT (message{; okButtonTitle})` は *okButtonTitle* が省略できることを意味します。 この場合、次のような呼び出し方が可能です: +In the *4D Language Reference* manual, the { } characters (braces) indicate optional parameters. For example, `ALERT (message{; okButtonTitle})` means that the *okButtonTitle* parameter may be omitted when calling the command. You can call it in the following ways: ```4d -ALERT("Are you sure?";"Yes I am") // 2つの引数 -ALERT("Time is over") // 1つの引数 +ALERT("Are you sure?";"Yes I am") //2 parameters +ALERT("Time is over") //1 parameter ``` -プロジェクトメソッドも同様に、同じ型の引数であれば、右側に不定数の引数を受け取ることができます。 任意パラメーターの問題は、それらが指定されない場合への対処が必要だということです。欠落がエラーに繋がってはいけません。 使用されなかったパラメーターにデフォルト値を代入するやり方が効果的です。 +4D project methods also accept such optional parameters, starting from the right. The issue with optional parameters is how to handle the case where some of them are missing in the called method - it should never produce an error. A good practice is to assign default values to unused parameters. -> 任意パラメーターが必要な場合、[オブジェクトプロパティを名前付き引数として使用する](#オブジェクトプロパティを名前付き引数として使用する) と型の制限がなく、柔軟で便利です。 +> When optional parameters are needed in your methods, you might also consider using [object properties as named parameters](#using-objects-properties-as-named-parameters) which provide a flexible way to handle variable numbers of parameters. -`Count parameters` コマンドを使用すると、メソッドに渡された引数の数を確認することができるため、数に応じて異なる処理をおこなえます。 +Using the `Count parameters` command from within the called method, you can detect the actual number of parameters and perform different operations depending on what you have received. -次の例はテキストメッセージを表示し、2つの引数が渡されていればディスク上のドキュメントに、3つ以上の場合は 4D Write Pro エリアにそのテキストを書き出します。 +The following example displays a text message and can insert the text into a document on disk or in a 4D Write Pro area: ```4d -// APPEND TEXT プロジェクトメソッド -// APPEND TEXT ( テキスト { ; テキスト { ; オブジェクト } } ) -// APPEND TEXT ( メッセージ { ; パス { ; 4DWPエリア } } ) +// APPEND TEXT Project Method +// APPEND TEXT ( Text { ; Text { ; Object } } ) +// APPEND TEXT ( Message { ; Path { ; 4DWPArea } } ) Method($message : Text; $path : Text; $wpArea : Object) @@ -453,91 +452,91 @@ ALERT("Time is over") // 1つの引数 End if End if ``` -このプロジェクトメソッドをアプリケーションに追加したあとは、次のように呼び出すことができます: +After this project method has been added to your application, you can write: ```4d -APPEND TEXT(vtSomeText) // メッセージを表示します -APPEND TEXT(vtSomeText;$path) // メッセージを表示して、 $path のドキュメントに書き出します -APPEND TEXT(vtSomeText;"";$wpArea) // メッセージを表示して、 $wpArea の4D Write Pro ドキュメントに追記します +APPEND TEXT(vtSomeText) //Will only display the message +APPEND TEXT(vtSomeText;$path) //Displays text message and appends it to document at $path +APPEND TEXT(vtSomeText;"";$wpArea) //Displays text message and writes it to $wpArea ``` -## 引数の渡し方: 値か参照か +## Values or references -引数を渡すとき、4D は呼び出し元メソッドのコンテキストにおいてその式を評価し、**結果の値** をクラス関数またはサブルーチンのローカル変数に格納します。 これらのローカル変数に格納されているのは、呼び出し元で使用されているフィールドや変数、式ではなく、渡された値のみです。 スコープがローカルに限られているため、クラス関数 / サブルーチン内でローカル変数の値を変えても、呼び出し元メソッドには影響ありません。 たとえば: +When you pass a parameter, 4D always evaluates the parameter expression in the context of the calling method and sets the **resulting value** to the local variables in the class function or subroutine. The local variables/parameters are not the actual fields, variables, or expressions passed by the calling method; they only contain the values that have been passed. Since its scope is local, if the value of a parameter is modified in the class function/subroutine, it does not change the value in the calling method. For example: ```4d - // MY_METHOD メソッド -DO_SOMETHING([People]Name) // [People]Name の値が "williams" だとします + //Here is some code from the method MY_METHOD +DO_SOMETHING([People]Name) //Let's say [People]Name value is "williams" ALERT([People]Name) - // DO_SOMETHING メソッド + //Here is the code of the method DO_SOMETHING $1:=Uppercase($1) ALERT($1) ``` -`DO_SOMETHING` メソッドによって表示されたアラートボックスでは "WILLIAMS" と表示され、`MY_METHOD` メソッドによって表示されるアラートボックスでは "williams" と表示されます。 `DO_SOMETHING` メソッドは $1 の値をローカルな範囲で変更しましたが、これは `MY_METHOD` メソッドがサブルーチンに渡す引数として指定した [People]Last Name フィールドの値には影響しません。 +The alert box displayed by `DO_SOMETHING` will read "WILLIAMS" and the alert box displayed by `MY_METHOD` will read "williams". The method locally changed the value of the parameter $1, but this does not affect the value of the field `[People]Name` passed as parameter by the method `MY_METHOD`. -もし `DO_SOMETHING` メソッド内でフィールドの値を変更したいのであれば、2通りのやり方があります: +There are two ways to make the method `DO_SOMETHING` change the value of the field: -1. サブルーチンに渡す式としてフィールドではなく、フィールドへのポインターを指定することができます。この場合、以下のようにコードを書きます: +1. Rather than passing the field to the method, you pass a pointer to it, so you would write: ```4d - // MY_METHOD メソッド - DO_SOMETHING(->[People]Name) // [People]Name の値が "williams" だとします + //Here is some code from the method MY_METHOD + DO_SOMETHING(->[People]Name) //Let's say [People]Name value is "williams" ALERT([People]Last Name) - // DO_SOMETHING メソッド + //Here the code of the method DO_SOMETHING $1->:=Uppercase($1->) ALERT($1->) ``` -この例では、引数として指定された式はフィールドではなく、フィールドへのポインターです。 そのため、`DO_SOMETHING` メソッド内において、$1 はフィールドの値ではなく、フィールドへのポインターになっています。 $1 引数によって **参照** される対象 (上記コード内での $1->) はフィールドそのものです。 その結果、参照されている対象を変更すると、その影響はサブルーチンのスコープを超え、実際のフィールドも変更されます。 さきほどの例題においては、両方のアラートボックスに "WILLIAMS" と表示されます。 +Here the parameter is not the field, but a pointer to it. Therefore, within the `DO SOMETHING` method, $1 is no longer the value of the field but a pointer to the field. The object **referenced** by $1 ($1-> in the code above) is the actual field. Consequently, changing the referenced object goes beyond the scope of the subroutine, and the actual field is affected. In this example, both alert boxes will read "WILLIAMS". -2. `DO_SOMETHING` メソッドに "何かさせる" 代わりに、値を返すようにメソッドを書き直すこともできます。 たとえば、以下のようにコードです: +2. Rather than having the method `DO_SOMETHING` "doing something," you can rewrite the method so it returns a value. Thus you would write: ```4d - // MY_METHOD メソッド - [People]Name:=DO_SOMETHING([People]Name) // もとの [People]Name の値が "williams" だとします + //Here is some code from the method MY METHOD + [People]Name:=DO_SOMETHING([People]Name) //Let's say [People]Name value is "williams" ALERT([People]Name) - // DO_SOMETHING メソッド + //Here the code of the method DO SOMETHING $0:=Uppercase($1) ALERT($0) ``` -このようにサブルーチンの戻り値を使うことを "関数を使う" と言います。 詳細については [戻り値](#戻り値) の章を参照ください。 +This second technique of returning a value by a subroutine is called “using a function.” This is described in the [Returning values](#returning-values) paragraph. -### 特殊ケース: オブジェクトやコレクションの場合 +### Particular cases: objects and collections -オブジェクトやコレクションのデータタイプは参照 (つまり、内部的な *ポインター*) を介した形でのみ扱われることに注意が必要です。 +You need to pay attention to the fact that Object and Collection data types can only be handled through a reference (i.e. an internal *pointer*). -したがって、`$1、$2...` には *値* ではなく *参照* が格納されます。 `$1、$2...` の値をサブルーチン内で変更した場合、その変更は元となるオブジェクトやコレクションが使用されているところへと伝播します。 This is the same principle as for [pointers](dt_pointer.md#pointers-as-parameters-to-methods), except that `$1, $2...` parameters do not need to be dereferenced in the subroutine. +Consequently, when using such data types as parameters, `$1, $2...` do not contain *values* but *references*. Modifying the value of the `$1, $2...` parameters within the subroutine will be propagated wherever the source object or collection is used. This is the same principle as for [pointers](dt_pointer.md#pointers-as-parameters-to-methods), except that `$1, $2...` parameters do not need to be dereferenced in the subroutine. -次の例では、`CreatePerson` メソッドはオブジェクトを作成したのち、それを引数として `ChangeAge` に渡します: +For example, consider the `CreatePerson` method that creates an object and sends it as a parameter: ```4d - // CreatePerson メソッド + //CreatePerson var $person : Object $person:=New object("Name";"Smith";"Age";40) ChangeAge($person) ALERT(String($person.Age)) ``` -`ChangeAge` メソッドは受け取ったオブジェクトの Age 属性に 10を加えます: +The `ChangeAge` method adds 10 to the Age attribute of the received object ```4d - // ChangeAge メソッド + //ChangeAge #DECLARE ($person : Object) $person.Age:=$person.Age+10 ALERT(String($person.Age)) ``` -`CreatePerson` メソッドを実行すると、サブルーチンにおいても同じオブジェクト参照が扱われているため、両方のアラートボックスにおいて ”50” と表示されます。 +When you execute the `CreatePerson` method, both alert boxes will read "50" since the same object reference is handled by both methods. -**4D Server:** "サーバー上で実行" オプションが使用された場合など、同じマシン上で実行されないメソッド間で引数が渡される場合、参照渡しは利用できません。 このような場合には、参照の代わりにオブジェクトとコレクションのコピーが引数として渡されます。 +**4D Server:** When parameters are passed between methods that are not executed on the same machine (using for example the "Execute on Server" option), references are not usable. In these cases, copies of object and collection parameters are sent instead of references. diff --git a/website/translated_docs/ja/Concepts/plug-ins.md b/website/translated_docs/ja/Concepts/plug-ins.md index 4b01e8f9158c64..0e62435acb5e9f 100644 --- a/website/translated_docs/ja/Concepts/plug-ins.md +++ b/website/translated_docs/ja/Concepts/plug-ins.md @@ -1,59 +1,59 @@ --- id: plug-ins -title: プラグイン +title: Plug-ins --- -4Dアプリケーションの開発を進めていくと、最初は気付かなかった数多くの機能を発見することでしょう。 それだけでなく、**プラグイン** を4D開発環境に追加することで、標準の4Dの機能を高めることもできます。 +As you develop a 4D application, you will discover many capabilities that you did not notice when you started. You can even augment the standard version of 4D by adding **plug-ins** to your 4D development environment. -## プラグインの必要性 +## Why the need for a plug-in? -オブジェクトやレコードの操作、ユーザーインターフェースの実装のため、4D は数百のビルトインコマンドを提供していますが、さらに特殊な機能 (プラットフォーム依存のものなど) が必要になることがあります。たとえば、Windows上のODBC 、macOS上のアップルサービス、特殊な統計機能、ソーシャルネットワークログイン、決済用のプラットフォーム、ネットワークを介したファイルアクセス、特殊なユーザーインターフェース、独自のピクチャー構造などです。 +Although 4D provides hundred of built-in methods used to manipulate objects, records and implement user interface, some special use or feature (sometimes platform dependant) may be needed: one may need ODBC under Windows, another may need Apple services under macOS, while yet another may want to implement specific statistics tools, social network login, payment platform, file access over the network, a special user interface, or a private picture structure. -これらの機能をすべて、macOS と Windows の両方で 4D コマンドによって提供しようとした場合、コマンド数は数千に膨れ上がると同時に、ほとんどのユーザーはそれらの追加機能を必要としないでしょう。 また、そのような万能ツールを作り上げたとしても、その結果として 4D 環境は複雑化することになり、4D の学習が困難になるだけでなく、成果が得られるまで時間を要するようになるでしょう。 +It is obvious that covering all areas of both the macOS and Windows operating systems by way of 4D commands would certainly lead to a product with thousands of commands, and at the same time, most users would have no need for such a large set of capabilities. Also, creating such an all-encompassing tool would make the 4D environment incredibly complex and would take most users months of study before useful results could be expected. -4D 環境のモジュール性により、基礎的なアプリケーションの作成はもちろんのこと、非常に複雑なシステムの開発も可能です。 4D プラグインのアーキテクチャーによって、4D 環境はあらゆるアプリケーションとユーザーに対して開かれています。 4D プラグインによってアプリケーションやユーザーの生産性を飛躍させることができます。 +The modular nature of the 4D environment allows the creation of basic applications but does not preclude the development of highly complex systems. The 4D Plug-in architecture opens the 4D environment to any type of application or user. 4D Plug-ins multiply that application or user's power and productivity. -## プラグインとは何か +## What is a plug-in and what can it do? -プラグインとは、4D 起動時にロードされるコードのことです。 プラグインは、4D に機能を追加します。 +A plug-in is a piece of code that 4D launches at start up. It adds functionality to 4D and thus increases its capacity. -通常、プラグインは: -- 4D ができないことを処理します (プラットフォーム特有の技術など) -- 4D だけでは難しいことを実現します -- プラグインのエントリーポイントの形でのみ提供されている機能を提供します +Usually, a plug-in does things that: +- 4D cannot do (ie, specific platform technology), +- will be very hard to write just using 4D, +- are only available as Plug-in Entrypoint -プラグインには通常複数のルーチンが含まれています。 プラグインは外部エリアを操作でき、外部プロセスを実行できます。 +A plug-in usually contains a set of routines given to the 4D Developer. It can handle an External Area and run an external process. -- **プラグインルーチン** とは、ネイティブ言語 (通常は C あるいは C++) で書かれたルーチンで、なんらかの処理を実行します。 -- **外部エリア** とはフォームの一部で、あらゆるものを表示することができ、必要に応じてユーザー操作を受け付けることができます。 -- **外部プロセス** とは、通常はループ形式で単独実行されるプロセスのことです。 プロセスのコードはすべてプラグインに属しており、4D はプロセスに対してイベントを送受信するだけです。 +- A **plug-in routine** is a routine written in native language (usually C or C++) that causes an action. +- An **external area** is a part of a form that can display almost everything and interact with the user when necessary. +- An **external process** is a process that runs alone, usually in a loop, doing almost everything it wants. All process code belongs to the plug-in, 4D is simply present to receive/send events to the process. -### 重要な注記 +### Important note -プラグインは、小さな処理をおこなう一つのルーチンを実行するだけの、とても簡単なものでありえます。また、百以上のルーチンとエリアを扱うような、非常に複雑なものでもありえます。 プラグインの機能に制限はありませんが、プラグインの開発にあたっては、プラグインがあくまで従たるコードであることに留意が必要です。 プラグインは 4D 内で実行されます。 プラグインは独立したアプリケーションではなく、4D の一部です。 プラグインは、他のプラグインや 4D 自身と CPU 時間とメモリを共有します。したがって、プラグインのコードは、必要なリソースだけを使用する控えめなコードであるべきです。 たとえば、非常に長いループ処理においては (その重要性が絶対的な優先権を要求しないかぎり)、プラグインは `PA_Yield()` を呼び出して、4D のスケジューラーにも処理時間を割り当てるべきです。 +A plug-in can be very simple, with just one routine performing a very small task, or it can be very complex, involving hundred of routines and areas. There is virtually no limit to what a plug-in can do, however every plug-in developer should remember that a plug-in is a "sample" piece of code. It is the plug-in that runs within 4D, not the opposite. As a piece of code, it is the host of 4D; it is not a stand-alone application. It shares CPU time and memory with 4D and other plug-ins, thus, it should be a polite code, using just what is necessary to run. For example, in long loops, a plug-in should call `PA_Yield()` to give time to the 4D scheduler unless its task is critical for both it and the application. -## プラグインの作り方 +## How to create a plug-in? -4D は GitHub 上に、4D Plugin API と the 4D Plugin Wizard を含んだオープンソースの [**プラグイン SDK**](https://github.com/4d/4D-Plugin-SDK) (英語) を提供しています: +4D provides on GitHub an open-source [**plug-in SDK**](https://github.com/4d/4D-Plugin-SDK), containing the 4D Plugin API and the 4D Plugin Wizard: -- [**4D Plugin API**](https://github.com/4d/4D-Plugin-SDK/blob/master/4D%20Plugin%20API) は C で書かれており、プラグインの開発を助けるための機能を400以上追加します。 4D Plug-in API の機能は、4D とプラグイン間の通信を管理します。 -- [**4D Plugin Wizard**](https://github.com/4d/4D-Plugin-SDK/blob/master/4D%20Plugin%20Wizard) は、4D プラグインの開発を簡略化するために不可欠なツールです。 プラグインのロードや、プラグインとの通信に 4D が必要とするコードがツールによって提供されることで、デベロッパーはプラグインの根幹をなすコードに集中することができます。 +- the [**4D Plugin API**](https://github.com/4d/4D-Plugin-SDK/blob/master/4D%20Plugin%20API), written in C, adds more than 400 functions that help you to easily create your own plug-ins to add new functionnalities to your 4D application. 4D Plug-in API functions manage all the interactions between the 4D application and your plug-in. +- The [**4D Plugin Wizard**](https://github.com/4d/4D-Plugin-SDK/blob/master/4D%20Plugin%20Wizard) is an essential tool that simplifies the task of developing 4D plug-ins. It writes the code 4D needs to correctly load and interact with a plug-in, allowing you to concentrate on your own code. -## インストールの手順 +## How to install a plug-in? -プラグインやコンポーネントは 4D環境の適切なフォルダーにコピーすることでインストールされます。 +You install plug-ins in the 4D environment by copying their files into the appropriate folder. -Windows および macOS用の 4Dプラグインは、“PluginName.bundle” フォルダー (macOSではパッケージと呼ばれます) に格納されます。 このフォルダーの内部構造により、4D Server環境において、接続するクライアントのOSに応じたプラグインがロード/配信され、クライアント上で実行されます。 プラグインをインストールするには、この “PluginName.bundle” フォルダー (パッケージ) を**Plugins** フォルダーに配置します。 +“PluginName.bundle” folders contain both Windows and macOS versions of 4D plug-ins. Their specific internal architecture lets 4D Server load the appropriate version according to the platform where the client machine will be run. To install a plug-in in your environment, you just need to put the “PluginName.bundle” folder or package concerned into the desired **Plugins** folder. -Plugins フォルダーは 2つの異なる場所に配置できます: +You can put the Plugins folder in two different places: -- 4D実行アプリケーションレベル: - - Windows: .exeファイルと同階層 - - macOS: アプリケーションパッケージ内の Contentsフォルダーの直下。 この場合、このアプリケーションで開かれるすべてのプロジェクトからプラグインを利用できます。 -- Project フォルダーと同階層: この場合、プラグインは当該プロジェクトでのみ利用可能です。 +- At the level of the 4D executable application, i.e.: + - Under Windows: next to the .exe file + - Under macOS: at the first level of the Contents folder inside the application package. In this case, plug-ins are available in every project opened by this application. +- At the same level as the Project folder. In this case, plug-ins are only available in this particular project. -場所の選択はプラグインをどのように使用するかによって決定します。 +The choice of location depends on how you want to use the plug-in. -同じプラグインが両方の場所にインストールされている場合、4Dはストラクチャーファイルと同階層にインストールされたもののみをロードします。 コンパイルされ、4D Volume Desktop がマージされたアプリケーションでは、同じプラグインのインスタンスが複数存在する場合、アプリケーションを開くことができません。 +If the same plug-in is placed in both locations, 4D will only load the one located next to the structure. In an application that is compiled and merged using 4D Volume Desktop, if there are several instances of the same plug-in present, this will prevent the application from opening. -プラグインは 4D 起動時にロードされるので、これらをインストールする際には 4Dアプリケーションを終了する必要があります。 インストールが終了したら 4D でプロジェクトを開きます。 プラグインの利用に特別なライセンスが必要な場合、プラグインはロードされますが、ライセンスをインストールするまで使用することはできません。 \ No newline at end of file +Plug-ins are loaded by 4D when the application is launched so you will need to quit your 4D application before installing them. Then open your project with 4D. If any plug-in requires a specific license for use, it will be loaded but not available for use. \ No newline at end of file diff --git a/website/translated_docs/ja/Concepts/quick-tour.md b/website/translated_docs/ja/Concepts/quick-tour.md index a34b94c661264c..93058fb83a68c5 100644 --- a/website/translated_docs/ja/Concepts/quick-tour.md +++ b/website/translated_docs/ja/Concepts/quick-tour.md @@ -1,72 +1,72 @@ --- id: quick-tour -title: 概要 -sidebar_label: 概要 +title: A Quick Tour +sidebar_label: A Quick Tour --- -4D ランゲージを使用して "Hello, world!" メッセージを表示するには複数の方法があります。 一番簡単な方法はおそらく、プロジェクトメソッドにコードを1行、次のように書くやり方です: +Using the 4D language, printing the traditional "Hello, world!" message on screen can be done in several ways. The most simple is probably to write the following single line in a project method: ```4d ALERT("Hello, World!") ``` -このコードは、 "Hello, World!" メッセージが表示された、OK ボタンの付いたプラットフォームの標準的なアラートダイアログボックスを開きます。 コードを実行するには、メソッドエディターの左上にある実行ボタンをクリックします: +This code will display a platform-standard alert dialog box with the "Hello, World!" message, containing an OK button. To execute the code, you just need to click on the execution button in the Method editor: ![alt-text](assets/en/Concepts/helloworld.png) -あるいは、フォーム内のボタンにこのコードを付けた場合、フォームを実行した状態でボタンをクリックすると、その都度アラートメッセージが表示されます。 いずれの方法でも、前述の1行のコードを実行するだけで目的達成です! +Or, you could attach this code to a button in a form and execute the form, in which case clicking on the button would display the alert dialog box. In any cases, you have just executed your first line of 4D code! -## 値の代入 +## Assigning Values -変数、フィールド、配列要素などを対象に、データを格納したり、格納したデータを別の対象にコピーしたりすることができます。 変数にデータを格納することを、変数にデータを代入すると言い、代入演算子 (:=) を使っておこないます。 代入演算子はフィールドや配列要素に対してデータを代入する場合にも使います。 +Data can be put into and copied out of variables, fields, array elements... Putting data into a variable is called assigning the data to the variable and is done with the assignment operator (:=). The assignment operator is also used to assign data to fields or array elements. ```4d -$MyNumber:=3 // MyNumber 変数に数値の3を代入します -[Products]Size:=$MyNumber // [Products]Size フィールドに MyNumber 変数の値を代入します -arrDays{2}:="Tuesday" // arrDays 配列の第二要素に文字列 "Tuesday" を代入します -MyVar:=Length("Acme") // MyVar 変数に関数の結果 (数値の4) を代入します -$myDate:=!2018/01/21! // 日付リテラルを代入します -$myHour:=?08:12:55? // 時間リテラルを代入します +$MyNumber:=3 //assigns 3 to MyNumber variable +[Products]Size:=$MyNumber //assigns MyNumber variable to [Products]Size field +arrDays{2}:="Tuesday" //assigns "Tuesday" string to the 2nd arrDays element +MyVar:=Length("Acme") //assigns the result of the function (4) to MyVar +$myDate:=!2018/01/21! //assigns a date literal +$myHour:=?08:12:55? //assigns a time literal ``` -代入演算 (:=) は必ず他の演算と区別しなければなりません。 代入演算子は、被演算子を組み合わせて新しい一つのものにするのではなく、演算子の右側の式の値を左側の変数やフィールドにコピーします。 +You MUST distinguish the assignment operator := from the other operators. Rather than combining expressions into a new one, the assignment operator copies the value of the expression to the right of the assignment operator into the variable or field to the left of the operator. -**重要:** 代入演算子 (:=) と比較演算子 (=) とを混同しないように注意してください。 (=) とは異なる代入演算子が採用されたのは意図的なことで、他のプログラミング言語で (==) や (===) の使用によって度々起こる間違いを避けるためです。 このような間違いはコンパイラーにとっても発見しにくく、時間を消耗するトラブルシューティングのもとです。 +**Important:** 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. -## 変数 +## Variables -4D ランゲージは強い型付けの言語ですが、多くの場合に柔軟性も発揮します。 型指定の変数を作成するには `var` キーワードを使います。 たとえば、日付型の変数を作成するには、次のように書くことができます: +The 4D language is strongly typed, although some flexibility is allowed in many cases. You create a typed variable using the `var` keyword. For example, to create a variable of the date type, you can write: ```4d var MyDate : Date ``` -`var` キーワードを使って、定義されているクラス型のオブジェクト変数を宣言することができます。例: +The `var` keyword allows declaring object variables of a defined class type, for example: ```4d var myPerson : cs.Person -// Person ユーザークラスの変数 +//variable of the Person user class ``` -推奨はされませんが、変数を使用することで宣言することもでき、必ずしも正式に宣言する必要はありません。 たとえば、今日の日付に30日足した値を格納した変数が欲しい場合、次のように書くことができます: +Even if it is usually not recommended, you can declare variables simply by using them; you do not necessarily need to formally define them. For example, if you want a variable that will hold the current date plus 30 days, you can write: ```4d MyOtherDate:=Current date+30 ``` -上のコードは "MyOtherDate に、現在の日付に30日を加算した値を代入します" という意味です。 この1行で変数が宣言され、変数に (仮の) データ型とデータが割り当てられます。 このように代入によって宣言された変数はデータ型が規定されていないと解釈され、コードの違う行では別のデータ型の値を代入することもでき、その際にはデータ型を動的に変化させます。 `var` によって宣言された変数はデータ型を変化させることはできません。 [コンパイルモード](interpreted.md) においては、その宣言方法にかかわらず、変数のデータ型は変更できません。 +The line of code reads “MyOtherDate gets the current date plus 30 days.” This line declares the variable, assigns it with both the (temporary) date type and a content. A variable declared by assignment is interpreted as typeless, that is, it can be assigned with other types in other lines and then changes the type dynamically. A variable typed with `var` cannot change the type. In [compiled mode](interpreted.md) however, the type can never be changed, regardless of how the variable was declared. -## コマンド +## Commands -4D コマンドとは、処理を実行するために 4D に組み込まれている命令文のことです。 すべての 4D コマンド、たとえば `CREATE RECORD` や `ALERT` などのコマンドはテーマ別に _4D ランゲージリファレンス_ に記載されています。 コマンドに引数を渡す場合は、コマンド名の後の括弧 () に引数を入れ、セミコロン (;) で区切ります。 例: +4D commands are built-in methods to perform an action. All 4D commands, such as `CREATE RECORD`, or `ALERT`, are described in the _4D Language Reference_ manual, grouped by theme. Commands are often used with parameters, which are passed in brackets () and separated by semicolons (;). Example: ```4d COPY DOCUMENT("folder1\\name1";"folder2\\" ; "new") ``` -コレクションやオブジェクトにコマンドが属している場合、それらは名前付きメソッドであり、ドット記法を用いて使用します。 たとえば: +Some commands are attached to collections or objects, in which case they are named methods and are used using the dot notation. For example: ```4d $c:=New collection(1;2;3;4;5) @@ -75,143 +75,143 @@ $nc:=$c.slice(0;3) //$nc=[1,2,3] $lastEmployee:=$employee.last() ``` -4D プラグインや 4D コンポーネントを利用して、4D 開発環境に新しくコマンドを追加することもできます。 +You can use 4D plug-ins or 4D components that add new commands to your 4D development environment. -4D のユーザーコミュニティーや、サードパーティーデベロッパーによるプラグインが多数存在します。 たとえば, [4d-plugin-pdf-pages](https://github.com/miyako/4d-plugin-pdf-pages) プラグインを macOS で使用した場合は次のコードが書けます: +There are many plug-ins proposed by the 4D user community or 3rd-party developers on the market. For example, using the [4d-plugin-pdf-pages](https://github.com/miyako/4d-plugin-pdf-pages) on macOS: ```4d PDF REMOVE PAGE(path;page) ``` -4D SVG はアプリケーションの機能を拡張するユーティリティコンポーネントの一例です: +4D SVG is an example of a utility component extending the capabilities of your application: ```4d -// 図の描画 +//drawing a picture svgRef:=SVG_New objectRef:=SVG_New_arc(svgRef;100;100;90;90;180) ``` -4D SVG は 4D に含まれています。 +4D SVG is included in 4D. -## 定数 +## Constants -4D では多くの定義済定数が用意されており、それらの値は名前によってアクセスすることができます。 たとえば、`Read Mode` は定数で、その値は 2 です。 メソッドエディターにおいて、定義済定数はデフォルトで下線付きで表示されます。 定義済みの定数によって、より可読性の高いコードを書くことができます。 +4D proposes an extensed set of predefined constants, whose values are accessible by name. For example, `Read Mode` is a constant (value 2). Predefined constants appear underlined by default in the 4D Method editor. They allow writing more readable code. ```4d -vRef:=Open document("PassFile";"TEXT";Read Mode) // ドキュメントを読み取り専用モードで開きます +vRef:=Open document("PassFile";"TEXT";Read Mode) // open doc in read only mode ``` ## Methods -4D が提供するたくさんのビルトインコマンドを使って、独自の **プロジェクトメソッド** を組み立てることができます。 プロジェクトメソッドとはユーザー定義のメソッドで、コマンドや演算子などの要素から成り立ちます。 プロジェクトメソッドは汎用性のあるメソッドですが、そうではない他の種類のメソッドも存在します: オブジェクトメソッド、フォームメソッド、テーブルメソッド (トリガー)、データベースメソッド。 +4D provides a large number of built-in methods (or commands) but also lets you can create your own **project methods**. Project methods are user-defined methods that contain commands, operators, and other parts of the language. Project methods are generic methods, but there are other kinds of methods: Object methods, Form methods, Table methods (Triggers), and Database methods. -メソッドは、一つ以上のステートメントで構成されます。ステートメントとは、メソッドの1行のことで1つの命令を実行します。 ステートメントは単純な場合もあれば、複雑な場合もあります。 +A method is composed of statements; each statement consists of one line in the method. A statement performs an action, and may be simple or complex. -たとえば、次のステートメントは確認ダイアログボックスを表示します: +For example, the following line is a statement that will display a confirmation dialog box: ```4d -CONFIRM("このアカウントを本当に閉じますか?";"はい";"いいえ") +CONFIRM("Do you really want to close this account?";"Yes";"No") ``` -メソッドは、テストとループの制御フローの実行を含みます。 `If...Else...End if` および `Case of...Else...End case` の分岐構造が使用できるほか、ループ構造としては `While...End while`、`Repeat...Until`、`For...End for`、そして `For each...End for each` が使用可能です: +A method also contains tests and loops that control the flow of the execution. 4D methods support `If...Else...End if` and `Case of...Else...End case` branching structures as well as looping structures: `While...End while`, `Repeat...Until`, `For...End for`, and `For each...End for each`: -テキスト変数 vtSomeText の文字を一つ一つループ処理します: +The following example goes through all the characters of the text vtSomeText: ```4d For($vlChar;1;Length(vtSomeText)) - // 文字がタブであれば + //Do something with the character if it is a TAB If(Character code(vtSomeText[[$vlChar]])=Tab) - // なんらかの処理をします + //... End if End for ``` -プロジェクトメソッドは他のプロジェクトメソッドを呼び出すことができ、その際に引数を渡すことも可能です。 メソッドに引数を渡す場合は、メソッド名の後の括弧 () に引数を入れ、 セミコロン (;) で区切ります。 引数は受け取り側のメソッドにて、受け取り順に番号が付けられたローカル変数 ($1, $2, ...$n) に格納されます。 メソッドの一つの値を戻り値とすることができ、$0 パラメーターを使います。 メソッドを呼び出すには、メソッド名を書きます: +A project method can call another project method with or without parameters (arguments). The parameters are passed to the method in parentheses, following the name of the method. Each parameter is separated from the next by a semicolon (;). The parameters are available within the called method as consecutively numbered local variables: $1, $2,…, $n. A method can return a single value in the $0 parameter. When you call a method, you just type its name: ```4d $myText:="hello" -$myText:=Do_Something($myText) // Do_Something メソッドを呼び出します +$myText:=Do_Something($myText) //Call the Do_Something method ALERT($myText) //"HELLO" - // Do_Something メソッドのコードです + //Here the code of the method Do_Something $0:=Uppercase($1) ``` -## データタイプ +## Data Types -4D ランゲージで扱うデータにはいくつかの種別があり、これらのデータ種別を "データタイプ" と呼びます。 基本のデータタイプ (文字、数値、日付、時間、ブール、ピクチャー、ポインター、配列) と混合型のデータタイプ (BLOB、オブジェクト、コレクション) があります。 +In the language, the various types of data that can be handled are referred to as data types. There are basic data types (string, numeric, date, time, Boolean, picture, pointers, arrays), and also composite data types (BLOBs, objects, collections). -データタイプのうち、文字タイプと数値タイプは、複数の類似するフィールドタイプに対応する点に注意してください。 これらのフィールドにデータが格納されるとき、4D ランゲージはフィールドタイプに合致するデータタイプへとデータを自動的に変換します。 反対に、たとえば整数フィールドのデータを呼び出すと、そのデータは自動的に数値タイプとして扱われます。 つまり、4D ランゲージを使用する際に、類似するフィールドタイプを厳密に区別する必要はありません。 +Note that string and numeric data types can be associated with more than one type of field. When data is put into a field, the language automatically converts the data to the correct type for the field. For example, if an integer field is used, its data is automatically treated as numeric. In other words, you need not worry about mixing similar field types when using the language; it will manage them for you. -しかし、プログラミングにおいて異なるデータタイプを混同しないようにすることは重要です。 "ABC" を日付フィールドに格納しても意味がないように、日付型の変数に "ABC" を格納することも意味がありません。 4D は、コードに書かれたことをできるだけ有効にしようとします。 たとえば、日付に数値を加算した場合は、日付に日数を加算したいものと認識します。しかし、日付に文字列を加算した場合には、4D はその操作が意味を持たないことを警告します。 +However, when using the language it is important that you do not mix different data types. In the same way that it makes no sense to store “ABC” in a Date field, it makes no sense to put “ABC” in a variable used for dates. In most cases, 4D is very tolerant and will try to make sense of what you are doing. For example, if you add a number to a date, 4D will assume that you want to add that number of days to the date, but if you try to add a string to a date, 4D will tell you that the operation cannot work. -あるタイプとして格納したデータを、別のタイプとして使用する場合があります。 4D ランゲージには、データタイプを変換するためのコマンドが用意されています。 たとえば、数値で始まり、"abc" 等の文字で終了する部品番号を作成する場合、 以下のように記述することができます: +There are cases in which you need to store data as one type and use it as another type. The language contains a full complement of commands that let you convert from one data type to another. For example, you may need to create a part number that starts with a number and ends with characters such as “abc”. In this case, you might write: ```4d -[Products]Part_Number:=String(Number)+"abc" +[Products]Part Number:=String(Number)+"abc" ``` -数値変数 _Number_ の値が17であれば、_[Products]Part_Number_ に "17abc" という文字列が代入されます。 +If _Number_ is 17, then _[Products]Part Number_ will get the string “17abc”. -データタイプについては [データタイプ](Concepts/data-types.md) の節で詳しく説明しています。 +The data types are fully defined in the section [Data Types](Concepts/data-types.md). -## オブジェクトとコレクション +## Objects and collections -4D ランゲージのオブジェクトとコレクションは、オブジェクト記法を使用して値を代入・取得することができます。 たとえば: +You can handle 4D language objects and collections using the object notation to get or to set their values. For example: ```4d employee.name:="Smith" ``` -大カッコ内と文字列の組み合わせを用いることもできます: +You can also use a string within square brackets, for example: ```4d $vName:=employee["name"] ``` -オブジェクトプロパティ値には、オブジェクトやコレクションも設定することが可能です。これらのサブプロパティにアクセスするため、オブジェクト記法では連続した字句を受け入れることができます: +Since an object property value can be an object or a collection, object notation accepts a sequence of symbols to access sub-properties, for example: ```4d $vAge:=employee.children[2].age ``` -オブジェクトのプロパティ値が、メソッド (フォーミュラ) をカプセル化したオブジェクトである場合には、プロパティ名の後に括弧 ( ) をつけることで実行できます: +Note that if the object property value is an object that encapsulates a method (a formula), you need to add parenthesis () to the property name to execute the method: ``` $f:=New object $f.message:=New formula(ALERT("Hello world!")) -$f.message() // "Hello world!" を表示します +$f.message() //displays "Hello world!" ``` -コレクションの要素にアクセスするためには、大カッコでくくった要素番号を渡します: +To access a collection element, you have to pass the element number embedded in square brackets: ```4d C_COLLECTION(myColl) myColl:=New collection("A";"B";1;2;Current time) -myColl[3] // コレクションの4番目の要素にアクセスします (0起点) +myColl[3] //access to 4th element of the collection ``` ## Classes -4D ランゲージではオブジェクトクラスがサポートされています。 "myClass" という名称のクラスを作成するには、プロジェクトの Project/Sources/Classes フォルダーに `myClass.4dm` ファイルを追加します。 +The 4D language supports object classes. Add a `myClass.4dm` file in the Project/Sources/Classes folder of a project to create a class named "myClass". -あるメソッドにおいて、クラスのオブジェクトをインスタンス化するには、*クラスストア* (`cs`) よりユーザークラスを呼び出して、`new()` メンバー関数を使います。 引数を渡すこともできます。 +To instantiate an object of the class in a method, call the user class from the *class store* (`cs`) and use the `new()` member function. You can pass parameters. ```4d -// 4D メソッド内 +// in a 4D method $o:=cs.myClass.new() ``` -`myClass` クラスメソッド内では、*methodName* クラスメンバーメソッドを宣言するのに `Function ` ステートメントを使います。 ほかのメソッドのように、クラスメンバーメソッドは引数を受け取ったり、値を返すことができ、オブジェクトインスタンスとして `This` を使えます。 +In the `myClass` class method, use the `Function ` statement to define the *methodName* class member method. A class member method can receive and return parameters like any method, and use `This` as the object instance. ```4d -// myClass.4dm ファイル内 +//in the myClass.4dm file Function hello C_TEXT($0) $0:="Hello "+This.who ``` -クラスメンバーメソッドを実行するには、オブジェクトインスタンスのメンバーメソッドに `()` 演算子を使います。 +To execute a class member method, just use the `()` operator on the member method of the object instance. ```4d $o:=cs.myClass.new() @@ -220,10 +220,10 @@ $message:=$o.myClass.hello() //$message: "Hello World" ``` -`Class constructor` キーワードを使用してオブジェクトのプロパティを宣言することもできます (任意)。 +Optionally, use the `Class constructor` keyword to declare properties of the object. ```4d -// Rectangle.4dm ファイル内 +//in the Rectangle.4dm file Class constructor C_LONGINT($1;$2) This.height:=$1 @@ -231,107 +231,107 @@ This.width:=$2 This.name:="Rectangle" ``` -クラスはほかのクラスから継承することもできます: `Class extends `。 また、`Super` コマンドを使って、スーパークラスを呼び出すことができます。 たとえば: +A class can extend another class by using `Class extends `. Superclasses can be called using the `Super` command. For example: ```4d -// Square.4dm ファイル内 -Class extends Rectangle +//in the Square.4dm file +Class extends rectangle Class constructor C_LONGINT($1) - // 親クラスのコンストラクターを呼び出します - // 長方形の高さ・幅パラメーターに正方形の一辺の長さを引数として渡します + // It calls the parent class's constructor with lengths + // provided for the Rectangle's width and height Super($1;$1) This.name:="Square" ``` -## 演算子 -プログラミング言語を使用する際に、データのみを必要とする場合は非常に稀です。 データを加工、または何らかの目的のために使用することがほとんどです。 そういった計算は演算子を使っておこないます。 一般的に演算子とは、2つのデータをもとに処理をおこない、1つの新しいデータを生成します。 日常的に使用されている演算子も多くあります。 例えば、1 + 2 という式は加算演算子(プラス記号)を使用し、2つの数値を足し合わせて、3という結果を返します。 以下に、よく知られている 4つの演算子を示します。 +## Operators +When you use the language, it is rare that you will simply want a piece of data. It is more likely that you will want to do something to or with that data. You perform such calculations with operators. Operators, in general, take two pieces of data and perform an operation on them that results in a new piece of data. You are already familiar with many operators. For example, 1 + 2 uses the addition (or plus sign) operator to add two numbers together, and the result is 3. This table shows some familiar numeric operators: -| 演算子 | 演算子 | 例題 | -| --- | -------- | ------------ | -| + | 加算 (足し算) | 1 + 2 の結果は 3 | -| – | 減算 (引き算) | 3 - 2 の結果は 1 | -| * | 乗算 (かけ算) | 2 * 3 の結果は 6 | -| / | 除算 (割り算) | 6 / 2 の結果は 3 | +| Operator | Operation | Example | +| -------- | -------------- | ------------------ | +| + | Addition | 1 + 2 results in 3 | +| – | Subtraction | 3 – 2 results in 1 | +| * | Multiplication | 2 * 3 results in 6 | +| / | Division | 6 / 2 results in 3 | -数値演算子は、使用可能な演算子のうちの 1種にすぎません。 4Dは、数値・テキスト・日付・ピクチャー等、異なるタイプのデータを扱うために、各データタイプで演算を実行するための演算子を備えています。 +Numeric operators are just one type of operator available to you. 4D supports many different types of data, such as numbers, text, dates, and pictures, so there are operators that perform operations on these different data types. -対象のデータタイプによって、同じ記号が異なる処理に使用される場合があります。 例えば、データタイプによってプラス記号 (+) は下記のように異なる演算を実行します: +The same symbols are often used for different operations, depending on the data type. For example, the plus sign (+) performs different operations with different data: -| データタイプ | 演算子 | 例題 | -| ------ | -------- | ---------------------------------------------------------- | -| 数値 | 加算 (足し算) | 1 + 2 は数値を加算し、結果は 3 です。 | -| String | 連結 (結合) | "みなさん" + "こんにちは" は文字を連結 (結合) し、結果は "みなさんこんにちは" です。 | -| 日付と数値 | 日付の加算 | !2006/12/4! + 20 は、2006年12月4日に 20日を加算し、結果は 2006年12月24日です。 | +| Data Type | Operation | Example | +| --------------- | ------------- | ---------------------------------------------------------------------------------------------------- | +| Number | Addition | 1 + 2 adds the numbers and results in 3 | +| String | Concatenation | “Hello ” + “there” concatenates (joins together) the strings and results in “Hello there” | +| Date and Number | Date addition | !1989-01-01! + 20 adds 20 days to the date January 1, 1989, and results in the date January 21, 1989 | -## 式 +## Expressions -式は、値を返します。 4D ランゲージでコードを書く際には、意識していなくても常に式を使用しています。 式は、"フォーミュラ" と呼ぶこともあります。 +Simply put, expressions return a value. In fact, when using the 4D language, you use expressions all the time and tend to think of them only in terms of the value they represent. Expressions are also sometimes referred to as formulas. -コマンド・演算子・変数・フィールド・オブジェクトプロパティ・コレクション要素等、複数のランゲージの要素を組み合わせて式は構成されます。 式により、ステートメント (メソッドの 1文や 1行) を構成します。 データが必要なとき、式が必要になります。 +Expressions are made up of almost all the other parts of the language: commands, operators, variables, fields, object properties, and collection elements. You use expressions to build statements (lines of code), which in turn are used to build methods. The language uses expressions wherever it needs a piece of data. -式が単独で使われることはほとんどありませんが、 単独で使用できる場合がいくつかあります : +Expressions rarely “stand alone.” There are several places in 4D where an expression can be used by itself. It includes: -- フォーミュラエディター (フォーミュラによるクエリや並べ替えなど) -- `EXECUTE FORMULA` コマンド -- フォームオブジェクトやウィジェットのデータソースとして -- デバッガー内で式の値を確認することができます -- クイックレポートエディターでカラムにフォーミュラを使用することができます +- Formula editor (apply formula, query with formula, order by formula) +- The `EXECUTE FORMULA` command +- The Property list, where an expression can be used as a data source for most of widgets +- Debugger where the value of expressions can be checked +- Quick Report editor as a formula for a column -### 式のタイプ -生成する値のタイプによって、式のタイプを定義することができます。 式のタイプは複数あります。 様々なタイプの式の例を以下に示します。 +### Expression types +You refer to an expression by the data type it returns. There are several expression types. The following table gives examples of each type of expression. -| 式 | タイプ | 説明 | -| --------------------------- | ----------- | ------------------------------------------------------------------------------ | -| "こんにちは" | String | これは文字列定数 "こんにちは" です。 文字列定数であることを表すために二重引用符が必要です。 | -| "みなさん" + "こんにちは" | String | 2つの文字列 "みなさん" と "こんにちは" が + 演算子により結合され、 "みなさんこんにちは" を返します。 | -| [People]Name + "様" | String | 2つの文字列の結合です。[People]Name フィールドと文字列 "様" が結合されます。 フィールドの値が "小林" の場合、"小林様" を返します。 | -| Uppercase ("smith") | String | この式は `Uppercase` コマンドを使用して、文字列 "smith" を英大文字に変換します。 そして "SMITH" を返します。 | -| 4 | 数値 | これは数値定数 4です。 | -| 4 * 2 | 数値 | 2つの数値、4 と 2 の乗算です。乗算演算子の (*) を使用しています。 数値の 8を返します。 | -| myButton | 数値 | これはボタンに紐づけられた変数です。 ボタンの現在の値を返します: クリックされた場合に 1、それ以外は 0 を返します。 | -| !06/12/24! または !2006/12/24! | 日付 | この式は日付定数で 2006年12月24日を表します。 | -| Current date + 30 | 日付 | これは日付の計算です。`Current date` コマンドは現在の日付を返します。 現在の日付に 30日を加えた日付を返します。 | -| ?8:05:30? | 時間 | これは時間定数で、8時5分30秒を表します。 | -| ?2:03:04? + ?1:02:03? | 時間 | 2つの時間の足し算をおこない、3時5分7秒を返します。 | -| True | ブール | このコマンドはブール値の true (真) を返します。 | -| 10 # 20 | ブール | これは 2つの数値の論理比較です。 #記号は、"等しくない" を表します。 10と20は "等しくない" ため、この式は true (真) を返します。 | -| "ABC" = "XYZ" | ブール | これは文字列の論理比較です。 文字列は等しくないため、式は FALSE (偽) を返します。 | -| My Picture + 50 | ピクチャー | この式は My Picture 変数に入っているピクチャーを右に 50ピクセル移動したピクチャーを返します。 | -| ->[People]Name | ポインター | この式は [People]Name フィールドへのポインターを返します。 | -| Table (1) | ポインター | このコマンドは一番目に定義されたテーブルへのポインターを返します。 | -| JSON Parse (MyString) | オブジェクト | このコマンドは MyString が適切なフォーマットであれば、オブジェクトとして返します。 | -| JSON Parse (MyJSONArray) | コレクション | このコマンドは MyJSONArray が適切なフォーマットであれば、コレクションとして返します。 | -| Form.pageNumber | オブジェクトプロパティ | オブジェクトプロパティは式として、サポートされているいずれのタイプでもありえます。 | -| Col[5] | コレクション要素 | コレクション要素は式として、サポートされているいずれのタイプでもありえます。 | -| $entitySel[0] | エンティティ | ORDA のエンティティセレクションの要素である、エンティティを返します。 これは **代入不可の式** です。 | +| Expression | Type | Description | +| ------------------------ | ------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| “Hello” | String | The word Hello is a string constant, indicated by the double quotation marks. | +| “Hello ” + “there” | String | Two strings, “Hello ” and “there”, are added together (concatenated) with the string concatenation operator (+). The string “Hello there” is returned. | +| “Mr. ” + [People]Name | String | Two strings are concatenated: the string “Mr. ” and the current value of the Name field in the People table. If the field contains “Smith”, the expression returns “Mr. Smith”. | +| Uppercase("smith") | String | This expression uses `Uppercase`, a command from the language, to convert the string “smith” to uppercase. It returns “SMITH”. | +| 4 | Number | This is a number constant, 4. | +| 4 * 2 | Number | Two numbers, 4 and 2, are multiplied using the multiplication operator (*). The result is the number 8. | +| myButton | Number | This is a variable associated to a button. It returns the current value of the button: 1 if it was clicked, 0 if not. | +| !1997-01-25! | Date | This is a date constant for the date 1/25/97 (January 25, 1997). | +| Current date+ 30 | Date | This is a date expression that uses the `Current date` command to get today’s date. It adds 30 days to today’s date and returns the new date. | +| ?8:05:30? | Time | This is a time constant that represents 8 hours, 5 minutes, and 30 seconds. | +| ?2:03:04? + ?1:02:03? | Time | This expression adds two times together and returns the time 3:05:07. | +| True | Boolean | This command returns the Boolean value TRUE. | +| 10 # 20 | Boolean | This is a logical comparison between two numbers. The number sign (#) means “is not equal to”. Since 10 “is not equal to” 20, the expression returns TRUE. | +| “ABC” = “XYZ” | Boolean | This is a logical comparison between two strings. They are not equal, so the expression returns FALSE. | +| My Picture + 50 | Picture | This expression takes the picture in My Picture, moves it 50 pixels to the right, and returns the resulting picture. | +| ->[People]Name | Pointer | This expression returns a pointer to the field called [People]Name. | +| Table (1) | Pointer | This is a command that returns a pointer to the first table. | +| JSON Parse (MyString) | Object | This is a command that returns MyString as an object (if proper format) | +| JSON Parse (MyJSONArray) | Collection | This is a command that returns MyJSONArray as a collection (if proper format) | +| Form.pageNumber | Object property | An object property is an expression that can be of any supported type | +| Col[5] | Collection element | A collection element is an expression that can be of any supported type | +| $entitySel[0] | Entity | A element of an ORDA entity selection is an expression of the entity type. This kind of expression is **non-assignable** | -### 代入可 vs 代入不可の式 +### Assignable vs non-assignable expressions -式は、数値の4や"Hello" の文字列のようなリテラル定数であったり、`$myButton` のような変数であったりします。 式には演算子も含められます。 たとえば、4 + 2 という式は加算演算子を使って二つの数値を加算し、結果の 6 を返します。 リテラル定数や演算子を使った式は **代入不可の式**で、式に値を代入することはできません。 **代入可能な式** も存在します。 代入演算子の左側に使えるものが、代入可能な式です。 たとえば: +An expression can simply be a literal constant, such as the number 4 or the string "Hello", or a variable like `$myButton`. It can also use operators. For example, 4 + 2 is an expression that uses the addition operator to add two numbers together and return the result 6. In any cases, these expressions are **non-assignable**, which means that you cannot assign a value to them. In 4D, expressions can be **assignable**. An expression is assignable when it can be used on the right side of an assignation. For example: ```4d -// 変数 $myVar は代入可能です: -$myVar:="Hello" // $myVar に "Hello" を代入します -//Form.pageNumber は代入可能です: -Form.pageNumber:=10 // Form.pageNumber に 10 を代入します -//Form.pageTotal-Form.pageNumber は代入不可です: -Form.pageTotal- Form.pageNumber:=10 // 代入不可のため、エラー +//$myVar variable is assignable, you can write: +$myVar:="Hello" //assign "Hello" to myVar +//Form.pageNumber is assignable, you can write: +Form.pageNumber:=10 //assign 10 to Form.pageNumber +//Form.pageTotal-Form.pageNumber is not assignable: +Form.pageTotal- Form.pageNumber:=10 //error, non-assignable ``` -このように、リテラル定数ではなくても、演算子を使っている式は代入不可です。 たとえば、`[Person]FirstName+" "+[Person]LastName` は代入不可です。 +In general, expressions that use an operator are non-assignable. For example, `[Person]FirstName+" "+[Person]LastName` is not assignable. -## ポインター +## Pointers -ポインターは、プログラミングにおいてデータを参照するための高度な方法です。 4D ではテーブル、フィールド、変数、配列、配列要素を参照するためにポインターを使用することができます。 +The 4D language provides an advanced implementation of pointers, that allow writing powerful and modular code. You can use pointers to reference tables, fields, variables, arrays, and array elements. -対象へのポインターは、その対象の前にポインター記号 (->) を付けることで取得することができます。反対にポインターから対象を取得するには、ポインター名の後にポインター記号をつけます: +A pointer to an element is created by adding a "->" symbol before the element name, and can be dereferenced by adding the "->" symbol after the pointer name. ```4d MyVar:="Hello" @@ -339,50 +339,50 @@ MyPointer:=->MyVar ALERT(MyPointer->) ``` -## コメント +## Comments -コメントとは、コード内の実行されないテキストのことです。 これらのテキストは、コード実行時にインタープリターによって無視されます。 +Comments are inactive lines of code. These lines are not interpreted by the 4D language and are not executed when the code is called. -コメントの書き方は2通りあります: +There are two ways to create comments: -- `//` 記号の後はすべてコメントとして扱われるため、これを使って1行のコメントが書けます -- `/*コメント*/` の表記方法でインラインコメント、または複数行にまたがるコメントが書けます +- `//` for single line comments +- `/*...*/` for inline or multiline commnents. -これらの書き方は同時に使用できます。 +Both styles of comments can be used simultaneously. -#### シングルラインコメント (//) +#### Single line comments (//) -コードの後や行の最初に `//` を使うと、その後のテキストはすべてコメントとなります。 例: +Insert `//` at the beginning of a line or after a statement to add a single line comment. Example: ```4d -// これはコメントです -For($vCounter;1;100) // ループを開始します - // コメント - // コメント - // コメント +//This is a comment +For($vCounter;1;100) //Starting loop + //comment + //comment + //comment End for ``` -#### インライン、およびマルチラインコメント (/* */) +#### Inline or multiline comments (/* */) -コメントを `/*` と `*/` で囲むと、そのあいだのテキストはコメントとなります。 この方法でインラインおよびマルチラインコメントが書けます: +Surround contents with `/*` ... `*/` characters to create inline comments or multiline comment blocks. Both inline and multiline comment blocks begin with `/*` and end with `*/`. -- **インラインコメント** の 例: +- **Inline comments** can be inserted anywhere in the code. Example: ```4d -For /* インラインコメント */ ($vCounter;1;100) +For /* inline comment */ ($vCounter;1;100) ... End for ``` -- **マルチラインコメント** は複数行にわたるコメントのことです。 この形式のコメントは入れ子にすることができ、4D コードエディターではこれを展開したり折りたたんだりすることができます。 例: +- **Multiline comment blocks** allows commenting an unlimited number of lines. Comment blocks can be nested (useful since the 4D code editor supports block collapsing). Example: ```4d For ($vCounter;1;100) /* -コメント +comments /* - 詳細なコメント + other comments */ */ ... diff --git a/website/translated_docs/ja/Concepts/shared.md b/website/translated_docs/ja/Concepts/shared.md index 76a02aefc5d803..8985b81f33c743 100644 --- a/website/translated_docs/ja/Concepts/shared.md +++ b/website/translated_docs/ja/Concepts/shared.md @@ -1,33 +1,33 @@ --- id: shared -title: 共有オブジェクトと共有コレクション +title: Shared objects and collections --- -**共有オブジェクト** および **共有コレクション** はプロセス間でコンテンツを共有することができる、特殊な [オブジェクト](Concepts/dt_object.md) と [コレクション](Concepts/dt_collection.md) です。 [インタープロセス変数](Concepts/variables.md#インタープロセス変数) に比べると、共有オブジェクトと共有コレクションは **プリエンプティブ4Dプロセス** と互換性があるという点で利点があります。つまり、`New process` や `CALL WORKER` といったコマンドの引数として、参照の形で渡すことができるということです。 +**Shared objects** and **shared collections** are specific [objects](Concepts/dt_object.md) and [collections](Concepts/dt_collection.md) whose contents are shared between processes. In contrast to [interprocess variables](Concepts/variables.md#interprocess-variables), shared objects and shared collections have the advantage of being compatible with **preemptive 4D processes**: they can be passed by reference as parameters to commands such as `New process` or `CALL WORKER`. -共有オブジェクトと共有コレクションは、標準の `C_OBJECT` と `C_COLLECTION` コマンドで宣言された変数に保存することができますが、専用のコマンドを使用してインスタンス化されている必要があります: +Shared objects and shared collections can be stored in variables declared with standard `C_OBJECT` and `C_COLLECTION` commands, but must be instantiated using specific commands: -- 共有オブジェクトを作成するには、`New shared object` コマンドを使用します。 -- 共有コレクションを作成するには、`New shared collection` コマンドを使用します。 +- to create a shared object, use the `New shared object` command, +- to create a shared collection, use the `New shared collection` command. -**注:** 共有オブジェクトと共有コレクションは標準の (非共有の) オブジェクトおよびコレクションのプロパティとして設定することができます。 +**Note:** Shared objects and collections can be set as properties of standard (not shared) objects or collections. -共有オブジェクト/コレクションを編集するには、**Use...End use** 構文を使う必要があります。 共有オブジェクト/コレクションの値を読むにあたっては、**Use...End use** は必要ありません。 +In order to modify a shared object/collection, the **Use...End use** structure must be called. Reading a shared object/collection value does not require **Use...End use**. -`Storage` コマンドが返す、データベースにおいて固有かつグローバルなカタログは、そのアプリケーション内あるいはコンポーネントからいつでも利用することができ、すべての共有オブジェクトおよびコレクションを保存するのに使用することができます。 +A unique, global catalog returned by the `Storage` command is always available throughout the application and its components, and can be used to store all shared objects and collections. -## 共有オブジェクト/共有コレクションの使用 +## Using shared objects or collections -`New shared object` あるいは `New shared collection` コマンドでインスタンス化されると、その共有オブジェクト/コレクションの属性と要素はどのプロセスからでも編集/読み出しができるようになります。 +Once instantiated with the `New shared object` or `New shared collection` commands, shared object/collection properties and elements can be modified or read from any process of the application. -### 編集 +### Modification -共有オブジェクトと共有コレクションは、編集することが可能です: +Modifications can be applied to shared objects and shared collections: -- オブジェクトプロパティの追加・削除 -- 値の追加・編集 (共有オブジェクトがサポートしている範囲内で)。これには、他の共有オブジェクトやコレクションの追加・編集も含まれます (この場合、共有グループを作成します。後述参照) +- adding or removing object properties, +- adding or editing values (provided they are supported in shared objects), including other shared objects or collections (which creates a shared group, see below). -ただし、共有オブジェクトあるいは共有コレクションを編集するコードは、必ず `Use...End use` 構文に組み込まれている必要があり、そうでない場合にはエラーが返されます。 +However, all modification instructions in a shared object or collection must be surrounded by the `Use...End use` keywords, otherwise an error is generated. ```4d $s_obj:=New shared object("prop1";"alpha") @@ -36,67 +36,67 @@ title: 共有オブジェクトと共有コレクション End Use ``` -一度に 1プロセスのみ、共有オブジェクト/コレクションを編集することができます。 `Use` は共有オブジェクト/コレクションを他のスレッドからアクセスできないようにロックする一方、`End use` はこのロックを解除します (ロックカウンターが 0 の場合; 後述参照)。 . `Use...End use` を使わずに共有オブジェクト/コレクションを編集しようとすると、エラーが生成されます。 すでに他のプロセスによって使用されている共有オブジェクト/コレクションに対して、別のプロセスが `Use...End use` を呼び出した場合、先着プロセスが `End use` でロックを解除するまで、その呼び出しは待機状態になります (エラーは生成されません)。 したがって、`Use...End use` 構文内の処理は迅速に実行され、ロックは可及的速やかに解除される必要があります。 そのため、共有オブジェクト/コレクションをインターフェース(ダイアログボックスなど) から直接編集することは避けることが強く推奨されます。 +A shared object/collection can only be modified by one process at a time. `Use` locks the shared object/collection from other threads, while `End use` unlocks the shared object/collection (if the locking counter is at 0, see below). . Trying to modify a shared object/collection without at least one `Use...End use` generates an error. When a process calls `Use...End use` on a shared object/collection that is already in use by another process, it is simply put on hold until the `End use` unlocks it (no error is generated). Consequently, instructions within `Use...End use` structures should execute quickly and unlock the elements as soon as possible. Thus, it is strongly advised to avoid modifying a shared object or collection directly from the interface, e.g. through a dialog box. -共有オブジェクト/コレクションを他の共有オブジェクト/コレクションのプロパティあるいは要素に割り当てることは可能で、このとき **共有グループ** が作成されます。 共有グループは、共有オブジェクト/コレクションのプロパティ値あるいは要素として他の共有オブジェクト/コレクションが設定されたときに自動的に作成されます。 共有グループを使用すると共有オブジェクトを入れ子にすることができますが、以下のルールに気をつける必要があります: +Assigning shared objects/collections to properties or elements of other shared objects/collections is allowed and creates **shared groups**. A shared group is automatically created when a shared object/collection is set as property value or element of another shared object/collection. Shared groups allow nesting shared objects and collections but enforce additional rules: -- あるグループの共有オブジェクト/コレクションに対して `Use` を使うと、そのグループに所属するすべての共有オブジェクト/コレクションのプロパティ/要素がロックされ、ロックカウンターを 1 増加させます。 `End use` はグループのロックカウンターを 1 減らします。カウンターが 0 になると、すべてのリンクされた共有オブジェクト/コレクションのロックが解除されます。 -- 共有オブジェクト/コレクションは一つの共有グループにしか所属することができません。 すでにグループに所属している共有オブジェクト/コレクションを他のグループへと割り当てようとした場合、エラーが返されます。 -- 一旦グループ化された共有オブジェクト/コレクションについて、グループを解除することはできません。 一度共有グループに含まれた共有オブジェクト/コレクションは、セッション中はずっと同グループに所属することになります。 親オブジェクト/コレクションから子オブジェクト/コレクションへの参照をすべて削除したとしても、両者のリンクが解除されるわけではありません。 +- Calling `Use` on a shared object/collection belonging to a group locks properties/elements of all shared objects/collections of the group and increments its locking counter. Calling `End use` decrements the locking counter of the group and when the counter is at 0, all the linked shared objects/collections are unlocked. +- A shared object/collection can only belong to one shared group. An error is returned if you try to set an already grouped shared object/collection to a different group. +- Grouped shared objects/collections cannot be ungrouped. Once included in a shared group, a shared object/collection is linked permanently to that group during the whole session. Even if all references of an object/collection are removed from the parent object/collection, they will remain linked. -共有グループのルールについての詳細は、例題2を参照してください。 +Please refer to example 2 for an illustration of shared group rules. -**注:** 共有グループは、*ロック識別子* と呼ばれる内部プロパティによって管理されています。 この値についての詳細は、[ランゲージリファレンス](https://doc.4d.com/4Dv18/4D/18/Shared-objects-and-shared-collections.300-4505654.ja.html#3648963) を参照ください。 +**Note:** Shared groups are managed through an internal property named *locking identifier*. For detailed information on this value, please refer to the 4D Developer's guide. -### 読み出し +### Read -たとえ共有オブジェクト/コレクションが他のプロセスによって使用中であっても、それらのプロパティや要素は、`Use...End use` 構文を呼び出さずとも取得することが可能です。 +Reading properties or elements of a shared object/collection is allowed without having to call the `Use...End use` structure, even if the shared object/collection is in use by another process. -ただし、複数の値が互いにリンクしていてそれらを一度に読み出す必要がある場合には、一貫性の観点から、共有オブジェクト/コレクションを `Use...End use` 内で扱う必要があります。 +However, it is necessary to read a shared object/collection within `Use...End use` when several values are linked together and must be read at once, for consistency reasons. -### 複製 +### Duplication -共有オブジェクト (あるいは共有オブジェクトをプロパティとして格納しているオブジェクト) に対して `OB Copy` コマンドを使用することは可能ですが、含まれている子オブジェクト含め、標準 (非共有) のオブジェクトが戻り値として返されます。 +Calling `OB Copy` with a shared object (or with an object containing shared object(s) as properties) is possible, but will return a standard (not shared) object including its contained objects (if any). -### ストレージ +### Storage -**ストレージ** は固有の共有オブジェクトで、各アプリケーションおよびマシン上で利用可能です。 この共有オブジェクトは `Storage` コマンドから返されます。 このオブジェクトは、他のプリエンティブあるいは標準プロセスからでも利用出来るように、セッション中に定義されたすべての共有オブジェクト/コレクションを参照するためのものです。 +**Storage** is a unique shared object, automatically available on each application and machine. This shared object is returned by the `Storage` command. You can use this object to reference all shared objects/collections defined during the session that you want to be available from any preemptive or standard processes. -`ストレージ` オブジェクトは標準の共有オブジェクトとは異なり、共有オブジェクト/コレクションがプロパティとして追加されたときでも共有グループを作成しないという点に注意してください。 この例外的な振る舞いにより、**ストレージ** オブジェクトを使用するたびに、リンクされている共有オブジェクト/コレクションをすべてロックせずに済みます。 +Note that, unlike standard shared objects, the `storage` object does not create a shared group when shared objects/collections are added as its properties. This exception allows the **Storage** object to be used without locking all connected shared objects or collections. -詳細な情報については、`Storage` コマンドの詳細を参照してください。 +For more information, refer to the `Storage` command description. ## Use...End use -`Use...End use` 構文の正式なシンタックスは、以下の通りです: +The formal syntax of the `Use...End use` structure is: ```4d Use(Shared_object_or_Shared_collection) - statement(s) // ステートメント + statement(s) End use ``` -`Use...End use` 構文は、内部セマフォーの保護下において *Shared_object_or_Shared_collection* 引数に対して処理を実行するステートメントを定義します。 *Shared_object_or_Shared_collection* として任意の有効な共有オブジェクトあるいは共有コレクションを渡すことができます。 +The `Use...End use` structure defines a sequence of statements that will execute tasks on the *Shared_object_or_Shared_collection* parameter under the protection of an internal semaphore. *Shared_object_or_Shared_collection* can be any valid shared object or shared collection. -共有オブジェクトおよび共有コレクションは、プロセス間の (とくに **プリエンプティブ4Dプロセス** 間の) 通信ができるように設計されています 。 これらはプロセスから他のプロセスへ、参照型の引数として渡すことができます。 共有オブジェクトおよび共有コレクションについての詳細な情報については、**共有オブジェクトと共有コレクション** を参照してください。 共有オブジェクトおよび共有コレクションを扱う際には、複数プロセスによる同時アクセスを避けるために、必ずそれらを `Use...End use` キーワードでくくる必要があります。 +Shared objects and shared collections are designed to allow communication between processes, in particular, **preemptive 4D processes**. They can be passed by reference as parameters from a process to another one. For detailed information on shared objects or shared collections, refer to the **Shared objects and shared collections** page. Surrounding modifications on shared objects or shared collections by the `Use...End use` keywords is mandatory to prevent concurrent access between processes. -- **Use** の実行が成功すると、対応する **End use が実行されるまで、_Shared_object_or_Shared_collection_ のプすべてのロパティ/要素は他のあらゆるプロセスに対し書き込みアクセスがロックされます。

  • -- _statement(s)_ で実行されるステートメントは、*Shared_object_or_Shared_collection* のプロパティ/要素に対して、競合アクセスのリスクなしに変更も実行することができます。 -- _Shared_object_or_Shared_collection_ に他の共有オブジェクトあるいはコレクションがプロパティとして追加された場合、それらも同じ共有グループとして連結されます (**共有オブジェクト/共有コレクションの使用** を参照してください)。 -- **Use...End use ** 内ステートメントの実行中に、他のプロセスが _Shared_object_or_Shared_collection_ のプロパティやリンクされたプロパティにアクセスしようとした場合、そのアクセスは自動的に保留され、実行中の処理が終了するまで待機します。 -- **End use** は、_Shared_object_or_Shared_collection_ プロパティおよび、同じグループのすべてのオブジェクトのロックを解除します。 -- 4D コード内では、複数の **Use...End use** 構文を入れ子にすることができます。 グループの場合、**Use** を使用するごとにグループのロックカウンターが 1 増加し、 **End use** ごとに 1 減少します。最後の **End use** によってロックカウンターが 0 になった場合にのみ、すべてのプロパティ/要素のロックが解除されます。 +- Once the **Use** line is successfully executed, all _Shared_object_or_Shared_collection_ properties/elements are locked for all other process in write access until the corresponding `End use` line is executed. +- The _statement(s)_ sequence can execute any modification on the Shared_object_or_Shared_collection properties/elements without risk of concurrent access. +- If another shared object or collection is added as a property of the _Shared_object_or_Shared_collection_ parameter, they become connected within the same shared group (see **Using shared objects or collections**). +- If another process tries to access one of the _Shared_object_or_Shared_collection_ properties or connected properties while a **Use...End use** sequence is being executed, it is automatically put on hold and waits until the current sequence is terminated. +- The **End use** line unlocks the _Shared_object_or_Shared_collection_ properties and all objects of the same group. +- Several **Use...End use** structures can be nested in the 4D code. In the case of a group, each **Use** increments the locking counter of the group and each **End use** decrements it; all properties/elements will be released only when the last **End use** call sets the locking counter to 0. -**注:** コレクションのメンバーメソッドが共有コレクションを変更する場合、そのメソッド実行中は、対象の共有コレクションに対して **Use** が内部的に自動で呼ばれます。 +**Note:** If a collection method modifies a shared collection, an internal **Use** is automatically called for this shared collection while the function is executed. -## 例題 1 +## Example 1 -それぞれ異なる製品の在庫更新を実行する複数のプロセスを起動し、同じ共有オブジェクトを更新していきます。 まずメインプロセスで空の共有オブジェクトをインスタンス化してから、共有オブジェクトへの参照と対象製品を引数として渡して別プロセス起動します: +You want to launch several processes that perform an inventory task on different products and update the same shared object. The main process instantiates an empty shared object and then, launches the other processes, passing the shared object and the products to count as parameters: ```4d ARRAY TEXT($_items;0) - ... // 在庫を確認する製品を配列に格納します + ... //fill the array with items to count $nbItems:=Size of array($_items) C_OBJECT($inventory) $inventory:=New shared object @@ -104,60 +104,59 @@ title: 共有オブジェクトと共有コレクション $inventory.nbItems:=$nbItems End use - // プロセスを起動します + //Create processes For($i;1;$nbItems) $ps:=New process("HowMany";0;"HowMany_"+$_items{$i};$_items{$i};$inventory) - // $inventory オブジェクトは参照で渡されます + //$inventory object sent by reference End for ``` -"HowMany" メソッド内では、在庫確認が終わるとすぐに $inventory 共有オブジェクトが更新されます: +In the "HowMany" method, inventory is done and the $inventory shared object is updated as soon as possible: ```4d C_TEXT($1) C_TEXT($what) C_OBJECT($2) C_OBJECT($inventory) - $what:=$1 // 可読性のため + $what:=$1 //for better readability $inventory:=$2 - $count:=CountMethod($what) // 在庫確認用のメソッド - Use($inventory) // 共有オブジェクトを使用します - $inventory[$what]:=$count // 当該製品の在庫を保存します + $count:=CountMethod($what) //method to count products + Use($inventory) //use shared object + $inventory[$what]:=$count //save the results for this item End use ``` -## 例題 2 +## Example 2 -以下の例題は、共有グループを扱う際のルールについて説明しています: +The following examples highlight specific rules when handling shared groups: ```4d $ob1:=New shared object $ob2:=New shared object Use($ob1) - $ob1.a:=$ob2 // グループ1 が作成されます + $ob1.a:=$ob2 //group 1 is created End use $ob3:=New shared object $ob4:=New shared object Use($ob3) - $ob3.a:=$ob4 // グループ2 が作成されます + $ob3.a:=$ob4 //group 2 is created End use - Use($ob1) // グループ1のオブジェクトを使用します - $ob1.b:=$ob4 // これはエラーになります - // $ob4 はすでに他のグループに所属しているため - // 代入することはできません + Use($ob1) //use an object from group 1 + $ob1.b:=$ob4 //ERROR + //$ob4 already belongs to another group + //assignment is not allowed End use Use($ob3) - $ob3.a:=Null // グループ2から$ob4 への参照をすべて解除します - + $ob3.a:=Null //remove any reference to $ob4 from group 2 End use - Use($ob1) // グループ1のオブジェクトを使用します - $ob1.b:=$ob4 // これもエラーになります - // $ob4 は依然としてグループ2に所属しているため - // 代入は不可能です + Use($ob1) //use an object from group 1 + $ob1.b:=$ob4 //ERROR + //$ob4 still belongs to group 2 + //assignment is not allowed End use ``` diff --git a/website/translated_docs/ja/Concepts/variables.md b/website/translated_docs/ja/Concepts/variables.md index b4df1278fbbf90..10e10b8b657f19 100644 --- a/website/translated_docs/ja/Concepts/variables.md +++ b/website/translated_docs/ja/Concepts/variables.md @@ -1,105 +1,105 @@ --- id: variables -title: 変数 +title: Variables --- -4D のデータは、根本的に異なっている 2つの方法で保持されます。 **フィールド** はディスクに永続的にデータを保存するのに対し、**変数** はメモリ上に一時的にデータを格納します。 +Data in 4D is stored in two fundamentally different ways. **Fields** store data permanently on disk; **variables** store data temporarily in memory. -データベースを作成する際には、フィールドに名前とデータタイプを指定します。 同様に、変数にも名前と [データタイプ](Concepts/data-types.md) を指定します。 +When you set up your 4D database, you specify the names and types of fields that you want to use. Variables are much the same—you also give them names and different types (see [Data types](Concepts/data-types.md)). -いったん作成された変数は、アプリケーションで必要とされる場所に使用できます。 たとえば、テキスト変数を同じタイプのフィールドに格納するには次のように書きます: +Once created, you can use a variable wherever you need it in your application. For example, you might need to store a text variable in a field of same type: ```4d [MyTable]MyField:=MyText ``` -変数はランゲージの要素です。画面上に表示されることのない、裏方に徹した変数を作成・利用することができます。 もちろん、フォーム上に変数の値を表示することもできます (ポインターやBLOBを除く)。また、変数に値を入力したり、変数の値をレポートに印刷したりすることも可能です。 このとき、入力可や入力不可の変数オブジェクトはフィールドオブジェクトと同様に振舞い、提供されるコントロールも類似しています。 フォーム上のボタン、リストボックス、スクロールエリア、ピクチャーボタンなどのオブジェクトも変数を使って制御することができるほか、保存不要な計算結果を表示させることもできます。 +Variables are language objects; you can create and use variables that will never appear on the screen. In your forms, you can display variables (except Pointer and BLOB) on the screen, enter data into them, and print them in reports. In this way, enterable and non-enterable area variables act just like fields, and the same built-in controls are available when you create them. Form variables can also control buttons, list boxes, scrollable areas, picture buttons, and so on, or display results of calculations that do not need to be saved. -## 変数の宣言 +## Declaring Variables -変数は宣言によって作成されます。 4D ランゲージでは、変数の宣言方法は2つあります: +You create variables by declaring them. The 4D language offers two ways to declare variables: -- `var` キーワードを使った宣言 (推奨、とくにオブジェクトやクラスをコードで使用する場合) -- "コンパイラー" や "配列" テーマの 4D ランゲージコマンドを使った宣言 (廃止予定、クラシックランゲージのみ) +- using the `var` keyword (recommended, specially if your code uses objects and classes), +- using one of the "Compiler" or "Arrays" theme 4D language commands (deprecated, classic language only). -**注:** この方法は推奨されませんが、単純に使用することによって変数を宣言することもできます。正式にそれらを定義することは必須ではありません。 たとえば、今日の日付に30日足した値を格納した変数を宣言するには、次のように書くことができます: +**Note:** Although it is usually not recommended, you can create basic variables simply by using them; you do not necessarily need to formally define them. For example, to declare a variable that will hold the current date plus 30 days, you can write: ```4d - MyDate:=Current date+30 // MyDateを作成します - // これは日付型の変数であると 4D は推測します - // 30日後の日付が代入されます + MyDate:=Current date+30 //MyDate is created + // 4D guesses it is of date type + // and assigns the current date plus 30 days ``` -### `var` キーワードによる宣言 +### Using the `var` keyword -オブジェクト変数をクラスに紐づけることができるため、`var` キーワードを使った変数宣言が推奨されます。 このシンタックスはコードエディターの自動補完機能を強化します。 +Declaring variables using the `var` keyword is recommended since this syntax allows you to bind object variables with classes. Using this syntax enhances code editor suggestions and type-ahead features. -`var` キーワードを使って変数を宣言するには、次のシンタックスを用います: +To declare a variable of any type with the `var` keyword, use the following syntax: `var {; ;...}{ : }` -たとえば: +For example: ```4d -var $myText : Text // テキスト変数 -var myDate1; myDate2 : Date // 複数の日付変数 -var $myFile : 4D.File // File クラスオブジェクト変数 -var $myVar // バリアント型変数 +var $myText : Text //a text variable +var myDate1; myDate2 : Date //several date variables +var $myFile : 4D.File //a file class object variable +var $myVar //a variant variable ``` -`varName` に指定する変数名は 4Dの [識別子の命名規則](Concepts/identifiers.md) に従う必要があります。 -このシンタックスは [ローカル変数とプロセス変数](#ローカル変数とプロセス変数) の宣言のみサポートしています。[インタープロセス変数](#インタープロセス変数) および [配列](Concepts/arrays.md) には使用できません。 +`varName` is the variable name, it must comply with the [4D rules](Concepts/identifiers.md) about identifiers. +This syntax only supports [local and process variables](#local-process-and-interprocess-variables) declarations, thus excluding [interprocess variables](#interprocess-variables) and [arrays](Concepts/arrays.md). -`varType` には次が指定できます: +`varType` can be: -- [基本のデータ型](Concepts/data-types.md): 変数には、宣言された型の値が格納されます -- [クラス参照](Concepts/classes.md) (4Dクラスまたはユーザークラス): 変数には、定義されたクラスのオブジェクトへの参照が格納されます +- a [basic type](Concepts/data-types.md), in which case the variable contains a value of the declared type, +- a [class reference](Concepts/classes.md) (4D class or user class), in which case the variable contains a reference to an object of the defined class. -`varType` を省略すると、**variant** 型の変数が作成されます。 +If `varType` is omitted, a variable of the **variant** type is created. -サポートされている `varType` 値の一覧です: +The following table lists all supported `varType` values: -| varType | 内容 | -| -------------- | ---------------------------- | -| テキスト | テキスト値 | -| 日付 | 日付値 | -| 時間 | 時間値 | -| ブール | ブール値 | -| 整数 | 倍長整数値 | -| 実数 | 実数値 | -| ポインター | ポインター値 | -| ピクチャー | ピクチャー値 | -| BLOB | BLOB値 | -| コレクション | コレクション値 | -| バリアント | バリアント値 | -| オブジェクト | デフォルトクラス (4D.Object) のオブジェクト | -| 4D.*className* | 4Dクラス名のオブジェクト | -| cs.*className* | ユーザークラス名のオブジェクト | +| varType | Contents | +| -------------- | ------------------------------------- | +| Text | Text value | +| Date | Date value | +| Time | Time value | +| Boolean | Boolean value | +| Integer | Long integer value | +| Real | Real value | +| Pointer | Pointer value | +| Picture | Picture value | +| Blob | BLOB value | +| Collection | Collection value | +| Variant | Variant value | +| Object | Object with default class (4D.Object) | +| 4D.*className* | Object of the 4D class name | +| cs.*className* | Object of the user class name | -#### 例題 +#### Examples -- 基本のデータ型の、ローカル変数およびプロセス変数の宣言: +- To declare local and process basic variables: ```4d var $myText; myText; $vt : Text var myVar //variant var $o : Object -// 次と同義です: +//equivalent to: var $o : 4D.Object -// C_OBJECT($o) とも同義です +//also equivalent to C_OBJECT($o) ``` -- 4Dクラス型のオブジェクト変数の宣言: +- To declare object variables of 4D class: ```4d var $myFolder : 4D.Folder var $myFile : 4D.File ``` -- ユーザークラス型のオブジェクト変数の宣言: +- To declare object variables of user class: ```4d var $myClass : cs.MyClass @@ -108,115 +108,115 @@ var $entity : cs.EmployeeEntity ``` -### C_ 指示子による宣言 +### Using a C_ directive -> **互換性に関する注記:** 4D v18 R3 以降は廃止予定となっています。 [var](#using-the-var-keyword) キーワードの使用が推奨されます。 +> **Compatibility Note:** This feature is deprecated as of 4D v18 R3. It is now recommended to use the [var](#using-the-var-keyword) keyword. -"コンパイラー" テーマコマンドの指示子を使って、基本のデータ型の変数を宣言することができます。 +Directives from the "Compiler" theme commands allow you to declare variables of basic types. -たとえば、テキスト変数を宣言するには次のように書きます: +For example, if you want to define a text variable, you write: ```4d C_TEXT(myText) ``` -いくつかの基本的な変数宣言の例です: +The following are some basic variable declarations: ```4d - C_BLOB(vxMyBlob) // プロセス変数 vxMyBlob を BLOB型として宣言します - C_DATE($vdCurDate) // ローカル変数 $vdCurDate を日付型として宣言します - C_LONGINT(vg1;vg2;vg3) // 3つのプロセス変数 vg1, vg2, vg3 を倍長整数型として宣言します - C_OBJECT($vObj) // ローカル変数 $vObj をオブジェクト型として宣言します - C_COLLECTION($vCol) // ローカル変数 $vCol をコレクション型として宣言します - ARRAY LONGINT(alAnArray;10) // プロセス変数 alAnArray を 10個の倍長整数型要素を持つ配列として宣言します + C_BLOB(vxMyBlob) // The process variable vxMyBlob is declared as a variable of type BLOB + C_DATE($vdCurDate) // The local variable $vdCurDate is declared as a variable of type Date + C_LONGINT(vg1;vg2;vg3) // The 3 process variables vg1, vg2 and vg3 are declared as variables of type longint + C_OBJECT($vObj) // The local variable $vObj is declared as a variable of type Object + C_COLLECTION($vCol) // The local variable $vCol is declared as a variable of type Collection + ARRAY LONGINT(alAnArray;10) //The process alAnArray variable is declared as a Longint array of 10 elements ``` -**注:** 配列とは、変数の一種です。 配列とは、同じタイプの変数を番号付きで並べたものです。 詳細については [配列](Concepts/arrays.md) を参照ください。 +**Note:** Arrays are a particular type of variables. An array is an ordered series of variables of the same type. For more information, please refer to [Arrays](Concepts/arrays.md). -## 変数への代入 +## Assigning Data -変数を対象に、データを格納したり、格納したデータを別の対象にコピーしたりすることができます。 変数にデータを格納することを、**変数にデータを代入する**と言い、代入演算子 (:=) を使っておこないます。 代入演算子はフィールドに対してデータを代入する場合にも使います。 +Data can be put into and copied out of variables and arrays. Putting data into a variable is called **assigning the data to the variable** and is done with the assignment operator (:=). The assignment operator is also used to assign data to fields. -代入演算子は、変数を作成し、変数にデータを代入するために使用します。 作成する変数名を代入演算子の左側に書きます。 たとえば: +The assignment operator is a primary way to create a variable and to put data into it. You write the name of the variable that you want to create on the left side of the assignment operator. For example: ```4d MyNumber:=3 ``` -は変数 _MyNumber_ を作成し、数値 3を代入します。 MyNumber が既に存在していれば、そこに数値 3が代入されます。 +creates the variable _MyNumber_ and puts the number 3 into it. If MyNumber already exists, then the number 3 is just put into it. -> [データ型の宣言](#変数の作成) をせずに変数を作成することは通常推奨されません。 +> It is usually not recommended to create variables without [declaring their type](#creating-variables). -もちろん、変数からデータを取り出すことができなければ、便利とはいえません。 再度代入演算子を使用します。 [Products]Size というフィールドに _MyNumber_ 変数の値を代入するには、代入演算子の右側に MyNumber を書きます: +Of course, variables would not be very useful if you could not get data out of them. Once again, you use the assignment operator. If you need to put the value of MyNumber in a field called [Products]Size, you would write _MyNumber_ on the right side of the assignment operator: ```4d [Products]Size:=MyNumber ``` -これで、_[Products]Size_ の値は3になります。 この例はとても単純ですが、ある場所から別の場所へランゲージによってデータを転送させる基本的な手順を表しています。 +In this case, _[Products]Size_ would be equal to 3. This example is rather simple, but it illustrates the fundamental way that data is transferred from one place to another by using the language. -配列要素にデータを代入するには中カッコ ({...}) を使用します: +You assign data to array elements by using curly braces ({...}): ```4d atNames{1}:="Richard" ``` -## ローカル、プロセス、およびインタープロセス変数 +## Local, Process, and Interprocess variables -**ローカル**、**プロセス**、および **インタープロセス** という、3種類の変数の変数を作成することができます。 これらの変数の違いは使用できるスコープにあります。また、それらを使用することのできるオブジェクトも異なります。 +You can create three types of variables: **local**, **process**, and **interprocess**. The difference between the three types of elements is their scope, or the objects to which they are available. -### ローカル変数 +### Local variables -ローカル変数はその名のとおりメソッド内でローカルであり、変数が作成されたメソッドの範囲内でのみ使用可能で、その他のメソッドからはアクセスできません。 メソッド内でローカルであるというのは、正式には「スコープがローカルである」といいます。 ローカル変数は、その使用範囲をメソッド内に限定するために用います。 +A local variable is, as its name implies, local to a method—accessible only within the method in which it was created and not accessible outside of that method. Being local to a method is formally referred to as being “local in scope.” Local variables are used to restrict a variable so that it works only within the method. -ローカル変数は、以下のような目的のために使用されます: +You may want to use a local variable to: -- 他の変数名との重複を避ける。 -- データを一時的に使用する。 -- プロセス変数の数を減らす。 +- Avoid conflicts with the names of other variables +- Use data temporarily +- Reduce the number of process variables -ローカル変数の名前は必ずドル記号 ($) で始め、この記号を除く31文字までの文字を指定できます。 これより長い名前を指定すると、4D は余分の32文字以降を切り捨てます。 +The name of a local variable always starts with a dollar sign ($) and can contain up to 31 additional characters. If you enter a longer name, 4D truncates it to the appropriate length. -多くのメソッドや変数を持つアプリケーションプロジェクトで作業する場合、現在作業しているメソッドの範囲内で一時的に変数が必要となる場合がよくあります。 この場合、同じ変数名が他で使用されていないかどうかを気にすることなくローカル変数を作成することができます。 +When you are working in an application project with many methods and variables, you often find that you need to use a variable only within the method on which you are working. You can create and use a local variable in the method without worrying about whether you have used the same variable name somewhere else. -アプリケーションではしばしば、ユーザーによる少量のデータ入力を必要とする場合があります。 `Request` コマンドを使って、この情報を取得することができます。 このコマンドはデータ入力を求めるダイアログボックスを表示し、 ユーザーがデータを入力すると、その情報を戻り値として返します。 このようなデータは通常、メソッド内で長期間維持する必要はありません。 これは、ローカル変数を使用する典型的な例といえます。 次に例を示します: +Frequently, in an application, small pieces of information are needed from the user. The `Request` command can obtain this information. It displays a dialog box with a message prompting the user for a response. When the user enters the response, the command returns the information the user entered. You usually do not need to keep this information in your methods for very long. This is a typical way to use a local variable. Here is an example: ```4d - $vsID:=Request("ID を入力してください:") + $vsID:=Request("Please enter your ID:") If(OK=1) QUERY([People];[People]ID =$vsID) End if ``` -このメソッドは、ユーザーに ID を入力するように要求します。 ローカル変数 $vsID にレスポンスが代入され、ユーザーが入力した ID に基づいた検索がおこなわれます。 このメソッドが終了した時点で、$vsID ローカル変数はメモリから消去されます。 この変数は 1回のみ、このメソッド内でしか使われないため、これ以上維持する必要はありません。 +This method simply asks the user to enter an ID. It puts the response into a local variable, $vsID, and then searches for the ID that the user entered. When this method finishes, the $vsID local variable is erased from memory. This is fine, because the variable is needed only once and only in this method. -**注:** メソッドに渡される $1, $2...等の引数はローカル変数です。 詳細については [パラメーター](Concepts/parameters.md) を参照ください。 +**Note:** Parameters $1, $2... passed to methods are local variables. For more information, please refer to [Parameters](Concepts/parameters.md). -### プロセス変数 +### Process variables -プロセス変数は、同じプロセスの範囲内に限り使用可能です。 この変数はプロセスメソッドと、そのプロセス内で呼び出された他のメソッドで使用することができます。 +A process variable is available only within a process. It is accessible to the process method and any other method called from within the process. -プロセス変数には名前に付ける接頭辞がありません。 プロセス変数の名前は、最大31文字までの長さで指定できます。 +A process variable does not have a prefix before its name. A process variable name can contain up to 31 characters. -インタープリターモードでは、変数は動的にメモリ上に作成・消去されます。 これに対してコンパイルモードでは、作成したすべてのプロセス (ユーザープロセス) で同じプロセス変数定義が共有されますが、変数のインスタンスはプロセス毎に異なるものとなります。 たとえば、プロセスP_1 とプロセスP_2 の両方においてプロセス変数 myVar が存在していても、それらはそれぞれ別のインスタンスです。 +In interpreted mode, variables are maintained dynamically; they are created and erased from memory “on the fly.” In compiled mode, all processes you create (user processes) share the same definition of process variables, but each process has a different instance for each variable. For example, the variable myVar is one variable in the process P_1 and another one in the process P_2. -バージョン6より、`GET PROCESS VARIABLE` や `SET PROCESS VARIABLE` を使用して、あるプロセスから他のプロセスのプロセス変数の値を取得したり、設定したりできるようになりました。 これらのコマンドの利用は、以下のような状況に限定することが、良いプログラミングの作法です: +A process can “peek and poke” process variables from another process using the commands `GET PROCESS VARIABLE` and `SET PROCESS VARIABLE`. It is good programming practice to restrict the use of these commands to the situation for which they were added to 4D: -- コード内の特定の箇所におけるプロセス間通信 -- プロセス間のドラッグ&ドロップ処理 -- クライアント/サーバーにおいて、クライアントマシン上のプロセスとサーバーマシン上のストアドプロシージャー間の通信 +- Interprocess communication at specific places or your code +- Handling of interprocess drag and drop +- In Client/Server, communication between processes on client machines and the stored procedures running on the server machines -詳細については **プロセス** の章と、各コマンドの説明を参照ください。 +For more information, see the chapter **Processes** and the description of these commands. -### インタープロセス変数 +### Interprocess variables -インタープロセス変数はプロジェクト全体で使用することができ、すべてのコオペラティブプロセスで共有されます。 これらは主としてプロセス間で情報を共有するために使われます。 +Interprocess variables are available throughout the project and are shared across all cooperative processes. They are primarily used to share information between processes. -> プリエンプティブプロセスにおいては使用できないことと、コードの保守管理を煩雑にすることから、インタープロセス変数の使用は推奨されません。 +> Use of interprocess variables is not recommended since they are not available from preemptive processes and tend to make the code less maintainable. -インタープロセス変数の名前は、必ずインタープロセス記号 (<>) で始めます。記号の後に31バイトまでの名前を指定できます。 +The name of an interprocess variable always begins with the symbols (<>) — a “less than” sign followed by a “greater than” sign— followed by 31 characters. -クライアント/サーバーでは、各マシン (クライアントマシンとサーバーマシン) で同じインタープロセス変数定義を共有しますが、マシンごとに各変数のインスタンスが存在します。 +In Client/Server, each machine (Client machines and Server machine) share the same definition of interprocess variables, but each machine has a different instance for each variable. diff --git a/website/translated_docs/ja/FormObjects/properties_Action.md b/website/translated_docs/ja/FormObjects/properties_Action.md index 985fb713f5cd89..d6b0c486314ba7 100644 --- a/website/translated_docs/ja/FormObjects/properties_Action.md +++ b/website/translated_docs/ja/FormObjects/properties_Action.md @@ -98,7 +98,7 @@ title: 動作 - 拡張子を省いた既存のプロジェクトメソッド名: `myMethod`。この場合、フォームオブジェクトに対して操作がおこなわれても、4D はそれらの変更を自動反映しません。 - .4dm 拡張子を含むカスタムのメソッドファイルパス: - `ObjectMethods/objectName.4dm`。 ファイルシステムも使用できます: + `../../CustomMethods/myMethod.4dm`。 ファイルシステムも使用できます: `/RESOURCES/Buttons/bOK.4dm`。 この場合、フォームオブジェクトに対して操作がおこなわれても、4D はそれらの変更を自動反映しません。 diff --git a/website/translated_docs/pt/API/cryptoKeyClass.md b/website/translated_docs/pt/API/cryptoKeyClass.md index c8939867cbd138..e787391963ac3c 100644 --- a/website/translated_docs/pt/API/cryptoKeyClass.md +++ b/website/translated_docs/pt/API/cryptoKeyClass.md @@ -29,7 +29,7 @@ ASSERT($status.success) ### Summary | | | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| [](#4dcryptokeynew)

        | +| [](#4dcryptokeynew)

        | | [](#curve)

         | | [](#decrypt)

        | | [](#encrypt)

        | @@ -46,6 +46,8 @@ ASSERT($status.success) + + ## 4D.CryptoKey.new()

    History @@ -57,7 +59,7 @@ ASSERT($status.success) **4D.CryptoKey.new**( *settings* : Object ) : 4D.CryptoKey - + | Parameter | Type | | Description | | --------- | ------------ | -- | ---------------------------------------------------------------------- | | settings | Object | -> | Settings to generate or load a key pair | @@ -82,7 +84,7 @@ The `4D.CryptoKey.new()` function create #### *cryptoKey* The returned `cryptoKey` object encapsulates an encryption key pair. It is a shared object and can therefore be used by multiple 4D processes simultaneously. - + diff --git a/website/translated_docs/pt/API/datastoreClass.md b/website/translated_docs/pt/API/datastoreClass.md index f842895cae2237..ff0364517b30f1 100644 --- a/website/translated_docs/pt/API/datastoreClass.md +++ b/website/translated_docs/pt/API/datastoreClass.md @@ -10,13 +10,14 @@ A [Datastore](ORDA/dsMapping.md#datastore) is the interface object provided by O ### Summary -| | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | [](#canceltransaction)

        | | [](#dataclassname)

         | | [](#encryptionstatus)

         | | [](#getinfo)

         | | [](#getrequestlog)

         | +| [](#makeSelectionsAlterable)

         | | [](#providedatakey)

         | | [](#startrequestlog)

         | | [](#starttransaction)

         | @@ -75,7 +76,7 @@ Using the main datastore on the 4D database: #### Example 2 -```4d +```4d var $connectTo; $firstFrench; $firstForeign : Object var $frenchStudents; $foreignStudents : cs.DataStore @@ -166,7 +167,7 @@ Pass in *connectionInfo* an object describing the remote datastore you want to c Connection to a remote datastore without user / password: ```4d - var $connectTo : Object + var $connectTo : Object var $remoteDS : cs.DataStore $connectTo:=New object("type";"4D Server";"hostname";"192.168.18.11:8044") $remoteDS:=Open datastore($connectTo;"students") @@ -178,7 +179,7 @@ Connection to a remote datastore without user / password: Connection to a remote datastore with user / password / timeout / tls: ```4d - var $connectTo : Object + var $connectTo : Object var $remoteDS : cs.DataStore $connectTo:=New object("type";"4D Server";"hostname";\"192.168.18.11:4443";\ "user";"marie";"password";$pwd;"idleTimeout";70;"tls";True) @@ -191,7 +192,7 @@ Connection to a remote datastore with user / password / timeout / tls: Working with several remote datastores: ```4d - var $connectTo : Object + var $connectTo : Object var $frenchStudents; $foreignStudents : cs.DataStore $connectTo:=New object("hostname";"192.168.18.11:8044") $frenchStudents:=Open datastore($connectTo;"french") @@ -203,7 +204,7 @@ Working with several remote datastores: #### Error management -In case of error, the command returns **Null**. If the remote datastore cannot be reached (wrong address, web server not started, http and https not enabled...), error 1610 "A remote request to host XXX has failed" is raised. You can intercept this error with a method installed by `ON ERR CALL`. +In case of error, the command returns **Null**. If the remote datastore cannot be reached (wrong address, web server not started, http and https not enabled...), error 1610 "A remote request to host XXX has failed" is raised. You can intercept this error with a method installed by `ON ERR CALL`. @@ -380,11 +381,11 @@ The `.getInfo()` function returns **Returned object** -| Property | Type | Description | -| ---------- | ------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| type | string |

  • "4D": main datastore, available through ds
  • "4D Server": remote datastore, open with Open datastore
  • | -| networked | boolean |
  • True: the datastore is reached through a network connection.
  • False: the datastore is not reached through a network connection (local database)
  • | -| localID | text | ID of the datastore on the machine. Corresponds to the localId string given with the `Open datastore` command. Empty string ("") for main datastore. | +| Property | Type | Description | +| ---------- | ------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| type | string |
  • "4D": main datastore, available through ds
  • "4D Server": remote datastore, open with Open datastore
  • | +| networked | boolean |
  • True: the datastore is reached through a network connection.
  • False: the datastore is not reached through a network connection (local database)
  • | +| localID | text | ID of the datastore on the machine. Corresponds to the localId string given with the `Open datastore` command. Empty string ("") for main datastore. | | connection | object | Object describing the remote datastore connection (not returned for main datastore). Available properties:

    PropertyTypeDescription
    hostnametextIP address or name of the remote datastore + ":" + port number
    tlsbooleanTrue if secured connection is used with the remote datastore
    idleTimeoutnumberSession inactivity timeout (in minutes)
    usertextUser authenticated on the remote datastore
    | * If the `.getInfo()` function is executed on a 4D Server or 4D single-user, `networked` is False. @@ -419,8 +420,8 @@ On a remote datastore: //"localID":"students", //"networked":true, //"connection":{hostname:"111.222.33.44:8044","tls":false,"idleTimeout":2880,"user":"marie"}} -``` - +``` + @@ -465,6 +466,39 @@ See Example 2 of [`.startRequestLog()`](#startrequestlog). + +## .makeSelectionsAlterable() + +

    History +| Version | Changes | +| ------- | ------- | +| v18 R5 | Added | +
    + + +**.makeSelectionsAlterable()** + + +| Parameter | Type | | Description | +| --------- | ---- |::| ------------------------------- | +| | | | Does not require any parameters | + + + +#### Description + +The `.makeSelectionsAlterable()` function sets all entity selections as alterable by default in all the current application datastores (including [remote datastores](ORDA/remoteDatastores.md)). It is intended to be used once, for example in the `On Startup` database method. + +When this function is not called, new entity selections can be shareable, depending on the nature of their "parent", or [how they are created](ORDA/entities.md#shareable-or-non-shareable-entity-selections). + +> This function does not modify entity selections created by [`.copy()`](#copy) or `OB Copy` when the explicit `ck shared` option is used. + + +> **Compatibility**: This function must only be used in projects converted from 4D versions prior to 4D v18 R5 and containing [.add()](entitySelectionClass.md#add) calls. In this context, using `.makeSelectionsAlterable()` can save time by restoring instantaneously the previous 4D behavior in existing projects. On the other hand, using this method in new projects created in 4D v18 R5 and higher **is not recommended**, since it prevents entity selections to be shared, which provides greater performance and scalabitlity. + + + + ## .provideDataKey() @@ -525,7 +559,7 @@ If no *curPassphrase* or *curDataKey* is given, `.provideDataKey()` returns **nu #### Example -```4d +```4d var $keyStatus : Object var $passphrase : Text @@ -539,7 +573,7 @@ If no *curPassphrase* or *curDataKey* is given, `.provideDataKey()` returns **nu End if End if ``` - + @@ -587,7 +621,7 @@ For a description of the ORDA request log format, please refer to the [**ORDA cl You want to log ORDA client requests in a file and use the log sequence number: -```4d +```4d var $file : 4D.File var $e : cs.PersonsEntity @@ -604,7 +638,7 @@ You want to log ORDA client requests in a file and use the log sequence number: You want to log ORDA client requests in memory: -```4d +```4d var $es : cs.PersonsSelection var $log : Collection @@ -617,7 +651,7 @@ You want to log ORDA client requests in memory: $log:=ds.getRequestLog() ALERT("The longest request lasted: "+String($log.max("duration"))+" ms") ``` - + @@ -653,7 +687,7 @@ You can nest several transactions (sub-transactions). Each transaction or sub-tr #### Example -```4d +```4d var $connect; $status : Object var $person : cs.PersonsEntity var $ds : cs.DataStore @@ -683,13 +717,14 @@ You can nest several transactions (sub-transactions). Each transaction or sub-tr $ds.validateTransaction() End if ``` - + + ## .stopRequestLog() diff --git a/website/translated_docs/pt/API/entitySelectionClass.md b/website/translated_docs/pt/API/entitySelectionClass.md index 4f580a0d48ee07..64b9afa2f892f6 100644 --- a/website/translated_docs/pt/API/entitySelectionClass.md +++ b/website/translated_docs/pt/API/entitySelectionClass.md @@ -23,6 +23,7 @@ An entity selection is an object containing one or more reference(s) to [entitie | [](#extract)

        | | [](#first)

        | | [](#getdataclass)

        | +| [](#isalterable)

        | | [](#isordered)

        | | [](#last)

        | | [](#length)

        | @@ -43,6 +44,46 @@ An entity selection is an object containing one or more reference(s) to [entitie + +**Create entity selection** ( *dsTable* : Table { ; *settings* : Object } ) : 4D.EntitySelection + + +| Parameter | Type | | Description | +| --------- | ------------------ |:--:| ------------------------------------------------------------------------------------------- | +| dsTable | Table | -> | Table in the 4D database whose current selection will be used to build the entity selection | +| settings | Object | -> | Build option: context | +| Result | 4D.EntitySelection | <- | Entity selection matching the dataclass related to the given table | + + + +#### Description + +The `Create entity selection` command builds and returns a new, [alterable](ORDA/entities.md#shareable-or-alterable-entity-selections) entity selection related to the dataclass matching the given *dsTable*, according to the current selection of this table. + +If the current selection is sorted, an [ordered](ORDA/dsMapping.md#ordered-or-unordered-entity-selection) entity selection is created (the order of the current selection is kept). If the current selection is unsorted, an unordered entity selection is created. + +If the *dsTable* is not exposed in [`ds`](API/datastoreClass.md#ds), an error is returned. This command cannot be used with a Remote datastore. + +In the optional *settings* parameter, you can pass an object containing the following property: + +| Property | Type | Description | +| -------- | ---- | ----------------------------------------------------------------------------------------------------------------- | +| context | Text | Label for the [optimization context](ORDA/entities.md#clientserver-optimization) applied to the entity selection. | + + +#### Example + +```4d +var $employees : cs.EmployeeSelection +ALL RECORDS([Employee]) +$employees:=Create entity selection([Employee]) +// The $employees entity selection now contains a set of reference +// on all entities related to the Employee dataclass +``` + +#### See also + +[`dataClass.newSelection()`](dataclassClass.md#newselection) ## [*index*] @@ -181,10 +222,10 @@ The resulting object is an entity selection of Employee with duplications remove ## .add()

    History -| Version | Changes | -| ------- | --------------------------------------------- | -| v18 R5 | Only supports non-shareable entity selections | -| v17 | Added | +| Version | Changes | +| ------- | ----------------------------------------- | +| v18 R5 | Only supports alterable entity selections | +| v17 | Added |
    @@ -204,7 +245,7 @@ The resulting object is an entity selection of Employee with duplications remove The `.add()` function adds the specified *entity* to the entity selection and returns the modified entity selection. > This function modifies the original entity selection. -**Warning:** The entity selection must be *non-shareable*, i.e. it has been created for example by [`.newSelection()`](dataclassClass.md#newselection) or `Create entity selection`, otherwise `.add()` will return an error. Shareable entity selections do not accept the addition of entities. For more information, please refer to the [Shareable vs Non-shareable entity selections](ORDA/entities.md#shareable-or-non-shareable-entity-selections) section. +**Warning:** The entity selection must be *alterable*, i.e. it has been created for example by [`.newSelection()`](dataclassClass.md#newselection) or `Create entity selection`, otherwise `.add()` will return an error. Shareable entity selections do not accept the addition of entities. For more information, please refer to the [Shareable or alterable entity selections](ORDA/entities.md#shareable-or-alterable-entity-selections) section. * If the entity selection is ordered, *entity* is added at the end of the selection. If a reference to the same entity already belongs to the entity selection, it is duplicated and a new reference is added. @@ -482,9 +523,9 @@ The `.copy()` function returns > This function does not modify the original entity selection. -By default, if the *option* parameter is omitted, the function returns a new, non-shareable entity selection (even if the function is applied to a shareable entity selection). Pass the `ck shared` constant in the *option* parameter if you want to create a shareable entity selection. +By default, if the *option* parameter is omitted, the function returns a new, alterable entity selection (even if the function is applied to a shareable entity selection). Pass the `ck shared` constant in the *option* parameter if you want to create a shareable entity selection. -> For information on the shareable property of entity selections, please refer to the [Shareable vs Non-shareable entity selections](ORDA/entities.md#shareable-or-non-shareable-entity-selections) section. +> For information on the shareable property of entity selections, please refer to the [Shareable or alterable entity selections](ORDA/entities.md#shareable-or-alterable-entity-selections) section. #### Example @@ -806,6 +847,7 @@ There is, however, a difference between both statements when the selection is em **.getDataClass()** : 4D.DataClass + | Parameter | Type | | Description | | --------- | ------------ |:--:| ------------------------------------------------------ | @@ -842,6 +884,47 @@ The following generic code duplicates all entities of the entity selection: + +## .isAlterable() + +
    History + +| Version | Changes | +| ------- | ------- | +| v18 R5 | Added | + +
    + + +**.isAlterable()** : Boolean + + +| Parameter | Type | | Description | +| --------- | ------- |:--:| ---------------------------------------------------------- | +| Result | Boolean | <- | True if the entity selection is alterable, False otherwise | + + +#### Description + +The `.isAlterable()` function returns True if the entity selection is alterable, and False if the entity selection is not alterable. + +For more information, please refer to [Shareable or alterable entity selections](ORDA/entities.md#shareable-or-alterable-entity-selections). + +#### Example + +You are about to display `Form.products` in a [list box](FormObjects/listbox_overview.md) to allow the user to add new products. You want to make sure it is alterable so that the user can add new products without error: + +```4d +If (Not(Form.products.isAlterable())) + Form.products:=Form.products.copy() +End if +... +Form.products.add(Form.product) +``` + + + + ## .isOrdered() @@ -988,6 +1071,7 @@ Entity selections always have a `.length` property. **.max**( *attributePath* : Text ) : any + | Parameter | Type | | Description | | ------------- | ---- |:--:| ------------------------------------------------ | @@ -1898,6 +1982,7 @@ Returns: "lastName": "Durham" } ] + ``` #### Example 4 @@ -2090,6 +2175,7 @@ Returns: }, { "firstName": "Gary", + "lastName": "Reichert", "directReports": [ { diff --git a/website/translated_docs/pt/ORDA/entities.md b/website/translated_docs/pt/ORDA/entities.md index afa3396ee84d0d..392c0c4065b6ef 100644 --- a/website/translated_docs/pt/ORDA/entities.md +++ b/website/translated_docs/pt/ORDA/entities.md @@ -184,71 +184,109 @@ You can create an object of type [entity selection](dsMapping.md#entity-selectio You can simultaneously create and use as many different entity selections as you want for a dataclass. Keep in mind that an entity selection only contains references to entities. Different entity selections can contain references to the same entities. -### Shareable or non-shareable entity selections +### Shareable or alterable entity selections -An entity selection can be **shareable** (readable by multiple processes, but not modifiable after creation) or **non-shareable** (only usable by the current process, but modifiable afterwards): +An entity selection can be **shareable** (readable by multiple processes, but not alterable after creation) or **alterable** (supports the [`.add()`](API/entitySelectionClass.md#add) function, but only usable by the current process). -- a **shareable** entity selection has the following characteristics: - - it can be stored in a shared object or shared collection, and can be shared between several processes or workers; - - it can be stored in several shared objects or collections, or in a shared object or collection which already belongs to a group (it does not have a *locking identifier*); - - it does not allow the addition of new entities. Trying to add an entity to a shareable entity selection will trigger an error (1637 - This entity selection cannot be altered). To add an entity to a shareable entity selection, you must first transform it into a non-shareable entity selection using the [`.copy()`](API/entitySelectionClass.md#copy) function, before calling [`.add()`](API/entitySelectionClass.md#add). +#### Properties -- a **non-shareable** entity selection has the following characteristics: - + it cannot be shared between processes, nor be stored in a shared object or collection. Trying to store a non-shareable entity selection in a shared object or collection will trigger an error (-10721 - Not supported value type in a shared object or shared collection); - + it accepts the addition of new entities. +A **shareable** entity selection has the following characteristics: -In most cases, new entity selections are **shareable**, including: +- it can be stored in a shared object or shared collection, and can be passed as parameter between several processes or workers; +- it can be stored in several shared objects or collections, or in a shared object or collection which already belongs to a group (it does not have a *locking identifier*); +- it does not allow the addition of new entities. Trying to add an entity to a shareable entity selection will trigger an error (1637 - This entity selection cannot be altered). To add an entity to a shareable entity selection, you must first transform it into a non-shareable entity selection using the [`.copy()`](API/entitySelectionClass.md#copy) function, before calling [`.add()`](API/entitySelectionClass.md#add). -- entity selections resulting from various ORDA class functions ([`.query()`](API/entitySelectionClass.md#query), [`.query()`](API/dataclassClass.md#query), etc.), -- entity selections based upon relations (e.g. `company.employee`), -- entity selections resulting from projections of values (e.g. `ds.Employee.all().employer`), -- entity selections explicitely copied as shareable with [`.copy()`](API/entitySelectionClass.md#copy) or `OB Copy`. +> Most entity selection functions (such as [`.slice()`](API/entitySelectionClass.md#slice), [`.and()`](API/entitySelectionClass.md#and)...) support shareable entity selections since they do not need to alter the original entity selection (they return a new one). -New entity selections are **non-shareable** in the following cases: +An **alterable** entity selection has the following characteristics: -- blank entity selections created using the [`.newSelection()`](API/dataclassClass.md#newselection) function or `Create entity selection` command, -- entity selections explicitely copied as non-shareable with [`.copy()`](API/entitySelectionClass.md#copy) or `OB Copy`. +- it cannot be shared between processes, nor be stored in a shared object or collection. Trying to store a non-shareable entity selection in a shared object or collection will trigger an error (-10721 - Not supported value type in a shared object or shared collection); +- it accepts the addition of new entities, i.e. it is supports the [`.add()`](API/entitySelectionClass.md#add) function. -#### Example + +#### How are they defined? + +The **shareable** or **alterable** nature of an entity selection is defined when the entity selection is created (it cannot be modified afterwards). You can know the nature of an entity selection using the [.isAlterable()](API/entitySelectionClass.md#isalterable) function or the `OB Is shared` command. + + +A new entity selection is **shareable** in the following cases: + +- the new entity selection results from an ORDA class function applied to a dataClass: [dataClass.all()](API/dataclassClass.md#all), [dataClass.fromCollection()](API/dataclassClass.md#fromcollection), [dataClass.query()](API/dataclassClass.md#query), +- the new entity selection is based upon a relation [entity.*attributeName*](API/entityClass.md#attributename) (e.g. "company.employees") when *attributeName* is a one-to-many related attribute but the entity does not belong to an entity selection. +- the new entity selection is explicitely copied as shareable with [entitySelection.copy()](API/entitySelectionClass.md#copy) or `OB Copy` (i.e. with the `ck shared` option). + +Example: +```4d +$myComp:=ds.Company.get(2) //$myComp does not belong to an entity selection +$employees:=$myComp.employees //$employees is shareable +``` + +A new entity selection is **alterable** in the following cases: + +- the new entity selection created blank using the [dataClass.newSelection()](API/dataclassClass.md#newselection) function or `Create entity selection` command, +- the new entity selection is explicitely copied as alterable with [entitySelection.copy()](API/entitySelectionClass.md#copy) or `OB Copy` (i.e. without the `ck shared` option). + +Example: +```4d +$toModify:=ds.Company.all().copy() //$toModify is alterable +``` + + +A new entity selection **inherits** from the original entity selection nature in the following cases: + +- the new entity selection results from one of the various ORDA class functions applied to an existing entity selection ([.query()](API/entitySelectionClass.md#query), [.slice()](API/entitySelectionClass.md#slice), etc.) . +- the new entity selection is based upon a relation: + - [entity.*attributeName*](API/entityClass.md#attributename) (e.g. "company.employees") when *attributeName* is a one-to-many related attribute and the entity belongs to an entity selection (same nature as [.getSelection()](API/entityClass.md#getselection) entity selection), + - [entitySelection.*attributeName*](API/entitySelectionClass.md#attributename) (e.g. "employees.employer") when *attributeName* is a related attribute (same nature as the entity selection), + - [.extract()](API/entitySelectionClass.md#extract) when the resulting collection contains entity selections (same nature as the entity selection). + +Examples: + +```4d +$highSal:=ds.Employee.query("salary >= :1"; 1000000) + //$highSal is shareable because of the query on dataClass +$comp:=$highSal.employer //$comp is shareable because $highSal is shareable + +$lowSal:=ds.Employee.query("salary <= :1"; 10000).copy() + //$lowSal is alterable because of the copy() +$comp2:=$lowSal.employer //$comp2 is alterable because $lowSal is alterable +``` + + +#### Sharing an entity selection between processes (example) You work with two entity selections that you want to pass to a worker process so that it can send mails to appropriate persons: ```4d - If(Storage.info=Null) - Use(Storage) - Storage.info:=New shared object() - End use - End if - Use(Storage.info) - //Put entity selections in a shared object - Storage.info.paid:=ds.Invoices.query("status=:1";"Paid") - Storage.info.unpaid:=ds.Invoices.query("status=:1";"Unpaid") - End use +var $paid; $unpaid : cs.InvoicesSelection +//We get entity selections for paid and unpaid invoices +$paid:=ds.Invoices.query("status=:1"; "Paid") +$unpaid:=ds.Invoices.query("status=:1"; "Unpaid") + +//We pass entity selection references as parameters to the worker +CALL WORKER("mailing"; "sendMails"; $paid; $unpaid) + +``` - CALL WORKER("mailing";"sendMails";Storage.info) -The sendMails method: +The `sendMails` method: - var $info: ;$1Object - var $paid;$unpaid : cs.InvoicesSelection +```4d + + #DECLARE ($paid : cs.InvoicesSelection; $unpaid : cs.InvoicesSelection) var $invoice : cs.InvoicesEntity - var $server;$transporter;$email;$status : Object + var $server; $transporter; $email; $status : Object //Prepare emails - $server:=New object + $server:=New object() $server.host:="exchange.company.com" $server.user:="myName@company.com" $server.password:="my!!password" $transporter:=SMTP New transporter($server) - $email:=New object + $email:=New object() $email.from:="myName@company.com" - //Get entity selections - $info:=$1 - $paid:=$info.paid - $unpaid:=$info.unpaid - //Loops on entity selections For each($invoice;$paid) $email.to:=$invoice.customer.address // email address of the customer @@ -385,6 +423,7 @@ The following methods automatically associate the optimization context of the so * `entitySelection.drop()` + **Example** Given the following code: diff --git a/website/translated_docs/pt/REST/manData.md b/website/translated_docs/pt/REST/manData.md index 6aa983fc269635..175b3de414697e 100644 --- a/website/translated_docs/pt/REST/manData.md +++ b/website/translated_docs/pt/REST/manData.md @@ -18,7 +18,7 @@ To query data directly, you can do so using the [`$filter`]($filter.md) function With the REST API, you can perform all the manipulations to data as you can in 4D. -To add and modify entities, you can call [`$method=update`]($method.md#methodupdate). Before saving data, you can also validate it beforehand by calling [`$method=validate`]($method.md#methodvalidate). If you want to delete one or more entities, you can use [`$method=delete`]($method.md#methoddelete). +To add and modify entities, you can call [`$method=update`]($method.md#methodupdate). If you want to delete one or more entities, you can use [`$method=delete`]($method.md#methoddelete). Besides retrieving a single entity in a dataclass using [{dataClass}({key})](%7BdataClass%7D_%7Bkey%7D.html), you can also write a [class function](classFunctions.md#function-calls) that returns an entity selection (or a collection).