OpenToken Parsing
Return to Introduction  Previous page  Next page

Anytime you display strings (such as headers/footers/etc) in your modules, you can easily add support for OpenUI Tokens. The conversion process is quite easy:

If the g.OUIX_Module_Version is at least '4.74' (compiled) or '4.56' (uncompiled), before you display the string, just call this function:

<MvFUNCTION NAME = "OUI_Token_Replace" PARAMETERS = "data" STANDARDOUTPUTLEVEL = "">  
 
You simply pass in the string, and it will return the expanded string for you to output.

Example Usage

Let's say your variable to display is g.textout. This is the code you have now:
 
<MvEVAL EXPR = "{ g.textout }">  
 
To add tokens, just change it to this:
 
<MvASSIGN NAME = "l.textout" VALUE = "{ g.textout }">  
 
<MvIF EXPR = "{ g.Merchant_Version LT 4.14 }">  
  <MvIF EXPR = "{ g.OUIX_Module_Version GE 4.56 }">  
    <MvDO FILE = "../ui/oui.mv" NAME = "l.textout" VALUE = "{ OUI_Token_Replace(l.textout) }">  
  </MvIF>  
<MvELSE>  
  <MvIF EXPR = "{ g.OUIX_Module_Version GE 4.74 }">  
    <MvDO FILE = "../ui/oui.mvc" NAME = "l.textout" VALUE = "{ OUI_Token_Replace(l.textout) }">  
  </MvIF>  
</MvIF>  
 
<MvEVAL EXPR = "{ l.textout }">  

 


Send feedback on this documentation.
© 2004 - 2000 Darren Ehlers & OpenUI Developer Consortium