-
To give you an idea, you mainly want to get tired of the value of "what" text2 when you click the button, then you can reuse the value in the label, that is, but assuming that the value of text1 is assigned first, it will be the result when the point is more than once, so you need to add a flag variable to identify whether it has been calculated once......Others think about it, the idea is almost like this, but the form can be changeable, the key is that the function of your ** is written independently The versatility is not enough, and it is slightly more to change**.
-
private lnumer1 as long,lnumer2 as long,lresult as long
private sub form_load()"Clear"
end sub
private sub text1_lostfoucs()lnumber1=val(
lresult=lnumber1
end sub
private sub text2_lostfoucs()lnumber2=val(
end sub
private sub command1_click()lresult=lresult + lnumber2= str$(lresult)
end sub
private sub command2_click()lresult=lresult - lnumber2= str$(lresult)
end sub
private sub command3_click()lresult=lresult / lnumber2= str$(lresult)
end sub
private sub command4_click()lresult=lresult * lnumber2= str$(lresult)
end sub
pirvate sub command5_click()"0"
lresult=0
end sub
Of course, this is not perfect, and it takes a lot of judgment to add talent, because you are a beginner, and you are just providing a method for your reference.
-
I also just learned, and the teacher in the sixth grade computer class said this:
private sub command1_click()= val( +val(
end sub
private sub command2_click()= val( -val(
end sub
private sub command3_click()= val( *val(
end sub
private sub command4_click()= val( / val(
end sub
private sub command5_click()= ""
end sub
private sub command6_click()endend sub
What you need to insert is:
-
Calculate the fix and cint parts of the function first, so it can be written as:
5\3/99*fix(
It means that the whole is out, and the priority of the operation is after *, and the division and multiplication should be calculated first, so:
-
4 * 6 mod 16 4 * 2 + 3) = 4 operator precedence is as follows: () > mod so the process is as follows:
ans=4 * 6 mod 16 / 4 * 5=24 mod 16 / 4 * 5
24 mod 4*5
24 mod 20=4
-
The operator priority (high to low) is as follows, and then push it yourself:
Exponential operations (
Negative numbers ( Multiplication and division (*)).
Integer division (
Modulo (mod
Addition and subtraction (+
String concatenation (&
Assign three numeric variables to three text boxes.
Write in an instance of a clip on one of the Stage: >>>More
1.Power-on on button: Press this key to power on, or clear all registers. >>>More
How to multiply the calculator with the same numberFirst calculate 2*2= and then press m+, in an 3*3=, in press m+, in press 4*4=, then press m+, and then press mrc is the result. was the dead body?and WHO I >>>More
One was disassembled, one was not.
Two connections. 1. The router is used as a switch. Connect the cable pulled by the landlord to the LAN port of the router, and then your computer and your buddy's computer are connected to the LAN port without passing through the WAN port of the route, remember to change the LAN IP of the router to the back of your own setting. >>>More