Short version; sometimes the same function/method/class/user/action could run content that has already generated once before - why ?!? - a solution that was created in 2007 was to record/catch parts of the execution for later reuse; the result is another appcatche that executes only in a script runtime environment cutting round trips. I could just correct the inital code but there is no fun in that.
The following example for a single run of JavaScript requires some KitCAD i3 KGC 2011 version files to be overridden and replaced with a new runtime function for KGraphicControl.QuickPaint executions
The above example Debug dump is from a BC2di_1000w_600d_903h_0hf.kpd KitCAD2 Object Item that causes 8 calls to the JavaScripted function titled KGraphicControl.QuickPaint; of which 6 calls are repeat visit/s.
The 2 calls that generate data can be record in a simple store using a identifier which is seperated from the output value by a linefeed return CRLF (\r\n, \xD0\xA0, or \u000D\u000A) and before a terminator with another linefeed return CRLF (\r\n, \xD0\xA0, or \u000D\u000A).
An example store showing the working data from the Debug dump above can be seen below :-
KGraphicControl.QuickPaint(true, 0, 0)[250][250][250][C:\Program Files\Kitchen\Objects\BC2di_1000w_600d_903h_0hf.kpd]
document_message(Canvas.Draws_def); Width = 250; Height = 250; kpdsquare = 250; atmovex = -137; atmovey = -82; Fmovex = 0; Fmovey = 0;
---appcatche---
\r\n
appcatche.storen
function call does not need to be ---appcatche---
followed by a RESERVED space and a Store delimiter as it could be exchanged for two or more astric symbols like ** or another kind of terminator identifier.
Use of jsappcatche.js script provides automatic use of the default Store terminator ---appcatche---
followed by RESERVED space and CRLF (\r\n, \xD0\xA0, or \u000D\u000A). The Store terminator is removed from the last line of a string that is returned during a appcatche.exestr
function call.
KGraphicControl.QuickPaint = function (
OFixed,
gFixmovex,
gFixmovey)
{
/*catche return starts*/ appcatche.catchstr = 'KGraphicControl.QuickPaint(' +
OFixed + ', ' +
gFixmovex + ', ' +
gFixmovey + ')[' +
kpdsquare + '][' +
Width + '][' +
Height + '][' +
KGraphicControl.DFileName() + ']';if(appcatche.ifstr(appcatche.catchstr)==false){ appcatche.catchstoren(appcatche.catchstr); /*catche return ends*/
document_message(Canvas.Draws_def);
/*catche return starts*/ appcatche.catchstore( '
document_message(Canvas.Draws_def);' ); /*catche return ends*/
/*catche return starts*/ appcatche.catchstored(); }else{ eval('' + appcatche.exestr(appcatche.catchstr) + ''); }/*catche return ends*/
<script id="designtime" src="http://www.kitchenpages.com/library/i3/TObject/TPersistent/TComponent/TControl/TGraphicControl/KGraphicControl.js"></script>
<!-- override a function with the appcatche altered version -->
<script type="text/javascript" src="
jsappcatche.js"></script><script type="text/javascript">/*<![CDATA[*/
document.writeln('<sc' + 'ript src="
http://www.kitchenpages.com/library/i3/function_KGraphicControl__QuickPaint_cpp.js"></s' + 'cript>'); /*]]>*/</script>
window.applicationCatche is not this - that is a play new thing for HTML5#offline.
MemCatched is not this - that is one of many middleware technology methods that records values for keys using storage. And like many, these can NOT execute a standalown store key to return value.
This example could be updated to use JSON, XML, or data transfer methods that could execute statements from new groups of javascript statement/s.
The Kitchen Pages JavaScript Search page is a reallife application of jsappcatche.js that provides basic JavaScript Funciton catching, DOM storage, User interface redrawing, and JavaScript Methods (disabled for IE-5).
The jsappcatche.js javascript technology topography will support other scripting and program execution encodings.
The jsappcatche.js javascript also supports JavaScript Search Speed Loader's and RSH0.6FINAL fragment identifier methods.
This page was written for KitchenPages.com and online uses. Needs changes for offline use. (C)Copyright 2009-2010. All rights reserved.