Addy The Sum Program

This miniprogram calculates the sum of a row of integers.

You need 1 textarea, 1 textbox and 1 commandbutton to get the program going.

You can also add negative integers.

Very helpful is the Splitcommand and the Stringarray String[]

The Code

PUBLIC SUB Button1_Click()
DIM text AS String
DIM summe AS Float
DIM Elt AS String[]
DIM Sb AS String
text = textarea1.Text
Elt = Split(text,Chr(10))
FOR EACH Sb IN Elt
 summe = summe + Val(sb)
NEXT
textbox1.Text = summe
END

-- ReinerHoffmann - 31 Jan 2004