Endline - Maple Help
For the best experience, we recommend viewing online help using Google Chrome or Microsoft Edge.

Online Help

All Products    Maple    MapleSim


Printer

  

Endline

  

mark end of a printed line

 

Calling Sequence

Parameters

Description

Examples

Calling Sequence

Printer:-Endline()

Parameters

Printer

-

Printer module

Description

• 

When used as an argument to a Print command, Endline inserts an end-of-line delimiter into the printed output.

• 

The actual string printed when Endline is encountered is determined by the language attribute Endline.  As there are several platform-specific conventions for delimiting the end of a line, you may want to explicitly set the value of Endline when defining a language.

Examples

Define a language EndlineExample in which statements are indented and appended with a semicolon and "\n".

withCodeGeneration:

LanguageDefinition[Define]("EndlineExample",
   AddPrintHandler(
      Names:-Statement = proc(x)
         Printer:-Print(
            Printer:-Indent(), x, ";", Printer:-Endline()
         )
      end proc
   ),
   SetLanguageAttribute( "Endline" = "\n" ),
   AddFunction( "f", anything::anything, "f" )
);
Translate(f(x), language = "EndlineExample", resultname = t);

t := (double) f(x);

See Also

Language Attributes

Print

Printer