Mirage Source
http://web.miragesource.net/forums/

VB6 Project 1 - Calculate this.
http://web.miragesource.net/forums/viewtopic.php?f=143&t=5464
Page 1 of 1

Author:  Jacob [ Sat Apr 11, 2009 3:49 am ]
Post subject:  VB6 Project 1 - Calculate this.

I'm going to try to write small projects users can build to help learn VB6. This will also help others by providing different methods / ideas on how to solve a solution. If you have any ideas for a project please PM me. I will give you full credit if I use it.

Our first program will be a small calculator program. You must be able to input any 2 numbers and use all basic math operators (+,-,/,*). The user must be able to pick what mathematical operator to use.

Overview
  • Input 2 numbers.
  • Must have all basic math operators - (+,-,/,*)
  • User must be able to pick which mathematical operator to use.

Notes
  • Please provide the source when submitting a project.
  • Make sure to comment your code.

Author:  Asrrin29 [ Sat Apr 11, 2009 6:00 am ]
Post subject:  Re: VB6 Project 1 - Calculate this.

Here's my contribution, sorry that I went overboard just a bit.

http://www.athrandironline.com/downloads/Calculator.zip

Author:  Rian [ Sat Apr 11, 2009 6:24 am ]
Post subject:  Re: VB6 Project 1 - Calculate this.

Your address is wrong. Htpp. Lol.

But I tried it the right way, and it still doesn't work.

Author:  Asrrin29 [ Sat Apr 11, 2009 6:25 am ]
Post subject:  Re: VB6 Project 1 - Calculate this.

Try it now.

Author:  Rian [ Sat Apr 11, 2009 6:26 am ]
Post subject:  Re: VB6 Project 1 - Calculate this.

You fixed it!

Author:  Jacob [ Sat Apr 11, 2009 11:49 am ]
Post subject:  Re: VB6 Project 1 - Calculate this.

I did a brief look through and it looks great so far!

Author:  KruSuPhy [ Sun Apr 12, 2009 8:14 pm ]
Post subject:  Re: VB6 Project 1 - Calculate this.

Download mine; http://www.megaupload.com/?d=O14UO35P
Textbox calculator. This was like, the second program I ever made. I've always liked it better than the command button calculator.
Updated it a little today, too.
(First being the Command1_Click()
MsgBox "Hello World!" Shit, lol)

Author:  Anarchy [ Fri Apr 17, 2009 5:45 am ]
Post subject:  Re: VB6 Project 1 - Calculate this.

:'(

SPOILER: (click to show)
Image

Author:  Asrrin29 [ Fri Apr 17, 2009 6:48 am ]
Post subject:  Re: VB6 Project 1 - Calculate this.

Ah, the one piece of error trapping I forgot. For you guys learning the source of this program, try and see how you can fix it. If you are having trouble, a solution is below:

SPOILER: (click to show)
Code:
Case DIVISION
            If frmCalculator.txtDisplay.Text <> 0 Then
                frmCalculator.txtDisplay.Text = TempValue / CDbl(Val(frmCalculator.txtDisplay.Text))
            Else
                MsgBox ("Cannot divide by zero, please try again.")
                frmCalculator.txtDisplay.Text = vbNullString
            End If

Author:  KruSuPhy [ Sun Apr 19, 2009 10:17 pm ]
Post subject:  Re: VB6 Project 1 - Calculate this.

http://www.megaupload.com/?d=V4K3VJAK
Eh. changed it a little bit.
Fixed the Divide by zero error I'm pretty sure.
I think Type mismatch is gone, too.

Author:  Exadon [ Sat May 16, 2009 3:18 pm ]
Post subject:  Re: VB6 Project 1 - Calculate this.

KruSuPhy wrote:
http://www.megaupload.com/?d=V4K3VJAK
Eh. changed it a little bit.
Fixed the Divide by zero error I'm pretty sure.
I think Type mismatch is gone, too.


I still get the divide by zero error.
Code:
Case DIVISION
            If CDbl(Val(frmCalculator.txtDisplay.Text)) <> 0 Then
                frmCalculator.txtDisplay.Text = TempValue / CDbl(Val(frmCalculator.txtDisplay.Text))
            Else
                'error trap method
            End If

it seems you could trap the error right in the case statement here. I looked at your code for a bit but did not see where you were trying to trap it before.

Author:  Exadon [ Sat May 16, 2009 3:32 pm ]
Post subject:  Re: VB6 Project 1 - Calculate this.

I am not sure if my calc has any errors...but here it is.

Attachments:
calc.rar [2.56 KiB]
Downloaded 362 times

Page 1 of 1 All times are UTC
Powered by phpBB® Forum Software © phpBB Group
https://www.phpbb.com/