On Mon, Jan 11, 2016 at 3:56 PM, silvioprog <silviop...@gmail.com> wrote:
> On Mon, Jan 11, 2016 at 3:41 PM, Anthony Walter <sys...@gmail.com> wrote: > >> I believe in Delphi only external functions may use varargs. In your case >> you are declaring a variable, which could be assigned to a local function. >> > > You are right: > [...] Fixed. I just removed the first `;`: === begin code === var FmtStr: function(const fmt: PAnsiChar): PAnsiChar; cdecl varargs; === end code === Now it compiles fine in an original copy of Delphi Seattle and in the FPC from trunk (3.1.1). I'm glad to compile that, but it is very strange, according EMB docs: "The varargs directive works only with external routines and only with the cdecl calling convention.": http://docwiki.embarcadero.com/RADStudio/Seattle/en/Procedures_and_Functions#External_Declarations But I saw many programmers using it in funcs declared as variable: http://www.swissdelphicenter.ch/torry/showcode.php?id=2114 https://github.com/e-tobi/Delphi-Libxml2-XmlTextReader/blob/master/libxml2.pas So I'm going to use it too hehe! :-) -- Silvio Clécio
_______________________________________________ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal