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 » Problem loading very large data files (The system hangs up when loading data from large files.)
Re: Problem loading very large data files [message #61458 is a reply to message #61452] Sat, 15 February 2025 16:14 Go to previous messageGo to previous message
koldo is currently offline  koldo
Messages: 3443
Registered: August 2008
Senior Veteran
Hi DMStevenson

You haven't done badly, but I'm including your modified code to be more similar to how I would have done it.
(remember to use the Forum {...} option to include code)

#include <CtrlLib/CtrlLib.h>

using namespace Upp;

struct WindowType : TopWindow {
	Button button;
	String FileName;
	DocEdit memo;
	//Progress progress1;
	//Vector<String> DataLines;
	
	void ReadFile(String file_name) {
		String line;
		FileIn infile;
		if (infile.Open(file_name)) //{
			memo.Load(infile);
			//while(!infile.IsEof()) {
			//	line = infile.GetLine();
			//	memo.Append(line);
			//	memo.Append("\n");
			//	DataLines.Add(line);
			//}
		//}
		//infile.Close();
	}
	
	WindowType()
	{
		Title("File Read");
		button << [=] {
			FileName = SelectFileOpen("All Files\t*.*");
			ReadFile(FileName); };
		button.SetLabel("Get File");
		Add(button.LeftPos(10, 60).TopPos(10, 30));
		Add(memo.LeftPos(10, 680).TopPos(50, 430));
	}
};

GUI_APP_MAIN
{
	WindowType app;
	app.SetRect(0,0,700,500);
	app.Run();
}


Best regards
IƱaki
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Getting Started U++ Framework examples?
Next Topic: Just a simple hello u++
Goto Forum:
  


Current Time: Thu Aug 07 20:42:47 CEST 2025

Total time taken to generate the page: 0.05731 seconds