Reconsidering the question, just use the velocity 1.6 #evaluate directive, see: http://velocity.apache.org/engine/releases/velocity-1.6.2/user-guide.html#Evaluate applied to your example (note the single quotes): #evaluate('#set( $returnVal = $varName($fieldPath.field.id)') Returned value: $returnVal
Let us know if this worked for you. :) Christoph > bren36 wrote: >> Hi , >> >> Is there a way that i can return a value from a velocity macro >> >> My macro looks something like so >> >> #macro(returnField $fieldPath $varName) >> #if($fieldPath.subfield) >> $$varName($fieldPath.field.id) >> #returnField ($varName $fieldPath.subfield ) >> #end >> #end >> >> Where i need to return $$varName($fieldPath.field.id) >> >> how can i call the returnField macro and assign it to a variable ?????? >> >> > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [email protected] > For additional commands, e-mail: [email protected] > --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
