variable in subroutine
variable in subroutine
- Subject: variable in subroutine
- From: Alberto Salvagnini <email@hidden>
- Date: Mon, 09 Jul 2001 12:46:48 +0200
Hi all,
I wrote the following script to get every folder and every file of a
selected volume/folder.
This works fine, if I watch the script working it finds everything in
every folder and subfolder, but
I can't get the total number of files and folders...
TheFiles and TheFolders return only the number of files and folders on
the first level.
If I call the subroutine from within itself at that moment the value of
TheFolders and TheFiles
should be the current value or not?
Some Suggestion?
Greetings from rainy Hamburg :)
Alberto
copy (choose folder) as string to VolumeToCheck
copy 0 to NumberOfFiles
copy 0 to NumberOfFolders
FindFolder(VolumeToCheck, NumberOfFiles, NumberOfFolders)
--copy NumberOfFiles & " " & NumberOfFolders to x
on FindFolder(currentFolder, TheFiles, TheFolders)
copy (list folder currentFolder without invisibles) to
itemsInCurrentFolder --zeigt alle items in der liste
repeat with currentItem in itemsInCurrentFolder
if folder of (info for (currentFolder & currentItem)) = true then
copy TheFolders + 1 to TheFolders
tell me to FindFolder(currentFolder & currentItem & ":", TheFiles,
TheFolders)
else
copy TheFiles + 1 to TheFiles
end if
end repeat
return (TheFiles & ", " & TheFolders) as string
--return
end FindFolder
[demime 0.98b removed an attachment of type text/x-vcard which had a name of asalvagnini.vcf]