Support Board
Date/Time: Mon, 03 Feb 2025 22:37:35 +0000
sc.GetPersistentSCString not returning the value set
View Count: 653
[2019-12-07 20:57:29] |
joshtrader - Posts: 498 |
The following code would set the persistent string, and then return that, I would think: SCSFExport scsf_TemplateFunction(SCStudyInterfaceRef sc) { if (sc.SetDefaults) { sc.GraphName = "Template Function"; sc.AutoLoop = 1; sc.SetPersistentSCString(1122, sc.Symbol); return; } SCString& mySymbol = sc.GetPersistentSCString(1122); SCString Buffer; Buffer.Format("My string is %s", mySymbol); sc.AddMessageToLog(Buffer, 0); } However, returned is: My string is €®"
This would seem to be just printing an address, but I don't see my error above. Any ideas? |
[2019-12-07 21:42:33] |
Sierra Chart Engineering - Posts: 104368 |
There is a problem in your code. Here is the corrected relevant line: Buffer.Format("My string is %s", mySymbol.GetChars());
Sierra Chart Support - Engineering Level Your definitive source for support. Other responses are from users. Try to keep your questions brief and to the point. Be aware of support policy: https://www.sierrachart.com/index.php?l=PostingInformation.php#GeneralInformation For the most reliable, advanced, and zero cost futures order routing, *change* to the Teton service: Sierra Chart Teton Futures Order Routing |
To post a message in this thread, you need to log in with your Sierra Chart account: