With the help of the Edit component, enter the words into the ListBox components: in the first one - “I”, “I can”, “write”, “any”, “program”; in the second - “Hacker”, “all”, “programs”, “remake”, “seeks”. Using the code, connect both ListBox components to each other so that when you select any order of the word in one, it will lead to the choice of the same order of the word in the other component, and both of these words will appear in the Memo component (on a new line).

  • one
    What else go ** s are prescribing Delphi exams - have they gone crazy? This is a dead tongue! - Barmaley
  • 3
    @Barmaley Your comment upsets Skype. developers Skype. - Costantino Rupert
  • I always suspected that something was wrong with Skype :) - Barmaley
  • one
    @Barmaley, you must have been deceived. According to the rating over the past year, according to some data, he even grew in popularity. See here - Dex
  • @Dex, TIOBE has a somewhat dubious evaluation method. Most likely, the "popularity" of them clocked up a small influx of noobs, flown on RAD-sugar, while loyal users gradually dumped. - karmadro4 2:41 pm

1 answer 1

Edit :

 Edit.Text := someVar; // пишем someVar в Edit someVar := Edit.Text; // читаем с Edit в someVar 

At ListBox 'a:

 ListBox.Add(someVar); // добавление нового элемента с текстом someVar selectedItem := ListBox.ItemIndex; // № выбранного элемента (начиная с нуля) someVar := ListBox.Items[selectedItem]; // значение элемента selectedItem 

At Memo :

 Memo.Add(someVar); // добавление новой строчки с текстом someVar someVar := Memo.Lines[lineIndex]; // значение строки lineIndex someVar := Memo.Text; // читаем весь текст с Memo в someVar Memo.Text := someVar; // записываем someVar в Memo (перезапишется всё) 

If you need the current line in Memo , then you need to look towards CaretPos .

And prepare a ready-made solution for yourself - this will help not to forget everything in the exam. Good luck!

  • 2
    Do not feed, you take away the bread from teachers and create unnecessary work to personnel departments. - karmadro4
  • 2
    Well, I will not :) - xEdelweiss