🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: microsoft.public.vc.language
Article #11

Re: choiceyn: cut down choice command, use of sleep, kbhit and getch

#11
From: Frank Hickman
Date: Tue, 13 Jan 2004 08:53
72 lines
4552 bytes
Yes, there are some tricks you can use to shrink the executable.  I don't
have my cheat sheet handy but you can probably find it in a google search.
I wasn't suggesting that you use the special keys, but you should test the
condition because in certain circumstances the second key code may be a y or
n and perhaps cause problems.  I used to use .bat and .cmd files allot in my
day to day operations, then I started messing around with scripting.  It's
definitely more powerful.

--
Frank

"Hal Styli" <no_spam@all> wrote in message news:4003a1fc_5@127.0.0.1...
> "Frank Hickman" <fhickman_nosp@m_noblesoft.com> wrote in message
> news:yJOdnaEvW6CsFZ7d4p2dnA@comcast.com...
> > Coming along, one thing sticks out though...in your yn() function your
> still
> > not handling special keys.  Run it and try pressing F1, you should hear
> two
> > beeps.  This is because getch() will return zero or 0xE0 for special
keys
> in
> > which case getch() must be called again to get the extended key code.
> >
> > --
> > Frank
> >
> <<>>
>
> Thanks Frank,
>
> My version of CHOICE.COM on win98 gives 2 beeps when F1 is pressed, so I
> think  I'll leave it unless you think I should be doing something special
> with the special keys which I could put in as a non-standard extension.
>
> No promises but Im close to a version 0.5 of  a full blown choice command
> and would prefer to add no more features unless absolutely necessary to
keep
> maintenance  time to a minimum. I just wanted to port my bat files from 98
> to xp and be confident that I would have the choice command available, as
> well as humour myself with some C. I have seen a version in assembler on
> google but no source was available.
>
> Its gonna be 5-10 pages of code unless I have really underestimated how to
> properly check parameters. At this sort of size, I think its too small to
> stick on sourceforge but I would like to make it available as open source
> and generate more interest and testing as I have had many queries about
> where it has gone in xp. Is there an appropriate site you could reccomend
?
>
> How about reducing its size? If I could get it down to a couple of kb I
> would be tempted to stay with C for a final version.
>
> Obvious ideas are:-
> a) rewrite in assembler - which appeals to me since its an opportunity to
> learn more assembler too. I guess I could start with the assembler out put
> you can get from the compiler or keep hunting for an open source file as a
> starting point. Anyway thats for another day and another newsgroup.
> b) use all size optimization flags on compile
> c) do some sort of squeeze and remove debug info
> d) use some neat tricks that strip out unused code within these large exe
> files. Im guessing there are some neat tricks!
>
> Any thoughts?
> Hal.
>
>
>
>
>
>
>
>
Technical Details
Message-ID: <ofCdnf-Ex48ELJ7dRVn-hg@comcast.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!newshosting.com!nx02.iad01.newshosting.com!216.196.98.140.MISMATCH!border1.nntp.ash.giganews.com!border2.nntp.sjc.giganews.com!border1.nntp.sjc.giganews.com!nntp.giganews.com!local1.nntp.sjc.giganews.com!nntp.comcast.com!news.comcast.com.POSTED!not-for-mail
References: <4002d4eb_5@127.0.0.1> <uIWdnZPEO6ofaJ_dRVn-ig@comcast.com> <4003717f_5@127.0.0.1> <yJOdnaEvW6CsFZ7d4p2dnA@comcast.com> <4003a1fc_5@127.0.0.1>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f8d38,6ae23aa1a5869fb6
X-Google-Attributes: gidf8d38,public
X-Google-Thread: f7a51,6ae23aa1a5869fb6
X-Google-Attributes: gidf7a51,public
X-Google-ArrivalTime: 2004-01-13 00:51:41 PST
Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!newshosting.com!nx02.iad01.newshosting.com!216.196.98.140.MISMATCH!border1.nntp.ash.giganews.com!border2.nntp.sjc.giganews.com!border1.nntp.sjc.giganews.com!nntp.giganews.com!local1.nntp.sjc.giganews.com!nntp.comcast.com!news.comcast.com.POSTED!not-for-mail
NNTP-Posting-Date: Tue, 13 Jan 2004 02:51:37 -0600
From: "Frank Hickman" <fhickman_nosp@m_noblesoft.com>
Newsgroups: microsoft.public.vc.language,borland.public.cpp.language
References: <4002d4eb_5@127.0.0.1> <uIWdnZPEO6ofaJ_dRVn-ig@comcast.com> <4003717f_5@127.0.0.1> <yJOdnaEvW6CsFZ7d4p2dnA@comcast.com> <4003a1fc_5@127.0.0.1>
Subject: Re: choiceyn: cut down choice command, use of sleep, kbhit and getch
Date: Tue, 13 Jan 2004 03:53:13 -0500
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
Message-ID: <ofCdnf-Ex48ELJ7dRVn-hg@comcast.com>
Lines: 74
NNTP-Posting-Host: 68.55.155.67
X-Trace: sv3-A0pwoc1c7vY5cPoFWxtyjunEdrY7UeEScWlOACxatKO5sA7gWWUuvB2u0ef48SjPpLPYaknWQXI0qJy!f4wOiPQPLpkl7BW2cqmIfCiC0mgHNqPbfHgm1LzgK/EuI/9m5ixDnTwp5sVI
X-Complaints-To: abuse@comcast.net
X-DMCA-Complaints-To: dmca@comcast.net
X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers
X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly
X-Postfilter: 1.1