Welcome, Guest
Username: Password: Remember me
General discussions, feature requests for CodeTyphon Project and discussions that don't fit in any of the other specific CodeTyphon forum categories.
  • Page:
  • 1

TOPIC:

About a FP's TThread's Problem on CT4.8 10 years 5 months ago #5565

  • goldqq
  • goldqq's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
  • Posts: 28
  • Thank you received: 0
var
AThread: TThread;
begin
AThread := TThread.CreateAnonymousThread(
procedure
var
i: integer;
begin
for i := 0 to 110 do
ListBox.Items.Add('i --> ' + IntToStr(i));
end
);
end;

this is a very simpled code, but CT compile error. why?

this is compile error info:
main.pas(82,5) Error: Illegal expression
main.pas(82,5) Fatal: Syntax error, ")" expected but "VAR" found

thank you!

Please Log in or Create an account to join the conversation.

About a FP's TThread's Problem on CT4.8 10 years 5 months ago #5566

  • goldqq
  • goldqq's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
  • Posts: 28
  • Thank you received: 0
var
AThread: TThread;
begin
AThread := TThread.CreateAnonymousThread(
procedure
var
i: integer;
begin
for i := 0 to 110 do
ListBox.Items.Add('i --> ' + IntToStr(i));
end
);
AThread.FreeOnTerminate := True;
AThread.start;
end;

this is a very simpled code, but CT compile error. why?

this is compile error info:
main.pas(82,5) Error: Illegal expression
main.pas(82,5) Fatal: Syntax error, ")" expected but "VAR" found

thank you!

Please Log in or Create an account to join the conversation.

About a FP's TThread's Problem on CT4.8 10 years 5 months ago #5567

  • goldqq
  • goldqq's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
  • Posts: 28
  • Thank you received: 0
CT/FreePascal non-support Anonymous functions ?

Please Log in or Create an account to join the conversation.

About a FP's TThread's Problem on CT4.8 10 years 5 months ago #5571

  • XANDR
  • XANDR's Avatar
  • Visitor
  • Visitor
Yes, Free pascal does not support the anonymous functions :-(

Please Log in or Create an account to join the conversation.

  • Page:
  • 1