24 lines
450 B
Plaintext
24 lines
450 B
Plaintext
# Project : Variadic function
|
|
|
|
sum([1,2])
|
|
sum([1,2,3])
|
|
nums = [1,2,3,4]
|
|
sum(nums)
|
|
|
|
func sum(nums)
|
|
total = 0
|
|
for num = 1 to len(nums)
|
|
total = total + num
|
|
next
|
|
showarray(nums)
|
|
see " " + total + nl
|
|
|
|
func showarray(vect)
|
|
see "["
|
|
svect = ""
|
|
for n = 1 to len(vect)
|
|
svect = svect + vect[n] + " "
|
|
next
|
|
svect = left(svect, len(svect) - 1)
|
|
see "" + svect + "]"
|