Article View: borland.public.cppbuilder.nativeapi
Article #6544An stupid question about Set assignation
From: Francisco M. Marzoa
Date: Fri, 29 Apr 2005 15:42
Date: Fri, 29 Apr 2005 15:42
33 lines
1858 bytes
1858 bytes
Hi,
I want to assing a value to a Set variable but as a whole, not just add
a flag using '<<'. The operator '=' seems to be overloaded for Set
types, but I don't know how to use it.
Some illustrative code:
enum TWaitFlags {fBreak=0, fCTS, fDSR, fErr, fRing, fRLSD,
fRxChar, fRxFlag, fTxEmpty};
typedef Set<TWaitFlags, fBreak, fTxEmpty> WaitFlags;
Now, I've a variable of type WaitFlags, lets say:
WaitFlags WFlags;
If I do in example:
WFlags << fCTS;
It seems to work fine, at least it compiles, but if I do something as:
WFlags = [fCTS];
Compiler gives me an error. 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, ...] and so on for those values that are true, but
it seems this is not the right manner to assign a value to WFlags with
'=' operator.
Is there another way?
TIA.
Technical Details
Message-ID:
<42725621$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!news.glorb.com!news.moat.net!news-out.newsgroups.com!propagator2-sterling.newsfeeds.com!news-in.newsfeeds.com!in.nntp.be!caladan.landsraad.net!newsgroups.borland.com!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,27158fd1de3e6ba1,start X-Google-Attributes: gid10cc67,public X-Google-Language: ENGLISH,ASCII-7-bit Date: Fri, 29 Apr 2005 17:42:41 +0200 From: "Francisco M. Marzoa" <fmmarzoa@softronica.org> User-Agent: Mozilla Thunderbird 1.0 (Windows/20041206) X-Accept-Language: en-us, en MIME-Version: 1.0 Newsgroups: borland.public.cppbuilder.nativeapi Subject: An stupid question about Set assignation Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit NNTP-Posting-Host: 213.4.20.55 Message-ID: <42725621$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1114789409 213.4.20.55 (29 Apr 2005 08:43:29 -0700) Lines: 34 Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!news.glorb.com!news.moat.net!news-out.newsgroups.com!propagator2-sterling.newsfeeds.com!news-in.newsfeeds.com!in.nntp.be!caladan.landsraad.net!newsgroups.borland.com!not-for-mail