Spaces:
Running
Running
Create a user-friendly HTML animation on this topic, in French [Voici un **cours clair et pédagogique en français** sur le **concept de *statement* en COBOL**, avec la **traduction du terme**, des **explications progressives**, et des **exemples commentés**, parfaitement adapté aux **débutants**.
ad5df0f verified Download statements.html from Robertuk/cobol-command-carnival: direct link, hf CLI and curl.
- Browser
- Download file 11 kB
-
https://huggingface.co/spaces/Robertuk/cobol-command-carnival/resolve/main/statements.html
- Command line
-
hf download hf://spaces/Robertuk/cobol-command-carnival/statements.html
-
curl -L -o statements.html https://huggingface.co/spaces/Robertuk/cobol-command-carnival/resolve/main/statements.html
11 kB
| <html lang="fr"> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
| <title>Les Statements en COBOL</title> | |
| <link rel="stylesheet" href="style.css"> | |
| <script src="https://cdn.tailwindcss.com"></script> | |
| <script src="https://unpkg.com/feather-icons"></script> | |
| </head> | |
| <body class="bg-gray-50 font-sans"> | |
| <custom-navbar></custom-navbar> | |
| <main class="container mx-auto px-4 py-8 max-w-4xl"> | |
| <header class="text-center mb-12"> | |
| <h1 class="text-4xl font-bold text-primary-500 mb-4">📘 Les <em>Statements</em> en COBOL</h1> | |
| <p class="text-xl text-gray-600">Instructions COBOL - Le cœur de votre programme</p> | |
| </header> | |
| <section class="bg-white rounded-xl shadow-lg p-6 mb-8 animate-fade-in"> | |
| <h2 class="text-2xl font-semibold text-secondary-500 mb-4">🔤 Traduction du terme</h2> | |
| <div class="flex items-center bg-blue-50 p-4 rounded-lg mb-4"> | |
| <div class="text-4xl mr-4">🇬🇧→🇫🇷</div> | |
| <div> | |
| <p class="font-bold text-lg">Statement (anglais) → Instruction (français)</p> | |
| <p class="text-gray-700">En COBOL, on parle donc d'<strong>instructions COBOL</strong>.</p> | |
| </div> | |
| </div> | |
| </section> | |
| <section class="grid md:grid-cols-2 gap-6 mb-8"> | |
| <div class="bg-white rounded-xl shadow-lg p-6 animate-fade-in"> | |
| <h2 class="text-2xl font-semibold text-secondary-500 mb-4">1️⃣ Qu'est-ce qu'une instruction ?</h2> | |
| <p class="mb-4 text-gray-700">Une <strong>instruction COBOL</strong> est une <strong>combinaison de mots-clés COBOL et d'opérandes</strong>.</p> | |
| <div class="bg-yellow-50 border-l-4 border-yellow-400 p-4 mb-4"> | |
| <p class="font-bold">Règle fondamentale :</p> | |
| <p>Une instruction doit toujours contenir au moins <strong>un mot-clé COBOL</strong>.</p> | |
| </div> | |
| <div class="bg-green-50 p-4 rounded-lg"> | |
| <h3 class="font-bold mb-2">🧠 Exemples de mots-clés COBOL</h3> | |
| <div class="grid grid-cols-2 gap-2"> | |
| <span class="bg-green-100 px-3 py-1 rounded-full text-sm font-mono">DISPLAY</span> | |
| <span class="bg-green-100 px-3 py-1 rounded-full text-sm font-mono">MOVE</span> | |
| <span class="bg-green-100 px-3 py-1 rounded-full text-sm font-mono">ADD</span> | |
| <span class="bg-green-100 px-3 py-1 rounded-full text-sm font-mono">IF</span> | |
| <span class="bg-green-100 px-3 py-1 rounded-full text-sm font-mono">PERFORM</span> | |
| <span class="bg-green-100 px-3 py-1 rounded-full text-sm font-mono">STOP RUN</span> | |
| </div> | |
| </div> | |
| </div> | |
| <div class="bg-white rounded-xl shadow-lg p-6 animate-fade-in"> | |
| <h2 class="text-2xl font-semibold text-secondary-500 mb-4">🧠 Exemple simple</h2> | |
| <div class="bg-gray-800 rounded-lg p-4 overflow-x-auto mb-4"> | |
| <pre class="text-green-400 font-mono text-sm"><code>DISPLAY "Hello World".</code></pre> | |
| </div> | |
| <div class="bg-gray-100 p-3 rounded-lg"> | |
| <p class="text-sm"><span class="font-bold">DISPLAY</span> → mot-clé COBOL</p> | |
| <p class="text-sm"><span class="font-bold">"Hello World"</span> → opérande (chaîne)</p> | |
| <p class="text-sm"><span class="font-bold">.</span> → fin de l'instruction</p> | |
| </div> | |
| </div> | |
| </section> | |
| <section class="bg-white rounded-xl shadow-lg p-6 mb-8 animate-fade-in"> | |
| <h2 class="text-2xl font-semibold text-secondary-500 mb-4">2️⃣ À quoi servent les instructions ?</h2> | |
| <div class="grid md:grid-cols-2 gap-4"> | |
| <div class="bg-blue-50 p-4 rounded-lg flex items-start"> | |
| <div class="text-blue-500 mr-3 text-2xl">🧭</div> | |
| <div> | |
| <h3 class="font-bold">Contrôler le flux</h3> | |
| <p class="text-sm">Gérer l'exécution du programme</p> | |
| </div> | |
| </div> | |
| <div class="bg-purple-50 p-4 rounded-lg flex items-start"> | |
| <div class="text-purple-500 mr-3 text-2xl">🔢</div> | |
| <div> | |
| <h3 class="font-bold">Manipuler les données</h3> | |
| <p class="text-sm">Calculs, transferts, conversions</p> | |
| </div> | |
| </div> | |
| <div class="bg-green-50 p-4 rounded-lg flex items-start"> | |
| <div class="text-green-500 mr-3 text-2xl">⌨️</div> | |
| <div> | |
| <h3 class="font-bold">Entrées/Sorties</h3> | |
| <p class="text-sm">Lire/écrire des fichiers, afficher</p> | |
| </div> | |
| </div> | |
| <div class="bg-yellow-50 p-4 rounded-lg flex items-start"> | |
| <div class="text-yellow-500 mr-3 text-2xl">🔁</div> | |
| <div> | |
| <h3 class="font-bold">Boucles</h3> | |
| <p class="text-sm">Répéter des opérations</p> | |
| </div> | |
| </div> | |
| </div> | |
| <div class="bg-red-50 border-l-4 border-red-400 p-4 mt-4"> | |
| <p class="font-bold">⚠️ Sans instructions, un programme COBOL ne fait rien.</p> | |
| </div> | |
| </section> | |
| <section class="bg-white rounded-xl shadow-lg p-6 mb-8 animate-fade-in"> | |
| <h2 class="text-2xl font-semibold text-secondary-500 mb-4">3️⃣ Où écrire les instructions ?</h2> | |
| <div class="bg-blue-50 p-4 rounded-lg mb-4"> | |
| <p class="font-bold">📍 Règle de positionnement</p> | |
| <p>Toutes les instructions doivent être écrites :</p> | |
| <ul class="list-disc pl-5 mt-2"> | |
| <li>Dans la <strong>PROCEDURE DIVISION</strong></li> | |
| <li>En <strong>Zone B</strong> (colonnes 12 à 72)</li> | |
| </ul> | |
| </div> | |
| <div class="bg-gray-800 rounded-lg p-4 overflow-x-auto"> | |
| <pre class="text-green-400 font-mono text-sm"><code> PROCEDURE DIVISION. ← Zone A | |
| DISPLAY "Hello". ← Zone B</code></pre> | |
| </div> | |
| <div class="mt-3 flex items-center"> | |
| <div class="w-4 h-4 bg-blue-500 mr-2"></div> | |
| <span class="text-sm">Zone A → structure</span> | |
| <div class="w-4 h-4 bg-green-500 ml-4 mr-2"></div> | |
| <span class="text-sm">Zone B → actions (instructions)</span> | |
| </div> | |
| </section> | |
| <section class="bg-white rounded-xl shadow-lg p-6 mb-8 animate-fade-in"> | |
| <h2 class="text-2xl font-semibold text-secondary-500 mb-4">4️⃣ Les 4 grandes catégories</h2> | |
| <div class="space-y-4"> | |
| <div class="border-l-4 border-blue-500 pl-4"> | |
| <h3 class="font-bold">① Instructions impératives</h3> | |
| <p class="text-sm">Elles ordonnent une action directe</p> | |
| <div class="bg-gray-100 p-2 mt-2 rounded"> | |
| <pre class="text-sm font-mono">DISPLAY "Hello".<br>MOVE 10 TO TOTAL.</pre> | |
| </div> | |
| </div> | |
| <div class="border-l-4 border-purple-500 pl-4"> | |
| <h3 class="font-bold">② Instructions conditionnelles</h3> | |
| <p class="text-sm">Exécutent une action si une condition est vraie</p> | |
| <div class="bg-gray-100 p-2 mt-2 rounded"> | |
| <pre class="text-sm font-mono">IF I > 5<br> DISPLAY "Fin"<br>END-IF</pre> | |
| </div> | |
| </div> | |
| <div class="border-l-4 border-green-500 pl-4"> | |
| <h3 class="font-bold">③ Instructions à portée délimitée</h3> | |
| <p class="text-sm">Définissent un bloc logique clair</p> | |
| <div class="bg-gray-100 p-2 mt-2 rounded"> | |
| <pre class="text-sm font-mono">PERFORM VARYING I FROM 1 BY 1<br> UNTIL I > 5<br> DISPLAY I<br>END-PERFORM</pre> | |
| </div> | |
| </div> | |
| <div class="border-l-4 border-yellow-500 pl-4"> | |
| <h3 class="font-bold">④ Instructions de directives</h3> | |
| <p class="text-sm">Donnent des instructions au compilateur</p> | |
| <div class="bg-gray-100 p-2 mt-2 rounded"> | |
| <pre class="text-sm font-mono">COPY MY-COPYBOOK.<br>REPLACE ==:OLD:== BY ==:NEW:==.</pre> | |
| </div> | |
| </div> | |
| </div> | |
| </section> | |
| <section class="bg-white rounded-xl shadow-lg p-6 animate-fade-in"> | |
| <h2 class="text-2xl font-semibold text-secondary-500 mb-4">🧠 Exemple complet commenté</h2> | |
| <div class="bg-gray-800 rounded-lg p-4 overflow-x-auto"> | |
| <pre class="text-green-400 font-mono text-sm"><code> IDENTIFICATION DIVISION. | |
| PROGRAM-ID. PROGSTRU. | |
| AUTHOR. MTH. | |
| PROCEDURE DIVISION. | |
| 1000-SEC1 SECTION. | |
| 1000-PARA. | |
| DISPLAY "Hello World". *> Instruction 1 | |
| DISPLAY "Welcome to MTH". *> Instruction 2 | |
| STOP RUN.</code></pre> | |
| </div> | |
| <div class="mt-4 space-y-2"> | |
| <div class="flex items-start"> | |
| <div class="bg-blue-100 text-blue-800 px-2 py-1 rounded-full text-xs mr-2">1</div> | |
| <p class="text-sm"><code>DISPLAY "Hello World".</code> → instruction impérative</p> | |
| </div> | |
| <div class="flex items-start"> | |
| <div class="bg-blue-100 text-blue-800 px-2 py-1 rounded-full text-xs mr-2">2</div> | |
| <p class="text-sm"><code>DISPLAY "Welcome to MTH".</code> → instruction impérative</p> | |
| </div> | |
| <div class="flex items-start"> | |
| <div class="bg-blue-100 text-blue-800 px-2 py-1 rounded-full text-xs mr-2">3</div> | |
| <p class="text-sm"><code>STOP RUN.</code> → instruction de fin de programme</p> | |
| </div> | |
| </div> | |
| </section> | |
| </main> | |
| <custom-footer></custom-footer> | |
| <script src="components/navbar.js"></script> | |
| <script src="components/footer.js"></script> | |
| <script src="script.js"></script> | |
| <script>feather.replace();</script> | |
| </body> | |
| </html> |