Login Page - Create Account

Support Board


Date/Time: Fri, 03 May 2024 20:36:17 +0000



Put seconds in a text format

View Count: 679

[2016-06-13 12:24:03]
User210074 - Posts: 63
I will want to implant in a text format a time variable: Seconds


#include <iostream>
#include <string>
#include <fstream>
#include "sierrachart.h"
using namespace std;

SCDLLName("Exemple");
SCSFExport scsf_Exemple(SCStudyGraphRef sc) {
if(sc.SetDefaults){
sc.Se="Sec : ";
   int Sec=GetSecond();
   sc.Se.Format("Sec : %02i",Sec);
    return;
}

}

ERROR

-- Starting build of Custom Studies Source files: Example.cpp. -- 14:14:14

"Z:\SierraChart\CPPCompiler\bin\g++.exe" "Z:\SC_Graphique_rithmic\ACS_Source\Example.cpp" -march=i686 -mtune=i686 -O2 -shared -static -static-libgcc -static-libstdc++ -s -fno-rtti -fno-exceptions -std=gnu++11 -o "Z:\SC_Graphique_rithmic\Data\Example.dll"

Z:\SC_Graphique_rithmic\ACS_Source\Example.cpp: In function 'void scsf_Exemple(SCStudyInterfaceRef)':
Z:\SC_Graphique_rithmic\ACS_Source\Example.cpp:10:9: error: 'struct s_sc' has no member named 'Se'
sc.Se="Sec : ";
^
Z:\SC_Graphique_rithmic\ACS_Source\Example.cpp:11:21: error: 'GetSecond' was not declared in this scope
int Sec=GetSecond();
^
Z:\SC_Graphique_rithmic\ACS_Source\Example.cpp:12:6: error: 'struct s_sc' has no member named 'Se'
sc.Se.Format("Sec : %02i",Sec);
^
-- End of Build -- 14:14:16

I don't understand this error
[2016-06-13 16:27:37]
Sierra Chart Engineering - Posts: 104368
This line makes no sense:
sc.Se="Sec : ";

This function does not exist.

It should be:
SCString SecondsString = "Sec : ";
Sierra Chart Support - Engineering Level

Your definitive source for support. Other responses are from users. Try to keep your questions brief and to the point. Be aware of support policy:
https://www.sierrachart.com/index.php?l=PostingInformation.php#GeneralInformation

For the most reliable, advanced, and zero cost futures order routing, *change* to the Teton service:
Sierra Chart Teton Futures Order Routing

To post a message in this thread, you need to log in with your Sierra Chart account:

Login

Login Page - Create Account