Login Page - Create Account

Support Board


Date/Time: Sun, 24 Nov 2024 10:46:08 +0000



Post From: [PROGRAMMING HELP] ACSIL compare SCDateTime

[2024-06-11 09:16:36]
User431178 - Posts: 541

if (IndexDateTime == MySCDateTime.GetDateTimeYMDHMS(2024,5,3,13,30,0)) SummerTime[i] = sc.Close[i];

should be


if (IndexDateTime == MySCDateTime.SetDateTimeYMDHMS(2024,5,3,13,30,0)) SummerTime[i] = sc.Close[i];

cannot bind non-const lvalue reference of type 'int&' to an rvalue of type 'int'
This is referring to the fact that GetDateTimeYMDHMS expects references to int values (lvalue references), whereas you are passing in temporary (rvalues) int.

Working with the SCDateTime Variables and Values: GetDateTimeYMDHMS()
Working with the SCDateTime Variables and Values: SetDateTimeYMDHMS()


You could also just construct the SCDateTime object in place and skip the set function altogether.


if (IndexDateTime == SCDateTime(2024, 5, 3, 13, 30, 0)) SummerTime[i] = sc.Close[i];

Date Time Of Last Edit: 2024-06-11 09:18:38