inno setup - Load text from INI file -
i want load text external ini file tricheditviewer
, don't know how. here code far (see ch_toolbar.rtftext):
{ch_toolbar} ch_toolbar := tricheditviewer.create(sppage); ch_toolbar.parent := sppage.surface; ch_toolbar.left := scalex(0); ch_toolbar.top := title.top + title.height + 10 ; ch_toolbar.width := scalex(480); ch_toolbar.height := scaley(80); ch_toolbar.taborder := 1; ch_toolbar.font.name := 'verdana'; ch_toolbar.color := -16777211; ch_toolbar.scrollbars := ssvertical; ch_toolbar.rtftext := expandconstant(#readini("setuppages", "setupvalues", "speulatext", "")) ;
how insertspeulatext
value in ch_toolbar.rtftext
?
#readini
executed @ compile time inserts long (unquoted) string literal.
if want load @ run time, use getinistring()
function:
ch_toolbar.rtftext := getinistring('setupvalues', 'speulatext', '', 'setuppages');
(setuppages
file name in both cases)
note ini strings have limited length , can't contain new line characters ini file bad choice this.
alternatively, can load rtf or text file directly:
extracttemporaryfile('lgpl-3.0.txt'); loadstringfromfile(expandconstant('{tmp}/lgpl-3.0.txt'), lgpltext); lgplpage.richeditviewer.rtftext := lgpltext;
Comments
Post a Comment