Making the move...

Dan Shafer revolutionary.dan at gmail.com
Tue Mar 28 18:39:45 EST 2006


Some great information in the replies by Richard and Mark Waddingham here.
Rather than quote them and intersperse comments, I thought I'd just make a
point or two in response.

Mark, you're right that the "secret sauce" here is training the Web server
to route pages to specific processes based on file extensions. So a page
ending in ".revhtml" or whatever could be mapped to invoke the Rev engine. I
think that installing Ruby and RoR handles that file editing transparently,
so it doesn't appear that there's any magic but there clearly is.

Taking your advice, Richard, I spent another half hour with merge and I
think the light is beginning to dawn for me. Based on my reading of the
(rather sparse) docs, I *assumed* it would not work to try to execute
abritrary code from inside those square brackets (or, as it turns out, using
a "return" statment in the more conventional <? and ?> delimiters, which Rev
also supports). I'm not sure where the limitations are but a bit of
experimenting revealed that I could get the following to work:

put merge ("It is now day [[line (dayOfWeek(the time)) of the weekdayNames]]
in Monterey, California") into field "htest"

Here, dayOfWeek is a function defined in the card script and the
weekdayNames is a built-in system function that returns a list of the names
of the days of the week, one per line. So I successfully executed a custom
function call that used two bulit-in system functions (the time and the
weekdayNames) and it worked.

Clearly, then, I would be able to do this same thing in a .revhtml page on
the server by invoking a Rev script after proper setup as described by Mark.

The possibilities begin to become clearer now. I'm going to putter a bit
more with this and see what I can come up with on my local (OS X Apache) Web
server. I have it on good authority that Andre Garzia is going to have some
very cool stuff along these lines to share with us in Monterey. I can hardly
wait.

Dan



More information about the use-livecode mailing list