Login Page - Create Account

Support Board


Date/Time: Sun, 19 Jan 2025 23:19:59 +0000



Post From: GetPersistentFloatFromChartStudy gives compile error C2039

[2018-05-05 23:07:39]
User787032 - Posts: 37
I would like to use the functions to get persistent variables from another study and I built a small test study based on the sample code given for GetPersistentFloatFromChartStudy. However, the compiler lists an error saying that GetPersistentFloatFromChartStudy is not a member of 's_sc'. Do I need to include additional header files for this to compile?

#include "sierrachart.h"

SCDLLName("test1")
SCSFExport scsf_GetStudyPersistentVariableFromChartExample(SCStudyInterfaceRef sc)
{
SCInputRef ChartStudyReference = sc.Input[0];

if (sc.SetDefaults)
{
// Set the configuration and defaults

sc.GraphName = "Get Study Persistent Variable from Chart Example";
sc.AutoLoop = 1;
sc.FreeDLL = 0;

ChartStudyReference.Name = "Chart Study Reference";
ChartStudyReference.SetChartStudyValues(1, 0);

return;
}

//Get a reference to a persistent variable with key value 100 in the chart and study specified by the ChartStudyReference Input.
float & FloatFromChartStudy = sc.GetPersistentFloatFromChartStudy(ChartStudyReference.GetChartNumber(), ChartStudyReference.GetStudyID(), 100);
  return;
}