A calculator I made

Demi666

New Member
Reaction score
127
Ok, this was my first project for VB6
Its a very very very simple calculator. It knows the terms plus,minus,divided,and multiplication.

Also Please post reply with feedback/thoughts

If anyone find a bug please post it here

Edit:
Fixed a small typo that sometime could couse wrong numbers in the calculation

Also im working on a File Manager its WIP atm, ill release beta here later =)

Code is here:

Code:
Dim iForm1 As Integer, iForm2 As Double, iA As Double, strOption As Double, sstrVariable As String, strVariable As String, ttText As String, cCounter As Integer
'Made by Demi666 a.Ka John Bradley

Public Sub Command1_Click()
Form1.Caption = "Loading."
Form1.Caption = "Loading.."
Form1.Caption = "Loading..."
Form1.Caption = "Loading...."
Form1.Caption = "Loading....."
Form1.Caption = "Loading......"
Form1.Caption = "Done!"

    iForm1 = CInt(strVariable)
    iForm2 = CInt(sstrVariable)
        
        If Option1.Value = True Then
        strOption = iForm1 + iForm2
                ttText = "+"
            ElseIf Option2.Value = True Then
            strOption = iForm1 - iForm2
                    ttText = "-"
                ElseIf Option3.Value = True Then
                    strOption = iForm1 / iForm2
                            ttText = "/"
                        ElseIf Option4.Value = True Then
                            strOption = iForm1 * iForm2
                                    ttText = "*"
                        End If
        
        
        
Label1.Caption = iForm1 & ttText & iForm2 & "=" & strOption
End Sub



Private Sub Form_Load()
Call MsgBox("This calculator was made by John Bradley a.Ka Demi666", vbOKOnly, "Credit")
End Sub

Private Sub Label1_Click()
Label1.Caption = ""
Call MsgBox("The text has been cleared", vbOKOnly, "Calculator")
End Sub

Private Sub Text1_Change()
strVariable = Text1.Text
End Sub

Private Sub Text2_Change()
sstrVariable = Text2.Text
End Sub

Private Sub Timer1_Timer()
cCounter = cCounter + 1
Form1.Caption = "Calculator  " & cCounter & " - " & Time
End Sub
 

Attachments

  • Project C.zip
    4.9 KB · Views: 217

holy_spirit

New Member
Reaction score
25
Glade to see some code here
I'll check it later
+rep for being a programmer ;-)
Note: try to use comments, it gives your Code more understandability
 
Reaction score
456
>Whats wrong with VB?
Does exactly what you want, so there's nothing wrong with it.

It works nicely, but one bad thing is that it doesn't create a button on the bar (no idea what those are really called), so if I have many windows opened, it's like pain in the ass to search for the calculator.

You should work on the layout a bit. Maybe create a textbox (where cannot be written anything) where the result is shown.

The size of the "Calculate" button is ridiculous.

The number increasing and current time on the top isn't needed at all for a calculator, but I guess you're just learning some basics.
 

Demi666

New Member
Reaction score
127
>Whats wrong with VB?
Does exactly what you want, so there's nothing wrong with it.

It works nicely, but one bad thing is that it doesn't create a button on the bar (no idea what those are really called), so if I have many windows opened, it's like pain in the ass to search for the calculator.

You should work on the layout a bit. Maybe create a textbox (where cannot be written anything) where the result is shown.

The size of the "Calculate" button is ridiculous.

The number increasing and current time on the top isn't needed at all for a calculator, but I guess you're just learning some basics.

>The number increasing and current time on the top isn't needed at all for a calculator, but I guess you're just learning some basics.

Learn by doing^^ so yea

>You should work on the layout a bit. Maybe create a textbox (where cannot be written anything) where the result is shown.

There is, if i take 50 * 2 it says under the texbars 50*2=100

>The size of the "Calculate" button is ridiculous.
Its imba

