Thread View: comp.lang.modula2
3 messages
3 total messages
Started by M. Klepcyk
Mon, 26 Feb 1996 08:24
Problems with Modula-2
Author: M. Klepcyk
Date: Mon, 26 Feb 1996 08:24
Date: Mon, 26 Feb 1996 08:24
14 lines
969 bytes
969 bytes
Hi, I am trying to write a certain program for a class of mine. However, when I go to compile it, it keeps telling me: "The number of actual parameters is incorrect." Could someone please e-mail me with the EXACT syntax for passing parameters to functions / procedures and the syntax for putting variables, etc. in the procedure header. I've asked my teacher and all he ever gives me is the "What do you think it is?" crap and sends me on my way. I just need someone to tell me the basics and I'll be all set. Please advise ( & HURRY :-) Thanks in advance!
Re: Problems with Modula-2
Author: k3is
Date: Mon, 26 Feb 1996 14:35
Date: Mon, 26 Feb 1996 14:35
12 lines
862 bytes
862 bytes
I wonder what your instructor will say to you if he sees any of this stuff you are asking on here.......I am sure if you just care to read your book for 2 hours you will find the solutions to all of your problems..... You asking how to pass arguments .... well, if you have a procedure with 2 paramters then you should pass TWO parameters to it.....and if the paramters are variables then you should pass your arguments as variables... Read your book! Later, Qusay
Re: Problems with Modula-2
Author: Rob van Albada
Date: Mon, 26 Feb 1996 23:13
Date: Mon, 26 Feb 1996 23:13
49 lines
1905 bytes
1905 bytes
Do not quite understand your question.
The number and types of the of the parameters should be clear fronm
the DEFINITION module or from your own declaration in your program
module.
e.g.
PROCEDURE DoSomeThing(VAR s: ARRAY OF CHAR; t: ARRAY OF CHAR, start,
finish : CARDINAL) : BOOLEAN;
BEGIN
.
.
.
END DoSomeThing;
should be called with two string parameters, two CARDINAL parameters
and as it is a function procedure *returns a BOOLEAN) should be called
as such:
VAR ok : BOOLEAN;
sentence, aword : str64;
i, j : CARDINAL;
BEGIN
ok := DoSomeThing(sentence,aword,i,j);
IF ok THEN WrStr('Thanks God!'); WrLn;
ELSE WrStr('You effing computer!!!!!'); WrLn;
END; (* IF ok *)
END ProgramName;
Et cetera.
Bye,
Rob van Albada
Albada.Ilex@net.hcc.nl
mjk+@osu.edu (M. Klepcyk) wrote:
>Hi,
>I am trying to write a certain program for a class of mine. However,
>when I go to compile it, it keeps telling me: "The number of actual
>parameters is incorrect." Could someone please e-mail me with the
>EXACT syntax for passing parameters to functions / procedures and the
>syntax for putting variables, etc. in the procedure header. I've
>asked my teacher and all he ever gives me is the "What do you think it
>is?" crap and sends me on my way. I just need someone to tell me the
>basics and I'll be all set.
>Please advise ( & HURRY :-)
>Thanks in advance!
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads