Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
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 Go to previous messageGo to previous message
omari is currently offline  omari
Messages: 264
Registered: March 2010
Experienced Member
Hi,

a Ctrl can't passed by value, use reference instead:
	void ExportCSV(T& o)


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.
 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: build methods
Next Topic: StreamRasterEncoder?
Goto Forum:
  


Current Time: Fri Apr 19 17:17:41 CEST 2024

Total time taken to generate the page: 0.04136 seconds