Dear,

It is correct that you trying to catch only the last line of your $tempfile.
This last line is the sum of previous lines.
First we think the same way, but later only we see that you are trying to get
the total amount of files and bytes in specified directory.
We have update our version a little bit.
New version:
code:
 $null=RedirectOutput("c:\kixdebug.txt")
$path="h:\"
$tempfile="c:\00003.tmp"

$lokaal=GetFileVersion("%WINDIR%\Explorer.exe", "Language")
IF ($lokaal = "0413Dutch")
$string="bestand(en)"
ELSE
$string="File(s)"
ENDIF
? "language "+$lokaal+" -> search for "+$string+" in directory "+$path
;
;=== Vang de DIR info op, filter alle regels weg behalve de regels met $String (directory output)
;
SHELL '%comspec% /c dir "$path" /s /a-d /-c | find "$string" >$tempfile'
;
IF (Open(1, $tempfile, 2) = 0)
$line=ReadLine(1)
$prevline=$line
WHILE ($line <> "") AND (@error = 0)
IF (InStr($line,"$string") <> 0)
$prevline=$line
ENDIF
$line=ReadLine(1)
? " line "+$line
? " prevline "+$prevline
LOOP
$=Close(1)
ENDIF
DEL $tempfile
;
? " input "+$prevline
$files=Val(Ltrim(Substr($prevline, 1, InStr($prevline, "f") - 2)))
? " files "+$files
$bytes=Ltrim(Substr($prevline,InStr($prevline,")")+1,Len($prevline)-InStr($prevline,")")-(Len($prevline)-InStr($prevline,"b")+2)))
? " bytes "+$bytes
WHILE (InStr($bytes,",") <> 0)
$bytes=Substr($bytes,1,InStr($bytes,",")-1)+Substr($bytes,InStr($bytes,",")+1,Len($bytes)-InStr($bytes,", ")+1)
? " convert "+$bytes
LOOP
;
;=== Converteer het resultaat naar een integer variable.
;
? " bytes "+Val($bytes)
$homedir_Mbytes=Val($bytes)/1048576
? " MBytes "+$homedir_Mbytes

btw: didn't you get something like
code:
 input          240 file(s)  3,626,893,373 bytes
files 240
bytes 3,626,893,373
convert 3626,893,373
convert 3626893,373
convert 3626893373
bytes -652415

Current version will show
code:
language 0409English -> search for File(s) in directory h:\
line 214 file(s) 34,605,720 bytes
prevline 19 file(s) 3,591,977,164 bytes
line 1 file(s) 27,648 bytes
prevline 214 file(s) 34,605,720 bytes
line 3 file(s) 281,795 bytes
prevline 1 file(s) 27,648 bytes
line 3 file(s) 1,046 bytes
prevline 3 file(s) 281,795 bytes
line 240 file(s) 3,626,893,373 bytes
prevline 3 file(s) 1,046 bytes
line
prevline 240 file(s) 3,626,893,373 bytes
input 240 file(s) 3,626,893,373 bytes
files 240
bytes 3,626,893,373
convert 3626,893,373
convert 3626893,373
convert 3626893373
bytes -668073923
MBytes -637

btw: later we will react on SPLIT function call.

please return the output of file c:\kixdebug.txt on the board.
greetings.

[ 29 May 2002, 15:23: Message edited by: MCA ]
_________________________
email scripting@wanadoo.nl homepage scripting@wanadoo.nl | Links | Summary of Site Site KiXforms FAQ kixtart.org library collection mirror MCA | FAQ & UDF help file UDF kixtart.org library collection mirror MCA | mirror USA | mirror europe UDF scriptlogic library collection UDFs | mirror MCA