Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


can you do programs in vb6?

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
xXx123
Expert Cheater
Reputation: 0

Joined: 27 Sep 2007
Posts: 118

PostPosted: Wed Nov 14, 2007 5:15 pm    Post subject: can you do programs in vb6? Reply with quote

i dont mean very good ones but simple ones... like i dont know like a calculator... can u give me more exaamples and how to do it?

thank you Razz
Back to top
View user's profile Send private message
atom0s
Moderator
Reputation: 205

Joined: 25 Jan 2006
Posts: 8588
Location: 127.0.0.1

PostPosted: Wed Nov 14, 2007 5:42 pm    Post subject: Reply with quote

Something very basic:

Add 1 command button to your form. Use the code:

Code:
Private Sub Command1_Click()
    MsgBox "1 + 1 = " & Val(1 + 1)
End Sub


To make it a little more advanced, add two text boxes to your form and use:

Code:
Private Sub Command1_Click()
    MsgBox Text1.Text & " + " & Text2.Text & " = " & (Val(Text1.Text) + Val(Text2.Text))
End Sub


Use your common sense from there to add other things and so on.

_________________
- Retired.
Back to top
View user's profile Send private message Visit poster's website
xXx123
Expert Cheater
Reputation: 0

Joined: 27 Sep 2007
Posts: 118

PostPosted: Wed Nov 14, 2007 5:48 pm    Post subject: Reply with quote

thank you but can you give more examples...
Back to top
View user's profile Send private message
XxOsirisxX
Grandmaster Cheater Supreme
Reputation: 0

Joined: 30 Oct 2006
Posts: 1597

PostPosted: Wed Nov 14, 2007 9:08 pm    Post subject: Reply with quote

+ = Add
- = substract
* = multiplication
/ = division



Make a new project, with 2 textbox, 1 label and 4 buttons..

in the first command (add) add this..


Code:
Label1.caption = val(text1) + val(text2)


Add the same line for the others buttons, but remplace the "+" for the other operator ( - , * , / ).

There you got a cheap calculator on VB.

_________________

Back to top
View user's profile Send private message
MisterT
Advanced Cheater
Reputation: 0

Joined: 30 Aug 2006
Posts: 76

PostPosted: Wed Nov 14, 2007 11:02 pm    Post subject: Reply with quote

Sadly yeah, though I don't recommend as an introduction to programming, Try some other less-visual oriented programs...
As the previous post have stated,
Declare a variable as double, integer or any other type you want and create two textboxes, a button and a label/textbox or use a msgbox, (but of course msgboxes are annoying).

declare (dim) variable as integer/variant/double/etc
Private Sub Command1_Click()
variable = textbox 1 + textbox 2
label1.caption =variable
End Sub

_________________

Finished on 10/21/06, 17:31, by MisterT
Back to top
View user's profile Send private message
atom0s
Moderator
Reputation: 205

Joined: 25 Jan 2006
Posts: 8588
Location: 127.0.0.1

PostPosted: Thu Nov 15, 2007 12:15 am    Post subject: Reply with quote

Some suggestions as you start too. Learn Error Handling early on, you will appreciate it when you need it. Error handling is 1 major cause a lot of programs suck, because they don't have any. Wink

Calculators are a good program to start with in any language as well. It helps you understand the basics of the language, learn how to use math with the language in question, etc. I don't think you can get much more basic then that in VB anyway. (Hello World doesn't count.)

Check out www.pscode.com for some source code examples as well as www.freevbcode.com for more code samples, and articles. A good API reference can be found at: http://allapi.mentalis.org/apilist/apilist.php

Just start slow, make sure to understand what you are doing before moving on. Don't stress yourself. Drink lots of coffee.

_________________
- Retired.
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
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 vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites