Sign in Join

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

Mailing lists / lazarus / 2011-04

How to convert it to FPC/Lazarus

3 messages · 2 people ·

Reply by email Subscribe to this list Your subscription

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

ik

Hello,

I have a Delphi based program that I try to rewrite for Lazarus (The original code is not mine).

There is a code there like so:

type
  TTab = (ttOne, ttTwo, ttThree);
  TTabs = set of TItems;
...
procedure DisplayTabs(Display : TTabs);
var
 i:integer;
begin
 Tabs:=Display;
 for i:=0 to PageControl.PageCount-1 do
begin
  PageControl.Pages[i].TabVisible:= word(Display) and (1 shl i)>0; // how to
make this work ?
 end;
 PageControl.ActivePageIndex:=ord(Display);
end;
...

I rewrote it for the example here,but that's the same code. How can I make it work in FPC+Lazarus ?

Thanks,
Ido
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20110412/ea5fd5a5/attachment.html>

Reply by email

Unknown author
to ik
ik wrote 27 lines
Hello, I have a Delphi based program that I try to rewrite for Lazarus (The original code is not mine). There is a code there like so: type TTab = (ttOne, ttTwo, ttThree); TTabs = set of TItems; ... procedure DisplayTabs(Display : TTabs); var i:integer; begin Tabs:=Display; for i:=0 to PageControl.PageCount-1 do begin PageControl.Pages[i].TabVisible:= word(Display) and (1 shl i)>0; // how to make this work ?
   PageControl.Pages[i].TabVisible:= TTab(I) in Display

Michael.

Reply by email

ik
to Unknown author
Show quoted text 37 lines
On Tue, 12 Apr 2011, ik wrote: Hello, > > I have a Delphi based program that I try to rewrite for Lazarus (The > original code is not mine). > > There is a code there like so: > > type > TTab = (ttOne, ttTwo, ttThree); > > TTabs = set of TItems; > > ... > procedure DisplayTabs(Display : TTabs); > var > > i:integer; > > begin > > Tabs:=Display; > > for i:=0 to PageControl.PageCount-1 do > begin > > PageControl.Pages[i].TabVisible:= word(Display) and (1 shl i)>0; // how > to > make this work ? > PageControl.Pages[i].TabVisible:= TTab(I) in Display

That's more simple :) Thanks.

Michael.
Show quoted text 7 lines
-- _______________________________________________ Lazarus mailing list http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

Ido
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20110412/e1166fcb/attachment.html>

Reply by email