🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.nativeapi
Article #6251

Re: How can i set the Parity Bit to 0 or 1 as i want ?

#6251
From: Bob Gonder
Date: Mon, 30 May 2005 14:50
22 lines
1799 bytes
Ramy wrote:

>But you did not answer my question - 
>
>Please show me one code for setting the parity bit to '1', and
>another code for setting the parity bit to '0', thanks.

To set the parity bit so it is a 1 for every chaaracter, use
MARKPARITY

To set the parity bit so it is a  0 for every character, use
SPACEPARITY.

To automatically set the number of 1 bits so there is always an odd
number, use ODDPARITY (Of the 9 totalt bits (8 data + 1parity),there
will be an odd number of 1 bits).

To automatically set the number of 1 bits so there is always an even
number, use EVENPARITY (Of the 9 totalt bits (8 data + 1parity),there
will be an even number of 1 bits).

Use SetCommState() with the properly modified DCB.
Technical Details
Message-ID: <lk9m91l862puqvbgjk39j2e2gb7i874rr5@4ax.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!news.glorb.com!news-out.nntp.be!propagator2-sterling.newsfeeds.com!in.nntp.be!caladan.landsraad.net!newsgroups.borland.com!not-for-mail
References: <4299b415$1@newsgroups.borland.com> <79sj91p7a1ob3jrc8ih4id3u2fdjpm7u4v@4ax.com> <429abd09$1@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,cb603903b4ecd1d3
X-Google-Attributes: gid10cc67,public
X-Google-Language: ENGLISH,ASCII-7-bit
From: Bob Gonder <notbg@notmindspring.invalid>
Newsgroups: borland.public.cppbuilder.nativeapi
Subject: Re: How can i set the Parity Bit to 0 or 1 as i want ? 
Date: Mon, 30 May 2005 07:50:39 -0700
Organization: MindSpring Enterprises, Inc.
Reply-To: notbg@notmindspring.invalid
Message-ID: <lk9m91l862puqvbgjk39j2e2gb7i874rr5@4ax.com>
References: <4299b415$1@newsgroups.borland.com> <79sj91p7a1ob3jrc8ih4id3u2fdjpm7u4v@4ax.com> <429abd09$1@newsgroups.borland.com>
X-Newsreader: Forte Agent 1.93/32.576 English (American)
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: 67.77.41.8
X-Trace: newsgroups.borland.com 1117464637 67.77.41.8 (30 May 2005 07:50:37 -0700)
Lines: 24
Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!news.glorb.com!news-out.nntp.be!propagator2-sterling.newsfeeds.com!in.nntp.be!caladan.landsraad.net!newsgroups.borland.com!not-for-mail