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 » U++ Library support » ArrayCtrl, HeaderCtrl & GridCtrl » Select Grid Row BY ID
Re: Select Grid Row BY ID [message #48029 is a reply to message #48009] Thu, 11 May 2017 20:17 Go to previous messageGo to previous message
germax is currently offline  germax
Messages: 20
Registered: March 2017
Location: germany
Promising Member
Ah well..
yes, isFinished instead.. with a processEvent... checked (I take notes Very Happy)

The rest Sad
This is just insane....

I tested with such loop:
for (int i = 0; i < grid.GetCount(); i++)
{
	grid.GetRow(i).Bg(LtGray());
	String item = grid(i,5);
	if (ToUpper(TrimBoth(item)).StartsWith("SHIPPING"))
	{
		continue; // skips the SQL query and i gets increased by the for loop
	}
	SQL * Select(SqlAll()).From(Whatever).Where(....);
	if(SQL.Fetch()){//some if then elses again }
}


And "inline" it works, it continues happily and leaves me with the correct iteration of i.

THIS however:
Thread().Run([=] {

for (int i = 0; i < grid.GetCount(); i++)
{
	grid.GetRow(i).Bg(LtGray());
	String item = grid(i,5);
	if (ToUpper(TrimBoth(item)).StartsWith("SHIPPING"))
	{
		continue; // will be ignored for some reason *SHRUGS*
	}
	SQL * Select(SqlAll()).From(Whatever).Where(....);
	if(SQL.Fetch()){//some if then elses again }
}

}

Just ignores the continue, sends an SQL query and as a result produces all kinds of errors
Worse:
correctly instead of a simple continue it holds a rowdelete
if (ToUpper(TrimBoth(item)).StartsWith("SHIPPING"))
{
	grid.Remove(i);
	i--;
	continue;
}

works just nicely
if (ToUpper(TrimBoth(item)).StartsWith("SHIPPING"))
{
	PostCallback([=] { grid.Remove(i); });
	i--;
	continue;
}

removes i-1 instead.
if there is i-1... if i was zero before I get Vcont.h line 84 Assertion Errors
of course (grid.Get(-1) crashes)
as if i is passed as a reference.

You see me completely baffled!

Ah well.. let's see if a while loop is more reliable inside the thread()...
Or do you have another idea?



that other german guy

[Updated on: Thu, 11 May 2017 20:19]

Report message to a moderator

 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Minor "mistake" in <CtrlLib/ArrayCtrl.h>
Next Topic: Insert Ctrl editors in a single row of ArrayCtrl
Goto Forum:
  


Current Time: Mon Apr 29 06:16:10 CEST 2024

Total time taken to generate the page: 0.03445 seconds