[REBOL] Re: Rebol Server Pages
From: al:bri:xtra at: 8-Oct-2002 17:14
Here's a better version with Maarten's suggested change.
Rebol [
Name: 'RSP
Title: "Rebol Server Pages"
File: %RSP.r
Author: "Andrew Martin"
eMail: [Al--Bri--xtra--co--nz]
Web: http://valley.150m.com
Date: 8/October/2002
Version: 1.1.0
Purpose: {}
Category: [util 1]
Acknowledgements: ["Maarten Koopmans"]
]
Hide: func [Block [block!]] [
do Block
return ; Deliberately returns unset! value.
]
RSP: function [Text [string!]] [RSP] [
RSP: make string! length? Text
use [StringScript ScriptString Script String] [
StringScript: "<%" ScriptString: "%>"
parse/all Text [
any [
end break
| StringScript copy Script to ScriptString ScriptString
(append RSP Script)
| copy String [to StringScript | to end] (append RSP mold
String)
]
]
]
form replace/all reduce load RSP unset! ""
]
Andrew Martin
ICQ: 26227169 http://valley.150m.com/