<> <> <> <<>> <> <<>> DIRECTORY BluejayUtils, Commander USING [CommandProc, Register], IO USING [card, PutF]; TuneStorage: CEDAR PROGRAM IMPORTS BluejayUtils, Commander, IO ~ BEGIN vfileTotalSpace: CARD _ 0; maxVFID: CARD _ 1000; AnalyzeTunes: Commander.CommandProc = { <<[cmd: Commander.Handle] RETURNS [result: REF ANY _ NIL, msg: ROPE _ NIL]>> <> exists: BOOL; size: INT; num: CARD _ 0; <> FOR tid: CARD IN [0..maxVFID] DO [exists, size] _ BluejayUtils.DescribeTune[tid]; IF exists THEN { vfileTotalSpace _ vfileTotalSpace + size; num _ num + 1; }; ENDLOOP; IO.PutF[cmd.out, "Total # of tunes = %g\n", IO.card[num]]; IO.PutF[cmd.out, "Total length of tunes (in chirps) = %g\n", IO.card[vfileTotalSpace]]; }; Commander.Register[key: "TuneStorage", proc: AnalyzeTunes, doc: "Computes total tune storage."]; END.