That's useful to know, and thank you for the quick reply.
Sent by FoxWeb Support on 11/13/2006 06:50:50 AM:
FoxWeb converts fwx scripts to regular prg files. Execution starts from the top of the file and continues until the end of the file, or until one of the following statements is encountered: RETURN, FUNCTION, ENDFUNC, PROCEDURE, ENDPROC. This means that all function code must be at the end of the file.
By the way, your code seems to be incorrect. The <%=lcMessage%> should be part of the HTML body, so it should be between the opening and closing BODY elements.
Sent by Gia Luc on 11/13/2006 04:08:35 AM:
If I try the following, I get a blank page (no html at all). Foxweb does not generate an error, and everything seems to run correctly :
If I move the FUNCTION...ENDFUNC to the end, just after the closing body and html tags, the script runs correctly i.e. it returns "Hello World" in the browser :
I'm only guessing, but it seems that in the first example, the script stops executing completely when the RETURN statement is reached.
The second example is essentially the same code, only with the FUNCTION block being moved to the end of the page. Yet it runs fine.
Is this normal, is there some rule about where to place FUNCTION...RETURN ENDFUNC ? Have I missed something in the documentation ?
Thanks for your help.