Hi.
I have usa a modified version of the default bom.ulp wich I have changed a bit to fit my needs, but there is one small thing thet irritates me. I cant get the date to automagically be filled in, in the file save dialog.
Originally the filename comes up like this "schname.csv" and I would like to get "schname YYMMDD.csv" with the day automagically filled in.
Ive tryed alot with the t2string() but as soon as I try to use it in the filename the filename field will be blank instead.
Anyone have a clue?
This is how the save function looks like today.
void SaveList (void)
{
string FileName;
string FileExt;
switch (OutputFormat)
{
case ofText: FileExt = ".txt"; break;
case ofHTML: FileExt = ".html"; break;
case ofCSV: FileExt = ".csv"; break;
}
schematic(SCH) FileName = filesetext (SCH.name, FileExt);
FileName = dlgFileSave (tr ("Save Bill Of Material"), FileName);
if (FileName)
{
string a [];
if (!fileglob (a, FileName) || dlgMessageBox (tr ("File '") + FileName +
tr ("' exists\n\nOverwrite?"), tr("+&Yes"), tr("-&No")) == 0)
{
output (FileName, "wt")
{
printf ("%s", MakeList ()); // using "%s" to avoid problems if list contains any '%'
}
}
}
}