Skip to content

Commit

Permalink
Add suporting of Console App., fix error with procedural type
Browse files Browse the repository at this point in the history
  • Loading branch information
N1ghtF1re committed Mar 8, 2018
1 parent 83aa46e commit 836e390
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 4 deletions.
Binary file modified AutoProcedureTableGenerator.exe
Binary file not shown.
Binary file modified src/Win32/Debug/AutoProcedureTableGenerator.exe
Binary file not shown.
Binary file modified src/Win32/Debug/genTable.dcu
Binary file not shown.
21 changes: 17 additions & 4 deletions src/genTable.pas
Original file line number Diff line number Diff line change
Expand Up @@ -88,19 +88,32 @@ procedure TTableGenForm.btnGenTableClick(Sender: TObject);
StringGrid1.Cells[4,0] := 'Íàçíà÷åíèå ïàðàìåòðà';
for I := 0 to memoInpCode.Lines.Count-1 do
begin
if pos('implementation', memoInpCode.Lines[i]) > 0 then
if (pos('implementation', AnsiLowerCase(memoInpCode.Lines[i])) > 0) or (pos('$APPTYPE CONSOLE', memoInpCode.Lines[i]) > 0) then
begin
isOk := true;
end;
memoInpCode.Lines[i] := trim(memoInpCode.Lines[i]);
b1 := pos('PROCEDURE',AnsiUpperCase(memoInpCode.Lines[i]));
b2 := pos('FUNCTION', memoInpCode.Lines[i]);
b2 := pos('FUNCTION', AnsiUpperCase(memoInpCode.Lines[i]));

if isOk and
( b1 > 0)
or
(b2 > 0) then
begin
begin
curr:= memoInpCode.Lines[i];
curr := trim(curr);

if (b1 > 1) or (b2 > 1) then
begin
if b1 = 0 then
k := b2
else
k := b1;

if pos('=', curr) < k then
continue; // Ïðîöåäóðíûé òèï
end;

if (pos('(', curr) <> 0) and (pos(')', curr) = 0) then
begin
k:=1;
Expand Down

0 comments on commit 836e390

Please sign in to comment.