Support Board
Date/Time: Sun, 24 Nov 2024 19:04:21 +0000
[ACSIL] Best way(s) to convert any data to SCString or string
View Count: 1979
[2022-05-03 10:26:45] |
User286186 - Posts: 22 |
Hello, I'm having a lot of trouble trying to convert data to SCString in order to be accepted as an argument by sc.AddMessageToLog() function. I tried any kind of C++ built-in "to string"-like function but it does not work. I see that ACSIL has some function like sc.TimeMSToString() or sc.DateToString() but they only work with these specific type of data. Could you please help me ? Thanks a lot. |
[2022-05-03 11:08:08] |
User431178 - Posts: 541 |
Much info here: ACSIL Programming Concepts: Working with SCString, Text Strings and Setting ACSIL Structure Member Name Strings This might be of particular interest: ACSIL Programming Concepts: Creating Strings that Consist of Numbers and Text http://www.cplusplus.com/reference/cstdio/printf/ Also: sc.FormatGraphValue() sc.FormatVolumeValue() |
[2022-05-03 13:32:32] |
JohnR - User831573 - Posts: 306 |
Here is another place with relevant info for your scstriing ACSIL Programming Concepts: Directly Accessing a SCString JohnR |
[2022-05-05 15:42:41] |
ForgivingComputers.com - Posts: 960 |
The following example creates a string, formats it with text and a variable, and writes it to the Message Log. SCString MessageOut;
float Price = sc.Last[sc.Index]; MessageOut.Format("Last Price = %f", Price); sc.AddMessageToLog(MessageOut, 0); |
[2024-05-21 09:56:13] |
ycomp - Posts: 318 |
for future reference: I guess this should work (scs being an SCString) std::string s{ scs.GetChars() }; // maybe you don't even need the .GetChars()? or auto s = scs.GetChars(); //for const char * Date Time Of Last Edit: 2024-05-21 09:58:06
|
To post a message in this thread, you need to log in with your Sierra Chart account: