VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



simple calculator using operator control array. place one label name called lbldisplay,place 11 lab

by Tatke Mayur Vijaybhai Mobile No 9825075580 (1 Submission)
Category: Custom Controls/Forms/Menus
Compatability: VB 6.0
Difficulty: Unknown Difficulty
Originally Published: Thu 1st January 2004
Date Added: Mon 8th February 2021
Rating: (1 Votes)

simple calculator using operator control array. place one label name called lbldisplay,place 11 labels using array give the name for that

API Declarations


dim n1 as currency,n2 as currency
dim op as string
dim newnumber
dim memory as currency


Rate simple calculator using operator control array. place one label name called lbldisplay,place 11 lab



if newnumber then
    lbldisplay=""
    newnumber=false
end if
lbldisplay=lbldisplay & lbldigit(index)
end sub

sub lbloperator_click(index as integer)
if op=""then
n1=lbldisplay
else
n2=lbldisplay
select case op
case "+"
lbldisplay=n1+n2
case "-
lbldisplay=n1-n2
case "*"
lbldisplay=n1*n2
case "/"
lbldisplay=n1/n2
end select
op=""
end if
if index>0 then
op=lbloperator(index)
end if
newnumber=true
end sub



subform_load()
newnumber=false
end sub



sub cmdclean_click()
lbldisplay=""
end sub


sub cmdMem_click()
memory=lbldisplay
end sub


sub cmdRecall_click()
lbldispaly=memory
end sub

sub cmdoff_click()
end 
end sub






Download this snippet    Add to My Saved Code

simple calculator using operator control array. place one label name called lbldisplay,place 11 lab Comments

No comments have been posted about simple calculator using operator control array. place one label name called lbldisplay,place 11 lab. Why not be the first to post a comment about simple calculator using operator control array. place one label name called lbldisplay,place 11 lab.

Post your comment

Subject:
Message:
0/1000 characters