Forum > Ported from Delphi/Kylix
tvplanit - how to save an iniDatastore?
wp:
--- Quote from: Nicole on December 16, 2022, 06:11:02 pm ---It shall be "WriteToIni"?
How to call it best?
--- End quote ---
One possibility is to write a class helper for the IniDatastore:
--- Code: Pascal [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---type TVpIniDatastoreHelper = class helper for TVpIniDatastore public procedure WriteIni; end; procedure TVpIniDatastoreHelper.WriteIni;begin WriteToIni;end;
With that your IniDataStore seems to have a new public method WriteIni (note the missing "To"), and you can rewrite the ini file at any time by calling this helper method, for example by means of a button click:
--- Code: Pascal [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---procedure TForm1.Button1Click(Sender: TObject);begin VpIniDatastore1.WriteIni;end;
Nicole:
Thank you so much!!
I have saved your text and it waits for my next programming session of this module.
Navigation
[0] Message Index
[*] Previous page