Recent

Author Topic: [SOLVED] Conflict using With Clause  (Read 1242 times)

flywire

  • Jr. Member
  • **
  • Posts: 85
[SOLVED] Conflict using With Clause
« on: April 13, 2015, 10:16:17 am »
How do I use the length function in this situation?

Code: [Select]
  TTocEntry = packed record
    Name: array[0..8-1] of char;
    NullB: Byte;
    Extension: array[0..3-1] of char;
    NullDW: DWord;
    Offset: DWord;
    Length: DWord;
  end;
...
        with TmpTocEntry do
        begin
         ...;
         // Note: conflict between length function and record field ***
         Extension := MidStr(ExtractFileExt(aDir[i].Name), 2, System.Length(ExtractFileExt(aDir[i].Name)-1));
         ...
        end;
« Last Edit: April 13, 2015, 10:44:11 am by flywire »

marcov

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 8729
  • FPC developer.
Re: Conflict using With Clause
« Reply #1 on: April 13, 2015, 10:23:29 am »
Your code contains the answer: System.length

flywire

  • Jr. Member
  • **
  • Posts: 85
Re: Conflict using With Clause
« Reply #2 on: April 13, 2015, 10:30:09 am »
Extension := MidStr(ExtractFileExt(aDir.Name), 2, System.Length(ExtractFileExt(aDir.Name))-1);

Late at night you are better off just going to bed!  :-[

 

TinyPortal © 2005-2018