Skip to main content



      Home
Home » Modeling » M2T (model-to-text transformation) » Xpand suppress return value output
Xpand suppress return value output [message #534171] Tue, 18 May 2010 05:39 Go to next message
Eclipse UserFriend
Hello everybody,

I'm quite new to this topic, and currently I am trying to create a small sample DSL for my Bachelor Thesis...

I succeeded in creating something like a Homepage-DSL for generating html files, and now I would like to develop another generator which creates .tex files from this Homepage DSL Model.

But I'm stuck with the problem of creating tex tables

The output of the generator should look something like:

\begin{tabular}{|l|l|}
Left upper corner&Right upper corner\\
Left lower corner&Right lower corner\\

This is a table with two columns => So i figured to use this:

«DEFINE column FOR Column»
«EXPAND element FOR elements.first()»
«elements.remove(elements.first())»
&«EXPAND element FOREACH elements»
«ENDDEFINE»

The problem is that elements.remove(elements.first()) will print [ ] to my tex code. How do I suppress this output?

Any idea? Thank you!

[Updated on: Tue, 18 May 2010 05:40] by Moderator

Re: Xpand suppress return value output [message #534187 is a reply to message #534171] Tue, 18 May 2010 06:20 Go to previous messageGo to next message
Eclipse UserFriend
I don't really know how to help you, but you can use
elements.withoutFirst() instead of elements.remove(elements.first())

From my experience, [ ] is the sign of a List.

Can you paste what exact text output you get ?
Re: Xpand suppress return value output [message #534200 is a reply to message #534187] Tue, 18 May 2010 06:55 Go to previous messageGo to next message
Eclipse UserFriend
Hello,

have a look at the xtend function toString("SeptaratorString") on a list so {"1","2"}.toStrring("&") delivers 1 & 2

on the other hand why don't you use the SEPARATOR flag on expand:

<<EXPAND element FOEACH elements SEPARATOR "&">>

~Christian
Re: Xpand suppress return value output [message #534231 is a reply to message #534171] Tue, 18 May 2010 08:37 Go to previous message
Eclipse UserFriend
@Maxime & Christian

Thank you so much for your quick response!

Both approaches solved my problem!
Previous Topic:[JET] how to show the details in progress bar
Next Topic:[check]
Goto Forum:
  


Current Time: Wed Jul 23 19:14:02 EDT 2025

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

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

Back to the top