=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Remitente:    Jim Hall <jh...@freedos.org>
Destinatario: Technical discussion and questions for FreeDOS developers. 
<freedos-devel@lists.sourceforge.net>
Fecha:        miércoles, 14 de septiembre de 2022, 14:00:14
Asunto:       [Freedos-devel] CLS reimplementation (Re: VERIFY reimplementation)
Archivos:     <none>
--====----====----====----====----====----====----====----====----====----===--
On Wed, Sep 14, 2022 at 6:24 AM Javier Gutiérrez Chamorro
<guti.bitacoras....@gmail.com> wrote:
> And now it is the turn of CLS (sorry Jim ;-) It reproduces the same
> CLS.C behaviour, including the redirection detection, but instead of
> a 9,080 bytes CLS.EXE it creates a 380 bytes CLS.COM.
> What I did not like about the original C implementation was the use
> of the non-portable clrscr() which is not available in OpenWatcom. So
> I guess that this ASM implementation would be also more portable.
> It is available at
> https://sourceforge.net/projects/nikkhokkho/files/CLS/


I don't mind. :-) I wrote that version of CLS long ago, back when I
wasn't sure if CLS should be an internal or external command. CLS is
now an internal command, so my original CLS is dead anyway.

With the original external CLS, I made an update that could also set
the text foreground and background colors, but I mainly did this
because rewriting CLS as an external command didn't make much sense if
all it did was clear the screen and reset the cursor. Changing the
colors justified (in my mind) making this an external "extended"
command. I think the usage was like "CLS white on blue" to set the
colors to 7,1 and "CLS bright white on blue" to set the colors to
15,1.

You are right, the original CLS external command used the clrscr()
function from Borland's conio library to clear the screen. I recall
the program detected if the user was on a console, and used clrscr()
to clear the screen - otherwise, it used an ANSI sequence to clear the
screen (such as a terminal). The equivalent console function in
OpenWatcom is _clearscreen(_GCLEARSCREEN) from graph.h. IA-16 GCC has
an i86 library that I believe implements clrscr() as well.

I'm curious: why does your CLS use "-h" for help instead of "/?"


_______________________________________________
Freedos-devel mailing list
Freedos-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/freedos-devel

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
 
 
Dear Jim,
 
There is no practical purpose on my mind, just the challenge of rapidly and 
efficiently convert it. As you said, both CLS and VERIFY are internal commands.
What surprised me about your ANSI fallback is that DOSBox, MS-DOS and DR-DOS 
already work it that way, but not the command console in Windows 11. It seems 
that with time we are losing capabilities instead of gaining.
In fact any argument passed to CLS will trigger the help screen no matter if it 
is -h, /? or whatever. It was simply silly to check for it, since CLS should 
not expect any argument. BTW, your implementation does the same, checking argc 
> 1 which is smart too.
At least in your 2.01 and 2.1 versions there is no possibility of changing 
colors, maybe they were lost in previous versions. But as you said, this does 
not matter, just a curiosity.
 
Kind regards.
_______________________________________________
Freedos-devel mailing list
Freedos-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/freedos-devel

Reply via email to