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
xtranslate
xtranslate
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
********************************************************************
Re: xtranslate
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
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
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
********************************************************************