Hey all, can someone please tell me why the script will not continue to report '? "Reported finds = " $finds ?' at the end of the script. At the moment the idea is to match directory names, from a text file. Then report them to $finds. Oh, itsdoes find matches as it also reports while running.

Thanks to the ppls examples I've used so far.

Phoe.

code:
  
cls break on
$file = "archlist.txt"
$countf = 0

$ = open(1,$file)
$line = readline(1)

;start with an initial array size of 5
dim $array[5]
$count = 0

while not @error

;let check to make sure you are not over the current array size,
;if we are increase the array size by 10

if $count = ubound($array)
redim preserve $array[ubound($array)+10]
endif

;add a line to the array
$array[$count] = $line

;increase our counter by 1
$count = $count + 1

;get the next line of text
$line = readline(1)

loop

$ = close(1)

;ok, time to trim back to array size to the actual size of the data.
if $count > 0
redim preserve $array[$count - 1]
else
;hmmm looks like no information was loaded... make sure your file
;is avaliable
$array = ""
endif

;just a simple check to show your data in the array...
for each $clientno in $array
; ? $clientno ?

GOSUB "find_dir"

NEXT

:find_dir
if len($clientno) <> 7
Exit
else
$dirno = $clientno
endif

$dirfnd = dir("c:\tmp\kix2001\clients\"+$dirno+"*")

if ($dirfnd <> ".") And ($dirfnd <> "..") And len($dirfnd); > 7 And GetFileAttr($basedir+"\"+$name) & 16)

? "Directory found: $dirfnd" ?
$finds = $finds+ ", " + $dirfnd
; GOSUB "zip_dir"

else

? "Directory not found: $dirno" ?
; Exit
endif
Return


:zip_dir
$filename = $dirfnd
$basedir="c:\tmp\kix2001\clients"

WHILE ($filename <> "") AND (@error = 0)
IF ($filename <> ".") AND ($filename <> "..")
GOSUB "create_zip"
ENDIF
$filename=Dir()
LOOP
; Exit

:create_zip
$cmd=" wzzip -a -ex -rp "
$cmd=$cmd+' "$basedir\'+LTRIM(RTRIM($filename))+'.zip" "$basedir\'+LTRIM(RTRIM($filename))+'" '
; SHELL '%comspec% /c $cmd ' ; <++++++++
; Return

? "Reported finds = " $finds ?