RichTextBox1. AppendText (vbTab & amp; VbTab & amp; "The Details About the Staff Wages" & amp; VbCrLf)
RichTextBox1. AppendText (" Username "& amp; The Login. The TextBox1. Text & amp; VbCrLf)
RichTextBox1. AppendText (" "& amp; VbCrLf)
RichTextBox1. AppendText (" Working Time (Hours) : "& amp; ClockoutWork. Label7. Text + vbTab)
RichTextBox1. AppendText (" Working Gross Wages: "& amp; ClockoutWork. Label8. Text & amp; VbCrLf)
RichTextBox1. AppendText (" "& amp; VbCrLf)
RichTextBox1. AppendText (" Lunch Time Break (Minutes) : "& amp; ClockoutLunchbreak. Label7. Text + vbTab)
If ClockoutLunchbreak. Label8. Text=(" As Paid ") Then
DeLT=0
The Else
If 60 & lt; ClockoutLunchbreak. Label7. Text & lt; Then=120
DeLT=5
ElseIf 120 & lt; ClockoutLunchbreak. Label7. Text & lt; Then=180
DeLT=10
The Else
DeLT=15
End the If
End the If
RichTextBox1. AppendText (" Lunch Time Wage Deduction: "& amp; DeLT & amp; VbCrLf)
RichTextBox1. AppendText (" "& amp; VbCrLf)
RichTextBox1. AppendText (" Personal Break Time (Minutes) : "& amp; ClockoutPersonalbreak. Label7. Text + vbTab)
If ClockoutPersonalbreak. Label7. Text & lt; 15 Then=
DeBT=0
ElseIf 15 & lt; ClockoutPersonalbreak. Label7. Text & lt; 30 Then=
DeBT=3
ElseIf 30 & lt; ClockoutPersonalbreak. Label7. Text & lt; 60 Then=
DeBT=5
The Else
DeBT=10
End the If
RichTextBox1. AppendText (" Personal Break Wage Deduction: "& amp; DeBT & amp; VbCrLf)
RichTextBox1. AppendText (" "& amp; VbCrLf)
RichTextBox1. AppendText (" Total Deduction: "& amp; (deBT + deLT) & amp; VbTab & amp; VbTab)
Total=ClockoutWork. Label8. Text - deBT - deLT
RichTextBox1. AppendText (" Gross Wages: "& amp; Total & amp; VbCrLf)
RichTextBox1. AppendText ("===================================================================="& amp; VbCrLf)
RichTextBox1. AppendText (vbTab & amp; Today & amp; VbTab & amp; TimeOfDay & amp; VbCrLf)
RichTextBox1. AppendText ("===================================================================="& amp; VbCrLf)
End Sub
CodePudding user response:
I want in the rich text box is shown before I calculate the time and money, butIf ClockoutLunchbreak. Label8. Text=(" As Paid ") Then
DeLT=0
The Else
If 60 & lt; ClockoutLunchbreak. Label7. Text & lt; Then=120
DeLT=5
ElseIf 120 & lt; ClockoutLunchbreak. Label7. Text & lt; Then=180
DeLT=10
The Else
DeLT=15
End the If
End the If
RichTextBox1. AppendText (" Lunch Time Wage Deduction: "& amp; DeLT & amp; VbCrLf)
There was a problem in this period, if I am the figures in the label & gt; But the result is showed only 5, 120
CodePudding user response:
If ClockoutPersonalbreak. Label7. Text & lt; 15 Then=DeBT=0
ElseIf 15 & lt; ClockoutPersonalbreak. Label7. Text & lt; 30 Then=
DeBT=3
ElseIf 30 & lt; ClockoutPersonalbreak. Label7. Text & lt; 60 Then=
DeBT=5
The Else
DeBT=10
End the If
RichTextBox1. AppendText (" Personal Break Wage Deduction: "& amp; DeBT & amp; VbCrLf)
This a problem, too, besides is zero all the rest only 3 that what should I do
CodePudding user response:
A problem is my logic, or said grammar problem??Sister asked you little brother, want to hand in the paper, I discovered a bug so
CodePudding user response:
The first thing you should learn to not these, but how to debug programs:http://www.360doc.com/content/14/1031/13/17799864_421417365.shtml
Can't debugging, not learned program,
ClockoutPersonalbreak. Label7. This is the Text Text, is not really a Int value, your new add an Int variable intValue first, transform Text into digital, judged by number:
If intValue & lt; 15 Then=
DeBT=0
ElseIf 15 & lt; IntValue & lt; 30 Then=
DeBT=3
ElseIf 30 & lt; IntValue & lt; 60 Then=
DeBT=5
The Else
DeBT=10
End the If
If you can't debugging, can use MessageBox. Show (intValue); The value of the output transformed intValue
CodePudding user response:
Better to select caseSelect Case ClockoutPersonalbreak. Label7. Text
The Case Is & lt;
=15DeBT=0
The Case Is & lt;=30
DeBT=3
The Case Is & lt;=60
DeBT=5
The Else
DeBT=10
End the Select
CodePudding user response:
Slightly change theThe Else
DeBT=10
===& gt;
In Case the Else
DeBT=10
CodePudding user response:
All commented On the Error Resume Next statement, in VB6 IDE,The error and then click the debugging, the cursor will stop error in the statement,
Or
In doubt may have a logical error statements in advance to set breakpoints, run through the breakpoint interrupt,
At this point can be used in the immediate window
? The variable name
Or
? The function name () function parameter
Or
Process (parameters)
Auxiliary debugging,
CodePudding user response: