Skip to content

Commit 836e390

Browse files
committed
Add suporting of Console App., fix error with procedural type
1 parent 83aa46e commit 836e390

File tree

4 files changed

+17
-4
lines changed

4 files changed

+17
-4
lines changed

AutoProcedureTableGenerator.exe

512 Bytes
Binary file not shown.
512 Bytes
Binary file not shown.

src/Win32/Debug/genTable.dcu

305 Bytes
Binary file not shown.

src/genTable.pas

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -88,19 +88,32 @@ procedure TTableGenForm.btnGenTableClick(Sender: TObject);
8888
StringGrid1.Cells[4,0] := 'Íàçíà÷åíèå ïàðàìåòðà';
8989
for I := 0 to memoInpCode.Lines.Count-1 do
9090
begin
91-
if pos('implementation', memoInpCode.Lines[i]) > 0 then
91+
if (pos('implementation', AnsiLowerCase(memoInpCode.Lines[i])) > 0) or (pos('$APPTYPE CONSOLE', memoInpCode.Lines[i]) > 0) then
9292
begin
9393
isOk := true;
9494
end;
95+
memoInpCode.Lines[i] := trim(memoInpCode.Lines[i]);
9596
b1 := pos('PROCEDURE',AnsiUpperCase(memoInpCode.Lines[i]));
96-
b2 := pos('FUNCTION', memoInpCode.Lines[i]);
97+
b2 := pos('FUNCTION', AnsiUpperCase(memoInpCode.Lines[i]));
98+
9799
if isOk and
98100
( b1 > 0)
99101
or
100102
(b2 > 0) then
101-
begin
103+
begin
102104
curr:= memoInpCode.Lines[i];
103-
curr := trim(curr);
105+
106+
if (b1 > 1) or (b2 > 1) then
107+
begin
108+
if b1 = 0 then
109+
k := b2
110+
else
111+
k := b1;
112+
113+
if pos('=', curr) < k then
114+
continue; // Ïðîöåäóðíûé òèï
115+
end;
116+
104117
if (pos('(', curr) <> 0) and (pos(')', curr) = 0) then
105118
begin
106119
k:=1;

0 commit comments

Comments
 (0)