Login Page - Create Account

Support Board


Date/Time: Wed, 19 Jan 2022 13:03:38 +0000



Can SC PersistVars be used for a string variable?

View Count: 1816

[2013-05-25 18:18:04]
ejtrader - Posts: 660
SC Team - in ACSIL - there is a need for me to expose the symbol name through Global Variables but would like to use the same DLL for multiple instruments. This is related to GDI function as we can't use SC structure at this time.. Wondering if SC persist Variables are likely to help.. I am able to use int/float to expose globally(using sc persist variables indirectly as pointers) but unable to do so for strings..

Can you please provide a helping hand here - if this is technically possible?

//Pseudo code

// Global Vars section
const char* symbol=nullptr;

void GDIfunction()
{
//Print Symbol Name on the Chart
}

void printVars(SCStudyInterfaceRef sc)
{
SCString gmessage;
gmessage.Format("symbol:%s", symbol); // This works as expected for a single instrument - but not simultaneously for multiple instruments at the same time
sc.AddMessageToLog(gmessage, 0);
return;
}

void initVars(SCStudyInterfaceRef sc)
{
if(symbol==nullptr) symbol=sc.Symbol.GetChars();
return;
}

int main()
{
initVars(sc);
printVars(sc);
sc.p_GDIFunction=GDIfunction; // Wanted to send the SymbolName Somehow to GDI function and don't want to use different DLLs for symbol specific
return 0;
}


Date Time Of Last Edit: 2013-05-26 01:20:12
[2013-05-26 10:02:49]
StarLight - Posts: 23
Hi ...

I do hope SC considers PersistVars for SCString.

At the moment, I store my very LONG LONG string variables on define SCInputRef.SetString(). And, it is expose on the study setting.

A tiny bug on v396, I could not change any LONG string added inside Study Setting input value. But ASCIL could get and set study variable. Not an issue for me.

Cheers ...




[2013-05-27 17:03:04]
Sierra Chart - Max - Posts: 5066
You can use sc.StorageBlock for not so long text strings:
http://www.sierrachart.com/index.php?l=doc/doc_ACSIL_Members.html#scStorageBlock
Sierra Chart Support
[2013-05-28 01:00:22]
Sierra Chart Engineering - Posts: 99781
Posts #2 and #3 are good suggestions.
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
[2013-05-28 06:07:12]
Sierra Chart Engineering - Posts: 99781
How long is the text string? So you are saying through the Study Settings window you cannot edit it?
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
Date Time Of Last Edit: 2013-05-28 06:07:27
[2013-05-28 13:29:22]
StarLight - Posts: 23
Hi support,


Yes ... Studying setting input value.

String with about 1500 chars is impossible to edit. No lost of data when retrieve by ASCIL getString().

String with 500 chars ... editable.

Edit: This only happened in WINE and not Window platform.

cheers ...

Date Time Of Last Edit: 2013-05-28 14:21:32
[2013-05-28 16:50:10]
Sierra Chart Engineering - Posts: 99781
OK this is going to be an operating system problem. That is quite clear.
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:

Login

Login Page - Create Account