Login Page - Create Account

Support Board


Date/Time: Wed, 12 Feb 2025 21:13:41 +0000



[User Discussion] - modf() broken in 2192?

View Count: 588

[2020-11-16 03:40:02]
Ed C. - Posts: 117
Something broke modf() in later releases of SC - I upgraded to 2192 this weekend to keep my Denali data feed, and it broke code:

double backdate, backtime;
  backdate = sc.BaseDateTimeIn[sc.Index - BarsBack].GetDate();
  backtime = std::modf(sc.BaseDateTimeIn[sc.Index - BarsBack], &date);

The compiler is throwing an error:

error C2665: 'modf': none of the 3 overloads could convert all the argument types

Any ideas? Since SC support isn't blowing up with complaints, I'm assuming it's on my end, but I'm not sure where to check.
Date Time Of Last Edit: 2020-11-16 03:40:23
[2020-11-16 08:56:04]
User907968 - Posts: 826
SCDateTime no longer converts directly to double - see link for details https://www.sierrachart.com/index.php?page=doc/Whats_New.php#SCVer2156

You could use Working with the SCDateTime Variables and Values: GetAsDouble()

backtime = std::modf(sc.BaseDateTimeIn[sc.Index - BarsBack].GetAsDouble(), &date);

[2020-11-16 15:13:56]
Ed C. - Posts: 117
Thanks! As you could probably tell, I haven't updated SC in a while!

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

Login

Login Page - Create Account