~ubuntu-branches/ubuntu/karmic/scilab/karmic

« back to all changes in this revision

Viewing changes to man/programming/select.man

  • Committer: Bazaar Package Importer
  • Author(s): Torsten Werner
  • Date: 2002-03-21 16:57:43 UTC
  • Revision ID: james.westby@ubuntu.com-20020321165743-e9mv12c1tb1plztg
Tags: upstream-2.6
ImportĀ upstreamĀ versionĀ 2.6

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
.TH select 1 "April 1993" "Scilab Group" "Scilab Function"
 
2
.so ../sci.an
 
3
.SH NAME
 
4
select - select keyword 
 
5
.SH DESCRIPTION
 
6
.nf
 
7
 select expr,
 
8
   case expr1 then instructions1,
 
9
   case expr2 then instructions2,
 
10
   ...
 
11
   case exprn then instructionsn,
 
12
   [else instructions],
 
13
 end
 
14
.fi
 
15
 
 
16
Notes:
 
17
.TP
 
18
-
 
19
The only constraint is that each "then"  keyword  must be on 
 
20
the same line line as corresponding "case" keyword.
 
21
.TP
 
22
-
 
23
The "keyword "then"  can be replaced by a carriage return or a comma.
 
24
 
 
25
 
 
26
\fVinstructions1\fR are executed if \fVexpr1=expr\fR, etc.
 
27
 
 
28
.LP
 
29
Warning: the number of characters used to define the body of any
 
30
conditionnal instruction (if while for or select/case) must be limited to
 
31
16k.
 
32
 
 
33
.SH Example
 
34
.nf
 
35
while %t do
 
36
  n=round(10*rand(1,1))
 
37
  select n
 
38
  case 0 then 
 
39
    disp(0)
 
40
  case 1 then
 
41
    disp(1)
 
42
  else
 
43
    break
 
44
  end
 
45
end
 
46
  
 
47
.fi
 
48
.SH SEE ALSO
 
49
if, while, for
 
50
 
 
51