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 7 hours 46 minutes ago #19650

  • Roman
  • Roman's Avatar Topic Author
  • Away
  • Junior Member
  • Junior Member
  • Posts: 140
  • Thank you received: 2
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 6 hours 4 minutes ago #19651

  • Matis A.
  • Matis A.'s Avatar
  • Away
  • Moderator
  • Moderator
  • Posts: 1419
  • Thank you received: 225
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

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

  • Page:
  • 1