Skip to Content
Former Member
Mar 26, 2010 at 06:58 PM

Please help loop not working


I want to read all records and then check "srmfile.extension" for extension

type against an array of file types, then accumulate the number of files

found, and the space consumed.

I cannot get the check for extension type to work on the array. The counter

AudioFilesNumber and AudioFilesNumberdoes not seem to get incremented.

I cannot get the code correct to update these outside of the do loop, i assume

the update of the array counter should be done in an ELSE.

NumbervAR foundit := 0;

NumberVar AudioFilescounter :=1;

NumberVar CompressedFilescounter :=1;

StringVar array AudioFiles := ["au","mp3","wav","wmf","ZIP"];

StringVar array CompressedFiles := ["gz","tar","tgz","*z","ZIP"];

Global NumberVar AudioFilesNumber ;

Global NumberVar AudioFilesNumber;

Global NumberVar TotalMBaudiofiles;


while AudioFilescounter <= count(Audiofiles)


(if {SRMFILE.EXTENSION} = AudioFiles[AudioFilescounter] Then

AudioFilesNumber := AudioFilesNumber+1;

AudioFilescounter := AudioFilescounter+1;

TotalMBaudiofiles := TotalMBaudiofiles + {SRMFILE.ACTUALSIZE}/1024;

foundit := 1;

Exit While


if foundit = 0 then (

while CompressedFilescounter < count(Compressedfiles)


(if {SRMFILE.EXTENSION} = CompressedFiles[CompressedFilescounter] then

CompressedFilesNumber := CompressedFilesNumber +1;

CompressedFilescounter := CompressedFilescounter +1;

foundit := 1;

exit while



foundit := 0;

AudioFilescounter :=1;

CompressedFilescounter :=1;