>It works nicely, but one bad thing is that it doesn't create a button on the bar (no idea what those are really called), so if I have many windows opened, it's like pain in the ass to search for the calculator.

I can make that:p
 
Reaction score
333
Whats wrong with VB?

Nothing per se, it simply offers a very ugly and very limited programming experience. Delphi might be a better alternative for the things you're doing.

>Whats wrong with VB?
Does exactly what you want, so there's nothing wrong with it.

This sort of pragmatism doesn't work. All (well, most) cars can drive, so there should be no reason to choose one car over any other?
 
Reaction score
456
You, TheDamien, are too much against everything.

>All (well, most) cars can drive, so there should be no reason to choose one car over any other?
I don't drive cars. I <3 these!
 

n[u]ll

You can change this now in User CP.
Reaction score
93
Nothing per se, it simply offers a very ugly and very limited programming experience. Delphi might be a better alternative for the things you're doing.

Delphi IS better(In the long run that is). You can do a lot more with it, and it's very easy to learn. It's what my dad prefers, and so he taught me it, and I believe it's a great choice:thup:.

If you do choose Delphi, you will want to download:
TurboDelphi

One of the best compilers/IDE I've seen.. No sense in getting the other versions Borland offers (a.k.a. the one's you pay for) because the only main difference is you can install Add-Ons, which you generally don't need.

Another great learning language is Pascal. However, keep in mind it was created for teaching basics of programming, and often going from Pascal to a more challenging language, like C++, will be very hard because the syntax is much different and it is Not Object Oriented.

And finally, if you are getting into programming so you can someday create games, I'd suggest the D Programming Language. It's got everything C++ (which is probably the most common language for game programming) has to offer, without dealing with memory. This means that, for the most part, you won't have to worry about memory leaks..
 

Demi666

New Member
Reaction score
127
>
Rapidly build web and internet applications
Rapidly build web applications without needing to know HTML, Javascript, CSS, or HTTP using the IntraWeb technology bundled with Turbo Delphi for Win32. Write applications that access the full range of Internet communications protocols with the InternetDirect (Indy) suite of components.

Do i need to know HTML etc?
I never heard of this language and i didnt really understand ... i mean.. why should i choose this instead of vb6(i know vb6 is old..)
 

n[u]ll

You can change this now in User CP.
Reaction score
93
Well, it's not just for web apps, they just have packages that help you build web apps because people like using Delphi for that.

You don't need to know HTML at all, though if you're going to do web development it's highly recommended (along with PHP, CSS, and JavaScript).

It's just a general purpose programming languages. You can create anything from that basic Hello World program, to using DelphiX DirectX to program advanced 3D Games. However, it is not the best language for game programming, for game programming you'd want to look into C++, C, or D.

Look into Delphi more with these following links:
http://en.wikipedia.org/wiki/Delphi_(programming_language)
http://delphi.about.com/cs/azindex/a/dhistory.htm

And here's a list of highly known programs built with Delphi:
http://delphi.wikia.com/wiki/Good_Quality_Applications_Built_With_Delphi
Some ones you might know off that list are
Ad-Aware
FL Studio
and Skype
 

Demi666

New Member
Reaction score
127
Delphi sounds good, is Delphi object oriented ?
And can you recommend me somewhere where i can learn basics? also i learned VB6 from iHe-Support so they helped me alot ^^ also i found a book about it, so if you have msn it would be great, if i need to ask you something or w/e
 

n[u]ll

You can change this now in User CP.
Reaction score
93
Books are always a great resource. You should check out, O'Reilly's Safari.
They always have some great books, and what's great is that all of their books are also uploaded as PDF's, meaning you don't have to get the physical book. If you wish not to spend much money on it, then
http://delphi.about.com/
has a lot of great resources and tutorials..

But if I were you, I would stay away from books and tutorials (for the most part). Because, for me at least, I don't like being taught, I'd rather learn it on my own.. I remember things easier that way, and you develop your own unique style, and creativity is a big part in just about anything..

