home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
DP Tool Club 13
/
CD_ASCQ_13_0494.iso
/
maj
/
419
/
mavgl.bas
< prev
next >
Wrap
BASIC Source File
|
1994-03-13
|
817b
|
25 lines
' +----------------------------------------------------------------------+
' | |
' | PBClone Copyright (c) 1990-1994 Thomas G. Hanlin III |
' | |
' +----------------------------------------------------------------------+
SUB MeanAverageL (Array&(), First%, Last%, Average&, ErrCode%)
ErrCode% = 0
IF First% = 0 THEN
F% = LBOUND(Array&, 1)
ELSE
F% = First%
END IF
IF Last% = 0 OR Last% < First% THEN
L% = UBOUND(Array&, 1)
ELSE
L% = Last%
END IF
FOR Tmp% = F% TO L%
Total& = Total& + Array&(Tmp%)
Count% = Count% + 1
NEXT
Average& = Total& \ CLNG(Count%)
END SUB