Am crating abit of code to save and add a menuitem to main menu but am having a small problem when reloading the saved lobby.dat file
when its saved it should be save just click the lobby name is below
Support Group Lobby=56
but it keeps thinking the space is a new line and saves like below.
Support
Group
Lobby=56
if FileExists(DataFolder + '\lobbies.dat') then
begin
sl := TStringList.Create;
sl.LoadFromFile(DataFolder + '\lobbies.dat');
//
NewItem := TMenuItem.Create(Self);
NewItem.Caption := LobbyName;
NewItem.Tag := StrToInt(LobbyID);
NewItem.OnClick := GoToLobbyClick;
//
MainMenu.Items.Items[2].Items[0].Add(NewItem);
//
sl.Duplicates := dupIgnore;
sl.CommaText := NewItem.Caption+'='+IntToStr(NewItem.Tag);
sl.SaveToFile(DataFolder + '\lobbies.dat');
sl.Free;
end;
any ideas thanks