Viktor, Przemyslaw,

I'd like to see a sample of code which uses with var as well.

Right now, with object enables me to write dynamic html pages via an
interpreter which uses &() to evaluate source code and to hide to this
interpreted code whether it is being run as a CGI or as a fast CGI (sort of,
it is xitami lrwp protocol).

I try to explain more in detail so that you can grasp what I'm looking for and
tell me if it is feasible or not with harbour (and following harbour rules).

My web server has an association between .prg files and a cgi program called
hscript (like the old contrib one from which I borrowed several ideas).

When a request comes in for a page with .prg extension the web server calls
hscript which 'executes' the source code like a cgi program and, before
returning, starts another instance of itself which attaches to the webserver
via the lrwp protocol so that all following requests for the same page are an
order of magnitude faster.

Inside hscript I have code like this:

// interpreted
with object oCGI
        Interprete( .... )
end

// fast cgi
with object oLRWP
        Interprete( ... )
end

Dynamic html pages contain code like this:

for i := 1 to Len( aPri )
         %>
         <option value='<% :cgiOut( aPri[ i ][ 1 ] ) %>' <% :cgiOut( iif(
aPri[ i ][ 1 ] == nSelected, " selected", "" ) ) %> > <% :cgiOut( aPri[ i ][ 2
] ) %> </option>
         <%
next

where <% and %> delimit clipper code which calls the oCGI/oLRWP methods to do
its work, output things, or access oCGI/oLRWP iVARs like :Sever_Name or
:Query_String.

So, if with var works with &() it is perfect for me, I don't mind having to
change a few with object statements.

with var oCGI
        Interprete( ... )
end

I'm really not able to give you more valid reasons to have such a capability,
because I'm using it just for this kind of code (my employer web site, for
example, is completely written this way).

Best regards.

Maurilio.


-- 
 __________
|  |  | |__| Maurilio Longo
|_|_|_|____| farmaconsult s.r.l.


_______________________________________________
Harbour mailing list (attachment size limit: 40KB)
[email protected]
http://lists.harbour-project.org/mailman/listinfo/harbour

Reply via email to