Re: [fpc-pascal] Bit manipulation

2006-02-21 Thread Geno Roupsky
it is as simple as this:

function isset(value: dword; bit: byte): boolean;
begin
  result := value and (1 shl pred(bit)) <> 0;
end;2006/2/20, Pianoman <[EMAIL PROTECTED]>:
Hi, I need to know how can I see whether a certain bit of byte/word/dword isset:  or not:function like this would be appreciated:function isset(value: byte word or dword;bit:byte):boolean;for example when i pass the function parrameter a of type word and I want to
see whether the bit 14 is set.RegardsPianoman- Original Message -From: <[EMAIL PROTECTED]>To: <
fpc-pascal@lists.freepascal.org>Sent: Monday, February 20, 2006 12:00 PMSubject: fpc-pascal Digest, Vol 18, Issue 24> Send fpc-pascal mailing list submissions to> 
fpc-pascal@lists.freepascal.org>> To subscribe or unsubscribe via the World Wide Web, visit> http://lists.freepascal.org/mailman/listinfo/fpc-pascal
> or, via email, send a message with subject or body 'help' to> [EMAIL PROTECTED]>> You can reach the person managing the list at
> [EMAIL PROTECTED]>> When replying, please edit your Subject line so it is more specific> than "Re: Contents of fpc-pascal digest..."
>>> Today's Topics:>>1.  Bug in RTL for arm (Koenraad Lelong)>2. Re:  Internal error 200312122 (Koenraad Lelong)>3. Re:  Internal error 200312122 (Peter Vreman)
>4.  How to run FPC 2.x on QNX (Michael M?ller)>5.  RE: tidypas (libtidy) question (Jeff Pohlmeyer)>>> -->
> Message: 1> Date: Sun, 19 Feb 2006 19:04:07 +0100> From: Koenraad Lelong <[EMAIL PROTECTED]>> Subject: [fpc-pascal] Bug in RTL for arm
> To: FPC-Pascal users discussions > Message-ID: <[EMAIL PROTECTED]
>> Content-Type: text/plain; charset=ISO-8859-1; format=flowed>> Hi,> Today I did an update via svn. When I compiled for arm (in the hope that> the bug I encountered a while ago would have disappeared) I found a bug
> in rtl/linux/arm/sysnr.inc :> Const>   syscall_nr_base = syscall_nr_base;> I modified this to :> Const>   syscall_nr_base = $90;> which is similar to fpc 2.0.2. When I compiled this I got my ususal error
:> /home/koenraad/fpc-devel/fpc/compiler/ppcrossarm -Ur -XParm-linux- -Xc> -Xr -Ur -Xs  -n -Fi../inc -Fi../arm -Fi../unix -Fiarm -FE.> -FU/home/koenraad/fpc-devel/fpc/rtl/units/arm-linux -darm -dRELEASE  -Us
> -Sg system.pp> /home/koenraad/fpc-devel/fpc/rtl/units/arm-linux/system.s: Assembler> messages:> /home/koenraad/fpc-devel/fpc/rtl/units/arm-linux/system.s:51368: Error:> unrecognized symbol type ""
> /home/koenraad/fpc-devel/fpc/rtl/units/arm-linux/system.s:51376: Error:> unrecognized symbol type ""> /home/koenraad/fpc-devel/fpc/rtl/units/arm-linux/system.s:51383: Error:> unrecognized symbol type ""
> /home/koenraad/fpc-devel/fpc/rtl/units/arm-linux/system.s:51390: Error:> unrecognized symbol type ""> /home/koenraad/fpc-devel/fpc/rtl/units/arm-linux/system.s:51398: Error:> unrecognized symbol type ""
> /home/koenraad/fpc-devel/fpc/rtl/units/arm-linux/system.s:51406: Error:> unrecognized symbol type ""> /home/koenraad/fpc-devel/fpc/rtl/units/arm-linux/system.s:51414: Error:> unrecognized symbol type ""
> /home/koenraad/fpc-devel/fpc/rtl/units/arm-linux/system.s:51422: Error:> unrecognized symbol type ""> /home/koenraad/fpc-devel/fpc/rtl/units/arm-linux/system.s:51430: Error:> unrecognized symbol type ""
> /home/koenraad/fpc-devel/fpc/rtl/units/arm-linux/system.s:51438: Error:> unrecognized symbol type ""> /home/koenraad/fpc-devel/fpc/rtl/units/arm-linux/system.s:51446: Error:> unrecognized symbol type ""
> /home/koenraad/fpc-devel/fpc/rtl/units/arm-linux/system.s:51454: Error:> unrecognized symbol type ""> /home/koenraad/fpc-devel/fpc/rtl/units/arm-linux/system.s:51462: Error:> unrecognized symbol type ""
> /home/koenraad/fpc-devel/fpc/rtl/units/arm-linux/system.s:51470: Error:> unrecognized symbol type ""> /home/koenraad/fpc-devel/fpc/rtl/units/arm-linux/system.s:51478: Error:> unrecognized symbol type ""
> /home/koenraad/fpc-devel/fpc/rtl/units/arm-linux/system.s:51624: Error:> unrecognized symbol type ""> /home/koenraad/fpc-devel/fpc/rtl/units/arm-linux/system.s:51632: Error:> unrecognized symbol type ""
> /home/koenraad/fpc-devel/fpc/rtl/units/arm-linux/system.s:51640: Error:> unrecognized symbol type ""> /home/koenraad/fpc-devel/fpc/rtl/units/arm-linux/system.s:51648: Error:> unrecognized symbol type ""
> /home/koenraad/fpc-devel/fpc/rtl/units/arm-linux/system.s:51655: Error:> unrecognized symbol type ""> /home/koenraad/fpc-devel/fpc/rtl/units/arm-linux/system.s:51662: Error:> unrecognized symbol type ""
> /home/koenraad/fpc-devel/fpc/rtl/units/arm-linux/system.s:51669: Error:> unrecognized symbol type ""> /home/koenraad/fpc-devel/fpc/rtl/units/arm-linux/system.s:51676: Error:> unrecognized symbol type ""
> /home/koenraad/fpc-devel/fpc/rtl/units/arm-linux/system.s:51683: Error:> unrecognized symbol type ""> /home/koenraad/fpc-devel/fpc/rtl/units/arm-linux/system.s:51690: Error:> unrecognized symbol 

