Hi,
Yes. As Theo pointed out, an 'in' formal parameter in TTCN-3 is follows the
'pass by value' parameter passing mechanism. This mechanism has the
following features:
-the actual parameter value is used to initialize the formal parameter (a in your case).
-The formal parameter (a) is usually a local copy whose scope is limited to the
function definition. (the formal parameter is only visible in the function (MyFunc ).
-Any attempt to reference the formal parameter 'a' outside of the function body
should result in a compilation error. This assumes that a is not defined in an
outer scope. (see scope rules for TTCN-3).
-Modifications to this formal parameter are allowed.
-When the function exits 'a' no longer exists (with respect to the function).
-If the actual parameter is a variable and its original value before the call to MyFunc()
was 666, then its value after returning from MyFunc will still be 666. Irrespective
of what other operations you may have made inside the function (usually the
formal parameter is a local copy and is removed (its activation record no longer exists).
-pass by value (depending on implementation) requires local storage to be allocated.
Note that in TTCN-3 an actual parameter value may be a literal value, a constant or even a variable.
However, in the case of TTCN-3 inout parameters, literals are not permitted as acutal parameters.
See section 5.2.1 of ES201 873-1 V2.2.1 (The TTCN-3 core notation specification)
Hope this helps,
Cheers,
Claude.
Claude Desroches
Technical Architect
Strategic Test Solutions
City Gate East
Toll House Hill
Nottingham
NG1 5FS
United Kingdom
Phone +44 (0) 115 9586600
Mobile +44 (0) 796 6482165
Fax +44 (0) 115 9586633
Email
This email address is being protected from spambots. You need JavaScript enabled to view it.
Web
www.strategictest.co.uk
TTCN - Imagination Technologies
>
Original Message
> From: jacon_wang [
This email address is being protected from spambots. You need JavaScript enabled to view it.]
> Sent: 03 December 2002 14:11
> To:
This email address is being protected from spambots. You need JavaScript enabled to view it.
> Subject: question about the parameter of function
>
>
> hi.
> In the following example,can I modify the (in) formal parameter?
>
> Thanks in advance.
>
> function MyFunc(in integer a)
> {
> a := 10;//here,Can I modify the (in) formal parameter "a"?
> }
>
>                  2002-12-03
> --
> Engineering is the art of making what you want from
> things you can get.
> ★★★★★★★★★★★★★★★★★★★★★★★★★★★★
> ★Department of Automation ★
> ★The University of Science and Technology of China ★
> ★RoomX11-215,Jinzai Road,Hefei,Anhui,China ★
> ★
> ★
> ★Tel: +865513630653(H),+865513606534-3016(O) ★
> ★Email:
This email address is being protected from spambots. You need JavaScript enabled to view it. ★
> ★★★★★★★★★★★★★★★★★★★★★★★★★★★★
>