on-rev example: 'globals.cgi' conversion

Phil Davis revdev at pdslabs.net
Sat Apr 18 15:05:14 EDT 2009


I just set up a CGI in my on-rev account that is 'mostly' equivalent to 
the .irev web page ("on-rev") approach, and tried it out. I was a little 
surprised that the CGI execution speed is almost the same as with on-rev:

revCGI = This page of code executed in 0.000242 secs.
on-rev = This page of code executed in 0.000206 secs.

FWIW, my CGI is here:
http://phildavis.on-rev.com/cgi-bin/globals.cgi

Phil



Phil Davis wrote:
> A quick on-rev example:
> Just to get started, I converted my 'globals' CGI script to an on-rev 
> web page:
>
>    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
>    <HTML>
>    <HEAD LANG="en">
>    <TITLE><?rev  put the short date && the long time  ?></TITLE>
>    </HEAD>
>    <BODY>
>
>    <p>Server Globals</p>
>    <div style="padding-left: 12px">
>    <?rev
>    put the long seconds into tStart
>    put the keys of $_SERVER into tList
>    sort lines of tList
>    repeat for each line gVar in tList
>      put gVar && "=" && $_SERVER[gVar] & "<br>"
>    end repeat
>    put "version,processor,systemVersion,platform,environment" into 
> tExtras
>    replace comma with cr in tExtras
>    repeat for each line tLine in tExtras
>      put "the" && tLine into tLine2
>      put tLine2 && "=" && value(tLine2) & "<br>"
>    end repeat
>    ?>
>    </div>
>    <p><?rev  put "This page of code executed in" && the long seconds -
>    tStart && "secs."  ?> </p>
>
>    </BODY>
>    </HTML>
>
> And here's what it looks like in the browser:
>   http://phildavis.on-rev.com/globals/index.irev
>
>
> I love being able to reuse my Rev know-how this way!

-- 
Phil Davis

PDS Labs
Professional Software Development
http://pdslabs.net




More information about the Use-livecode mailing list