サンプル・スクリプト

' sample statement written in the calling routine
Sub Calculate()
Hs.Exp "A#DiffCash = " & Difference("A#Cash", "YTD")
End Sub

' programming of the DIFFERENCE function
FUNCTION DIFFERENCE(strPOV,strVIEW)
IF strVIEW = "" THEN 
strVIEW = HS.SCENARIO.DEFAULTVIEW (“”) 
END IF
strPOV = UCASE(strPOV)
strVIEW = UCASE(strVIEW)

IF strVIEW = "PERIODIC" THEN
DIFFERENCE = "("&strPOV &"-"& strPOV & ".P#PRIOR" &")"
ELSEIF strVIEW = "YTD" THEN
DIFFERENCE = "("&strPOV &"-"& strPOV & ".Y#PRIOR.P#LAST" &")" 

ELSE
EXIT FUNCTION
END IF

END FUNCTION