I got the same error - shit. I felt so guilty I set up a test and wrote the whole damn thing so it works. Serves me right for not testing..
Sorry! I'll email it to you... And I see you don't have e-mail. Well then, here it goes again:>>Note:
Appearantly, kix want you to stuff the value of $dirarray[$counter] into a seperate variable before you use it (in a SHELL at least).
So:
$now=$dirarray[$counter]
and THEN
SHELL '%comspec% /c dir /b $now >> $now.txt'
works just fine...
---------------------------------------------
;run the script from the root of your dir-structure
BREAK ON
DIM $dirarray[4]
$dirarray[0]="directory"
$dirarray[1]="directory1"
$dirarray[2]="directory2"
$dirarray[3]="directory3"
$countermax=4 ;(total array + 1)
$counter=0
WHILE $counter<$countermax
$now=$dirarray[$counter]
SHELL '%comspec% /c dir /b $now >> $now.txt'
$counter=$counter+1
LOOP
$counter=0
WHILE $counter<$countermax
GOSUB delroutine
$counter=$counter+1
LOOP
? "Check done"
GET $none
EXIT
;------------------------DELROUTINE---------------------
:delroutine
$now=$dirarray[$counter]
OPEN (6,"$now.txt")
$currentfile=READLINE(6)
WHILE ($currentfile<>"")
$date_old=getfiletime("$now\$currentfile")
$year_old=VAL(substr($date_old,1,4))
$month_old=VAL(substr($date_old,6,2))
$day_old=VAL(substr($date_old,9,2))
IF (VAL(substr(@date,1,4))-$year_old)>0 AND ($month_old<12) GOTO decided ENDIF
IF (VAL(substr(@date,1,4))-$year_old)>0 AND ($month_old=12) AND (@monthno>1) GOTO decided ENDIF
IF ((@monthno-$month_old)>1) GOTO decided ENDIF
IF ((@monthno-$month_old)=1) GOTO decided ENDIF
GOTO endloop
:decided
DEL "$now\$currentfile"
:endloop
$currentfile=READLINE(6)
LOOP
CLOSE (6)
DEL "$now.txt" ;delete the directory-content-file when done.
RETURN
;-------------------------------------------------------------
[This message has been edited by Fuentez (edited 26 July 2000).]