Login Page - Create Account

Support Board


Date/Time: Sat, 19 Apr 2025 15:37:28 +0000



Post From: [ACSIL] How select Path only like Set(get)PathAndFileName?

[2025-03-17 01:52:27]
cmet - Posts: 689
Got it. Not sure if this is what you're looking for, but this lets you explicitly set your path, and then stores it in sc.input. Set it up so you can verify the paths in message log.

#include "sierrachart.h"

SCDLLName("SetPathOnly")

void SetPathOnly(SCInputRef Input, const char* DefaultPath)
{
Input.SetString(DefaultPath);
}

SCSFExport scsf_SetPathOnly(SCStudyInterfaceRef sc)
{
if (sc.SetDefaults)
{
sc.GraphName = "Set Path Only";

//inputs
sc.Input[0].Name = "Log Files Directory";
SetPathOnly(sc.Input[0], "C:\\Logs\\");

sc.Input[1].Name = "Images Directory";
SetPathOnly(sc.Input[1], "C:\\Images\\");

sc.Input[2].Name = "CSV Data Directory";
SetPathOnly(sc.Input[2], "C:\\CSV\\");

sc.Input[3].Name = "Scripts Directory";
SetPathOnly(sc.Input[3], "C:\\Scripts\\");

return;
}

//update on changes only
if (!sc.IsFullRecalculation)
return;

SCString LogsDirectory = sc.Input[0].GetString();
SCString ImagesDirectory = sc.Input[1].GetString();
SCString CSVDirectory = sc.Input[2].GetString();
SCString ScriptsDirectory = sc.Input[3].GetString();

//messages
SCString logMessage;
logMessage.Format("Logs Directory: %s", LogsDirectory.GetChars());
sc.AddMessageToLog(logMessage, 0);

logMessage.Format("Images Directory: %s", ImagesDirectory.GetChars());
sc.AddMessageToLog(logMessage, 0);

logMessage.Format("CSV Directory: %s", CSVDirectory.GetChars());
sc.AddMessageToLog(logMessage, 0);

logMessage.Format("Scripts Directory: %s", ScriptsDirectory.GetChars());
sc.AddMessageToLog(logMessage, 0);
}

Date Time Of Last Edit: 2025-03-17 03:28:39