Book a Demo

Author Topic: custom template that return one value  (Read 5617 times)

Daniel Gavrila

  • EA Novice
  • *
  • Posts: 2
  • Karma: +0/-0
    • View Profile
custom template that return one value
« on: May 09, 2012, 10:59:42 pm »
Hello,

Is it  possible  for a custom template to return one value ?
If yes, I would like to have a small sample.


Many thanks,
Daniel


 

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: custom template that return one value
« Reply #1 on: May 10, 2012, 06:52:22 am »
What?

q.

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: custom template that return one value
« Reply #2 on: May 10, 2012, 03:46:00 pm »
So it's not me, there are others that don't understand the question too ;D

Geert

Daniel Gavrila

  • EA Novice
  • *
  • Posts: 2
  • Karma: +0/-0
    • View Profile
Re: custom template that return one value
« Reply #3 on: May 10, 2012, 04:15:50 pm »
Ok, my mistake that I did not make clear from the begining...

In the User guide at the page "Call Templates From Templates"

is this small sample how to call a template that return the value.

$sSource = %StateEnumeratedName($Source)%.

My question now is how should look this template StateEnumeratedName
that is able to return a value.I tried something like :

$return="my return value" or
$parameter0="my return value"  

but without success...

Hope now is clearer.

Many thanks,
Daniel

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: custom template that return one value
« Reply #4 on: May 10, 2012, 07:41:12 pm »
That's definitely clearer, but unfortunately I have no answer. Maybe someone else.

q.

Makulik

  • EA User
  • **
  • Posts: 400
  • Karma: +0/-0
    • View Profile
Re: custom template that return one value
« Reply #5 on: May 10, 2012, 08:02:35 pm »
I think usually there should not be such thing as an explicit return value for a template. There's just the text expanded that is rendered in it, when the template is 'called'.
I'm not so sure if it's possible to pass parameters (other than the standard ones) to your custom template. Variables will have always local scope, so these won't help either.

HTH
Günther

Ondrej Kolenaty

  • EA User
  • **
  • Posts: 23
  • Karma: +0/-0
    • View Profile
Re: custom template that return one value
« Reply #6 on: May 29, 2012, 08:12:54 pm »
The result of the template call is a resultin text after processing all macros. So I guess the answer for Your quwstion is custom template containing only:

my return value

That's all. no qoutes, no assignment to a variable.

More complicated way can be this:

$return="my return value"
$return

the second row makes "my return value" be te result of the custom template