Hi,

I'm not sure this is anything that anybody but me would find
interesting. Still ....

In lieu of %RANDOM% (Win32's CMD) or whatever 4DOS offers, I just now
had to hack up my own stupid way of doing things. Really, the only
reason is to use ANSI escapes in my prompt and change the color
randomly (variety is the spice of life, no?). It's fairly stupid, but
it works. You may or may not want a similar hack in your own stuff
(doubt it, but ...).

Used like this (AUTOEXEC.BAT):

set ME=c:\utils\myprompt.bat
if exist %ME% call %ME%
if not exist %ME% prompt [ FreeDOS ] $p$g
set ME=

(MYPROMPT.BAT):

@echo off

REM ("set /e" only works with FreeCOM 0.84-pre2 and needs %TEMP% set)
REM Also see here if necessary:  http://www.catseye.tc/projects/bef

goto begin

REM rand4.bef
========================================
?1>"0">+# ,# @#"0"<4
>2^3<
<   ^
========================================

:begin
set random=1
if exist c:\utils\rand4.bef set /e random=befi c:\utils\rand4.bef
prompt $e[1;40;3%RANDOM%m[ FreeDOS ] $p$g$e[m
set random=

:end

A better way could definitely be done in a variety of languages
(BWBASIC? DEBUG?). I could probably even whip up a 7-bit ASCII .COM /
textfile that does similar (like I did for VMSCOM.ASM). If a true
random was needed, I imagine FreeCOM internally stuffing into %RANDOM%
(like Win32's CMD does), or using something like "random.com 60" to
find between 1 and 60 and return errorlevel, would suffice for more
general use.

P.S. Oops, forgot about Timo's BAT Tricks FAQ, he probably has a
billion ideas!   ftp://garbo.uwasa.fi/pc/link/tsbat.zip

------------------------------------------------------------------------------
5 Ways to Improve & Secure Unified Communications
Unified Communications promises greater efficiencies for business. UC can 
improve internal communications as well as offer faster, more efficient ways
to interact with customers and streamline customer service. Learn more!
http://www.accelacomm.com/jaw/sfnl/114/51426253/
_______________________________________________
Freedos-devel mailing list
Freedos-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/freedos-devel

Reply via email to