January 1, 2005

WinTask - AddArrayElement

'
' AddArrayElement - add an element to an array
'
' Author: Joe Strazzere
'
dim array$(10)

Function AddElement$(Element$)
 array$(AddElementCount) = Element$
 AddElementCount = AddElementCount + 1
EndFunction

AddElementCount = 0
AddElement$("b")
AddElement$("a")
AddElement$("e")
AddElement$("")
AddElement$("g")
AddElement$("c")
AddElement$("d")

i=0
while i < AddElementCount
  Msgbox("There are "+Str$(AddElementCount)+" elements in total"+CRLF+"array("+Str$(i)+") = ["+array$(i)+"]")
  i=i+1
wend