Wargod18 Posted September 24, 2006 Report Share Posted September 24, 2006 (edited) i am trying to make an equal sign but when i click it if i have say 9+1 it equals 2 or if i give it 7+0 it equals nothing. i have it coded to work with only the add button right now i dont want to go any father until this is fixed. Dim operand1 As Integer, operand2 As IntegerDim ans As IntegerPrivate Sub CMDadd_Click() sign = "+" operand1 = Val(LBLans.Caption) LBLans.Caption = "" 'Clear for next number LBLsign.Caption = "+"End SubPrivate Sub CMDans_Click()If LBLsign.Caption = "+" Then operand1 = Val(LBLans.Caption) operand2 = LBLans.Caption ans = operand1 + operand2 LBLans.Caption = ansEnd IfEnd Sub i am just starting to program in VB, i thought this would work but i guess not what am i doing wrong and what do i have to change, thanks in advance. Edited September 24, 2006 by Wargod18 Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.