Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Calculator button basic
1. 1. What happen when you click on a button "5"
Public Class Form 1
1 Private Sub Button5_Click( ….) Handles Button5.Click
Statement 1
Statement 2 2
Statement 3
3
End Sub
End Class
2. 2. Global variables vs Local variables
Public Class Form 1 There are two variables defined in the codes.
Dim total as Double = 0
total is a global variable
existingString is a local variable in Button5_click
Private Sub Button5_Click( ….) Handles Button5.Click
What happen to these two variables before, during and after you
Dim existingString as String = "5" click button 5:
total = total + 5; 1. When the calculator just started
total is set to 0
existingString not defined
End Sub
2. When the button 5 is clicked
existingString is set to 5
total is set to total + 5
= ( 0 + 5)
=5
End Class 3. After that, return back to the calculator
existingString not defined (it just disappear)
total is now 5