Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1

TOPIC: Function Parameterization and Arrays

Function Parameterization and Arrays 20 May 2004 12:32 #6671

Hi,

There is some confusion here as to whether the TTCN-3 language allows arrays to
be passed as parameters to functions.
The spec does not explicitly rule out arrays as parameters.
Example:
function ArrayTestFunction(in integer arrayX)
{
...
}

...

var integer arrayX[10];
ArrayTestFunction(arrayX);

The only way I see to do it is via a subtype with an arrayDef. This however
fixes the size of the passed array.
Example:
type integer IntegerArray10[10]
function ArrayTestFunction(in IntegerArray10 arrayX)......


Does the type matching allow the following?:
type integer IntegerArray10[10]
function ArrayTestFunction(in IntegerArray10 arrayX)
{
...
}

...
var integer arrayX[5];
ArrayTestFunction(arrayX);

Could someone please clarify this?.
Are there any future changes to the way this is works to work?

Thanks
Jas


********************************************************************************
*********************************************
The information contained in this email and any attachments is likely to be
confidential and legally privileged, and is for the intended recipient named
above only. Any copying, dissemination, disclosure of or use of this email or
its attachments unless authorised by us is prohibited, except that you may
forward this email and/or attachments to a third party on a strict "need to
know" basis. If you have received this email in error, please notify us
immediately by forwarding the email to This email address is being protected from spambots. You need JavaScript enabled to view it.. Please then delete
this email and any full or partial copies of it.
You as the intended recipient must be aware and accept that email is not a
totally secure communications medium.
Although we have taken all reasonable steps to make sure this email and any
attachments are free from viruses, we do not (to the extent permitted by law)
accept any liability whatsoever for any virus infection and/or compromise of
security caused by this email and any attachment.
No contract may be formed or documents served by you on or with us by this email
or any attachments unless expressly agreed otherwise by us. Any views expressed
in this email or attachments by an individual are not necessarily those of any
UbiNetics company.
The administrator has disabled public write access.

Function Parameterization and Arrays 20 May 2004 15:03 #6672

Hi Jason,

a quick answer: Instead of using arrays try using "record of"
constructs. This should solve your problem. "Record of" are equivalent
to arrays. There you do not have to fix the length!

I try to compile a small useful example. But in the meantime I hope this
points you into the right direction.

Best regards,

Theo

Jason Capstick wrote:

> Hi,
>
> There is some confusion here as to whether the TTCN-3 language allows arrays
to be passed as parameters to functions.
> The spec does not explicitly rule out arrays as parameters.
> Example:
> function ArrayTestFunction(in integer arrayX)
> {
> ...
> }
>
> ...
>
> var integer arrayX[10];
> ArrayTestFunction(arrayX);
>
> The only way I see to do it is via a subtype with an arrayDef. This however
fixes the size of the passed array.
> Example:
> type integer IntegerArray10[10]
> function ArrayTestFunction(in IntegerArray10 arrayX)......
>
>
> Does the type matching allow the following?:
> type integer IntegerArray10[10]
> function ArrayTestFunction(in IntegerArray10 arrayX)
> {
> ...
> }
>
> ...
> var integer arrayX[5];
> ArrayTestFunction(arrayX);
>
> Could someone please clarify this?.
> Are there any future changes to the way this is works to work?
>
> Thanks
> Jas
>
>
>
********************************************************************************
*********************************************
> The information contained in this email and any attachments is likely to be
confidential and legally privileged, and is for the intended recipient named
above only. Any copying, dissemination, disclosure of or use of this email or
its attachments unless authorised by us is prohibited, except that you may
forward this email and/or attachments to a third party on a strict "need to
know" basis. If you have received this email in error, please notify us
immediately by forwarding the email to This email address is being protected from spambots. You need JavaScript enabled to view it.. Please then delete
this email and any full or partial copies of it.
> You as the intended recipient must be aware and accept that email is not a
totally secure communications medium.
> Although we have taken all reasonable steps to make sure this email and any
attachments are free from viruses, we do not (to the extent permitted by law)
accept any liability whatsoever for any virus infection and/or compromise of
security caused by this email and any attachment.
> No contract may be formed or documents served by you on or with us by this
email or any attachments unless expressly agreed otherwise by us. Any views
expressed in this email or attachments by an individual are not necessarily
those of any UbiNetics company.
>
The administrator has disabled public write access.
  • Page:
  • 1

FacebookTwitterGoogle BookmarksRedditNewsvineTechnoratiLinkedin