|
Blue Forest http://www.lslnet.com at 8:28 on August 25, 2006
[Address] on the label replacement, please master guiding!
TemplateCode read from the database template file, which is seeking a broadened foreword latest ENGLISH fail?
{#SiteName} {#SiteUrl} {#ShowArticle (1,2, False, True,20, True))
ASP-like how they will replace function, and write down the value function.
For {$SiteName} this can be used to replace direct replacement Replace function, the parameters of the zone, how does the replacement?
A friend of mine said this is then replaced with the following.
Function ReplaceFunction (FileCode)
New Set Reg = RegExp
Reg.Pattern = "{# ([^}]*))"
Reg.Global = True
ReplaceFunction = Reg.Replace (FileCode, "$ 1")
Reg = Nothing Set
End Function
However, the result is only replacement
{#ShowArticle (1,2, False, True,20, True))
Become replacement
ShowArticle (1,2, False, True,20, True)
Show, but not the value of this function
Perplexity, please gets advice, thank you. |
On the replacement labels, please master guiding!
This lack of understanding
PHP function can be used to replace regular
But do not know how to deal with specific asp |
On the replacement labels, please master guiding!
After Execute what can be a replacement |
On the replacement labels, please master guiding!
Lonely said in a message
Sorry, I really do not understand the trouble that can understand it, specifically how to write, Thank you!
|
On the replacement labels, please master guiding!
ShowArticle premise : the process should be a function instead, it's this idea, setting what must landlord.
Function ReplaceFunction (FileCode)
Dim sTmp, oMatches, oMatch
New Set Reg = RegExp
Reg.Pattern = "{# ([^}]*))"
Reg.Global = True
Set oMatches = Reg.Execute (FileCode)
For Each oMatch In oMatches
Execute ( "sTmp =" &oMatch.SubMatches (0))
FileCode = Replace (FileCode, oMatch.Value, sTmp)
Next
Reg = Nothing Set
End Function |
On the replacement labels, please master guiding!
ShowArticle is a function, I know that.
I debugging, Thank you lonely. |
On the replacement labels, please master guiding!
Countdown fourth line
FileCode = Replace (FileCode, oMatch.Value, sTmp)
A typo, changed
ReplaceFunction = Replace (FileCode, oMatch.Value, sTmp)
On it.
Thank you!
|
Thank you, I understand |
|