FUNCTION ShowCode
************************************************************************
* wcDemoServer :: ShowCode
*********************************
*** Function: Routine displays code for a given routine
*** Assume: Retrieves all text between the FUNCTION header and the
*** next FUNCTION statement. Last Method in the class
*** must add a dummy function header to be found.
************************************************************************
LOCAL lcMethod
lcMethod=Request.QueryString("func")
lcProgram=Request.QueryString("prog")
IF EMPTY(lcMethod)
*** Try with the scriptname instead
lcMethod = JUSTSTEM(Request.GetPreviousUrl())
ENDIF
IF EMPTY(lcProgram)
lcProgram = ".\samples\wwdemo\wwdemo.prg"
ELSE
IF "\" $ lcProgram OR "/" $ lcProgram
this.ErrorMsg("Not Allowed","You've accessed a file that is not allowed to be viewed")
RETURN
ENDIF
lcProgram = ".\samples\wwDemo\" + lcProgram
ENDIF
lcProgram=File2Var(lcProgram)
IF lcMethod == "ALL"
lcCode = lcProgram
ELSE
*lcCode=Extract(lcProgram,"FUNCTION "+lcMethod,"ENDFUNC"