Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 15

'COORDINATES counter = counter + 2

ElseIf temp(counter + 1) = "s" And temp(counter + 2)


If Text1.Text = "" Then = "c" And temp(counter + 3) = "(" Then
MsgBox ("Input the coordinates."), vbExclamation counter = counter + 2
GoTo overflow Else
End If MsgBox ("Check the trigonometric function."),
vbExclamation
'ITERATION GoTo overflow
End If
iteration = Val(Text4.Text)
If iteration = 0 Then ElseIf temp(counter) = "s" Then
MsgBox ("Input the number of iteration."), If temp(counter + 1) = "i" And temp(counter + 2) =
vbExclamation "n" And temp(counter + 3) = "(" Then
GoTo overflow counter = counter + 2
ElseIf iteration > 34 Then ElseIf temp(counter + 1) = "e" And temp(counter + 2)
MsgBox ("Maximum number of iteration is 34."), = "c" And temp(counter + 3) = "(" Then
vbExclamation counter = counter + 2
GoTo overflow ElseIf temp(counter + 1) = "q" And temp(counter + 2)
End If = "r" And temp(counter + 3) = "t" And temp(counter + 4)
= "(" Then
'READING OF TRIGO FUNCTIONS counter = counter + 3
Else
b = Text3.Text MsgBox ("Check the trigonometric function."),
length = Len(b) vbExclamation
GoTo overflow
counter = 1 End If
While counter <= length
temp(counter) = Mid(b, counter, 1) ElseIf temp(counter) = "t" Then
counter = counter + 1 If temp(counter + 1) = "a" And temp(counter + 2) =
Wend "n" And temp(counter + 3) = "(" Then
counter = counter + 2
counter = 1 Else
openpa = 0 MsgBox ("Check the trigonometric function."),
closepa = 0 vbExclamation
GoTo overflow
While counter <= length End If
If temp(counter) = "+" Then
If counter = 1 Then ElseIf temp(counter) = "e" Then
MsgBox ("Wrong input"), vbExclamation If temp(counter + 1) <> "(" Then
GoTo overflow MsgBox ("Check the exponential function."),
ElseIf temp(counter + 1) = "+" Then vbExclamation
MsgBox ("Two or more consecutive + sign is not GoTo overflow
allowed."), vbExclamation End If
GoTo overflow
End If
ElseIf temp(counter) = "." Then
If IsNumeric(temp(counter - 1)) = False And
ElseIf temp(counter) = "-" Then IsNumeric(temp(counter + 1)) = False Then
ElseIf temp(counter) = "*" Then MsgBox ("Wrong input near point(.)."),
ElseIf temp(counter) = "/" Then vbExclamation
ElseIf temp(counter) = "c" Then GoTo overflow
If temp(counter + 1) = "o" And temp(counter + 2) = End If
"s" And temp(counter + 3) = "(" Then
counter = counter + 2
ElseIf temp(counter) = "(" Then
ElseIf temp(counter + 1) = "o" And temp(counter + 2)
If temp(counter + 1) = ")" Then
= "t" And temp(counter + 3) = "(" Then
MsgBox ("Empty is not allowed between open and counter = 1
close parenthesis."), vbExclamation counter1 = 0
GoTo overflow While counter <= length
End If If IsNumeric(temp(counter)) = True Then
If temp(counter - 1) = "-" And counter = 2 Then
openpa = openpa + 1 constant = temp(counter - 1)
End If
ElseIf temp(counter) = ")" Then
While IsNumeric(temp(counter))
closepa = closepa + 1 constant = constant & temp(counter)
counter = counter + 1
ElseIf temp(counter) = "x" Then Wend
If temp(counter + 1) = "x" Then
MsgBox ("Two or more consecutive x is not If temp(counter) <> "x" Then
allowed."), vbExclamation equation(counter1) = Val(constant)
GoTo overflow constant = ""
End If Else
constant = ""
ElseIf IsNumeric(temp(counter)) Then GoTo skip5
ElseIf temp(counter) = "^" Then End If
If temp(counter - 1) <> "x" Then
MsgBox ("Wrong input near ^."), vbExclamation counter = counter - 1
GoTo overflow
ElseIf IsNumeric(temp(counter + 1)) And ElseIf temp(counter) = "+" Then
IsNumeric(temp(counter + 1)) Then equation(counter1) = temp(counter)
MsgBox ("You are allowed to enter either +/- one ElseIf temp(counter) = "-" Then
digit."), vbExclamation If counter = 1 Then
GoTo overflow counter1 = counter1 - 1
End If GoTo skip
Else Else
MsgBox ("Wrong input"), vbExclamation equation(counter1) = temp(counter)
GoTo overflow End If
End If
counter = counter + 1 ElseIf temp(counter) = "*" Then
Wend equation(counter1) = temp(counter)
ElseIf temp(counter) = "/" Then
If openpa <> closepa Then equation(counter1) = temp(counter)
MsgBox ("Check number of open or close ElseIf temp(counter) = "x" Then
parenthesis."), vbExclamation skip5:
GoTo overflow If temp(counter + 1) = "^" Then
End If temp(counter) = Val(Text1.Text)
If temp(counter + 2) = "-" Then
'READING OF NUMBERS /TERMS d = Val(temp(counter + 3)) * -1
Else
a1 = 1 d = Val(temp(counter + 2))
For a = 1 To iteration End If
b = Text3.Text
length = Len(b) If d < 0 Then
counter = 1 d = d * -1
End If
While counter <= length
temp(counter) = Mid(b, counter, 1) e=1
counter = counter + 1 While e < d
Wend temp(counter) = Val(temp(counter)) *
Val(Text1.Text)
equation(counter1) = temp(counter) Wend
e=e+1 If temp(counter - 1) = "-" And counter = 2 Then
Wend constant = temp(counter - 1) & constant
End If
If temp(counter + 2) = "-" Then counter = counter + h
temp(counter) = 1 / Val(temp(counter)) equation(counter1) = Val(constant) *
equation(counter1) = temp(counter) Val(temp(counter))
End If constant = ""
h=0
If IsNumeric(temp(counter - 1)) Then End If
While IsNumeric(temp(counter - 1))
constant = temp(counter - 1) & constant ElseIf temp(counter) = "c" And temp(counter + 1) =
counter = counter - 1 "o" And temp(counter + 2) = "s" Then
h=h+1 counter = counter + 4
Wend i = counter
If temp(counter - 1) = "-" And counter = 2 GoTo cos
Then ElseIf temp(counter) = "s" And temp(counter + 1) =
constant = temp(counter - 1) & constant "i" And temp(counter + 2) = "n" Then
End If counter = counter + 4
counter = counter + h i = counter
equation(counter1) = Val(constant) * GoTo sin
Val(temp(counter)) ElseIf temp(counter) = "t" And temp(counter + 1) =
constant = "" "a" And temp(counter + 2) = "n" Then
h=0 counter = counter + 4
i = counter
End If GoTo tan
If temp(counter + 1) = "^" And temp(counter + ElseIf temp(counter) = "s" And temp(counter + 1) =
2) = "-" Then "e" And temp(counter + 2) = "c" Then
counter = counter + 3 counter = counter + 4
Else i = counter
counter = counter + 2 sec = 1
End If GoTo cos
GoTo skip ElseIf temp(counter) = "c" And temp(counter + 1) =
"s" And temp(counter + 2) = "c" Then
Else counter = counter + 4
i = counter
temp(counter) = Val(Text1.Text) csc = 1
equation(counter1) = (temp(counter)) GoTo sin
End If ElseIf temp(counter) = "c" And temp(counter + 1) =
If temp(counter - 1) = "-" And counter = 2 Then "o" And temp(counter + 2) = "t" Then
constant = temp(counter - 1) counter = counter + 4
If Val(temp(counter)) < 0 Then i = counter
temp(counter) = Val(temp(counter)) * -1 cot = 1
constant = "" GoTo tan
equation(counter1) = constant & ElseIf temp(counter) = "s" And temp(counter + 1) =
temp(counter) "q" And temp(counter + 2) = "r" And temp(counter + 3) =
Else "t" Then
equation(counter1) = constant & temp(counter) counter = counter + 5
End If i = counter
End If GoTo sqrt
If IsNumeric(temp(counter - 1)) Then ElseIf temp(counter) = "e" Then
While IsNumeric(temp(counter - 1)) counter = counter + 2
constant = temp(counter - 1) & constant i = counter
counter = counter - 1 GoTo exponent:
h=h+1 ElseIf temp(counter) = "(" Then
counter = counter + 1
GoTo parenthesis equation(counter1) = ""
skip: equation(counter1 - 1) = ""
equation(counter1 + 1) = g
End If g4 = 1
constant = "" GoTo jump
counter = counter + 1 jump4:
counter1 = counter1 + 1 Text2.Text = Val(g)
Wend While counter8 <> 0
zero(counter8) = ""
counter1 = 0 counter8 = counter8 - 1
While counter1 < length Wend
If IsNumeric(equation(counter1)) Then ElseIf equation(counter1) = "/" Then
equation(counter1) = Val(equation(counter1)) g = Val(equation(counter1 - 1)) /
If counter1 = 0 Then Val(equation(counter1 + 1))
g = Val(equation(counter1)) equation(counter1) = ""
g1 = 1 equation(counter1 - 1) = ""
GoTo jump equation(counter1 + 1) = g
jump1: g5 = 1
Text2.Text = Val(g) GoTo jump
While counter8 <> 0 jump5:
zero(counter8) = "" Text2.Text = Val(g)
counter8 = counter8 - 1 While counter8 <> 0
Wend zero(counter8) = ""
End If counter8 = counter8 - 1
ElseIf equation(counter1) = "+" Then Wend
g = Val(equation(counter1 - 1)) +
Val(equation(counter1 + 1)) End If
equation(counter1) = "" counter1 = counter1 + 1
equation(counter1 - 1) = "" Wend
equation(counter1 + 1) = g
g2 = 1 'Plotting to table
GoTo jump
jump2: If a <= 17 Then
Text2.Text = Val(g) With Form3
While counter8 <> 0 .Label1(a).Caption = Val(a)
zero(counter8) = "" .Label2(a).Caption = Val(Text1.Text)
counter8 = counter8 - 1 Text1.Text = Text2.Text
Wend .Label3(a).Caption = Val(g)
ElseIf equation(counter1) = "-" Then If a >= 2 Then
g = Val(equation(counter1 - 1)) - If Val(.Label3(a).Caption) = 0 Then
Val(equation(counter1 + 1)) MsgBox ("division by zero in getting percentage
equation(counter1) = "" error is not allowed"), vbExclamation
equation(counter1 - 1) = "" End If
equation(counter1 + 1) = g ae = Abs(Val(.Label3(a).Caption) - Val(.Label3(a -
g3 = 1 1).Caption))
GoTo jump c = Abs((Val(ae) / Val(.Label3(a).Caption)) * 100)
jump3: signi = Round(c, 5)
Text2.Text = Val(g) c = signi
While counter8 <> 0 .Label4(a).Caption = Val(c)
zero(counter8) = "" End If
counter8 = counter8 - 1 If Text5.Text <> "" Then
Wend te = Abs(Val(.Label3(a).Caption) - Val(Text5.Text))
ElseIf equation(counter1) = "*" Then .Label5(a).Caption = (Val(te) / Val(Text5.Text)) *
g = Val(equation(counter1 - 1)) * 100
Val(equation(counter1 + 1)) End If
End With Wend
Else If temp(counter) <> "x" Then
With table2 tempcos(counter2) = Val(constant)
.Label1(a1).Caption = Val(a) constant = ""
.Label2(a1).Caption = Val(Text1.Text) Else
Text1.Text = Text2.Text constant = ""
.Label3(a1).Caption = Val(g) GoTo skip6
End If
If Val(.Label3(a1).Caption) = 0 Then counter = counter - 1
MsgBox ("division by zero in getting percentage
error is not allowed"), vbExclamation ElseIf temp(counter) = "+" Then
End If tempcos(counter2) = temp(counter)
If a1 < 2 Then ElseIf temp(counter) = "-" Then
.Label3(a1 - 1).Caption = Form3.Label3(a - If counter = i Then
1).Caption counter2 = counter2 - 1
End If GoTo skip2
ae = Abs(Val(.Label3(a1).Caption) - Val(.Label3(a1 - Else
1).Caption)) tempcos(counter2) = temp(counter)
c = Abs((Val(ae) / Val(.Label3(a1).Caption)) * 100) End If
signi = Round(c, 5) ElseIf temp(counter) = "*" Then
c = signi tempcos(counter2) = temp(counter)
.Label4(a1).Caption = Val(c) ElseIf temp(counter) = "/" Then
tempcos(counter2) = temp(counter)
If Text5.Text <> "" Then ElseIf temp(counter) = "x" Then
te = Abs(Val(.Label3(a1).Caption) - Val(Text5.Text)) skip6:
.Label5(a1).Caption = (Val(te) / Val(Text5.Text)) * If temp(counter + 1) = "^" Then
100 temp(counter) = Val(Text1.Text)
End If If temp(counter + 2) = "-" Then
a1 = a1 + 1 d = Val(temp(counter + 3)) * -1
End With Else
End If d = Val(temp(counter + 2))
Next End If
Y = Text1.Text If d < 0 Then
Text6.Text = "xn = " & Str(Y) d = d * -1
End If
Text1.Text = Form3.Label2(1).Caption e=1
h=0 While e < d
While h <= Len(b) temp(counter) = Val(temp(counter)) *
equation(h) = "" Val(Text1.Text)
h=h+1 tempcos(counter2) = temp(counter)
Wend e=e+1
GoTo skip1 Wend
If temp(counter + 2) = "-" Then
'.......................................cosine func temp(counter) = 1 / Val(temp(counter))
cos: tempcos(counter2) = temp(counter)
counter2 = 0 End If
coss: If IsNumeric(temp(counter - 1)) Then
While temp(counter) <> ")" While IsNumeric(temp(counter - 1))
If IsNumeric(temp(counter)) = True Then constant = temp(counter - 1) & constant
If temp(counter - 1) = "-" And counter = i + 1 Then counter = counter - 1
constant = temp(counter - 1) h=h+1
End If Wend
While IsNumeric(temp(counter)) If temp(counter - 1) = "-" And counter = i + 1
constant = constant & temp(counter) Then
counter = counter + 1 constant = temp(counter - 1) & constant
End If cos1 = counter2
counter = counter + h cos3 = 1
tempcos(counter2) = Val(constant) * GoTo sin
Val(temp(counter)) ElseIf temp(counter) = "t" And temp(counter + 1) = "a"
constant = "" And temp(counter + 2) = "n" Then
h=0 counter = counter + 4
End If i = counter
If temp(counter + 1) = "^" And temp(counter + cos1 = counter2
2) = "-" Then cos3 = 1
counter = counter + 3 GoTo tan
Else ElseIf temp(counter) = "s" And temp(counter + 1) = "e"
counter = counter + 2 And temp(counter + 2) = "c" Then
End If counter = counter + 4
GoTo skip2 i = counter
Else If counter2 = 0 Then
cos2 = 1
temp(counter) = Val(Text1.Text) cos1 = counter2
tempcos(counter2) = (temp(counter)) Else
End If cos1 = counter2
If temp(counter - 1) = "-" And counter = i + 1 Then cos2 = cos1
constant = temp(counter - 1) End If
tempcos(counter2) = constant & temp(counter) cos3 = 1
End If sec = 1
If IsNumeric(temp(counter - 1)) Then sec1 = 1
While IsNumeric(temp(counter - 1)) GoTo coss
constant = temp(counter - 1) & constant ElseIf temp(counter) = "c" And temp(counter + 1) = "s"
counter = counter - 1 And temp(counter + 2) = "c" Then
h=h+1 counter = counter + 4
Wend i = counter
If temp(counter - 1) = "-" And counter = i + 1 Then cos1 = counter2
constant = temp(counter - 1) & constant cos3 = 1
End If csc = 1
counter = counter + h GoTo sin
tempcos(counter2) = Val(constant) * ElseIf temp(counter) = "c" And temp(counter + 1) = "o"
Val(temp(counter)) And temp(counter + 2) = "t" Then
constant = "" counter = counter + 4
h=0 i = counter
End If cos1 = counter2
ElseIf temp(counter) = "c" And temp(counter + 1) = "o" cos3 = 1
And temp(counter + 2) = "s" Then cot = 1
counter = counter + 4 GoTo tan
i = counter ElseIf temp(counter) = "s" And temp(counter + 1) = "q"
If counter2 = 0 Then And temp(counter + 2) = "r" And temp(counter + 3) = "t"
cos2 = 1 Then
cos1 = counter2 counter = counter + 5
Else i = counter
cos1 = counter2 cos1 = counter2
cos2 = cos1 cos3 = 1
End If GoTo sqrt
GoTo coss ElseIf temp(counter) = "e" Then
counter = counter + 2
ElseIf temp(counter) = "s" And temp(counter + 1) = "i" i = counter
And temp(counter + 2) = "n" Then exp1 = counter2
counter = counter + 4 GoTo exponent:
i = counter2 ElseIf temp(counter) = "(" Then
i=0
counter = counter + 1 While counter8 <> 0
cos1 = counter2 zero(counter8) = ""
cos3 = 1 counter8 = counter8 - 1
GoTo parenthesis Wend
End If ElseIf tempcos(counter2) = "*" Then
cosval = Val(tempcos(counter2 - 1)) *
skip2: Val(tempcos(counter2 + 1))
constant = "" tempcos(counter2) = ""
counter2 = counter2 + 1 tempcos(counter2 - 1) = ""
counter = counter + 1 tempcos(counter2 + 1) = cosval
cosval4 = 1
Wend GoTo cosjump
counterparent = counter cosjump4:
If cos2 = 0 Then While counter8 <> 0
counter2 = 0 zero(counter8) = ""
Else counter8 = counter8 - 1
counter2 = cos1 Wend
End If ElseIf tempcos(counter2) = "/" Then
While counter2 < length cosval = Val(tempcos(counter2 - 1)) /
If IsNumeric(tempcos(counter2)) Then Val(tempcos(counter2 + 1))
tempcos(counter2) = Val(tempcos(counter2)) tempcos(counter2) = ""
If counter2 = 0 Then tempcos(counter2 - 1) = ""
cosval = Val(tempcos(counter2)) tempcos(counter2 + 1) = cosval
cosval1 = 1 cosval5 = 1
GoTo cosjump GoTo cosjump
cosjump1: cosjump5:
While counter8 <> 0 While counter8 <> 0
zero(counter8) = "" zero(counter8) = ""
counter8 = counter8 - 1 counter8 = counter8 - 1
Wend Wend
End If End If
If cos1 = 1 Then counter2 = counter2 + 1
cosval = Val(tempcos(counter2)) Wend
End If
ElseIf tempcos(counter2) = "+" Then If cos2 <> 0 Then
cosval = Val(tempcos(counter2 - 1)) + counter2 = cos1
Val(tempcos(counter2 + 1)) tempcos(counter2 + 2) = ""
tempcos(counter2) = "" tempcos(counter2) = cos(Val(cosval))
tempcos(counter2 - 1) = "" If sec1 = 1 Then
tempcos(counter2 + 1) = cosval tempcos(counter2) = 1 / Val(tempcos(counter2))
cosval2 = 1 sec1 = 0
GoTo cosjump End If
cosjump2: If counter2 = 0 Then
While counter8 <> 0 Else
zero(counter8) = "" If IsNumeric(tempcos(counter2 - 1)) = True Then
counter8 = counter8 - 1 tempcos(counter2 - 1) = Val(tempcos(counter2 -
Wend 1)) * Val(tempcos(counter2))
ElseIf tempcos(counter2) = "-" Then tempcos(counter2) = ""
cosval = Val(tempcos(counter2 - 1)) - counter2 = counter2 - 1
Val(tempcos(counter2 + 1)) End If
tempcos(counter2) = "" End If
tempcos(counter2 - 1) = ""
tempcos(counter2 + 1) = cosval cos2 = 0
cosval3 = 1 cos1 = 0
GoTo cosjump GoTo skip2
cosjump3:
tempexpo(counter6 - 1) = Val(tempexpo(counter6
ElseIf parent3 <> 0 Then - 1)) * Val(tempexpo(counter6))
tempparent(counter7) = cos(Val(cosval)) tempexpo(counter5) = ""
If counter7 <> 0 Then End If
If IsNumeric(tempparent(counter7 - 1)) = True Then End If
tempparent(counter7 - 1) = Exp3 = 0
Val(tempparent(counter7 - 1)) * counter = counterparent
Val(tempparent(counter7)) GoTo skip12
tempparent(counter7) = "" Else
End If equation(counter1) = cos(Val(cosval))
End If If temp(1) = "-" And temp(2) = "c" And temp(3) = "o"
parent3 = 0 And temp(4) = "s" Then
counter = counterparent If cos(Val(cosval)) < 0 Then
GoTo skip14 equation(counter1) = cos(Val(cosval)) * -1
ElseIf sin3 <> 0 Then Else
tempsin(counter3) = cos(Val(cosval)) equation(counter1) = cos(Val(cosval)) * -1
If counter3 <> 0 Then End If
If IsNumeric(tempsin(counter3 - 1)) = True Then ElseIf temp(1) = "-" And temp(2) = "s" And temp(3) =
tempsin(counter3 - 1) = Val(tempsin(counter3 - 1)) "e" And temp(4) = "c" Then
* Val(tempsin(counter3)) If cos(Val(cosval)) < 0 Then
tempsin(counter3) = "" equation(counter1) = cos(Val(cosval)) * -1
End If Else
End If equation(counter1) = cos(Val(cosval)) * -1
sin3 = 0 End If
counter = counterparent End If
GoTo skip3 End If
ElseIf tan3 <> 0 Then If sec = 1 Then
temptan(counter4) = cos(Val(cosval)) equation(counter1) = 1 / Val(equation(counter1))
If counter4 <> 0 Then sec = 0
If IsNumeric(temptan(counter4 - 1)) = True Then End If
temptan(counter4 - 1) = Val(temptan(counter4 - If counter1 > 0 Then
1)) * Val(temptan(counter4)) If IsNumeric(equation(counter1 - 1)) = True Then
temptan(counter4) = "" equation(counter1 - 1) = Val(equation(counter1 - 1))
End If * Val(equation(counter1))
End If equation(counter1) = ""
tan3 = 0 counter1 = counter1 - 1
counter = counterparent ElseIf equation(counter1 - 1) = "-" And counter1 - 1 = 0
GoTo skip4 Then
ElseIf sqr3 <> 0 Then equation(counter1 - 1) = equation(counter1 - 1) &
tempsqrt(counter5) = cos(Val(cosval)) equation(counter1)
If counter5 <> 0 Then equation(counter1) = ""
If IsNumeric(tempsqrt(counter5 - 1)) = True Then counter1 = counter1 - 1
tempsqrt(counter5 - 1) = Val(tempsqrt(counter5 - End If
1)) * Val(tempsqrt(counter5)) End If
tempsqrt(counter5) = "" i=0
End If GoTo skip
End If
sqr3 = 0 '...............................................sine
counter = counterparent sin:
GoTo skip10 counter3 = 0
ElseIf Exp3 <> 0 Then sinn:
tempexpo(counter6) = cos(Val(cosval)) While temp(counter) <> ")"
If counter6 <> 0 Then If IsNumeric(temp(counter)) = True Then
If IsNumeric(tempexpo(counter6 - 1)) = True Then If temp(counter - 1) = "-" And counter = i + 1 Then
constant = temp(counter - 1)
End If
While IsNumeric(temp(counter)) If temp(counter - 1) = "-" And counter = i + 1
constant = constant & temp(counter) Then
counter = counter + 1 constant = temp(counter - 1) & constant
Wend End If
If temp(counter) <> "x" Then counter = counter + h
tempsin(counter3) = Val(constant) tempsin(counter3) = Val(constant) *
constant = "" Val(temp(counter))
Else constant = ""
constant = "" h=0
GoTo skip7 End If
End If If temp(counter + 1) = "^" And temp(counter +
counter = counter - 1 2) = "-" Then
counter = counter + 3
ElseIf temp(counter) = "+" Then Else
tempsin(counter3) = temp(counter) counter = counter + 2
ElseIf temp(counter) = "-" Then End If
If counter = i Then GoTo skip3
counter3 = counter3 - 1 Else
GoTo skip3 temp(counter) = Val(Text1.Text)
Else tempsin(counter3) = (temp(counter))
tempsin(counter3) = temp(counter) End If
End If If temp(counter - 1) = "-" And counter = i + 1 Then
ElseIf temp(counter) = "*" Then constant = temp(counter - 1)
tempsin(counter3) = temp(counter) tempsin(counter3) = constant & temp(counter)
ElseIf temp(counter) = "/" Then End If
tempsin(counter3) = temp(counter) If IsNumeric(temp(counter - 1)) Then
ElseIf temp(counter) = "x" Then While IsNumeric(temp(counter - 1))
skip7: constant = temp(counter - 1) & constant
If temp(counter + 1) = "^" Then counter = counter - 1
temp(counter) = Val(Text1.Text) h=h+1
If temp(counter + 2) = "-" Then Wend
d = Val(temp(counter + 3)) * -1 If temp(counter - 1) = "-" And counter = i + 1 Then
Else constant = temp(counter - 1) & constant
d = Val(temp(counter + 2)) End If
End If counter = counter + h
If d < 0 Then tempsin(counter3) = Val(constant) *
d = d * -1 Val(temp(counter))
End If constant = ""
e=1 h=0
While e < d End If
temp(counter) = Val(temp(counter)) * ElseIf temp(counter) = "c" And temp(counter + 1) = "o"
Val(Text1.Text) And temp(counter + 2) = "s" Then
tempsin(counter3) = temp(counter) counter = counter + 4
e=e+1 i = counter
Wend sin1 = counter3
If temp(counter + 2) = "-" Then sin3 = 1
temp(counter) = 1 / Val(temp(counter)) GoTo cos
tempsin(counter3) = temp(counter) ElseIf temp(counter) = "s" And temp(counter + 1) = "i"
End If And temp(counter + 2) = "n" Then
If IsNumeric(temp(counter - 1)) Then counter = counter + 4
While IsNumeric(temp(counter - 1)) i = counter
constant = temp(counter - 1) & constant If counter3 = 0 Then
counter = counter - 1 sin2 = 1
h=h+1 sin1 = counter3
Wend Else
sin1 = counter3
sin2 = sin1 sin1 = counter3
End If sin3 = 1
GoTo sinn counter = counter + 1
ElseIf temp(counter) = "t" And temp(counter + 1) = "a" GoTo parenthesis
And temp(counter + 2) = "n" Then End If
counter = counter + 4
i = counter skip3:
sin1 = counter3 constant = ""
sin3 = 1 counter3 = counter3 + 1
GoTo tan counter = counter + 1
ElseIf temp(counter) = "s" And temp(counter + 1) = "e" Wend
And temp(counter + 2) = "c" Then
counter = counter + 4 counterparent = counter
i = counter If sin2 = 0 Then
sec = 1 counter3 = 0
sin1 = counter3 Else
sin3 = 1 counter3 = sin1
GoTo cos End If
ElseIf temp(counter) = "c" And temp(counter + 1) = "s" While counter3 < length
And temp(counter + 2) = "c" Then If IsNumeric(tempsin(counter3)) Then
counter = counter + 4 tempsin(counter3) = Val(tempsin(counter3))
i = counter If counter3 = 0 Then
If counter3 = 0 Then sinval = Val(tempsin(counter3))
sin2 = 1 sinval1 = 1
sin1 = counter3 GoTo sinjump
Else sinjump1:
sin1 = counter3 While counter8 <> 0
sin2 = sin1 zero(counter8) = ""
End If counter8 = counter8 - 1
csc = 1 Wend
csc1 = 1 End If
GoTo sinn If sin1 = 1 Then
ElseIf temp(counter) = "c" And temp(counter + 1) = "o" sinval = Val(tempsin(counter3))
And temp(counter + 2) = "t" Then End If
counter = counter + 4
i = counter ElseIf tempsin(counter3) = "+" Then
cot = 1 sinval = Val(tempsin(counter3 - 1)) +
sin1 = counter3 Val(tempsin(counter3 + 1))
sin3 = 1 tempsin(counter3) = ""
GoTo tan tempsin(counter3 - 1) = ""
ElseIf temp(counter) = "s" And temp(counter + 1) = "q" tempsin(counter3 + 1) = sinval
And temp(counter + 2) = "r" And temp(counter + 3) = "t" sinval2 = 1
Then GoTo sinjump
counter = counter + 5 sinjump2:
i = counter While counter8 <> 0
sin1 = counter3 zero(counter8) = ""
sin3 = 1 counter8 = counter8 - 1
GoTo sqrt Wend
ElseIf temp(counter) = "e" Then ElseIf tempsin(counter3) = "-" Then
counter = counter + 2 sinval = Val(tempsin(counter3 - 1)) -
i = counter Val(tempsin(counter3 + 1))
sin1 = counter3 tempsin(counter3) = ""
sin3 = 1 tempsin(counter3 - 1) = ""
GoTo exponent: tempsin(counter3 + 1) = sinval
ElseIf temp(counter) = "(" Then sinval3 = 1
i=0
GoTo sinjump sin1 = 0
sinjump3: GoTo skip3
While counter8 <> 0
zero(counter8) = "" ElseIf parent3 <> 0 Then
counter8 = counter8 - 1 tempparent(counter7) = sin(Val(sinval))
Wend If counter7 <> 0 Then
ElseIf tempsin(counter3) = "*" Then If IsNumeric(tempparent(counter7 - 1)) = True Then
sinval = Val(tempsin(counter3 - 1)) * tempparent(counter7 - 1) =
Val(tempsin(counter3 + 1)) Val(tempparent(counter7 - 1)) *
tempsin(counter3) = "" Val(tempparent(counter7))
tempsin(counter3 - 1) = "" tempparent(counter7) = ""
tempsin(counter3 + 1) = sinval End If
sinval4 = 1 End If
GoTo sinjump parent3 = 0
sinjump4: counter = counterparent
While counter8 <> 0 GoTo skip14
zero(counter8) = "" ElseIf cos3 <> 0 Then
counter8 = counter8 - 1 tempcos(counter2) = sin(Val(sinval))
Wend If counter2 <> 0 Then
ElseIf tempsin(counter3) = "/" Then If IsNumeric(tempcos(counter2 - 1)) = True Then
sinval = Val(tempsin(counter3 - 1)) / tempcos(counter2 - 1) = Val(tempcos(counter2 -
Val(tempsin(counter3 + 1)) 1)) * Val(tempcos(counter2))
tempsin(counter3) = "" tempcos(counter2) = ""
tempsin(counter3 - 1) = "" End If
tempsin(counter3 + 1) = sinval End If
sinval5 = 1 sin3 = 0
GoTo sinjump counter = counterparent
sinjump5: GoTo skip2
While counter8 <> 0 ElseIf tan3 <> 0 Then
zero(counter8) = "" temptan(counter4) = sin(Val(sinval))
counter8 = counter8 - 1 If counter4 <> 0 Then
Wend If IsNumeric(temptan(counter4 - 1)) = True Then
End If temptan(counter4 - 1) = Val(temptan(counter4 -
counter3 = counter3 + 1 1)) * Val(temptan(counter4))
Wend temptan(counter4) = ""
If sin2 <> 0 Then End If
counter3 = sin1 End If
tempsin(counter3 + 2) = "" tan3 = 0
tempsin(counter3) = sin(Val(sinval)) counter = counterparent
If csc1 = 1 Then GoTo skip4
tempsin(counter3) = 1 / Val(tempsin(counter3)) ElseIf sqr3 <> 0 Then
csc1 = 0 tempsqrt(counter5) = sin(Val(sinval))
End If If counter5 <> 0 Then
If counter3 = 0 Then If IsNumeric(tempsqrt(counter5 - 1)) = True Then
tempsqrt(counter5 - 1) = Val(tempsqrt(counter5 -
Else 1)) * Val(tempsqrt(counter5))
If IsNumeric(tempsin(counter3 - 1)) = True Then tempsqrt(counter5) = ""
tempsin(counter3 - 1) = Val(tempsin(counter3 - 1)) End If
* Val(tempsin(counter3)) End If
tempsin(counter3) = "" sqr3 = 0
counter3 = counter3 - 1 counter = counterparent
End If GoTo skip10
End If ElseIf Exp3 <> 0 Then
tempexpo(counter6) = sin(Val(sinval))
sin2 = 0 If counter6 <> 0 Then
If IsNumeric(tempexpo(counter6 - 1)) = True Then constant = temp(counter - 1)
tempexpo(counter6 - 1) = Val(tempexpo(counter6 End If
- 1)) * Val(tempexpo(counter6)) While IsNumeric(temp(counter))
tempexpo(counter5) = "" constant = constant & temp(counter)
End If counter = counter + 1
End If Wend
Exp3 = 0 If temp(counter) <> "x" Then
counter = counterparent temptan(counter4) = Val(constant)
GoTo skip12 constant = ""
Else
Else constant = ""
equation(counter1) = sin(Val(sinval)) GoTo skip8
If temp(1) = "-" And temp(2) = "s" And temp(3) = "i" End If
And temp(4) = "n" Then counter = counter - 1
If sin(Val(sinval)) < 0 Then
equation(counter1) = sin(Val(sinval)) * -1 ElseIf temp(counter) = "+" Then
Else temptan(counter4) = temp(counter)
equation(counter1) = sin(Val(sinval)) * -1 ElseIf temp(counter) = "-" Then
End If If counter = i Then
ElseIf temp(1) = "-" And temp(2) = "c" And temp(3) = counter4 = counter4 - 1
"s" And temp(4) = "c" Then GoTo skip4
If sin(Val(sinval)) < 0 Then Else
equation(counter1) = sin(Val(sinval)) * -1 temptan(counter4) = temp(counter)
Else End If
equation(counter1) = sin(Val(sinval)) * -1 ElseIf temp(counter) = "*" Then
End If temptan(counter4) = temp(counter)
End If ElseIf temp(counter) = "/" Then
End If temptan(counter4) = temp(counter)
If csc = 1 Then ElseIf temp(counter) = "x" Then
equation(counter1) = 1 / Val(equation(counter1)) skip8:
csc = 0 If temp(counter + 1) = "^" Then
End If temp(counter) = Val(Text1.Text)
If counter1 > 0 Then If temp(counter + 2) = "-" Then
If IsNumeric(equation(counter1 - 1)) = True Then d = Val(temp(counter + 3)) * -1
equation(counter1 - 1) = Val(equation(counter1 - 1)) Else
* Val(equation(counter1)) d = Val(temp(counter + 2))
equation(counter1) = "" End If
counter1 = counter1 - 1 If d < 0 Then
ElseIf equation(counter1 - 1) = "-" And counter1 - 1 = 0 d = d * -1
Then End If
equation(counter1 - 1) = equation(counter1 - 1) & e=1
equation(counter1) While e < d
equation(counter1) = "" temp(counter) = Val(temp(counter)) *
counter1 = counter1 - 1 Val(Text1.Text)
End If temptan(counter4) = temp(counter)
End If e=e+1
i=0 Wend
GoTo skip If temp(counter + 2) = "-" Then
temp(counter) = 1 / Val(temp(counter))
'...........................................tangent temptan(counter4) = temp(counter)
tan: End If
counter4 = 0 If IsNumeric(temp(counter - 1)) Then
tann: While IsNumeric(temp(counter - 1))
While temp(counter) <> ")" constant = temp(counter - 1) & constant
If IsNumeric(temp(counter)) = True Then counter = counter - 1
If temp(counter - 1) = "-" And counter = i + 1 Then
h=h+1 ElseIf temp(counter) = "t" And temp(counter + 1) = "a"
Wend And temp(counter + 2) = "n" Then
If temp(counter - 1) = "-" And counter = i + 1 counter = counter + 4
Then i = counter
constant = temp(counter - 1) & constant If counter4 = 0 Then
End If tan2 = 1
counter = counter + h tan1 = counter4
temptan(counter4) = Val(constant) * Else
Val(temp(counter)) tan1 = counter4
constant = "" tan2 = tan1
h=0 End If
End If GoTo tann
If temp(counter + 1) = "^" And temp(counter + ElseIf temp(counter) = "s" And temp(counter + 1) = "e"
2) = "-" Then And temp(counter + 2) = "c" Then
counter = counter + 3 counter = counter + 4
Else i = counter
counter = counter + 2 tan1 = counter4
End If tan3 = 1
GoTo skip4 sec = 1
Else GoTo cos
temp(counter) = Val(Text1.Text) ElseIf temp(counter) = "c" And temp(counter + 1) = "s"
temptan(counter4) = (temp(counter)) And temp(counter + 2) = "c" Then
End If counter = counter + 4
If temp(counter - 1) = "-" And counter = i + 1 Then i = counter
constant = temp(counter - 1) csc = 1
temptan(counter4) = constant & temp(counter) tan1 = counter4
End If tan3 = 1
If IsNumeric(temp(counter - 1)) Then GoTo sin
While IsNumeric(temp(counter - 1)) ElseIf temp(counter) = "c" And temp(counter + 1) = "o"
constant = temp(counter - 1) & constant And temp(counter + 2) = "t" Then
counter = counter - 1 counter = counter + 4
h=h+1 i = counter
Wend If counter4 = 0 Then
If temp(counter - 1) = "-" And counter = i + 1 Then tan2 = 1
constant = temp(counter - 1) & constant tan1 = counter4
End If Else
counter = counter + h tan1 = counter4
temptan(counter4) = Val(constant) * tan2 = tan1
Val(temp(counter)) End If
constant = "" cot1 = 1
h=0 cot = 1
End If GoTo tann
ElseIf temp(counter) = "c" And temp(counter + 1) = "o" ElseIf temp(counter) = "s" And temp(counter + 1) = "q"
And temp(counter + 2) = "s" Then And temp(counter + 2) = "r" And temp(counter + 3) = "t"
counter = counter + 4 Then
i = counter counter = counter + 5
tan1 = counter i = counter
tan3 = 1 tan1 = counter4
GoTo cos tan3 = 1
ElseIf temp(counter) = "s" And temp(counter + 1) = "i" GoTo sqrt
And temp(counter + 2) = "n" Then ElseIf temp(counter) = "e" Then
counter = counter + 4 counter = counter + 2
i = counter i = counter
tan1 = counter4 tan1 = counter4
tan3 = 1 tan3 = 1
GoTo sin GoTo exponent:
ElseIf temp(counter) = "(" Then GoTo tanjump
i=0 tanjump3:
tan1 = counter4 While counter8 <> 0
tan3 = 1 zero(counter8) = ""
counter = counter + 1 counter8 = counter8 - 1
GoTo parenthesis Wend
End If ElseIf temptan(counter4) = "*" Then
tanval = Val(temptan(counter4 - 1)) *
skip4: Val(temptan(counter4 + 1))
constant = "" temptan(counter4) = ""
counter4 = counter4 + 1 temptan(counter4 - 1) = ""
counter = counter + 1 temptan(counter4 + 1) = tanval
Wend tanval4 = 1
counterparent = counter GoTo tanjump
If tan2 = 0 Then tanjump4:
counter4 = 0 While counter8 <> 0
Else zero(counter8) = ""
counter4 = tan1 counter8 = counter8 - 1
End If Wend
ElseIf temptan(counter4) = "/" Then
While counter4 < length tanval = Val(temptan(counter4 - 1)) /
If IsNumeric(temptan(counter4)) Then Val(temptan(counter4 + 1))
temptan(counter4) = Val(temptan(counter4)) temptan(counter4) = ""
If counter4 = 0 Then temptan(counter4 - 1) = ""
tanval = Val(temptan(counter4)) temptan(counter4 + 1) = tanval
tanval1 = 1 tanval5 = 1
GoTo tanjump GoTo tanjump
tanjump1: tanjump5:
While counter8 <> 0 While counter8 <> 0
zero(counter8) = "" zero(counter8) = ""
counter8 = counter8 - 1 counter8 = counter8 - 1
Wend Wend
End If End If
If tan1 = 1 Then counter4 = counter4 + 1
tanval = Val(temptan(counter4)) Wend
End If If tan2 <> 0 Then
ElseIf temptan(counter4) = "+" Then counter4 = tan1
tanval = Val(temptan(counter4 - 1)) + temptan(counter4 + 2) = ""
Val(temptan(counter4 + 1)) temptan(counter4) = tan(Val(tanval))
temptan(counter4) = "" If cot1 = 1 Then
temptan(counter4 - 1) = "" temptan(counter4) = 1 / Val(temptan(counter4))
temptan(counter4 + 1) = tanval cot1 = 0
tanval2 = 1 End If
GoTo tanjump If counter4 = 0 Then
tanjump2:
While counter8 <> 0 Else
zero(counter8) = "" If IsNumeric(temptan(counter4 - 1)) = True Then
counter8 = counter8 - 1 temptan(counter4 - 1) = Val(temptan(counter4 -
Wend 1)) * Val(temptan(counter4))
ElseIf temptan(counter4) = "-" Then temptan(counter4) = ""
tanval = Val(temptan(counter4 - 1)) - counter4 = counter4 - 1
Val(temptan(counter4 + 1)) End If
temptan(counter4) = "" End If
temptan(counter4 - 1) = ""
temptan(counter4 + 1) = tanval tan2 = 0
tanval3 = 1
tan1 = 0 If IsNumeric(tempexpo(counter6 - 1)) = True Then
GoTo skip4 tempexpo(counter6 - 1) = Val(tempexpo(counter6
- 1)) * Val(tempexpo(counter6))
ElseIf parent3 <> 0 Then tempexpo(counter5) = ""
tempparent(counter7) = tan(Val(sinval)) End If
If counter7 <> 0 Then End If
If IsNumeric(tempparent(counter7 - 1)) = True Then Exp3 = 0
tempparent(counter7 - 1) = counter = counterparent
Val(tempparent(counter7 - 1)) * GoTo skip12
Val(tempparent(counter7)) Else
tempparent(counter7) = "" equation(counter1) = tan(Val(tanval))
End If If temp(1) = "-" And temp(2) = "t" And temp(3) = "a"
End If And temp(4) = "n" Then
parent3 = 0 If tan(Val(tanval)) < 0 Then
counter = counterparent equation(counter1) = tan(Val(tanval)) * -1
GoTo skip14 Else
ElseIf cos3 <> 0 Then equation(counter1) = tan(Val(tanval)) * -1
tempcos(counter2) = tan(Val(sinval)) End If
If counter2 <> 0 Then ElseIf temp(1) = "-" And temp(2) = "c" And temp(3) =
If IsNumeric(tempcos(counter2 - 1)) = True Then "o" And temp(4) = "t" Then
tempcos(counter2 - 1) = Val(tempcos(counter2 - If tan(Val(cosval)) < 0 Then
1)) * Val(tempcos(counter2)) equation(counter1) = tan(Val(tanval)) * -1
tempcos(counter2) = "" Else
End If equation(counter1) = tan(Val(tanval)) * -1
End If End If
cos3 = 0 End If
counter = counterparent End If
GoTo skip2 If cot = 1 Then
ElseIf sin3 <> 0 Then equation(counter1) = 1 / Val(equation(counter1))
tempsin(counter3) = tan(Val(sinval)) cot = 0
If counter3 <> 0 Then End If
If IsNumeric(tempsin(counter3 - 1)) = True Then If counter1 > 0 Then
tempsin(counter3 - 1) = Val(tempsin(counter3 - 1)) If IsNumeric(equation(counter1 - 1)) = True Then
* Val(tempsin(counter3)) equation(counter1 - 1) = Val(equation(counter1 - 1))
tempsin(counter3) = "" * Val(equation(counter1))
End If equation(counter1) = ""
End If counter1 = counter1 - 1
sin3 = 0 ElseIf equation(counter1 - 1) = "-" And counter1 - 1 = 0
counter = counterparent Then
GoTo skip3 equation(counter1 - 1) = equation(counter1 - 1) &
ElseIf sqr3 <> 0 Then equation(counter1)
tempsqrt(counter5) = tan(Val(sinval)) equation(counter1) = ""
If counter5 <> 0 Then counter1 = counter1 - 1
If IsNumeric(tempsqrt(counter5 - 1)) = True Then End If
tempsqrt(counter5 - 1) = Val(tempsqrt(counter5 - End If
1)) * Val(tempsqrt(counter5)) i=0
tempsqrt(counter5) = "" GoTo skip
End If
End If overflow:
sqr3 = 0 If Err.Number = 6 Then
counter = counterparent MsgBox ("OVERFLOW."), vbExclamation
GoTo skip10 End If
ElseIf Exp3 <> 0 Then
tempexpo(counter6) = tan(Val(sinval)) command2.Enabled = True
If counter6 <> 0 Then End Sub

You might also like