Login Page - Create Account

Support Board


Date/Time: Wed, 01 May 2024 23:51:07 +0000



Post From: basic acsil - how to write message to a log (from within CustomChartBarFunction)

[2019-11-06 16:13:03]
ochocinco - Posts: 29
This is a basic acsil help request. Im certain there is a simple concept I'm missing.
What is the right way to add a message to a log from within the "CustomFunction" function?

Im using Remote Build. The output is:

debug_test.cpp: In function 'void CustomFunction(SCCustomChartBarInterfaceRef)':
debug_test.cpp:10:4: error: 'sc' was not declared in this scope
sc.AddMessageToLog(DebugMessage, 0);
^

This code below is only used as a compile test, not to actually build custom chart bars.


#include "sierrachart.h"
SCDLLName("debug example")
SCSFExport CustomFunction(SCCustomChartBarInterfaceRef ChartBarInterface)
{
ChartBarInterface.StartNewBarFlag = 0;
if (ChartBarInterface.IsDeterminingIfShouldStartNewBar)
{
SCString DebugMessage;
DebugMessage.Format("Hello World #1");
sc.AddMessageToLog(DebugMessage, 0);
return;
}
}
SCSFExport scsf_CustomChartBarsExample(SCStudyInterfaceRef sc)
{
if (sc.SetDefaults)
{
// This function is called from another thread.
sc.fp_ACSCustomChartBarFunction = CustomFunction;
sc.AutoLoop = 0;//Always use manual looping.
return;
}
}

thanks for your consideration,