Xcriber51
2007-03-31 01:25:51 UTC
Hi
A BlackBox question. I have this piece of code (from Wirth's "Programming
In Oberon") adapted to BlackBox's IDE:
MODULE Oscillation;
IMPORT StdLog, Math;
PROCEDURE Do*(n: INTEGER; r: REAL);
CONST dx = 0.196349375; (*pi/16*)
VAR i: INTEGER;
x, y: REAL;
BEGIN
i := 0; x := 0.0;
REPEAT
x := x + dx; i := i+1;
y := Math.Exp(-r*x) * Math.Cos(x);
StdLog.Real(x); StdLog.Real(y); StdLog.Ln()
UNTIL i >= n;
END Do;
END Oscillation.
However, when I try to call this as
! Oscillation.Do 2 7
(or "Oscillation.Do 2,7", "Oscillation.Do(2,7)", etc., the way the
parameters are passed is irrelevant; I tried all combinations), I keep
getting this error:
command error: incompatible parameter list in Oscillation.Do
(As you've probably guessed, I get the same error with some other trials
where I try to call a module procedure again with parameters.)
Why*
Also, what is the easiest way to create interactive programs in BlackBox
where I can just enter a few parameters to a program and call any
procedure in the module I like, pass arguments to it, and get results
using, say, the Log area?
Thanks
-- Ken
A BlackBox question. I have this piece of code (from Wirth's "Programming
In Oberon") adapted to BlackBox's IDE:
MODULE Oscillation;
IMPORT StdLog, Math;
PROCEDURE Do*(n: INTEGER; r: REAL);
CONST dx = 0.196349375; (*pi/16*)
VAR i: INTEGER;
x, y: REAL;
BEGIN
i := 0; x := 0.0;
REPEAT
x := x + dx; i := i+1;
y := Math.Exp(-r*x) * Math.Cos(x);
StdLog.Real(x); StdLog.Real(y); StdLog.Ln()
UNTIL i >= n;
END Do;
END Oscillation.
However, when I try to call this as
! Oscillation.Do 2 7
(or "Oscillation.Do 2,7", "Oscillation.Do(2,7)", etc., the way the
parameters are passed is irrelevant; I tried all combinations), I keep
getting this error:
command error: incompatible parameter list in Oscillation.Do
(As you've probably guessed, I get the same error with some other trials
where I try to call a module procedure again with parameters.)
Why*
Also, what is the easiest way to create interactive programs in BlackBox
where I can just enter a few parameters to a program and call any
procedure in the module I like, pass arguments to it, and get results
using, say, the Log area?
Thanks
-- Ken