Login Page - Create Account

Support Board

Date/Time: Fri, 19 Jul 2024 17:31:18 +0000

[ACSIL] Best way(s) to convert any data to SCString or string

View Count: 1585

[2022-05-03 10:26:45]
User286186 - Posts: 21

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: 452
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

[2022-05-03 13:32:32]
JohnR - User831573 - Posts: 303
Here is another place with relevant info for your scstriing

ACSIL Programming Concepts: Directly Accessing a SCString

[2022-05-05 15:42:41]
ForgivingComputers.com - Posts: 903
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: 292
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()?


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:


Login Page - Create Account