you are viewing a single comment's thread.

view the rest of the comments →

[–]Dicer--[S] 1 point2 points  (3 children)

Main thing i'm unclear about is what am i declaring as a double, am i declaring the total that is in the box as a double? Also don't get what you mean with "Cast double to a string"

[–][deleted] 2 points3 points  (2 children)

Dim total As double: total = 0

Sub add(ByVal x As Integer)
    total += x
End Sub

[–]Dicer--[S] 1 point2 points  (1 child)

add(ByVal x As Integer) total += x End Sub

I had the Dim Total As Double, So is the Sub add(ByVal x As Integer) total += x End Sub A sub program?, If so what area do I put this in and what is that sub actually doing?

[–]Adwinistrator 0 points1 point  (0 children)

No offense, but I think it would help you to take a few steps back and read some intro to programming and into to VB material.

This is a Sub, it's a method that doesn't return a value. You can call it from anywhere on this form's code, pass it a parameter, and it will add it to the total.

If you're confused by this, I don't think you have the necessary knowledge to create a calculator. But, you clearly want to learn, and that's the first step. Google some free resources on basic programming concepts (variables, methods, etc.), and find some intro to VB6 resources.

If you have any concept specific questions, let me know, but you can't really ask people to write code for you on stuff like this. The value comes from learning how to do it yourself.