Eclipse Community Forums - RDF feed
https://www.eclipse.org/forums/
Eclipse Community Forumsvariable definition
https://www.eclipse.org/forums/index.php/mv/msg/1097838/1803407/#msg_1803407
le tian2019-02-28T08:39:11-00:00Re: variable definition
https://www.eclipse.org/forums/index.php/mv/msg/1097838/1803413/#msg_1803413
in TTCN-3 there is no such as global variable but it has much more scope than C has.
Static global variable and static function variable do'nt exist in TTCN-3 but component variables are similar to class member variables in C++ and Java.
Not every scope has variable, e.g module level variables do not exist.
Let me refer to the paragraph 5.2.0 first part of the TTCN-3 standards, ETSI ES 201 873-1, https://www.etsi.org/deliver/etsi_es/201800_201899/20187301/04.02.01_60/es_20187301v040201p.pdf:
TTCN-3 provides nine basic units of scope:
a) module definitions part;
b) control part of a module;
c) component types;
d) functions;
e) altsteps;
f) test cases;
g) statement blocks;
h) templates;
i) user defined named types.
Best regards
Jeno
]]>Jeno Attila Balasko2019-02-28T09:47:59-00:00Re: variable definition
https://www.eclipse.org/forums/index.php/mv/msg/1097838/1803415/#msg_1803415
the lack of global variables is intentional, and has the following philosophy:
components are being used to simulate separate nodes in TTCN-3 ; these nodes can be physically distinct, located in different geographical positions etc.
in the physical reality they are forced to communicate among themselves over physical channels that present an amount of latency /delay.
Simulations are forced, in lack of global variables, to use connections (e.g. internal ports) between components that are the equivalent of the above physical channels.
If global variables would exist, components could communicate with each other using such shared variables, which would lead to an unrealistic simulation.
So lack of global variables is more a feature that enforces a discipline and a way of thinking than a missing language element.