Hello to everybody,
I need help with the TMemo component. I am creating an import from a CSV file and the output should be a SQL BLOCK statement with INSERTs, which I want to insert into the MEMO component.
EXECUTE BLOCK AS BEGIN
INSERT INTO <table> (<columns>) VALUES (<values>)
INSERT ...
INSERT ...
...
END;
I have two forms created. Form1 contains, among other things, the showSQL button, which is used to launch Form2 with the ShowModal command. There is only a MEMO component on Form2.
For the test, I created a CSV file with 20000 lines. Creating a Stringlist and assigning it to the Form2.MEMO component will be ok. I then run Form2.ShowModal. On first run, Form2 opens fine and there are 20000 rows in MEMO. But when I close Form2 and want to open it again, the program displays an error
"Failed to create win32 control error 0: operation completed successfully."
If the number of source rows is at most 5126, the error will not appear and I can display the second form as many times as I want.
I am attaching a short project with two forms, in which I insert only the text "Number "+<integer variable> into MEMO.
I don't know if I'm making a mistake somewhere or if MEMO is somehow limited by the number of lines.
I use Lazarus version 2.0.10, FPC version 3.2.0, SVN Revision 63526 - on Windows 10