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

TOPIC: Value list and record of

Value list and record of 30 Jul 2007 09:01 #7167

Hello,
I have some question related to Value List and Record Of. I looked
after in many places but I did not find any answer (just some very
basic examples).
So, there is a received message in which there is a Record Of. In this
message the number of the record can be 2 or 3 but both is OK.
But in case of 3 records, the 3rd record must also be checked.

How can I create a tempate which can match both message? Can be used
Value List in case of Record Of?

I tried this way but it did not work.


type record User {
charstring name,
charstring password
}
type record of User UserList;


template a_UserList users :=
{
{
name := a,
password := 1
},
{
name := b,
password := 2
},
({
name := c,
password := 3
},omit)
}

Thanks for your help in advance,
Csaba
The administrator has disabled public write access.

Value list and record of 30 Jul 2007 09:32 #7168

Hi,

the value list matching applies to most TTCN-3 types including the
record of type. The value list shall enlist all entries to be matched
within parentheses. If you want to have a template matching either two
or three exact entries then you have to enlist these values in a comma
separated list within the parentheses.

You had the following additional errors in you sample:
1) If you record has charstring type elements then you must enclose the
values within quotation marks;
2) the omit value must not appear within record of/set of type value;
3) the type of your template should be UserList.

Your desired template looks properly as follows:

template UserList users := (
{
{
name := "a",
password := "1"
},
{
name := "b",
password := "2"
}
},
{
{
name := "a",
password := "1"
},
{
name := "b",
password := "2"
},
{
name := "c",
password := "3"
}
}
);

Regards,
Roland.

>
Original Message
> From: active_ttcn3 : mts stf133 ttcn version 3 - active
> members only [This email address is being protected from spambots. You need JavaScript enabled to view it.] On Behalf Of Csaba Bejan
> Sent: Monday, July 30, 2007 11:01
> To: This email address is being protected from spambots. You need JavaScript enabled to view it.
> Subject: Value list and record of
>
> Hello,
> I have some question related to Value List and Record Of. I
> looked after in many places but I did not find any answer
> (just some very basic examples).
> So, there is a received message in which there is a Record
> Of. In this message the number of the record can be 2 or 3
> but both is OK.
> But in case of 3 records, the 3rd record must also be checked.
>
> How can I create a tempate which can match both message? Can
> be used Value List in case of Record Of?
>
> I tried this way but it did not work.
>
>
> type record User {
> charstring name,
> charstring password
> }
> type record of User UserList;
>
>
> template a_UserList users :=
> {
> {
> name := a,
> password := 1
> },
> {
> name := b,
> password := 2
> },
> ({
> name := c,
> password := 3
> },omit)
> }
>
> Thanks for your help in advance,
> Csaba
>
The administrator has disabled public write access.

Value list and record of 30 Jul 2007 09:40 #7169

Hi,

You have two different cases: the received record of has two elements with any content or has three elements, the two first may be with any content, the third one with a specific value. You have to "merge" the two cases into a value list:

template UserList users :=
( ? length(2), { ?, ?, {name := "c", password := "3"} } )

BR, Gyorgy

>
Original Message
>From: active_ttcn3 : mts stf133 ttcn version 3 - active
>members only [This email address is being protected from spambots. You need JavaScript enabled to view it.] On Behalf Of Csaba Bejan
>Sent: Monday, 2007 July 30. 11:01 AM
>To: This email address is being protected from spambots. You need JavaScript enabled to view it.
>Subject: Value list and record of
>
>Hello,
>I have some question related to Value List and Record Of. I looked
>after in many places but I did not find any answer (just some very
>basic examples).
>So, there is a received message in which there is a Record Of. In this
>message the number of the record can be 2 or 3 but both is OK.
>But in case of 3 records, the 3rd record must also be checked.
>
>How can I create a tempate which can match both message? Can be used
>Value List in case of Record Of?
>
>I tried this way but it did not work.
>
>
>type record User {
> charstring name,
> charstring password
>}
>type record of User UserList;
>
>
>template a_UserList users :=
>{
> {
> name := a,
> password := 1
> },
> {
> name := b,
> password := 2
> },
> ({
> name := c,
> password := 3
> },omit)
>}
>
>Thanks for your help in advance,
>Csaba
>
The administrator has disabled public write access.

