Sponsored links: Algebra eBooks
 

Help Index

A

B

C

D

E

F

G

H

I

J

K

L

M

N

O

P

Q

R

S

T

U

V

W

X

Y

Z

The Maxima on-line user's manual

Algebra Calculator

Search:

With_stdout Calculator

With_stdout

Function: with_stdout (<f>, <expr_1>, <expr_2>, <expr_3>, ...)

Function: with_stdout (<s>, <expr_1>, <expr_2>, <expr_3>, ...) Evaluates <expr_1>, <expr_2>, <expr_3>, ... and writes any output thus generated to a file <f> or output stream <s>. The evaluated expressions are not written to the output. Output may be generated by print, display, grind, among other functions.

The global flag file_output_append governs whether with_stdout appends or truncates the output file <f>. When file_output_append is true, with_stdout appends to the output file. Otherwise, with_stdout truncates the output file. In either case, with_stdout creates the file if it does not yet exist.

with_stdout returns the value of its final argument.

See also writefile.

          (%i1) with_stdout ("tmp.out", for i:5 thru 10 do
                print (i, "! yields", i!))$
          (%i2) printfile ("tmp.out")$
          5 ! yields 120
          6 ! yields 720
          7 ! yields 5040
          8 ! yields 40320
          9 ! yields 362880
          10 ! yields 3628800

(%o1)                                true
(%i2) 

With_stdout Example

Related Examples

with_stdout

? with_stdout;

Calculate

with_stdout

? with_stdout;

Calculate