#1396
|
||||
|
||||
Loading items in combobox from text file
I am trying to load the items in a combobox from a text file but whats it loading is the last line and not all the lines..
Pl help. Thnx in advance.. Code:
var S: String; function GetFileLines(const FileName: string; out Items: string): Boolean; var FileLines: TArrayOfString; LineIndex: Integer; begin Result:= LoadStringsFromFile(FileName, FileLines); if Result then for LineIndex:=0 to (GetArrayLength(FileLines)-1) do Items:= FileLines[LineIndex]; end; Combobox1:= TComboBox.Create(WizardForm); with Combobox1 do begin Parent:=WizardForm; SetBounds(left, Top, Width, Height); Style:=csDropDown; Color:=clWhite; if GetFileLines(ExpandConstant('{src}\Text.ini'), S) then Items.Add(S); end; Last edited by bunti_o4u; 19-06-2020 at 09:12. |
Sponsored Links |
#1397
|
||||
|
||||
Quote:
Code:
procedure GetFileLines(const FileName: string; var Combo: TComboBox); var FileLines: TArrayOfString; LineIndex: Integer; begin if LoadStringsFromFile(FileName, FileLines) then for LineIndex := 0 to GetArrayLength(FileLines) - 1 do Combo.Items.Add(FileLines[LineIndex]); end; Combobox1:= TComboBox.Create(WizardForm); with Combobox1 do begin Parent := WizardForm; SetBounds(left, Top, Width, Height); Style := csDropDown; Color := clWhite; GetFileLines(ExpandConstant('{src}\Text.ini'), Combobox1) end; |
The Following User Says Thank You to Cesar82 For This Useful Post: | ||
bunti_o4u (19-06-2020) |
#1398
|
||||
|
||||
I have done the same but forgot to put var in the procedure
Code:
procedure GetFileLines(const FileName: string; var Combo: TComboBox); I have second Combobox which is dependent on first combobox for its filename. Procedure is generating Combobox1.Items.Text as Line1Line2Line3(...).ini Pl tell me how to fix it.. Code:
Combobox2:= TComboBox.Create(WizardForm); with Combobox2 do begin Parent := WizardForm; SetBounds(left, Top, Width, Height); Style := csDropDown; Color := clWhite; GetFileLines(ExpandConstant('{src}\'+ ComboBox1.Items.Text +'.ini'), Combobox2) end; Last edited by bunti_o4u; 19-06-2020 at 13:52. |
#1399
|
||||
|
||||
Quote:
Code:
var I: Integer Combobox2:= TComboBox.Create(WizardForm); with Combobox2 do begin Parent := WizardForm; SetBounds(left, Top, Width, Height); Style := csDropDown; Color := clWhite; for I := 0 to Combobox1.Items.Count - 1 do GetFileLines(ExpandConstant('{src}\' + ComboBox1.Items.Strings[I]), Combobox2) end; |
The Following User Says Thank You to Cesar82 For This Useful Post: | ||
bunti_o4u (20-06-2020) |
#1400
|
||||
|
||||
Thank you for helping me out..
This code didn't work.. I am trying something else and I don't know whether it would fix it or not.. Pl have a look at the attached script.. |
#1401
|
||||
|
||||
Quote:
I added 2 modes. (I commented on the mode with external functions) |
The Following User Says Thank You to Cesar82 For This Useful Post: | ||
bunti_o4u (20-06-2020) |
#1402
|
||||
|
||||
Quote:
it's working smooth as butter.. |
The Following User Says Thank You to bunti_o4u For This Useful Post: | ||
Cesar82 (20-06-2020) |
#1403
|
||||
|
||||
Hey guys.
Can someone help me with a problem. I was wondering if you have a way to convert hexadecimal Cyrillic characters (string) to a string using only inno setup functions or just the windows API without including additional libraries. Summing up: I would like to convert: C := Chr($05E2); I attached a file with a function that uses this, but I can't get it to work without including an additional library (I don't want to use Libs) If some of the more knowledgeable users can help me, thank you in advance. Please look at the attached code. |
#1404
|
||||
|
||||
Quote:
Chr accepts byte value and returns ASCII value, $0532 is a Word value You must use #$???? For UTF-8 format, example C := #$05E2 Last edited by Razor12911; 21-06-2020 at 03:28. |
#1405
|
||||
|
||||
Quote:
They are Word values. I know that chr only supports Byte and these type of characters are word type. But as in the script example, I need to convert a hexadecimal string read from the inno setup language file and convert it to a string (text). Code:
S1 := '<0420><0443><0441><0441><043A><0438><0439>'; I want to do this using only API or in the script itself if there is im way to do this without external DLL. Please take a look at the script. |
#1406
|
||||
|
||||
Quote:
BTW if you are on discord pl add me (discord id: buntionly4u#4466) Code:
function InitializeSetup(): Boolean; var S1, S2: String; begin S1 := #$0420+#$0443+#$0441+#$0441+#$043A+#$0438+#$0439; MsgBox(S1, mbInformation, MB_OK); end; Last edited by bunti_o4u; 21-06-2020 at 11:43. |
#1407
|
||||
|
||||
Quote:
I get the string using the ISPP by calling the ReadIni function. Check the Russian.isl language language of Inno Setup and try to read the key LanguageName= using GetIniString and try to transform it into text as in your message. Download the ChrW script that you will understand. |
#1408
|
||||
|
||||
Hey guys&girls
I'm looking for a char (preferably) or icon (max 14x14px) to display free/need space, which can be understand in any language (or at least most). Anyone have ideas? I already had looked through windows charmap but can't find anything usefull.
__________________
Haters gonna hate
Last edited by KaktoR; 22-06-2020 at 05:32. |
#1409
|
||||
|
||||
If we want to run any task during installation we can use below command which run the task or other program in a separate window:
Code:
function Exec(const Filename, Params, WorkingDir: String; const ShowCmd: Integer; const Wait: TExecWait; var ResultCode: Integer): Boolean; If yes then pl tell how to do it.. Thanks in advance.. |
#1410
|
|||
|
|||
Quote:
download ISutils and got the CaptureConsole.iss https://www.fileforums.com/showthread.php?t=99835 |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
INNO TROUBLESHOOT - Tutorials and Answers about INNO Setup | REV0 | Conversion Tutorials | 129 | 21-05-2021 05:51 |
INNO TUTORIAL - Using Unicode and ANSI Versions of INNO Setup | REV0 | Conversion Tutorials | 51 | 26-03-2015 06:57 |
Frequently Asked Questions | Joe Forster/STA | PC Games - Frequently Asked Questions | 0 | 29-11-2005 09:48 |