Mirage Source

Free ORPG making software.
It is currently Thu Jun 06, 2024 7:17 pm

All times are UTC




Post new topic Reply to topic  [ 12 posts ] 
Author Message
PostPosted: Sat Apr 11, 2009 3:49 am 
Offline
Pro
User avatar

Joined: Tue Nov 13, 2007 2:42 pm
Posts: 509
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.


Top
 Profile  
 
PostPosted: Sat Apr 11, 2009 6:00 am 
Offline
Pro
User avatar

Joined: Wed Jun 07, 2006 8:04 pm
Posts: 464
Location: MI
Google Talk: asrrin29@gmail.com
Here's my contribution, sorry that I went overboard just a bit.

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

_________________
Image
Image


Top
 Profile  
 
PostPosted: Sat Apr 11, 2009 6:24 am 
Offline
Persistant Poster
User avatar

Joined: Tue May 30, 2006 2:07 am
Posts: 836
Location: Nashville, Tennessee, USA
Google Talk: rs.ruggles@gmail.com
Your address is wrong. Htpp. Lol.

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

_________________
I'm on Facebook! Google Plus My Youtube Channel My Steam Profile

Image


Top
 Profile  
 
PostPosted: Sat Apr 11, 2009 6:25 am 
Offline
Pro
User avatar

Joined: Wed Jun 07, 2006 8:04 pm
Posts: 464
Location: MI
Google Talk: asrrin29@gmail.com
Try it now.

_________________
Image
Image


Top
 Profile  
 
PostPosted: Sat Apr 11, 2009 6:26 am 
Offline
Persistant Poster
User avatar

Joined: Tue May 30, 2006 2:07 am
Posts: 836
Location: Nashville, Tennessee, USA
Google Talk: rs.ruggles@gmail.com
You fixed it!

_________________
I'm on Facebook! Google Plus My Youtube Channel My Steam Profile

Image


Top
 Profile  
 
PostPosted: Sat Apr 11, 2009 11:49 am 
Offline
Pro
User avatar

Joined: Tue Nov 13, 2007 2:42 pm
Posts: 509
I did a brief look through and it looks great so far!


Top
 Profile  
 
PostPosted: Sun Apr 12, 2009 8:14 pm 
Offline
Knowledgeable

Joined: Sun Jan 13, 2008 5:59 pm
Posts: 107
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)


Top
 Profile  
 
PostPosted: Fri Apr 17, 2009 5:45 am 
Offline
Knowledgeable
User avatar

Joined: Thu Jun 01, 2006 11:16 pm
Posts: 112
:'(

SPOILER: (click to show)
Image

_________________
Matt wrote:
We need more black people around here, that way they don't have to dub a white person as the local black guy.


Top
 Profile  
 
PostPosted: Fri Apr 17, 2009 6:48 am 
Offline
Pro
User avatar

Joined: Wed Jun 07, 2006 8:04 pm
Posts: 464
Location: MI
Google Talk: asrrin29@gmail.com
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

_________________
Image
Image


Top
 Profile  
 
PostPosted: Sun Apr 19, 2009 10:17 pm 
Offline
Knowledgeable

Joined: Sun Jan 13, 2008 5:59 pm
Posts: 107
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.


Top
 Profile  
 
PostPosted: Sat May 16, 2009 3:18 pm 
Offline
Regular
User avatar

Joined: Thu Aug 28, 2008 7:55 pm
Posts: 62
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.


Top
 Profile  
 
PostPosted: Sat May 16, 2009 3:32 pm 
Offline
Regular
User avatar

Joined: Thu Aug 28, 2008 7:55 pm
Posts: 62
I am not sure if my calc has any errors...but here it is.


Attachments:
calc.rar [2.56 KiB]
Downloaded 312 times
Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 12 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group