Login Page - Create Account

Support Board


Date/Time: Fri, 03 May 2024 02:15:12 +0000



Post From: sc.GetPersistentSCString not returning the value set

[2019-12-07 20:57:29]
joshtrader - Posts: 439
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?