Value list and record of 30 Jul 2007 11:34 #7170

Hi
Thanks Roland and Gyorgy. That's what I was looking for. Roland's
examples is clear but I don't really understand Gyorgy's solution. I
have a book "Introduction to TTCN3" and I read many document from the
web but I have never seen such kind of template. Could you tell me
where can I find any reference for this sintax.

Thanks.

On 7/30/07, György Réthy (IJ/ETH) <This email address is being protected from spambots. You need JavaScript enabled to view it.> wrote:
> Hi,
>
> You have two different cases: the received record of has two elements with any content or has three elements, the two first may be with any content, the third one with a specific value. You have to "merge" the two cases into a value list:
>
> template UserList users :=
> ( ? length(2), { ?, ?, {name := "c", password := "3"} } )
>
> BR, Gyorgy
>
> >
Original Message
> >From: active_ttcn3 : mts stf133 ttcn version 3 - active
> >members only [This email address is being protected from spambots. You need JavaScript enabled to view it.] On Behalf Of Csaba Bejan
> >Sent: Monday, 2007 July 30. 11:01 AM
> >To: This email address is being protected from spambots. You need JavaScript enabled to view it.
> >Subject: Value list and record of
> >
> >Hello,
> >I have some question related to Value List and Record Of. I looked
> >after in many places but I did not find any answer (just some very
> >basic examples).
> >So, there is a received message in which there is a Record Of. In this
> >message the number of the record can be 2 or 3 but both is OK.
> >But in case of 3 records, the 3rd record must also be checked.
> >
> >How can I create a tempate which can match both message? Can be used
> >Value List in case of Record Of?
> >
> >I tried this way but it did not work.
> >
> >
> >type record User {
> > charstring name,
> > charstring password
> >}
> >type record of User UserList;
> >
> >
> >template a_UserList users :=
> >{
> > {
> > name := a,
> > password := 1
> > },
> > {
> > name := b,
> > password := 2
> > },
> > ({
> > name := c,
> > password := 3
> > },omit)
> >}
> >
> >Thanks for your help in advance,
> >Csaba
> >
>
The administrator has disabled public write access.

Value list and record of 30 Jul 2007 11:44 #7171

Hello Csaba,

Regarding the notation, please have a look at section 10.4.6.2 of the mentioned book or
Clauses 15.7.4 or B.1.4.1 of the core language standard.

Best regards

Thomas


>
Original Message
>From: active_ttcn3 : mts stf133 ttcn version 3 - active
>members only [This email address is being protected from spambots. You need JavaScript enabled to view it.] On Behalf Of ext Csaba Bejan
>Sent: Monday, 30. July 2007 13:35
>To: This email address is being protected from spambots. You need JavaScript enabled to view it.
>Subject: Re: Value list and record of
>
>Hi
>Thanks Roland and Gyorgy. That's what I was looking for.
>Roland's examples is clear but I don't really understand
>Gyorgy's solution. I have a book "Introduction to TTCN3" and I
>read many document from the web but I have never seen such
>kind of template. Could you tell me where can I find any
>reference for this sintax.
>
>Thanks.
>
>On 7/30/07, György Réthy (IJ/ETH) <This email address is being protected from spambots. You need JavaScript enabled to view it.> wrote:
>> Hi,
>>
>> You have two different cases: the received record of has two
>elements with any content or has three elements, the two first
>may be with any content, the third one with a specific value.
>You have to "merge" the two cases into a value list:
>>
>> template UserList users :=
>> ( ? length(2), { ?, ?, {name := "c", password := "3"} } )
>>
>> BR, Gyorgy
>>
>> >
Original Message
>> >From: active_ttcn3 : mts stf133 ttcn version 3 - active
>members only
>> >[This email address is being protected from spambots. You need JavaScript enabled to view it.] On Behalf Of Csaba Bejan
>> >Sent: Monday, 2007 July 30. 11:01 AM
>> >To: This email address is being protected from spambots. You need JavaScript enabled to view it.
>> >Subject: Value list and record of
>> >
>> >Hello,
>> >I have some question related to Value List and Record Of. I looked
>> >after in many places but I did not find any answer (just some very
>> >basic examples).
>> >So, there is a received message in which there is a Record Of. In
>> >this message the number of the record can be 2 or 3 but both is OK.
>> >But in case of 3 records, the 3rd record must also be checked.
>> >
>> >How can I create a tempate which can match both message?
>Can be used
>> >Value List in case of Record Of?
>> >
>> >I tried this way but it did not work.
>> >
>> >
>> >type record User {
>> > charstring name,
>> > charstring password
>> >}
>> >type record of User UserList;
>> >
>> >
>> >template a_UserList users :=
>> >{
>> > {
>> > name := a,
>> > password := 1
>> > },
>> > {
>> > name := b,
>> > password := 2
>> > },
>> > ({
>> > name := c,
>> > password := 3
>> > },omit)
>> >}
>> >
>> >Thanks for your help in advance,
>> >Csaba
>> >
>>
>
The administrator has disabled public write access.

