Login Page - Create Account

Support Board


Date/Time: Tue, 14 May 2024 05:27:45 +0000



[User Discussion] - declared as reference but not initialized -- Error

View Count: 1767

[2020-10-09 16:34:22]
User681150 - Posts: 62
i keep getting this error, not sure what i am doing wrong... here is the link to the function
sc.GetSessionTimesFromChart()

int GetSessionTimesFromChart(const int ChartNumber, n_ACSIL::s_ChartSessionTimes& r_ChartSessionTimes);

// mycode, errors on line 1, "error: 'chartTime' declared as reference but not initialized"
n_ACSIL::s_ChartSessionTimes& chartTime ;

sc.GetSessionTimesFromChart(chartnum,chartTime) ;

SCDateTime ch_stime = chartTime.StartTime ;
SCDateTime ch_etime = chartTime.EndTime ;

Date Time Of Last Edit: 2020-10-09 16:38:08
[2020-10-09 19:31:54]
norvik_ - Posts: 106
Hi, in c++ is impossible to declare references without being initiated.
Should be something like this

n_ACSIL::s_ChartSessionTimes& chartTime = n_ACSIL::s_ChartSessionTimes() ;//default constructor may be..

And in your case it is not necessary for declaration ChartTime as reference.

Should be declared as variable.

n_ACSIL::s_ChartSessionTimes chartTime;
Date Time Of Last Edit: 2020-10-09 20:36:37
[2020-10-12 09:25:13]
User253985 - Posts: 21
Since the update I had the same problem on my Custom Studies.

In the 'Add Study' window I get the response

The advanced custom study D:\SierraChart\Data\StudyNameBlahBlah.dll needs to be recompiled to be used on this version 2179
I went into one of the studies and initiated the reference (i think that's what it is called, hehehe)

for example I change

char PosShort;
to
char PosShort = 0;

when defining the variable

It seemed to of worked.


But i also have the problem of an amplified screen, everything is a lot bigger. I can't resolve this issue.
http://www.sierrachart.com/image.php?Image=1602494543141.png

is anyone else having this issue?
Date Time Of Last Edit: 2020-10-12 09:28:02

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

Login

Login Page - Create Account