not.
I was attempting to cut down on the memory usage of an
inidicator by limiting the number of days to display using code
similar to that included below.
I was surprised to find that the memory didn't decrease at all.
In fact, the program seems to allocate plot data for all plots
whether they are ever displayed or not.
I have been going down the path of using a display control
variable to select among a number of ways to display data.
This can be catastrophic from a resource point of view since all
the unused plots take up memory.
Is there some way to suppress plots programmatically that
doesn't use memory?
Or do I have to multiply the number of indicators by the number
of unique ways I will display them?
What do you recommend?
Code: Select all
Input: DisplayNumberOfDays(30); // 0 => All drawings shown. >= 0 => limit the number of days of display to today minus that number.
Var: IntrabarPersist int displayMasterDisable(False); // Flag set from DisplayNumberOfDays to prevent drawing too much.
// Handle the displayMasterDisable flag
Once Begin
// Turn it on if using it at all:
If DisplayNumberOfDays > 0 Then Begin
displayMasterDisable = True;
End;
End;
// Check the disable flag on date changes.
If DisplayNumberOfDays > 0 and Date[0] <> Date[1] Then Begin
If CurrentDate - Date > DisplayNumberOfDays Then Begin
displayMasterDisable = True;
End Else Begin
displayMasterDisable = False;
End;
End;
If displayMasterDisable = False Then Begin
If displayMode = 1 Then Begin
Plot1(1.0, "one");
End Else If displayMode = 2 Then Begin
Plot2(2.0, "two");
End Else If displayMode = 3 Then Begin
Plot3(3.0, "three");
End;
End;