esteva
Mechanical
- Jun 28, 2001
- 20
I have been making some basic programs in Visual Basic. One of the problems I have and I havent solved is when I create a variable (example variable "a"
Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
'Main Module
Public VarA As Single
Sub Main()
Form1.Show 1
Form2.Show 1
End Sub
'Form 1
Private Sub cmdOK_Click()
'Get the value for A
VarA = CSng(Text1.Text)
End Sub
'Form 2
Private Sub Form_Load()
'Calculate value B and show it
VarB = Sqr(VarA)
Text1.Text = Format(VarB,"##0.0##)
End Sub
Public VarA As Single
Public VarB As Single
Sub Main()
Form1.Show 1
VarB = 2 * VarA
Form2.Show 1
End
End Sub
Private Sub cmdOK_Click()
'Get the value for A
VarA = CSng(Text1.Text)
Unload Me
End Sub
Private Sub Form_Load()
'Show the New Value (B)
Text1.Text = CStr(VarB)
End Sub
Private Sub cmdOK_Click()
Unload Me
End Sub