;*****************************************************************************
;*                                                                           *
;*Mathpack.inc  ver.  1.0                                                    *
;*Copyright(C)   1999 Symantec Corp.                                         *
;*All Rights Reserved                                                        *
;* Programmer: Dave Hemmann                                                  *
;                                                                            *
;* This ASPECT Include SCRIPT demonstrates how additional code may be stored *
;* in a separate file so that it may be inserted into various scripts.       *
;* This file is not directly compilable.  This code is only compiled with    *
;* the script including it.                                                  *
;*                                                                           *
;* Procedure Math_Pack                                                       *
;*                                                                           *
;* Calls: Addition, Subtraction, Multiple, Divide                            *
;* Called by: external reference                                             *
;* Modifies globals: none                                                    *
;*                                                                           *
;*****************************************************************************
proc Math_Pack                ;the only procedure called from "outside"
param float Num1              ;Input float point number.
param float Num2              ;Input float point number.
param string Operator         ;Input String with the mathmatical operator
param string Value            ;Input string to return the computed value

   switch Operator            ;Call the appropriate mathmatical procedure
      case "+"
         Addition(Num1,Num2,&Value)    ;Add num1 and num2 via procedure
      endcase
      case "-"
         Subtraction(Num1,Num2,&Value) ;Subtract num2 from num1 via procedure
      endcase
      case "*"
         Multiply(Num1,Num2,&Value)    ;Multiply num1 and num2 via procedure
      endcase
      case "/"
         Divide(Num1,Num2,&Value)      ;Divide num1 by num2 via procedure
      endcase
   endswitch
endproc  



;*****************************************************************************
;*                                                                           *
;* Addition                                                                  *
;* The procedure Addition adds the 2 variables and returns the result        *
;*                                                                           *
;* Calls: none                                                               *
;* Called by: Math_Pack                                                      *
;* Modifies globals: none                                                    *
;*                                                                           *
;*****************************************************************************
proc Addition  
param float AddEnd
param float Additive
param string Value
float result

   Result=Addend + Additive
   ftoa Result Value 

endproc



;*****************************************************************************
;*                                                                           *
;* Subtraction                                                               *
;* The procedure Subtract subtracts the 2 variables and returns the result   *
;*                                                                           *
;* Calls: none                                                               *
;* Called by: Math_Pack                                                      *
;* Modifies globals: none                                                    *
;*                                                                           *
;*****************************************************************************
proc Subtraction  
param float Subtrahend
param float Subtractor
param string Value
float result

   Result=Subtrahend - Subtractor
   ftoa Result Value 

endproc  



;*****************************************************************************
;*                                                                           *
;* Multiply                                                                  *
;* The procedure Multiply multiplies the 2 variables and returns the result  *
;*                                                                           *
;* Calls: none                                                               *
;* Called by: Math_Pack                                                      *
;* Modifies globals: none                                                    *
;*                                                                           *
;*****************************************************************************
proc Multiply
param float Multipican
param float Multiplier
param string Value
float result

   Result= Multipican * Multiplier
   ftoa Result Value 

endproc     



;*****************************************************************************
;*                                                                           *
;* Divide                                                                    *
;* The procedure Divide divides the 2 variables and returns the result       *
;*                                                                           *
;* Calls: none                                                               *
;* Called by: Math_Pack                                                      *
;* Modifies globals: none                                                    *
;*                                                                           *
;*****************************************************************************
proc Divide
param float Dividen
param float Divisor
param string Value
float result

   Result= Dividen / Divisor
   ftoa Result Value 

endproc     
