Dear All
Allow me to clarify and restate the problem. I have ripped my audio CDs and made .mp3 files of them. All the mp3 files are stored on the MP3 player. This programme runs from the player when it is plugged into the computer. The purpose of the programme is to write an .m3u playlist file, disconnect the player from the computer and run the playlist file so as to listen to the selected files while driving without having to work the MP3 player while driving.
The button I click is not a BitBtn. It is a FileNameEdit1 from the Misc tab/ribbon. It is clicked and I select a number of files, that are mp3s. Once selected and the file dialogue is closed, the selected paths\filenames are passed to a string. See the code. This works. It has no issues.
procedure TForm1.FileNameEdit1Change(Sender: TObject);
TheFileNames := FileNameEdit1.DialogFiles.Text; // Copy the list of files to string: TheFileNames
FileNameEdit1.DialogFiles.Text := '';
Then a lot of validating is done to that string to make sure the files names end in mp3 and the path\file names consist of 1 byte chars that the mp3 player will read. If the path\file name contains invalid char the the entry in the Play List file will not play. Validated entries are appended to a Play List (.m3u) file. This works.
After making Menu entries that successfully call various BitBtn OnClick events, I made a menu entry to call the OnChange event. The only thing that does not work is this Menu entry called "Append", whose OnClick event calls the FileEdit1Change event. Please see attached PNG. This is the problem. The Menu entry does not work. The FileNameEdit1Change button still works, but not via the menu entry. The Menu Append event OnClick event does not call the FileNameEdit1Change event.
I have not understood most of the comments made so far. Is someone saying that OnChange is the wrong event?
This advice:
Add something like ShowMessage('HERE') to do a sanity check
.
look interesting but I do not know what to do. Add the code where?
Hope that helps to understand.