Re: [fpc-pascal] Bit manipulation

2006-02-21 Thread Florian Klaempfl
Geno Roupsky wrote:
> it is as simple as this:
> 
> function isset(value: dword; bit: byte): boolean;
> begin
>   result := value and (1 shl pred(bit)) <> 0;
> end;

Adding inline doesn't hurt speedwise ;)

> 
> 2006/2/20, Pianoman <[EMAIL PROTECTED] >:
> 
> Hi, I need to know how can I see whether a certain bit of
> byte/word/dword is
> set:  or not:
> function like this would be appreciated:
> function isset(value: byte word or dword;bit:byte):boolean;
> for example when i pass the function parrameter a of type word and I
> want to
> see whether the bit 14 is set.
> Regards
> Pianoman
> - Original Message -
> From: <[EMAIL PROTECTED]
> >
> To: < fpc-pascal@lists.freepascal.org
> >
> Sent: Monday, February 20, 2006 12:00 PM
> Subject: fpc-pascal Digest, Vol 18, Issue 24
> 
> 
> > Send fpc-pascal mailing list submissions to
> > fpc-pascal@lists.freepascal.org
> 
> >
> > To subscribe or unsubscribe via the World Wide Web, visit
> > http://lists.freepascal.org/mailman/listinfo/fpc-pascal
> 
> > or, via email, send a message with subject or body 'help' to
> > [EMAIL PROTECTED]
> 
> >
> > You can reach the person managing the list at
> > [EMAIL PROTECTED]
> 
> >
> > When replying, please edit your Subject line so it is more specific
> > than "Re: Contents of fpc-pascal digest..."
> >
> >
> > Today's Topics:
> >
> >1.  Bug in RTL for arm (Koenraad Lelong)
> >2. Re:  Internal error 200312122 (Koenraad Lelong)
> >3. Re:  Internal error 200312122 (Peter Vreman)
> >4.  How to run FPC 2.x on QNX (Michael M?ller)
> >5.  RE: tidypas (libtidy) question (Jeff Pohlmeyer)
> >
> >
> > --
> >
> > Message: 1
> > Date: Sun, 19 Feb 2006 19:04:07 +0100
> > From: Koenraad Lelong <[EMAIL PROTECTED]
> >
> > Subject: [fpc-pascal] Bug in RTL for arm
> > To: FPC-Pascal users discussions  >
> > Message-ID: <[EMAIL PROTECTED]
> >
> > Content-Type: text/plain; charset=ISO-8859-1; format=flowed
> >
> > Hi,
> > Today I did an update via svn. When I compiled for arm (in the
> hope that
> > the bug I encountered a while ago would have disappeared) I found
> a bug
> > in rtl/linux/arm/sysnr.inc :
> > Const
> >   syscall_nr_base = syscall_nr_base;
> > I modified this to :
> > Const
> >   syscall_nr_base = $90;
> > which is similar to fpc 2.0.2. When I compiled this I got my
> ususal error
> :
> > /home/koenraad/fpc-devel/fpc/compiler/ppcrossarm -Ur -XParm-linux- -Xc
> > -Xr -Ur -Xs  -n -Fi../inc -Fi../arm -Fi../unix -Fiarm -FE.
> > -FU/home/koenraad/fpc-devel/fpc/rtl/units/arm-linux -darm
> -dRELEASE  -Us
> > -Sg system.pp
> > /home/koenraad/fpc-devel/fpc/rtl/units/arm-linux/system.s: Assembler
> > messages:
> > /home/koenraad/fpc-devel/fpc/rtl/units/arm-linux/system.s:51368:
> Error:
> > unrecognized symbol type ""
> > /home/koenraad/fpc-devel/fpc/rtl/units/arm-linux/system.s:51376:
> Error:
> > unrecognized symbol type ""
> > /home/koenraad/fpc-devel/fpc/rtl/units/arm-linux/system.s:51383:
> Error:
> > unrecognized symbol type ""
> > /home/koenraad/fpc-devel/fpc/rtl/units/arm-linux/system.s:51390:
> Error:
> > unrecognized symbol type ""
> > /home/koenraad/fpc-devel/fpc/rtl/units/arm-linux/system.s:51398:
> Error:
> > unrecognized symbol type ""
> > /home/koenraad/fpc-devel/fpc/rtl/units/arm-linux/system.s:51406:
> Error:
> > unrecognized symbol type ""
> > /home/koenraad/fpc-devel/fpc/rtl/units/arm-linux/system.s:51414:
> Error:
> > unrecognized symbol type ""
> > /home/koenraad/fpc-devel/fpc/rtl/units/arm-linux/system.s:51422:
> Error:
> > unrecognized symbol type ""
> > /home/koenraad/fpc-devel/fpc/rtl/units/arm-linux/system.s:51430:
> Error:
> > unrecognized symbol type ""
> > /home/koenraad/fpc-devel/fpc/rtl/units/arm-linux/system.s:51438:
> Error:
> > unrecognized symbol type ""
> > /home/koenraad/fpc-devel/fpc/rtl/units/arm-linux/system.s:51446:
> Error:
> > unrecognized symbol type ""
> > /home/koenraad/fpc-devel/fpc/rtl/units/arm-linux/system.s:51454:
> Error:
> > unrecognized symbol type ""
> > /home/koenraad/fpc-devel/fpc/rtl/units/arm-linux/system.s:51462:
> Error:
> > unrecognized symbol type ""
> > /home/koenraad/fpc-devel/fpc/rtl/unit

