Category : Utilities for DOS and Windows Machines
Archive   : LET12.ZIP
Filename : DEMO-10.BAT

 
Output of file : DEMO-10.BAT contained in archive : LET12.ZIP
echo Off
If `%Name%' == `' Demo
cls
echo ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»
echo ÚÄ×ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ×Ä¿
echo ³ º Data Formatting: FILL º ³
echo ÀÄ×ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ×ÄÙ
echo ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ
echo ÿ
echo Here's a handy little feature: data formatting.
echo ÿ
echo This is how we do it. Imagine a template, or pattern as we'll
echo call it, which consist of two kinds of characters: fill-characters
echo and "stuff." For example, we have a pattern below:
set Rfill=óóó,óóó,óóó,óóó.óó
echo ÿ
echo %Rfill%
echo ÿ
echo The little less-than-or-equal signs (ó) are fill-characters, and the
echo commas and period are "stuff." Imagine now, that we can fill data
echo into this pattern, in effect replacing the fill-characters with data,
echo but leaving the "stuff." Here: I'll show you. What is your self-
echo estimated value to your employer (this is usually your salary with the
echo decimal point moved a few places to the right) Try to keep it a number
echo less than a million--understatement is the better part of tact.
LET num=(replace (ask "Well? What are you worth? ") "$" "" "," "" " " "")
LET P=(pos num ".")
if %P% == 0 LET num=(concat num "00")
if not %P% == 0 LET num=(replace num "." "")
echo I've doctored that number up so that I can use it: %num%
echo Now, let us fill that number into your pattern and see what we get.
LET result=(fill Rfill (concat " " num))
echo ÿ
echo This gives us the result of "%result%"
echo But wait! We can suppress the "stuff" that shouldn't be there!
echo (I deliberately prevented the suppression to show you how data
echo gets filled.) Any leading commas can be zapped away--
LET dummy=(ask "automatically--press RETURN to go on. ")
LET result=(fill Rfill num " ")
echo ÿ
echo With suppression, we get
echo ÿ
echo "%result%"
echo ÿ
echo You want a floating dollarsign? Ok.
LET result=(fill Rfill num " $")
echo ÿ
echo "%result%"
echo ÿ
echo How about asterisk filling
LET result=(fill Rfill num "*$")
echo ÿ
echo "%result%"
echo ÿ
Echo How's that?
set Result=
set Rfill=
set P=
set num=
pause
DEMO-11


  3 Responses to “Category : Utilities for DOS and Windows Machines
Archive   : LET12.ZIP
Filename : DEMO-10.BAT

  1. Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!

  2. This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.

  3. But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/