Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!cis.ohio-state.edu!ucbvax!bloom-beacon!eru!hagbard!sunic!isgate!krafla!einari From: einari@rhi.hi.is (Einar Indridason) Newsgroups: comp.binaries.ibm.pc.d Subject: Re: ALED goes to the wastebasket here in Iceland Message-ID: <3263@krafla.rhi.hi.is> Date: 17 Jun 91 13:58:54 GMT References: <1991Jun15.172306.19724@uwasa.fi> <1991Jun15.222200.26041@cbfsb.att.com> <3259@krafla.rhi.hi.is> Reply-To: einari@rhi.hi.is (Einar Indridason) Organization: University of Iceland (RHI) Lines: 88 Someone sent me mail, asking for a demo for reading the key. Following are a short examples in C. For simplicity I presume that 'getchar' returns 8 bit clean character from the keyboard. Here is a short code fragment in C to read a key from the keyboard: (this is the way it *should* be done) int read_a_key_from_keyboard() { return (getchar()); /* this is ok. It leaves the 8th bit alone */ } Now, here is a fragment that could fit Aled. I am sorry to say that this type of coding is *much* too *much* common: (this is the way it *SHOULD NOT* be done.) int read_a_key_from_keyboard_the_way_the_americans_do_it_bad() { return (getchar() & 0x7f); /* this one is not ok. It masks the */ /* 8th bit off. USELESS to us */ /* Icelanders!!!!!!!! */ } (frisk posted a good list of what should be done for foreign support.) I don't know the article number, but this, at least, is the beginning of programming for foreign countries. -- Internet: einari@rhi.hi.is | "Just give me my command line and drag UUCP: ..!mcsun!isgate!rhi!einari | the GUIs to the waste basket!!!!" Surgeon Generals warning: Masking the 8th bit can seriously damage your brain!! Newsgroups: alt.flame Subject: Re: ALED goes to the wastebasket here in Iceland Summary: Expires: References: <1991Jun15.172306.19724@uwasa.fi> <1991Jun15.222200.26041@cbfsb.att.com> <1991Jun16.004537.21920@uwasa.fi> Sender: Reply-To: einari@rhi.hi.is (Einar Indridason) Followup-To: Distribution: Organization: University of Iceland (RHI) Keywords: Someone sent me mail, asking for a demo for reading the key. Following are a short examples in C. For simplicity I presume that 'getchar' returns 8 bit clean character from the keyboard. Here is a short code fragment in C to read a key from the keyboard: (this is the way it *should* be done) int read_a_key_from_keyboard() { return (getchar()); /* this is ok. It leaves the 8th bit alone */ } Now, here is a fragment that could fit Aled. I am sorry to say that this type of coding is *much* too *much* common: (this is the way it *SHOULD NOT* be done.) int read_a_key_from_keyboard_the_way_the_americans_do_it_bad() { return (getchar() & 0x7f); /* this one is not ok. It masks the */ /* 8th bit off. USELESS to us */ /* Icelanders!!!!!!!! */ } (frisk posted a good list of what should be done for foreign support.) I don't know the article number, but this, at least, is the beginning of programming for foreign countries. -- Internet: einari@rhi.hi.is | "Just give me my command line and drag UUCP: ..!mcsun!isgate!rhi!einari | the GUIs to the waste basket!!!!" Surgeon Generals warning: Masking the 8th bit can seriously damage your brain!!