Vax 613 0S Instruction Manual Page 12

  • Download
  • Add to my manuals
  • Print
  • Page
    / 85
  • Table of contents
  • BOOKMARKS
  • Rated. / 5. Based on customer reviews
Page view 11
MDP
PRODUCT
INFORMATION Issue 3 - Vol 2
USER
GROUP
NEWS
THE
RETURN
STATEMENT
The
standard
MDL/u
mechanism for returning from
a.
function or procedure
is
to
branch to either
prend
or
frend.
If a value
is
returnable by a function
it
must first be assigned
to
the function name and the
branch
to
frend.
The
Rational
return
statement
provides these runctions.
For
example
deffn
fact (arg)
if
(arg<=l)
return
(1)
else
return (fact(arg-l)*arg)
fnend
produces the
MDL/u
source
10
DEFFN
FACT
(ARG)
20
IF
(NOT
(ARG<=l))
THEN
50
30
FACT=1
40
GOTO
70
50
FACT
= FACT(ARG-l)*ARG
60
GOTO
70
70
FNEND
In the case of a procedure a
return
does the following:
defpr proc( arg)
return
pread
generates this
MDL/u
source
10
DEFPR
PROC(ARG)
20
xx
GO
TO
xx+l
xx+l
PREND
The last
statement
in either a function or procedure
must
be a
return.
DEFINE
STATEMENTS
Any string of alphanumerics can
be
defined as a name; thereafter, whenever
that
name occurs in the
input
it
is
replaced with rest
of the line.
define
is
usually used to create symbolic parameters:
define MAXLEN 256
INCLUDE
STATEMENT
The
Statement
include test.r
inserts the contents
of
the
file
test.r
into
the
Rational
inpllt
in place of the include statement.
8
TEKTRONIX
December 1983
Page view 11
1 2 ... 7 8 9 10 11 12 13 14 15 16 17 ... 84 85

Comments to this Manuals

No comments