' sample statement written in the calling routine
Sub Calculate()
HS.EXP "A#TOT_Cash ="&Cumulative("A#Cash"," ",0)
End Sub
' programming of the Cumulative function
Function Cumulative(StrPov, StrVIEW, nPERIOD)
DIM strCUM
DIM i
IF nPERIOD <= 0 THEN
nPERIOD = HS.PERIOD.NUMBER() - 1
ELSE
nPERIOD = nPERIOD - 1
END IF
IF strVIEW = "" THEN
strVIEW = HS.SCENARIO.DEFAULTVIEW(“”)
END IF
strPOV = UCASE(strPOV)
strVIEW = UCASE(strVIEW)
IF strVIEW = "PERIODIC" THEN
strVIEW = ".W#PERIODIC"
ELSEIF strVIEW = "YTD" THEN
strVIEW = ".W#YTD"
ELSE
EXIT FUNCTION
END IF
FOR i = 0 TO nPERIOD
IF i = 0 THEN
strCUM = strPOV & strVIEW
ELSE
strCUM = strCUM &"+"& strPOV & strVIEW &".P#CUR-"&i
END IF
NEXT
Cumulative = "("& strCUM &")"
END FUNCTION