It seems simple, but for some reason the problem with the types. There is an img folder / 4 img _ *. Jpg files are stored there. When you click on the button, the image is selected randomly. Here is the code:
procedure TProForm.Button1Click(Sender: TObject); var v:integer; begin v:=Random(4)+1; image1.Picture:='img/img_'+v+'.jpg'; end;
Error: [Pascal Error] Unit2.pas (44): E2010 Incompatible types: 'TPicture' and 'Integer' [Pascal Error] Unit2.pas (45): E2010 Incompatible types: 'string' and 'TPicture'
What is the problem and how to avoid such errors? What type to set for variable v? So that there were no problems?