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: 223

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.
  • The Helper The Helper:
    I am not big on the recipes I am just promoting them - I use the site as a practice place promoting stuff
    +2
  • Monovertex Monovertex:
    @tom_mai78101 I must be blind. If I go on my profile I don't see any area to edit the signature; If I go to account details (settings) I don't see any signature area either.
  • The Helper The Helper:
    You can get there if you click the bell icon (alerts) and choose preferences from the bottom, signature will be in the menu on the left there https://www.thehelper.net/account/preferences
  • The Helper The Helper:
    I think I need to split the Sci/Tech news forum into 2 one for Science and one for Tech but I am hating all the moving of posts I would have to do
  • The Helper The Helper:
    What is up Old Mountain Shadow?
  • The Helper The Helper:
    Happy Thursday!
    +1
  • Varine Varine:
    Crazy how much 3d printing has come in the last few years. Sad that it's not as easily modifiable though
  • Varine Varine:
    I bought an Ender 3 during the pandemic and tinkered with it all the time. Just bought a Sovol, not as easy. I'm trying to make it use a different nozzle because I have a fuck ton of Volcanos, and they use what is basically a modified volcano that is just a smidge longer, and almost every part on this thing needs to be redone to make it work
  • Varine Varine:
    Luckily I have a 3d printer for that, I guess. But it's ridiculous. The regular volcanos are 21mm, these Sovol versions are about 23.5mm
  • Varine Varine:
    So, 2.5mm longer. But the thing that measures the bed is about 1.5mm above the nozzle, so if I swap it with a volcano then I'm 1mm behind it. So cool, new bracket to swap that, but THEN the fan shroud to direct air at the part is ALSO going to be .5mm to low, and so I need to redo that, but by doing that it is a little bit off where it should be blowing and it's throwing it at the heating block instead of the part, and fuck man
  • Varine Varine:
    I didn't realize they designed this entire thing to NOT be modded. I would have just got a fucking Bambu if I knew that, the whole point was I could fuck with this. And no one else makes shit for Sovol so I have to go through them, and they have... interesting pricing models. So I have a new extruder altogether that I'm taking apart and going to just design a whole new one to use my nozzles. Dumb design.
  • Varine Varine:
    Can't just buy a new heatblock, you need to get a whole hotend - so block, heater cartridge, thermistor, heatbreak, and nozzle. And they put this fucking paste in there so I can't take the thermistor or cartridge out with any ease, that's 30 dollars. Or you can get the whole extrudor with the direct driver AND that heatblock for like 50, but you still can't get any of it to come apart
  • Varine Varine:
    Partsbuilt has individual parts I found but they're expensive. I think I can get bits swapped around and make this work with generic shit though
  • Ghan Ghan:
    Heard Houston got hit pretty bad by storms last night. Hope all is well with TH.
  • The Helper The Helper:
    Power back on finally - all is good here no damage
    +2
  • V-SNES V-SNES:
    Happy Friday!
    +1
  • The Helper The Helper:
    New recipe is another summer dessert Berry and Peach Cheesecake - https://www.thehelper.net/threads/recipe-berry-and-peach-cheesecake.194169/
  • The Helper The Helper:
    I think we need to add something to the bottom of the front page that shows the Headline News forum that has a link to go to the News Forum Index so people can see there is more news. Do you guys see what I am saying, lets say you read all the articles on the front page and you get to the end and it just ends, no kind of link for MOAR!
  • The Helper The Helper:
    Happy Wednesday!
    +1
  • V-SNES V-SNES:
    Happy Friday!
    +1

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top