The strcat worked great!! Thanks so much PaulS!
I will post my code to help out any future readers, I know I've lurked hoping to find info, but found none because the OP would figure it out and not leave their knowledge. So here it is:
//Vars:
char CurrentFileName[20];
String DirectoryString[10];
String NameString[6];
String ExtensionString[4];
char* SDFileDirectory(char* DirectoryString, char* NameString, char* ExtensionString) {
CurrentFileName[0] = 0; // start with a null string:
strcat(CurrentFileName, DirectoryString); // add first string, in this case the directory for use with an sd card
strcat(CurrentFileName, itoa(Config1,NameString,10)); //add my Config1 incrementationilizer, I used mine to name the files: 1.txt,2.txt~~100.txt
strcat(CurrentFileName, ExtensionString);} //The file extension
void loop()
{
if(OnStart==0)
{
if(!SD.exists("Config.txt")) // This hub is used to CREATE the config if there isn't one already
{
CurrentFile=SD.open("Config.txt",FILE_WRITE);
CurrentFile.print("Maximum presets : ");
CurrentFile.println(MaxPresets);
CurrentFile.close();
}
CurrentFile=SD.open("Config.txt"); //Then proceed to read info from the file, it is closed prior then reopened as if there is a config file, it will still be able to open this one:
if(CurrentFile)
{
while(CurrentFile.available())
{
Serial.write(CurrentFile.read());
}
CurrentFile.close();
}
while(Config1<MaxPresets)
{ Config1++;
SDFileDirectory("/Presets/","",".txt");//This is the function that PaulS helped me with, 1: Directory, 2: left blank/reserved for SDFileDirectory function up at the top, 3: File extension. 1 and 3 can be renamed here/wherever this line is called, and 2 is renamed in the function, I have not yet figured out how to change what var it uses, but only to change the value of Config1. If anyone can help on this, please let me know
if(!SD.exists(CurrentFileName)){
CurrentFile=SD.open(CurrentFileName,FILE_WRITE);
FileFunction();
CurrentFile.close();
Serial.print("File not found, creating: ");
Serial.print(CurrentFileName);
Serial.println();
}
}
Serial.println("Initialization Complete!");
OnStart=1;
}