[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Newsgroup Home]
[news.eclipse.modeling.gmt] Re: [MOFScript]couldn't print list element

Hello,

Running:
myMdl.Test::main(){

self.stringList->forEach(s){

stdout.println("A  " + s)

}

}

on a model A (test- stringList[eeeeeeee, ttttttttttt]) conforming to 
metamodel X containing 1 EClass that has 1 EAttribute of type EString upper 
bound -1.

Gives the following result:

## Loading source model - My.test...(Loading time 16 - Msec)

## Executing MOFScript Specification

## Starting transformation: "ExampleTransformation"

A  eeeee

A  tttttttttttt


I can still not understand what this (s:string) of yours is...

Cheers,
Gøran

"Ye Liu" <yeliu@xxxxxx> wrote in message 
news:d25c63b2e4a9425580479a0f380fcc54$1@xxxxxxxxxxxxxxxxxx
> Hello,
>  Well, the problem is still not solved.As I described in my first post,s 
> means a variable of type String.I think this iteration for string is 
> right,what do you think?
> -------------------------------
> I have a class Sca,with one attribute List<String> xxx,I want print all
> the elements in this list,I write the following statment in MOFScript:
> In the context of Sca,
> self.xxx->forEach(s:string)
>   print(s+",")
> --------------------------------
>
> Thanks
>
> Ye
>