And, yes, it is Object Oriented..
 

Rad

...
Reaction score
228
I don't think I could have learned to understand more complex things in programming. Things like pointers and references in C++, and understand public/private variables in declaring objects.

Also, don't you think its kind of pointless to put your name in such a trivial program? Calculators are usually the first thing people make. If someone knows how to program something that would even be able to use this, they could easily just write their own.
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • Varine Varine:
    How can you tell the difference between real traffic and indexing or AI generation bots?
  • The Helper The Helper:
    The bots will show up as users online in the forum software but they do not show up in my stats tracking. I am sure there are bots in the stats but the way alot of the bots treat the site do not show up on the stats
  • Varine Varine:
    I want to build a filtration system for my 3d printer, and that shit is so much more complicated than I thought it would be
  • Varine Varine:
    Apparently ABS emits styrene particulates which can be like .2 micrometers, which idk if the VOC detectors I have can even catch that
  • Varine Varine:
    Anyway I need to get some of those sensors and two air pressure sensors installed before an after the filters, which I need to figure out how to calculate the necessary pressure for and I have yet to find anything that tells me how to actually do that, just the cfm ratings
  • Varine Varine:
    And then I have to set up an arduino board to read those sensors, which I also don't know very much about but I have a whole bunch of crash course things for that
  • Varine Varine:
    These sensors are also a lot more than I thought they would be. Like 5 to 10 each, idk why but I assumed they would be like 2 dollars
  • Varine Varine:
    Another issue I'm learning is that a lot of the air quality sensors don't work at very high ambient temperatures. I'm planning on heating this enclosure to like 60C or so, and that's the upper limit of their functionality
  • Varine Varine:
    Although I don't know if I need to actually actively heat it or just let the plate and hotend bring the ambient temp to whatever it will, but even then I need to figure out an exfiltration for hot air. I think I kind of know what to do but it's still fucking confusing
  • The Helper The Helper:
    Maybe you could find some of that information from AC tech - like how they detect freon and such
  • Varine Varine:
    That's mostly what I've been looking at
  • Varine Varine:
    I don't think I'm dealing with quite the same pressures though, at the very least its a significantly smaller system. For the time being I'm just going to put together a quick scrubby box though and hope it works good enough to not make my house toxic
  • Varine Varine:
    I mean I don't use this enough to pose any significant danger I don't think, but I would still rather not be throwing styrene all over the air
  • The Helper The Helper:
    New dessert added to recipes Southern Pecan Praline Cake https://www.thehelper.net/threads/recipe-southern-pecan-praline-cake.193555/
  • The Helper The Helper:
    Another bot invasion 493 members online most of them bots that do not show up on stats
  • Varine Varine:
    I'm looking at a solid 378 guests, but 3 members. Of which two are me and VSNES. The third is unlisted, which makes me think its a ghost.
    +1
  • The Helper The Helper:
    Some members choose invisibility mode
    +1
  • The Helper The Helper:
    I bitch about Xenforo sometimes but it really is full featured you just have to really know what you are doing to get the most out of it.
  • The Helper The Helper:
    It is just not easy to fix styles and customize but it definitely can be done
  • The Helper The Helper:
    I do know this - xenforo dropped the ball by not keeping the vbulletin reputation comments as a feature. The loss of the Reputation comments data when we switched to Xenforo really was the death knell for the site when it came to all the users that left. I know I missed it so much and I got way less interested in the site when that feature was gone and I run the site.
  • Blackveiled Blackveiled:
    People love rep, lol
    +1
  • The Helper The Helper:
    The recipe today is Sloppy Joe Casserole - one of my faves LOL https://www.thehelper.net/threads/sloppy-joe-casserole-with-manwich.193585/
  • The Helper The Helper:
    Decided to put up a healthier type recipe to mix it up - Honey Garlic Shrimp Stir-Fry https://www.thehelper.net/threads/recipe-honey-garlic-shrimp-stir-fry.193595/

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top