This class uses the wwScripting class to parse <%= %> expression blocks and <% %> codeblocks. ExpandScript() behavior can be called explicitly or is available through generic script processing in the wwScriptMaps process handler which can be mapped for any extension in your server's Process method.
o.ExpandScript(tcPageName, tnMode, tvContentType, tlTemplateStr, llNoOutput)
tnMode
Optional - Determines the compilation mode for scripts. Default Mode is 1. For more info see wwServer::nScriptMode.
tvContentType
Optional - Either a wwHTTPHeader object or a content type string.
Response.ExpandScript(THIS.cHTMLPagePath + "scriptdemo.wcs") Response.ExpandScript(Request.GetPhysicalPath()) && Default
<%= DateTime() %> <%= lcVar %> <%= TQuery.FieldName %> <%= MyFunction() %>Code Block Examples:
<%
lcOutput = ""
for x = 1 to 5
lcOutput = lcOutput + TRANS(x) + "<br>"
endfor
Response.Write(lcOutput)
%>
<%
SELECT Company from TT_CUST INTO CURSOR TQuery
SCAN
%>
Company: <%= Company %><br />
<% ENDSCAN %>To exit a script issue RETURN as part of a script block:
<% IF llCanceled
RETURN && Exit script
ENDIF
%>Script pages have access to a special wwScriptingHttpResponse object which provides the ability to write output into the HTTP stream using Response. methods. From within script code you can add headers, cookies and otherwise manipulate the Response.
<%
lcOutput = "New Value"
Response.Write(lcOutput)
%>
<%
Response.AppendHeader("Expires","-1")
Response.AppendHeader("Refresh","1;url=http://www.west-wind.com/")
Response.AddCookie("SomeCookie","Some Value")
Response.AddCookie("MyCookie","My Cookie Value","/",Date() + 10)
%>Overloads: