Previous Page Next Page Contents

protocol -- create a protocol of a MuPAD session

Introduction

protocol(filename) starts a protocol of the current MuPAD session in the file with the name filename.

protocol(n) writes into the file associated with the file descriptor n.

protocol() stops the protocol.

Call(s)

protocol(filename <, InputOnly>)
protocol(n <, InputOnly>)
protocol()

Parameters

filename - the name of a file: a character string
n - a file descriptor provided by fopen: a positive integer

Options

InputOnly - only input is protocolled

Returns

the void object of type DOM_NULL.

Side Effects

The function is sensitive to the environment variable WRITEPATH. If this variable has a value, then the protocol file is created in the corresponding directory. Otherwise, the file is created in the ``current working directory''.

Related Functions

fclose, finput, fopen, fprint, fread, ftextinput, pathname, print, read, READPATH, write, WRITEPATH

Details

Option: InputOnly

Example 1

We open a text file test in write mode with fopen:

>> n := fopen(Text, "test", Write):

A protocol is written into this file:

>> protocol(n):
   1 + 1, a/b;
   solve(x^2 = 2)
   protocol():

The file now has the following content:

      1 + 1, a/b;
      
                                      a
                                   2, -
                                      b
      solve(x^2 = 2)
      
                               1/2           1/2
                        {[x = 2   ], [x = - 2   ]}
      protocol():

Example 2

The protocol file is opened directly by protocol. Only input is protocolled:

>> protocol("test", InputOnly):
   1 + 1; a/b;
   solve(x^2 = 2)
   protocol():

The file now has the following content:

      1 + 1; a/b;
      solve(x^2 = 2)
      protocol():

Changes




Do you have questions or comments?


Copyright © SciFace Software GmbH & Co. KG 2000