On Sat, Jun 7, 2008 at 12:03 PM, Przemyslaw Czerpak <[EMAIL PROTECTED]> wrote:

> I'm still missing what you exactly want to do in final code.
> Now it looks that you want to preprocess text token, isn't it?

Yes.

> You are using in your code:
>   #pragma __streaminclude "foo1.html" | cHtml := %s
> and you want to preprocess foo1.html before you asign it to cHtml.

Yes.

> But there is another question if our PP will be smart enough to
> preprocess "foo1.html" in the way you want. Probably if you agree
> with foo1.html author some naming convention it will be possible.

Sorry, probably I'm wrong but:
if PP already transform __streaminclude xyz into a cContent :=
e"...whatever" and it is smart enough to process escapes and to
correctly terminates strings even if they include " and ' can't it:
when found a given marker like "$%" terminates the string, add an +
add exactly what's between the first marker and the second marker,
then add another + and continue with the stream process?

Sth like:

 #pragma __streaminclude "foo1.html" markers "$%", "%$" | cHtml := %s

foo1.html is:
<html>
<title>$%cTitle%$</title>
</html>

will become:

cHtml := e"<html><title>" + cTitle + "</title><html>"

The main problem of strtran approach is that mispelled names are found
by the user that sees $%cTitle%$ because the designer or the
programmer has written cTilte.
Using PP the problem will be found by the compiler since cTitle is a local.
And in a complex app there are many strtran.

My aim is to make Harbour more usable for web developers.
PHP didn't exist when Clipper was mainstream and now is supported by
many big of the software. I think that with an Apache module to run
HRBs and few other things ( like a standard SQL interface ) Harbour
could be a viable alternative for web developers.

best regards,
Lorenzo
_______________________________________________
Harbour mailing list
Harbour@harbour-project.org
http://lists.harbour-project.org/mailman/listinfo/harbour

Reply via email to