1.

Solve : Loop counter - of sorts...?

Answer»

Once upon a time I knew how to do this...  hope someone here still remembers.

In a batch loop, put a period on the screen and add another after it on the same line every time a loop is executed.  (good for letting people know the *censored* thing is still running...)

I'm USING 98SE DOS - ver 4.1

... my failing memory!   :-/I don't think there is a way to do that ... at least with the native Win98SE commands.  The only native commands that I can think of that will write characters to the screen all force a CRLF at the end of the output, which would prevent the characters from going across the screen.

As I was typing I came up with a couple of ideas, but I doubt they will work.  Let me try a few things, and I'll post back if I come up with anything.I couldn't come up with anything easy, especially in Win98 DOS prompt.  How are you executing your loops (what is the code)?  Maybe I can still come up with something that will work once I see what you are doing.Tx Gary...

I gave it up - had to move on.  I just put an echo statement in prompting the user
to wait until the window closed.  I could write a BASIC program and get the job done,
but I won't do that unless I have trouble with the office help...

 You could have put this in the loop:
cls
print time /t

That would give the user a warm and fuzzy.

Mac
SatTracker,

Instead of putting dots on the screen you can change the window title with the TITLE command.

It has the advantage that even if the window is minimized, the user could still see the title changing in the task bar.  That way you can output the percentage of progress or just a rotating string.

I.e.:
[edit]echo off
set rotate=Running---
for /l %%a in (1,1,100) do (
    call:bannerRotate rotate
    call TITLE Application is %%rotate%%
)
TITLE Application finished
pause
goto:eof


:bannerRotate varref -- rotates TEXT in varref ONE STEP and updates title
... here goes the rotate function from http://www.dostips.com/DtCodeCmdLib.php#bannerRotate
EXIT /b %ERRORLEVEL%[/edit]

Within the loop the window title will change:

Application is Running---
Application is unning---R
Application is nning---Ru
Application is ning---Run
Application is ing---Runn
Application is g---Runnin
Application is ---Running
Application is --Running-
Application is -Running--
Application is Running---

Try it out, it's fun  If I run
echo.off
it prints the word "off"
I have to use
echo off

DosItHelp: SatTracksr states that he is using the DOS that comes with Win98 SE, which I don't think supports some of the commands in your code.



Discussion

No Comment Found