Home » Community » Newbie corner » Passing an ArrayCtrl / SqlArray to a function template
Re: Passing an ArrayCtrl / SqlArray to a function template [message #49281 is a reply to message #49276] |
Mon, 15 January 2018 14:13 |
omari
Messages: 264 Registered: March 2010
|
Experienced Member |
|
|
Hi,
a Ctrl can't passed by value, use reference instead:
PS: think about using GetDesktopFolder ()
template <class T>
void ExportCSV(T& o)
{
String filename = "";
FileSel fs;
fs.Type("CSV", "*.csv");
fs.PreSelect(GetDesktopFolder ());
if(!fs.ExecuteSaveAs()) return;
filename = fs;
SaveFile(filename, "Prova");
FileOut out(filename);
if(!out) {
Exclamation(t_("Failed opening ") + filename);
return;
}
out.Put(o.AsCsv());
}
regards
omari.
|
|
|
Goto Forum:
Current Time: Fri Apr 19 17:17:41 CEST 2024
Total time taken to generate the page: 0.04136 seconds
|