Created an item in the Listbox. I assigned him an onClick handler. in the handler made the creation of a .txt file with the name of the same element.

 void __fastcall TForm1::ListBoxItem2Click(TObject *Sender) { ListBox1->Items->SaveToFile("(ListBox1->Items->Strings[ListBox1->ItemIndex])+".txt"); } 

When compiling for win32 everything works fine. BUT when compiling under android, when you first click on an element (item), this error crashes (photo): enter image description here

But, if I click the next time (and any of the elements of this listbox), all handlers work fine (including this one). Why is that? How to fix it?

  • Does this expression compile "(ListBox1-> Items-> Strings [ListBox1-> ItemIndex]) +". Txt "? There is an odd number of apostrophes in it. - Vlad from Moscow
  • Even, all is correct. This indicates the name of the file. - Max
  • And where is even? I counted three apostrophes. - Vlad from Moscow
  • Oh. This is an error when copying the code to the site - Max

0