Tell me how to combine the two procedures or convert one procedure into a function so that from the first procedure (function) pass the value to the second.
Function TForm1.Button1Click(Sender: TObject); var a , b : string; i : integer; begin a := Edit1.Text; b := Edit2.Text; i := Pos (b, a); ShowMessage(IntToStr(i)); end; procedure TForm1.Button2Click(Sender: TObject); var a : string; caunt : integer; begin a := Edit1.Text; caunt := Length(a); Delete (a, 5, caunt); ShowMessage (a); end; I need to insert the variable i from the first procedure into the second procedure Delete (a, 5, caunt); instead of "5" .
Screen:
