ZTree.com  | ZEN  | About...  

 Index   Back

ZB1 worked, SetLocal ENABLEEXTENSIONS and !ANS! question   [Q]

By: Ryan       
Date: Oct 24,2016 at 12:20
In Response to: ZB1 worked, SetLocal ENABLEEXTENSIONS and !ANS! question (Ben Kent)

2. Call a function
---
Set Worker=AAA.EXE
Set Random=%RND%
Set Counter=0
For %%%%V In (%FSPEC%) Do Call :DoFile %%%%V
goto :eof
:DoFile

SET /A Counter+=1
IF %Counter% EQU %Random% Start "" %Worker% "%2:%3\%%%%V"
)
------------------------------------------------------

AA=
For %%%%V In (%FSPEC%) Do Call :DoFile %%%%V

BB=
:DoFile

if there are 200 files in a directory AA= runs 200 files x 2 sec = 400 seconds
until 400 sec is done, AA= will not let ztree go free.

how long is BB=? i am not sure how many lines of ":DoFile" "Call" funtion includes.

SET /A Counter+=1, is it equal to SET /A Counter = Counter + 1 ?

original script is included with the correct indents for an easy recognition, but in graphic form.
[image]

this script runs and looks for a file in about 0.5 sec among 3000 files.
excpet for the directory names with "!"
if there is no easy way to fix k3=!k3!+ 1 kind of things, i will just include "abort" procedure in the script.

unfortunately i use ! as a directory and file group marker or thing everywhere, so that they are always in the 1st line area before the alphabetical orders

this batch script was easy to read and understand until the difficult concept of "variable transfers"
SetLocal ENABLEEXTENSIONS
SetLocal ENABLEDELAYEDEXPANSION

890 views      
Thread locked
 

Messages in this Thread

 
96,637 Postings in 12,231 Threads, 350 registered users, 64 users online (1 registered, 63 guests)
Index | Admin contact |   Forum Time: Mar 29, 2024 - 5:17 am UTC  |  Hits:62,393,431  (8,217 Today )
RSS Feed