File: execstr.man

package info (click to toggle)
scilab 2.6-4
  • links: PTS
  • area: non-free
  • in suites: woody
  • size: 54,632 kB
  • ctags: 40,267
  • sloc: ansic: 267,851; fortran: 166,549; sh: 10,005; makefile: 4,119; tcl: 1,070; cpp: 233; csh: 143; asm: 135; perl: 130; java: 39
file content (56 lines) | stat: -rw-r--r-- 1,483 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
.TH execstr 1 "April 1993" "Scilab Group" "Scilab Function"
.so ../sci.an
.SH NAME
execstr - execute Scilab code in strings
.SH CALLING SEQUENCE
.nf
execstr(instr)
ierr=execstr(instr,'errcatch' [,msg])
.fi
.SH PARAMETERS
.TP 10
instr 
: vector of character strings, Scilab instruction to be executed.
.TP
ierr
: integer, 0 or error number.
.TP
msg
: character string with values \fV'm'\fR or \fV'n'\fR.  Default
value is \fV'n'\fR.
.SH DESCRIPTION
Executes the Scilab instructions given in argument \fVinstr\fR.
.LP
If the 'errcatch' flag is not present, error handling works as usual.
.LP
If the 'errcatch' flag is set, and an error is encountered while
executing the instructions defined in \fVinstr\fR, \fVexecstr\fR
issues no error message, but aborts execution of the \fVinstr\fR
instructions (at the point where the error occurred), and resumes with
\fVierr\fR equal to the error number.  In this case the display of the
error message is controlled by the \fVmsg\fR option:
.TP 10
"m"
: error message is displayed and recorded.
.TP
"n"
: no error message is displayed, but the error message is recorded
(see \fVlasterror\fR).  This is the default.

.SH EXAMPLE
.nf
execstr('a=1') // sets a=1.
execstr('1+1') // does nothing (while evstr('1+1') returns 2)

execstr(['if %t then';
         '  a=1';
         '  b=a+1';
         'else'
         ' b=0'
         'end'])

execstr('a=zzzzzzz','errcatch')
execstr('a=zzzzzzz','errcatch','m')
.fi 
.SH SEE ALSO
evstr, lasterror, error