hello.pas 614 B

1234567891011121314151617181920212223242526272829303132333435
  1. unit hello;
  2. {$mode ObjFPC}
  3. {$modeswitch externalclass}
  4. interface
  5. uses
  6. Rtl.WorkerCommands;
  7. Type
  8. TJSHelloCommand = class external name 'Object' (TCustomWorkerCommand)
  9. msg : string;
  10. end;
  11. { TJSHelloCommandHelper }
  12. TJSHelloCommandHelper = class helper (TCustomWorkerCommandHelper) for TJSHelloCommand
  13. class function create(aMessage : String) : TJSHelloCommand; static;
  14. end;
  15. implementation
  16. { TJSHelloCommandHelper }
  17. class function TJSHelloCommandHelper.create(aMessage: String): TJSHelloCommand;
  18. begin
  19. Result:=TJSHelloCommand(createCommand('hello'));
  20. Result.msg:=aMessage;
  21. end;
  22. end.