Welcome, Guest
Username: Password: Remember me
General Forum discussions that don't fit in any of the other specific forum categories, help etc.
  • Page:
  • 1

TOPIC:

Аnonymous procedures and functions 2 weeks 6 days ago #19650

  • Roman
  • Roman's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
  • Posts: 144
  • Thank you received: 3
Does the CT 8.9 and it's FPC support anonymous procedures and functions?

The code CLASSES.PAS contains the type TThreadProcedure = reference to procedure, but attempting to declare a variable of type "reference to procedure" generates an error. Also, code containing anonymous procedures fails to compile, even though, according to the FPC version, it should support this.

What's the verdict?

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

Аnonymous procedures and functions 2 weeks 6 days ago #19651

  • Matis A.
  • Matis A.'s Avatar
  • Offline
  • Moderator
  • Moderator
  • Posts: 1423
  • Thank you received: 228
Yes Sir
CT 9.0 support anonymous procedures and functions.
with

{$MODE DELPHI}
{$MODESWITCH ANONYMOUSFUNCTIONS}

you can use and :
{$MODESWITCH FUNCTIONREFERENCES}
{$MODESWITCH UNICODESTRINGS}   
{$ModeSwitch ADVANCEDRECORDS}  
{$ModeSwitch TYPEHELPERS}
{$ModeSwitch NESTEDPROCVARS}

For sample look at 
typhon\components\packages_pl\pl_Skia\source\libskiaobj.pas ### at line: 271
typhon\components\packages_pl\pl_Tensorium\source\ntensors.pas ### at line: 212


 
PilotLogic Core Programmer
The following user(s) said Thank You: Roman

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

Аnonymous procedures and functions 2 weeks 5 days ago #19653

  • Roman
  • Roman's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
  • Posts: 144
  • Thank you received: 3
Thank you very much, sir!
It works in version 8.9 too:

{$mode ObjFPC}{$H+}
{$MODESWITCH ANONYMOUSFUNCTIONS}
{$MODESWITCH FUNCTIONREFERENCES}
 

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

Last edit: by Roman.
  • Page:
  • 1