Navigation: FXLV4SpeedTools > Reference Functions >

SETMEM and GETMEM Functions

 

 

 

SETMEM and GETMEM Functions

Optimize your formulas by storing and retrieving the results of very calculation-intensive expressions used more than once in a formula.

Description

The SETMEM and GETMEM functions are thread-safe functions that you can use to avoid repeated calculation of expressions that occur more than once in the same formula.

Use SETMEM to store in memory the results of calculating a calculation-intensive formula expression so that you can replace the later repeats of the formula expression with GETMEM.

This can save time when the additional cost of using SETMEM and GETMEM is less than the cost of the repeated calculation of the calculation-intensive formula expression.

You can use GETMEM as many times as you like within a formula to retrieve the previously stored results.

SETMEM and GETMEM are both thread-safe, non-volatile, array functions

SETMEM Syntax

SETMEM (TheValue, SetID)

TheValue

The value, range, array, or expression result to be stored.

SetID (Optional. Default “A”)

The ID (string) for the stored values. Default is “A”. When you have more than one SETMEM within a single formula you should use a different SetID string for each SETMEM so that you can tell GETMEM which stored value to recall.

GETMEM Syntax

GETMEM (SetID)

SetID (Optional. Default “A”)

The ID (string) for the previously stored temporary values. Default is “A”.

 

 

 

Copyright © 2023 Decision Models Ltd