Menu

Unexpected token near &

Help
2006-09-11
2013-05-23
  • Olivier Monney

    Olivier Monney - 2006-09-11

    I get an error with this message
    "Exception TEParseError unexpected token in factor Near &".
    I use "&" operator to sort a TList. I have to give the address of the function which sorts my list.
    The token "&" looks to be not recognized by the jcf.
    Is it a work around for this problem?
    Thanks in advance

     
    • Anthony Steele

      Anthony Steele - 2006-10-20

      It's possible that there is a problem with this syntax. Can I get a code sample?

       
    • Anthony Steele

      Anthony Steele - 2006-10-20

      The following works fine for me. Is yours more complex?

      unit TestAtParam;

      interface

      implementation

      uses Classes;

      function aCompare(p1, p2: pointer): integer;
      begin
        Result := -1;
      end;

      procedure TestList;
      var
        myList: TList;
      begin
        myList := TList.Create();

        myList.Sort(@aCompare);

      end;

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.