xtranslate

mod_harbour is an Apache module that allows to run PRGs directly on the web !!!
Post Reply
User avatar
Otto
Posts: 4470
Joined: Fri Oct 07, 2005 7:07 pm
Contact:

xtranslate

Post by Otto »

Dear Antonio,
is there a way that we could xTranslate {{ }} inside BLOCK that we could use xBase code inside Block like this:
{{Date()}} mHb_date()

Thank you in advance
Otto

#xtranslate

function Main()
? "Seconds {%Seconds()%} before compilation<br><br>"
BLOCKS

Current date is {{Date()}}
Current date is mhb_date()

ENDTEXT

return nil
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org

********************************************************************
User avatar
Otto
Posts: 4470
Joined: Fri Oct 07, 2005 7:07 pm
Contact:

Re: xtranslate

Post by Otto »

Otto, you may use this:
09:32 Uhr
#xcommand BLOCKS [ PARAMS [<v1>] [,<vn>] ] => ;
#pragma __cstream | AP_RPuts( ReplaceBlocks( MyTranslate( %s ), "{{", "}}" [,<(v1)>][+","+<(vn)>] [, @<v1>][, @<vn>] ) )

function Main()

BLOCKS
mhb_date()
<br>
mhb_time()
ENDTEXT

return nil

function MyTranslate( cText )

cText = StrTran( cText, "mhb_date()", "{{Date()}}" )
cText = StrTran( cText, "mhb_time()", "{{Time()}}" )

return cText
09:32 Uhr
Tested from IIS mod_harbour
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org

********************************************************************
Post Reply