Maple Professionel
Maple Académique
Maple Edition Étudiant
Maple Personal Edition
Maple Player
Maple Player for iPad
MapleSim Professionel
MapleSim Académique
Maple T.A. - Suite d'examens de classement
Maple T.A. MAA Placement Test Suite
Möbius - Didacticiels de mathématiques en ligne
Machine Design / Industrial Automation
Aéronautique
Ingénierie des véhicules
Robotics
Energie
System Simulation and Analysis
Model development for HIL
Modélisation du procédé pour la conception de systèmes de contrôle
Robotics/Motion Control/Mechatronics
Other Application Areas
Enseignement des mathématiques
Enseignement de l’ingénierie
Enseignement secondaire et supérieur (CPGE, BTS)
Tests et évaluations
Etudiants
Modélisation financière
Recherche opérationnelle
Calcul haute performance
Physique
Webinaires en direct
Webinaires enregistrés
Agenda des évènements
Forum MaplePrimes
Blog Maplesoft
Membres Maplesoft
Maple Ambassador Program
MapleCloud
Livres blancs techniques
Bulletin électronique
Livres Maple
Math Matters
Portail des applications
Galerie de modèles MapleSim
Cas d'Etudes Utilisateur
Exploring Engineering Fundamentals
Concepts d’enseignement avec Maple
Centre d’accueil utilisateur Maplesoft
Centre de ressources pour enseignants
Centre d’assistance aux étudiants
Printer:-Indent - indent line in printed output
Printer:-PopIndentation - reduce indentation depth
Printer:-PushIndentation - increase indentation depth
Calling Sequence
Printer:-Indent()
Printer:-PopIndentation()
Printer:-PushIndentation()
Parameters
Printer
-
Printer module
Description
The procedure Indent, when used as an argument to a Print call, indicates the argument following Indent() should be indented at the current indentation level.
The procedures PushIndentation and PopIndentation, when called, respectively increase and decrease the current indentation level.
The string used for indentation is controlled by the language attribute "Indent_Char". The number of indentation characters used for all lines, and the number of characters for each level of indentation are controlled by the language attributes "Indent_Base" and "Indent_Increment" respectively.
Any indented output line will have indentation characters, where b is the value of "Indent_Base", d the value of "Indent_Increment", and l the current indentation level.
Examples
Define a language IndentExample, as an extension of C, in which statements are indented and appended with a semicolon, a comment and an end-of-line delimiter.
with(CodeGeneration): LanguageDefinition:-Define("IndentExample", 'extend' = "C", AddPrintHandler( Names:-Statement = proc(x) Printer:-Print( Printer:-Indent(), x, "; /* statement */", Printer:-Endline() ) end proc, Names:-Assignment = proc(x,y) Printer:-Print( Printer:-Indent(), x, " = ", y, "; /* assignment */", Printer:-Endline() ) end proc ), AddFunction( "f", [numeric]::numeric, "f" ) ); Translate(proc(x) local t; t := f(x); t/2 end, language = "IndentExample", resultname = t);
double t (double x) { double t; /* statement */ t = f(x); /* assignment */ return(t / 0.2e1); /* statement */ }
Define a language identical to VisualBasic, but which uses tab characters instead of spaces for indentation.
a = Sin(x) b = Asin(a)
See Also
Language Attributes, Print, Printer
Download Help Document
Copyright © MathResources Inc. All Rights Reserved.
www.mathresources.com