Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2007-06

strange "with" usage

4 messages · 4 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Unknown author
In a delphi app I came across the following syntax;
    with PropInfo^, PropType^^ do

Which results in a "Error: Illegal qualifier". Has anyone an idea of what is meant here and how to port that to FPC? I'm puzzled.

Darius

Reply by email

Vincent Snijders
to Unknown author
Show quoted text 6 lines
In a delphi app I came across the following syntax; with PropInfo^, PropType^^ do Which results in a "Error: Illegal qualifier". Has anyone an idea of what is meant here and how to port that to FPC? I'm puzzled.

You have to check the definition carefully. IIRC fpc has one indirection less, (giving not exact names, but just to describe the situation): PropType is a a pointer to TPropType in fpc and a pointer to pointer to TPropType in Delphi.

Vincent

Reply by email

Michael Van Canneyt
to Unknown author: In a delphi app I came across the following syntax; with PropInfo^, PropType^^ do Which…
Show quoted text 6 lines
In a delphi app I came across the following syntax; with PropInfo^, PropType^^ do Which results in a "Error: Illegal qualifier". Has anyone an idea of what is meant here and how to port that to FPC? I'm puzzled.

There is an extra (or was it one less ?) dereference needed for PropInfo^, I think. This is a known issue, which we're not going to solve: it has to do with the internal storage of the RTTI information.

People should use the functions in the TypInfo unit to retrieve this information. You can find there what the exact difference is between FPC/Delphi structures. AFAIK there is only 1.

Michael.

Reply by email

memsom
to Unknown author: In a delphi app I came across the following syntax; with PropInfo^, PropType^^ do Which…
Show quoted text 6 lines
In a delphi app I came across the following syntax; with PropInfo^, PropType^^ do Which results in a "Error: Illegal qualifier". Has anyone an idea of what is meant here and how to port that to FPC? I'm puzzled.

with PropInfo^, PropType^^ do [...]

is the same as

with PropInfo^ do begin
  with PropType^^ do begin
    [...]
  end;
end;

but is extremely horrible code. Try changing it to that and any further errors should become clearer.

M

Reply by email