Article View: borland.public.cppbuilder.nativeapi
Article #6547Re: An stupid question about Set assignation
From: Remy Lebeau (TeamB)
Date: Fri, 29 Apr 2005 18:47
Date: Fri, 29 Apr 2005 18:47
38 lines
2004 bytes
2004 bytes
"Francisco M. Marzoa" <fmmarzoa@softronica.org> wrote in message
news:42725621$1@newsgroups.borland.com...
> if I do something as:
>
> WFlags = [fCTS];
>
> Compiler gives me an error
Of course, because the compiler does not support that use of '[] brackets.
Your use of the '<<' operator is the correct way to go.
> I've used [] because I've been that when I change a property
> of this type on Builder's designer it creates an array like
> [fCTS, fTXEmpty, ...]
That is only for visual display, not for actual coding. Also, Delphi pascal
does use '[]' brackets in certain Set operations, and the VCL itself is
largely written in Delphi, not C++.
> it seems this is not the right manner to assign a value to
> WFlags with '=' operator.
Correct. The '=' operator is only used when assigning one Set to another,
not for assigning individual flags. That is what the '<<' operator is for
instead. For example:
WaitFlags WFlags1;
WaitFlags WFlags2;
// you can use '<<' to assign multiple flags at one time
WFlags1 << fCTS /* << fDSR << fRxFlag << etc... */;
WFlags2 = WFlags1;
Gambit
Technical Details
Message-ID:
<427281ed$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!newshub.sdsu.edu!logbridge.uoregon.edu!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mailReferences:
<42725621$1@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,27158fd1de3e6ba1 X-Google-Attributes: gid10cc67,public X-Google-Language: ENGLISH,ASCII-7-bit From: "Remy Lebeau \(TeamB\)" <no.spam@no.spam.com> Newsgroups: borland.public.cppbuilder.nativeapi References: <42725621$1@newsgroups.borland.com> Subject: Re: An stupid question about Set assignation Date: Fri, 29 Apr 2005 11:47:56 -0700 Lines: 40 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1409 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1409 NNTP-Posting-Host: 68.69.17.41 Message-ID: <427281ed$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1114800621 68.69.17.41 (29 Apr 2005 11:50:21 -0700) Path: arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!newshub.sdsu.edu!logbridge.uoregon.edu!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail