|Description:||Initializes a cache for use in fn vbs cachedEval and sets the parameters used to maintain it.|
This can also be used to change the parameters of an existing cache after initialization, without clearing the data it currently holds.
|Syntax:||[cache, maxsize, cleansize, cleanmode, arrayinput] call fn_vbs_cacheInit|
|Return Value:||Boolean - Returns true if successful, false if not. Most likely cause of failure is passing a nil variable.|
When using functions in VBS versions older than 3.4, certain limitations and requirements should be kept in mind - the main ones being that capitalization of the function name is crucial, and that #include "\vbs2\headers\function_library.hpp" has to be included in every script that utilizes it. More Category VBS Scripting Functions.
["mycache", 100, 150, 2, true] call fn_vbs_cacheInit
|See also:||fn vbs cachedEval, fn vbs cacheDiag|
- The optimal cache parameters (max size, cleanup type) depend on the situation the cache is used in, and require a lot of trial and error to determine. You can use the function
- to monitor the status of the cache, which can help you run tests with different cache parameters until you find the "best" setup. --
- 22:47, 30 December 2009 (CET)