When writing external classes there will be situations where a function or field name collides with object-pascal reserved words. The good news is that you can use whatever name you like if you provide an external keyword inside the definition itself. For example, let's say an external object has a method called "end". This is a reserved word in object-pascal so obviously a 1:1 translation will not compile. In such cases just use a more suitable name for the pascal side, and inform the compiler what name it should use when compiling instead, like this:


JSomeObject = class external

 function Quit; external "end";

end;


Much like in Delphi and Freepascal you can also prefix properties and fields with "&" to avoid such issues, but it's nice to have options for different situations.