Re: SDL-News: Procedure call of a value returning procedure


Subject: Re: SDL-News: Procedure call of a value returning procedure
From: Rick Reed TSE (rickreed#tseng.co.uk)
Date: Fri Jan 08 1999 - 16:09:53 GMT


The originator of this message is responsible for its content.
-----From Rick Reed TSE <rickreed#tseng.co.uk> to sdlnews -----

At 15:05 +0000 8/1/99, tariq aslam wrote:
>-----From tariq aslam <tariq#erg.abdn.ac.uk> to sdlnews -----
>if you are using telelogic SDT tool then following might help. I am
>outlineing
>the method
....
>Note Assumptions
>number1, number2, number3 HigestValue are declared at
>process level.
>
>Hope this help!!!!!

Possibly not - this may confuse Janos - because
1) There is no need for number1, number2, number3, HighestValue to be
declared at process level. Any variables declared there are distinct from
the procedure parameters.
2) There is no step on how to call the procedure.
3) You have not mentioned RETURNS. I expect what Janos wants to do is
RETURN more than one value. Current SDL does not allow this unless a STRUCT
value is returned.

You can write:

PROCEDURE fred
/*insert ";" here in SDT for SDL/GR - not legal - but SDT requires it!*/
FPAR
IN a Integer;
IN/OUT b Boolean;
RETURNS Integer;
...

...

Calling context

DCL i,j Integer, x Boolean
...

j:=fred(i,x);/*updates x, and returns an integer value*/

or with
NEWTYPE s STRUCT
k Integer;
y Boolean;
ENDNEWTYPE;

PROCEDURE jim
/*insert ";" here in SDT for SDL/GR - not legal - but SDT requires it!*/
FPAR
IN a Integer;
IN/OUT b Boolean;
RETURNS s;
....

***next to return symbol*** (. <integer expression>, <boolean expression> .)

DCL t s;

t:=jim(i,x)

>> The originator of this message is responsible for its content.
>> -----From Janos Bauer <janos.bauer#eth.ericsson.se> to sdlnews -----
>>
>> Hi,
>>
>> I would like to know how to call a value returning procedure if it has
>> more than one IN/OUT parameter (of course I want to get them back).
>> Thanks for your help!
>>
>> /Janos
>>
>> -----End text from Janos Bauer <janos.bauer#eth.ericsson.se> to sdlnews
>>-----

--
Rick Reed, TSE Limited
13 Weston House, 18-22 Church Street
Lutterworth Leicestershire LE17 4AW United Kingdom
Tel +44 14 55 55 96 55; Fax +44 14 55 55 96 58
Mob +44 79 70 50 96 50
email: rickreed#tseng.co.uk
http://www.tseng.co.uk   ftp://ftp.tseng.co.uk/tseng/

-----End text from Rick Reed TSE <rickreed#tseng.co.uk> to sdlnews ----- For help, email "majordomo#sdl-forum.org" with the body of your email as: help or (iff this does not answer your question) email: owner-sdlnews#sdl-forum.org



This archive was generated by hypermail 2a23 : Sun Jun 16 2013 - 10:41:40 GMT