Rev 747 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 747 | Rev 748 | ||
---|---|---|---|
Line 1... | Line 1... | ||
1 | unit STRLIST; |
1 | unit STRLIST; |
2 | 2 | ||
3 | (************************************************) |
3 | (************************************************) |
4 | (* STRLIST.PAS *) |
4 | (* STRLIST.PAS *) |
5 | (* Author: Daniel Marschall *) |
5 | (* Author: Daniel Marschall *) |
6 | (* Revision: 2022-02-16 *) |
6 | (* Revision: 2022-02-19 *) |
7 | (* License: Apache 2.0 *) |
7 | (* License: Apache 2.0 *) |
8 | (* This file contains: *) |
8 | (* This file contains: *) |
9 | (* - StringList implementation for Turbo Pascal *) |
9 | (* - StringList implementation for Turbo Pascal *) |
10 | (************************************************) |
10 | (************************************************) |
11 | 11 | ||
Line 192... | Line 192... | ||
192 | function ListGetElement(list: PStringList; idx: integer): string; |
192 | function ListGetElement(list: PStringList; idx: integer): string; |
193 | var |
193 | var |
194 | tmp: PStringList; |
194 | tmp: PStringList; |
195 | i: integer; |
195 | i: integer; |
196 | begin |
196 | begin |
197 | if idx < 0 then exit; |
197 | if (idx < 0) or (idx > ListCount(list)-1) then |
- | 198 | begin |
|
198 | if idx > ListCount(list)-1 then exit; |
199 | ListGetElement := ''; |
- | 200 | Exit; |
|
- | 201 | end; |
|
199 | 202 | ||
200 | tmp := list; |
203 | tmp := list; |
201 | i := 0; |
204 | i := 0; |
202 | while i < idx do |
205 | while i < idx do |
203 | begin |
206 | begin |