Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » M2T (model-to-text transformation) » [Xpand] How to use local variable in a template
[Xpand] How to use local variable in a template [message #917627] Thu, 20 September 2012 09:06 Go to next message
Hai Le is currently offline Hai LeFriend
Messages: 9
Registered: April 2012
Location: Vietnam
Junior Member
Hello everyone,

There is a need of using local variable in a template (in scope of «DEFINE» ... «ENDDEFINE»).

Could it be using let expression (i.e «let strLst = {} : strLst.add("str") -> ""»)?

My temporary solution is to use globalvar extension from xtend stdlib.

Hope to hear from you soon.

Thanks in advance,

Hai LE
Re: [Xpand] How to use local variable in a template [message #917709 is a reply to message #917627] Thu, 20 September 2012 10:50 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14665
Registered: July 2009
Senior Member
Hi what about <<LET ...>><<ENDLET>>

--
Need training, onsite consulting or any other kind of help for Xtext?
Go visit http://xtext.itemis.com or send a mail to xtext at itemis dot de


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: [Xpand] How to use local variable in a template [message #918404 is a reply to message #917709] Fri, 21 September 2012 01:49 Go to previous messageGo to next message
Hai Le is currently offline Hai LeFriend
Messages: 9
Registered: April 2012
Location: Vietnam
Junior Member
Hi Christian,

In fact, <<LET>>...<<ENDLET>> just allows the variable evaluated one time at the beginning. We are not able to change the value of variable in block.
Re: [Xpand] How to use local variable in a template [message #918512 is a reply to message #918404] Fri, 21 September 2012 04:39 Go to previous message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14665
Registered: July 2009
Senior Member
Could you show an example Of your usecase?

--
Need training, onsite consulting or any other kind of help for Xtext?
Go visit http://xtext.itemis.com or send a mail to xtext at itemis dot de


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Previous Topic:[xpand.support.cdt] DefaultCodeFormatterOptions not found
Next Topic:[Xpand] Version in Juno SR1: 1.2.1 or 1.2.2?
Goto Forum:
  


Current Time: Thu Apr 25 12:38:42 GMT 2024

Powered by FUDForum. Page generated in 0.03002 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top