Member_2_7965240
asked on
Delphi: Android software strange behaviour
Hello,
I have and Android multiplatform program written in Delphi Seattle.
I process a query like this (simplified version):
Then I changed it to this:
After this, only the first record was processed! The same code in Vcl (Windows) works perfectly.
Then I tried with a thread:
After this, it processed again all the records but the MyQuery2 insert actually didn't happen.
Then I tried "MyMemo.Lines.Add( 'xxx'); instead of MyQuery2 and again it processed the first record only:
What is weird for me that it seems to me that sometimes Android doesn't process the commands sequentially.
What can I do? Is there a "rule book" when Android decides when not to "take care" of my next command line?
Thank you very much.
I have and Android multiplatform program written in Delphi Seattle.
I process a query like this (simplified version):
While not MyQuery.Eof Do
Begin
MyProcedure(MyQuery.FieldByName('Field1').AsString );
MyQuery.Next;
End;
This worked well, it processed every record.Then I changed it to this:
While not MyQuery.Eof Do
Begin
MyProcedure(MyQuery.FieldByName('Field1').AsString );
MyQuery2.Sql.Text := 'Insert into ....';
MyQuery2.Execute;
MyQuery.Next;
End;
After this, only the first record was processed! The same code in Vcl (Windows) works perfectly.
Then I tried with a thread:
While not MyQuery.Eof Do
Begin
MyProcedure(MyQuery.FieldByName('Field1').AsString );
MyQuery2.Sql.Text := 'Insert into ....';
T := TTask.Run (
procedure
begin
MyQuery2.Execute;
end);
MyQuery.Next;
End;
After this, it processed again all the records but the MyQuery2 insert actually didn't happen.
Then I tried "MyMemo.Lines.Add( 'xxx'); instead of MyQuery2 and again it processed the first record only:
While not MyQuery.Eof Do
Begin
MyProcedure(MyQuery.FieldByName('Field1').AsString );
MyMemo.Lines.Add( 'xxx');
MyQuery.Next;
End;
What is weird for me that it seems to me that sometimes Android doesn't process the commands sequentially.
What can I do? Is there a "rule book" when Android decides when not to "take care" of my next command line?
Thank you very much.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.