Ian Branch 127 Posted May 21 Hi Team, I have this code in the project file: // Create or open the DBW.ini file oDBWIni := TIniFile.Create('E:\DBiWorkflow\DBW.ini'); try // Read the delimited IP addresses from the 'DBiDashboard' section with 'IPAddresses' identifier sAllowedIPs := oDBWIni.ReadString('DBiDashboard', 'IPAddresses', ''); finally // Free the DBWIni object to release resources oDBWIni.Free; // end; // ShowMessage(sAllowedIPs); // oDBWIni is declared as a TIniFile in the Var. System.IniFiles is in the uses clause. The file is there, the section is there, the identifier is there and there are valid IPs there. But, sAllowedIPs shows nothing. 😞 What have I missed please?  Regards & TIA, Ian Share this post Link to post
Uwe Raabe 2057 Posted May 21 12 minutes ago, Ian Branch said: What have I missed please? Showing the actual content of the DBW.ini file located in E:\DBiWorkflow. Best attach the complete file so we can scan for suspicious characters. Share this post Link to post
Ian Branch 127 Posted May 21 (edited) This is the relevant section. Quote [DBiDashboard] IPAddresses=27.32.138.205,127.0.0.1,255.255.255.255 I can't show the rest of the ini content as there is confidential information in it. Â In another App, albeit in the mainform, I access the data like this: procedure TMainForm.LoadIPMemoFromIni; var DelimitedString: string; LineList: TStringList; begin LineList := TStringList.Create; try DelimitedString := DBWIni.ReadString('DBiDashboard', 'IPAddresses', ''); if DelimitedString <> '' then begin LineList.CommaText := DelimitedString; IPMemo.Lines.Assign(LineList); end; finally LineList.Free; end; end; And it works fine. Here, DBWIni is a TIni component. Edited May 21 by Ian Branch Share this post Link to post
Lajos Juhász 293 Posted May 21 3 minutes ago, Ian Branch said: I can't show the rest of the ini content as there is confidential information in it. I've copied IPADresses you posted and using the i.ReadString('DBiDashboard', 'IPAddresses', '') cannot reproduce your problem. Share this post Link to post
Ian Branch 127 Posted May 21 Oh My! Found it. I really do need to get my eyes rechecked. It wasn't DBWIni.ini, it was DBiWIni.ini. All good now. Thank you for your inputs and apologies for any inconvenience.  Ian 1 Share this post Link to post