Sign in Join

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

Mailing lists / fpc-pascal / 2010-10

Erorr: Illegal type conversion: "Set Of ShortInt" to "LongInt"

3 messages · 2 people ·

Reply by email Subscribe to this list Your subscription

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

Roland Turcan

Hello FPC-Pascal users discussions!

I have this conversion:

type TWordSet = set of 0..15;
     PWordSet = ^TWordSet;
var  btn: TMsgDlgButtons;
begin
  ...
  Integer(PWordSet(@btn)^) := Params[0]; // Params is Variant
  ...
end;

With FPC 2.4 it is OK, but up-to-date FPC SVN reports error in subject.

Is it a bug or it needs different conversion.

How can I fix it?

Thanks.

Roland Turcan
to Jonas Maebe

Thanks for fast and helpful answer. It works fine.

TRoland;

<<< 08.10.2010 10:41 - Jonas Maebe "" >>>

Roland Turcan wrote 18 lines
> I have this conversion: > > type TWordSet = set of 0..15; > PWordSet = ^TWordSet; > > var btn: TMsgDlgButtons; > > begin > ... > Integer(PWordSet(@btn)^) := Params[0]; // Params is Variant > ... > end; > > > With FPC 2.4 it is OK, but up-to-date FPC SVN reports error in > subject. > > Is it a bug or it needs different conversion.

JM> http://wiki.freepascal.org/User_Changes_Trunk#Sizes_of_sets_in_TP.2FDelphi_mode

JM> Jonas