[fpc-pascal] FOSDEM 2006

2006-02-21 Thread Den Jean
Hi,

is someone going to the FOSDEM 2006 this WE in Brussels ?

http://www.fosdem.org/2006

kind regards,

Den Jean
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Bit manipulation

2006-02-21 Thread Steve Williams

Florian Klaempfl wrote:


Geno Roupsky wrote:
 


it is as simple as this:

function isset(value: dword; bit: byte): boolean;
begin
 result := value and (1 shl pred(bit)) <> 0;
end;
   



Adding inline doesn't hurt speedwise ;)
 



It is also assuming that bit counting starts at 1.  I'd remove the 
'pred' and have bit counting start at zero.


--
Sly



This message and its attachments may contain legally privileged or confidential 
information. This message is intended for the use of the individual or entity 
to which it is addressed. If you are not the addressee indicated in this 
message, or the employee or agent responsible for delivering the message to the 
intended recipient, you may not copy or deliver this message or its attachments 
to anyone. Rather, you should permanently delete this message and its 
attachments and kindly notify the sender by reply e-mail. Any content of this 
message and its attachments, which does not relate to the official business of 
the sending company must be taken not to have been sent or endorsed by the 
sending company or any of its related entities. No warranty is made that the 
e-mail or attachment(s) are free from computer virus or other defect.
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


[fpc-pascal] Get RGB Color with TColor

2006-02-21 Thread Ryo T
How to get Red, Green, Blue value with TColor
(TColorDialog object) in Delphi ?


==
12y0
  The ~'S'~

__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal