[Pas2js] call from external js files

pas2js at gauns.org pas2js at gauns.org
Tue Jun 18 08:28:09 CEST 2019


> You can use (as I proposed originally) an external class definition:
> (see the external name just after the class keyword)

oh sorry, i missed that

> 
> TExternal = class external name 'anonymous'
>    public
>      name : String;
>      function getName : String;
>      procedure log( aMessage : String );
>    end;
> 
> 
> var
>   logger : TExternal; external name 'logger';

would by nice to have it this way, if its possible,
but to have the external declaration two times (class and variable) is 
also ok, just a wish

type
   TExternal = class external name 'logger'
   public
     name : String;
     function getName : String;
     procedure log( aMessage : String );
   end;

var
   ext : TExternal;



thanks michael

cheers
peter



> 
> Michael.
> _______________________________________________
> Pas2js maillist  -  Pas2js at lists.freepascal.org
> https://lists.freepascal.org/cgi-bin/mailman/listinfo/pas2js


More information about the Pas2js mailing list