Value list and record of 30 Jul 2007 14:05 #7172

Hello Thomas!

I checked and you are right. It seems so when i read this part i
didn't understand everything correctly:) There are still some unclear
issues, but at least now i have some ideas how to go further.

Thanks

On 7/30/07, Thomas Deiss <This email address is being protected from spambots. You need JavaScript enabled to view it.> wrote:
> Hello Csaba,
>
> Regarding the notation, please have a look at section 10.4.6.2 of the mentioned book or
> Clauses 15.7.4 or B.1.4.1 of the core language standard.
>
> Best regards
>
> Thomas
>
>
> >
Original Message
> >From: active_ttcn3 : mts stf133 ttcn version 3 - active
> >members only [This email address is being protected from spambots. You need JavaScript enabled to view it.] On Behalf Of ext Csaba Bejan
> >Sent: Monday, 30. July 2007 13:35
> >To: This email address is being protected from spambots. You need JavaScript enabled to view it.
> >Subject: Re: Value list and record of
> >
> >Hi
> >Thanks Roland and Gyorgy. That's what I was looking for.
> >Roland's examples is clear but I don't really understand
> >Gyorgy's solution. I have a book "Introduction to TTCN3" and I
> >read many document from the web but I have never seen such
> >kind of template. Could you tell me where can I find any
> >reference for this sintax.
> >
> >Thanks.
> >
> >On 7/30/07, György Réthy (IJ/ETH) <This email address is being protected from spambots. You need JavaScript enabled to view it.> wrote:
> >> Hi,
> >>
> >> You have two different cases: the received record of has two
> >elements with any content or has three elements, the two first
> >may be with any content, the third one with a specific value.
> >You have to "merge" the two cases into a value list:
> >>
> >> template UserList users :=
> >> ( ? length(2), { ?, ?, {name := "c", password := "3"} } )
> >>
> >> BR, Gyorgy
> >>
> >> >
Original Message
> >> >From: active_ttcn3 : mts stf133 ttcn version 3 - active
> >members only
> >> >[This email address is being protected from spambots. You need JavaScript enabled to view it.] On Behalf Of Csaba Bejan
> >> >Sent: Monday, 2007 July 30. 11:01 AM
> >> >To: This email address is being protected from spambots. You need JavaScript enabled to view it.
> >> >Subject: Value list and record of
> >> >
> >> >Hello,
> >> >I have some question related to Value List and Record Of. I looked
> >> >after in many places but I did not find any answer (just some very
> >> >basic examples).
> >> >So, there is a received message in which there is a Record Of. In
> >> >this message the number of the record can be 2 or 3 but both is OK.
> >> >But in case of 3 records, the 3rd record must also be checked.
> >> >
> >> >How can I create a tempate which can match both message?
> >Can be used
> >> >Value List in case of Record Of?
> >> >
> >> >I tried this way but it did not work.
> >> >
> >> >
> >> >type record User {
> >> > charstring name,
> >> > charstring password
> >> >}
> >> >type record of User UserList;
> >> >
> >> >
> >> >template a_UserList users :=
> >> >{
> >> > {
> >> > name := a,
> >> > password := 1
> >> > },
> >> > {
> >> > name := b,
> >> > password := 2
> >> > },
> >> > ({
> >> > name := c,
> >> > password := 3
> >> > },omit)
> >> >}
> >> >
> >> >Thanks for your help in advance,
> >> >Csaba
> >> >
> >>
> >
>
The administrator has disabled public write access.
  • Page:
  • 1

FacebookTwitterGoogle BookmarksRedditNewsvineTechnoratiLinkedin