Support Board
Date/Time: Sat, 14 Jun 2025 20:34:03 +0000
Post From: Reading Persistent variable in other study
[2020-06-13 20:35:04] |
User53601 - Posts: 106 |
I try to use Persistent variable instead of Global variable, as it was recomended on other place. To share variable accross multiple studies I am trying to use Persistent variable in conjuction with SetPersistentIntForChartStudy GetPersistentIntFromChartStudy Persitent variable is declared in Study01, then nonzero value is set in Study02 ( by SetPersistentIntForChartStudy). I would expect to read the nonzero value in Study03 (by GetPersistentIntFromChartStudy). However, the value is not returned, resp. the returned value is zero. Could you please help to figure out what I am doing wrong? Here is my code: STUDY 01 int& g_LongMarkersCount = sc.GetPersistentInt(1); STUDY 02 sc.SetPersistentIntForChartStudy(sc.ChartNumber,1,1,33); STUDY 03 int g_Counter_Markers_Long = sc.GetPersistentIntFromChartStudy(sc.ChartNumber,1,1) ; Here is the problem, I expect the returned value should be 33, but instead the returned value is zero. |