Rebol Talk Forum  |  Getting Started  |  Newbie Help  |  Topic: Can't remember the name of a rebol function
Pages: [1] Print
Author Topic: Can't remember the name of a rebol function  (Read 328 times)
rebolnotes
Newbie
*
Offline Offline

Posts: 23


View Profile
Can't remember the name of a rebol function
« on: July 10, 2008, 12:52:58 PM »

Hi,

I know there is a function in rebol that allow to do replace something between <% and %> but can't remember its name.

Thanks Smiley
Logged
notchent
Newbie
*
Offline Offline

Posts: 40


View Profile WWW
Re: Can't remember the name of a rebol function
« Reply #1 on: July 11, 2008, 09:48:22 AM »

If you know what you're searching for inside the <% %>, you could use the "replace" function.  Otherwise, you could use "parse":

Code:
rebol []

; to replace a specific string inside the characters:

code: "text1 <% replace this %> text3"
replace code "<% replace this %>" "<% text2 %>"
print code

; to replace everything between the special characters:

code: "text1 <% replace this %> text3"
parse code  [any [thru "<%" copy new to "%>" (replace code new " text2 ")] to end]
print code

halt
Logged

rebolnotes
Newbie
*
Offline Offline

Posts: 23


View Profile
Re: Can't remember the name of a rebol function
« Reply #2 on: July 11, 2008, 10:46:17 AM »

Hi thanks for answering, but I don't know what I'm looking for and the function is not replace.
Logged
notchent
Newbie
*
Offline Offline

Posts: 40


View Profile WWW
Re: Can't remember the name of a rebol function
« Reply #3 on: July 11, 2008, 10:50:12 AM »

Then use the parse example:

Code:
code: "text1 <% replace this %> text3"
parse code  [any [thru "<%" copy new to "%>" (replace code new " text2 ")] to end]
print code

That will do what you asked, but if it's not what you're looking for, you can find related functions at the bottom of any function page in the Rebol dictionary, such as this page for the "change" function:

http://www.rebol.com/docs/words/wchange.html
« Last Edit: July 11, 2008, 01:32:07 PM by notchent » Logged

Sunanda
Full Member
***
Offline Offline

Posts: 100


View Profile
Re: Can't remember the name of a rebol function
« Reply #4 on: July 12, 2008, 02:35:43 AM »

I think you are looking for RSP -- REBOL Server Pages.

I am not sure if it still exists, or is available.

Some hints here:

http://www.rebol.org/cgi-bin/cgiwrap/rebol/ml-display-message.r?m=rmlDDDS
Logged
notchent
Newbie
*
Offline Offline

Posts: 40


View Profile WWW
Re: Can't remember the name of a rebol function
« Reply #5 on: July 13, 2008, 12:39:44 AM »

Cheyenne has support for RSP:  http://cheyenne-server.org/

Also, this older server supported similar inline Rebol code, using <? ?> tags:  http://vpavlu.plain.at/plain-dev/r80v5/r80v5.html
Logged

Sunanda
Full Member
***
Offline Offline

Posts: 100


View Profile
Re: Can't remember the name of a rebol function
« Reply #6 on: July 15, 2008, 01:36:53 PM »

And the Cheyenne site has just added an RSP reference page:

http://cheyenne-server.org/docs/rsp-api.html
Logged
notchent
Newbie
*
Offline Offline

Posts: 40


View Profile WWW
Re: Can't remember the name of a rebol function
« Reply #7 on: July 15, 2008, 11:47:42 PM »

Yowsa!  That's great Smiley
Logged

rebolnotes
Newbie
*
Offline Offline

Posts: 23


View Profile
Re: Can't remember the name of a rebol function
« Reply #8 on: July 24, 2008, 02:10:54 PM »

Hi great links, thanks to all.

Also for those interested I remembered the name of the function: build-markup
http://www.rebol.com/docs/changes.html#section-3.11

template: {<HTML>
    <BODY>
    Hi <%name%>, your email is <i><%email%></i>.<P>
    </BODY>
    </HTML>
}

name: "Bob"
email: bob@example.com
page: build-markup template
Logged
Pages: [1] Print 
Rebol Talk Forum  |  Getting Started  |  Newbie Help  |  Topic: Can't remember the name of a rebol function
Jump to:  

  
Quick Search...

Advanced search
  
Welcome, Guest. Please login or register.
Did you miss your activation email?
October 07, 2008, 11:02:08 AM
Username: Password: Session Length:
  

News: 01-09-08

Alpha version of REBOL 3 has been released!


  
2241 Posts in 585 Topics by 2232 Members
Latest Member: ThortHoTeMorY

  Rebol Talk Forum | Powered by SMF 1.0.9.
© 2001-2005, Lewis Media. All Rights Reserved.

RT design by Defiant Pc