0% found this document useful (0 votes)
3 views1 page

Control Array Calculator Code Example

Uploaded by

Jeya lakshmi
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views1 page

Control Array Calculator Code Example

Uploaded by

Jeya lakshmi
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

Control Array command1--0 to 9, dot

Control Array cmdoperator  +,-,* and /

Private LastOperator As String


Private FirstPart As String

Private Sub cmdClear_Click()


FirstPart = ""
LastOperator = ""
End Sub
Private Sub cmdEquals_Click()
Select Case LastOperator
Case Is = "+"
[Link] = FirstPart + [Link]
Case Is = "-"
[Link] = FirstPart - [Link]
Case Is = "/"
[Link] = FirstPart / [Link]
Case Is = "*"
[Link] = FirstPart * [Link]
End Select
FirstPart = ""
LastOperator = ""
End Sub
Private Sub cmdOperator_Click(Index As Integer)
LastOperator = cmdOperator(Index).Caption
FirstPart = [Link]
[Link] = ""
End Sub
Private Sub Command1_Click(Index As Integer)
[Link] = [Link] + Command1(Index).Caption
End Sub

You might also like