Previous Topic: GetTokenNext Topic: Example: Using DLLs from Script Function


User-defined Functions

This script demonstrates how to use functions in AM scripts.

REM
REM This script demonstrates how to use functions in AM
REM scripts
REM

'*********************************************************
'*
'* This function adds two integers and return the sum
'*
'*********************************************************
Function sum( a as Integer, b as Integer) as integer
 DIM result AS Integer
 
 result = a + b
 
 'Return the result as the function value
 sum = result 
End Function 'sum

'*********************************************************
'************************--Main --************************
'*********************************************************
'This is the actual program
Print str(Sum(3,4))		'7
Print str(Sum(234,567))		'801