annotate scripts/io/puts.m @ 2071:4d7237e6dbce

[project @ 1996-04-18 01:28:24 by jwe] Initial revision
author jwe
date Thu, 18 Apr 1996 01:28:24 +0000
parents
children 5cffc4b8de57
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
2071
4d7237e6dbce [project @ 1996-04-18 01:28:24 by jwe]
jwe
parents:
diff changeset
1 # Copyright (C) 1996 John W. Eaton
4d7237e6dbce [project @ 1996-04-18 01:28:24 by jwe]
jwe
parents:
diff changeset
2 #
4d7237e6dbce [project @ 1996-04-18 01:28:24 by jwe]
jwe
parents:
diff changeset
3 # This file is part of Octave.
4d7237e6dbce [project @ 1996-04-18 01:28:24 by jwe]
jwe
parents:
diff changeset
4 #
4d7237e6dbce [project @ 1996-04-18 01:28:24 by jwe]
jwe
parents:
diff changeset
5 # Octave is free software; you can redistribute it and/or modify it
4d7237e6dbce [project @ 1996-04-18 01:28:24 by jwe]
jwe
parents:
diff changeset
6 # under the terms of the GNU General Public License as published by the
4d7237e6dbce [project @ 1996-04-18 01:28:24 by jwe]
jwe
parents:
diff changeset
7 # Free Software Foundation; either version 2, or (at your option) any
4d7237e6dbce [project @ 1996-04-18 01:28:24 by jwe]
jwe
parents:
diff changeset
8 # later version.
4d7237e6dbce [project @ 1996-04-18 01:28:24 by jwe]
jwe
parents:
diff changeset
9 #
4d7237e6dbce [project @ 1996-04-18 01:28:24 by jwe]
jwe
parents:
diff changeset
10 # Octave is distributed in the hope that it will be useful, but WITHOUT
4d7237e6dbce [project @ 1996-04-18 01:28:24 by jwe]
jwe
parents:
diff changeset
11 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
4d7237e6dbce [project @ 1996-04-18 01:28:24 by jwe]
jwe
parents:
diff changeset
12 # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
4d7237e6dbce [project @ 1996-04-18 01:28:24 by jwe]
jwe
parents:
diff changeset
13 # for more details.
4d7237e6dbce [project @ 1996-04-18 01:28:24 by jwe]
jwe
parents:
diff changeset
14 #
4d7237e6dbce [project @ 1996-04-18 01:28:24 by jwe]
jwe
parents:
diff changeset
15 # You should have received a copy of the GNU General Public License
4d7237e6dbce [project @ 1996-04-18 01:28:24 by jwe]
jwe
parents:
diff changeset
16 # along with Octave; see the file COPYING. If not, write to the Free
4d7237e6dbce [project @ 1996-04-18 01:28:24 by jwe]
jwe
parents:
diff changeset
17 # Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
4d7237e6dbce [project @ 1996-04-18 01:28:24 by jwe]
jwe
parents:
diff changeset
18
4d7237e6dbce [project @ 1996-04-18 01:28:24 by jwe]
jwe
parents:
diff changeset
19 function retval = puts (s)
4d7237e6dbce [project @ 1996-04-18 01:28:24 by jwe]
jwe
parents:
diff changeset
20
4d7237e6dbce [project @ 1996-04-18 01:28:24 by jwe]
jwe
parents:
diff changeset
21 # usage: puts (string)
4d7237e6dbce [project @ 1996-04-18 01:28:24 by jwe]
jwe
parents:
diff changeset
22 #
4d7237e6dbce [project @ 1996-04-18 01:28:24 by jwe]
jwe
parents:
diff changeset
23 # Write string to the standard output.
4d7237e6dbce [project @ 1996-04-18 01:28:24 by jwe]
jwe
parents:
diff changeset
24 #
4d7237e6dbce [project @ 1996-04-18 01:28:24 by jwe]
jwe
parents:
diff changeset
25 # See also: fputs, printf, fprintf
4d7237e6dbce [project @ 1996-04-18 01:28:24 by jwe]
jwe
parents:
diff changeset
26
4d7237e6dbce [project @ 1996-04-18 01:28:24 by jwe]
jwe
parents:
diff changeset
27 retval = -1;
4d7237e6dbce [project @ 1996-04-18 01:28:24 by jwe]
jwe
parents:
diff changeset
28
4d7237e6dbce [project @ 1996-04-18 01:28:24 by jwe]
jwe
parents:
diff changeset
29 if (nargin == 1)
4d7237e6dbce [project @ 1996-04-18 01:28:24 by jwe]
jwe
parents:
diff changeset
30 retval = fputs (stdout, s);
4d7237e6dbce [project @ 1996-04-18 01:28:24 by jwe]
jwe
parents:
diff changeset
31 else
4d7237e6dbce [project @ 1996-04-18 01:28:24 by jwe]
jwe
parents:
diff changeset
32 usage ("puts (string)");
4d7237e6dbce [project @ 1996-04-18 01:28:24 by jwe]
jwe
parents:
diff changeset
33 endif
4d7237e6dbce [project @ 1996-04-18 01:28:24 by jwe]
jwe
parents:
diff changeset
34
4d7237e6dbce [project @ 1996-04-18 01:28:24 by jwe]
jwe
parents:
diff changeset
35 endfunction