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 


[VB 6]Little help needed :P (Answered)

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

Joined: 09 Jul 2006
Posts: 762
Location: Poland.

PostPosted: Mon Dec 15, 2008 3:48 pm    Post subject: [VB 6]Little help needed :P (Answered) Reply with quote

ok so i made thread about the same but in VC++, i also know more VB so better when i go on with VB instead VC.

1.I Have Text1 where i need to put number.
2.Click a Button then it will be divided by 3 then multiplicated by 2.
3.Result have to appear in Text2.

umm i did this:
Code:
Private Sub Command1_Click()
Text2 = Val(Tekxt1.Text) / 3 * 2
End Sub


but does not work xD idk why Razz if someone can explain me how to fix it? Confused


Last edited by Wiw3K on Mon Dec 15, 2008 4:27 pm; edited 1 time in total
Back to top
View user's profile Send private message
gogodr
I post too much
Reputation: 125

Joined: 19 Dec 2006
Posts: 2041

PostPosted: Mon Dec 15, 2008 4:01 pm    Post subject: Reply with quote

Private Sub Command1_Click()
Text2.Text = Val(Tekxt1.Text) / 3 * 2
End Sub

done

but I recommend you to use labels to show values


Last edited by gogodr on Mon Dec 15, 2008 4:01 pm; edited 1 time in total
Back to top
View user's profile Send private message MSN Messenger
hcavolsdsadgadsg
I'm a spammer
Reputation: 26

Joined: 11 Jun 2007
Posts: 5801

PostPosted: Mon Dec 15, 2008 4:01 pm    Post subject: Reply with quote

I've never used VB6, but this seems right enough

TextBox2.Text = CStr(CInt(TextBox1.Text) / 3 * 2)
Back to top
View user's profile Send private message
Wiw3K
Grandmaster Cheater
Reputation: 0

Joined: 09 Jul 2006
Posts: 762
Location: Poland.

PostPosted: Mon Dec 15, 2008 4:15 pm    Post subject: Reply with quote

slovach wrote:
I've never used VB6, but this seems right enough

TextBox2.Text = CStr(CInt(TextBox1.Text) / 3 * 2)

ty for help alot but gogodr answer works Smile

gogodr wrote:
Private Sub Command1_Click()
Text2.Text = Val(Tekxt1.Text) / 3 * 2
End Sub

done

but I recommend you to use labels to show values

ok everything ok Very Happy i want now make not show like 23.233333

eg.
23
press button
15,333333
appear , i want to show 15 only , not 15,333333
how i can do that?
Back to top
View user's profile Send private message
gogodr
I post too much
Reputation: 125

Joined: 19 Dec 2006
Posts: 2041

PostPosted: Mon Dec 15, 2008 4:23 pm    Post subject: Reply with quote

Wiw3K wrote:
slovach wrote:
I've never used VB6, but this seems right enough

TextBox2.Text = CStr(CInt(TextBox1.Text) / 3 * 2)

ty for help alot but gogodr answer works Smile

gogodr wrote:
Private Sub Command1_Click()
Text2.Text = Val(Tekxt1.Text) / 3 * 2
End Sub

done

but I recommend you to use labels to show values

ok everything ok Very Happy i want now make not show like 23.233333

eg.
23
press button
15,333333
appear , i want to show 15 only , not 15,333333
how i can do that?

you can use
Round()
or
Trunk()

Private Sub Command1_Click()
Text2.Text = Round(Val(Tekxt1.Text) / 3 * 2,0 )
End Sub

or

Private Sub Command1_Click()
Text2.Text = Trunk(Val(Tekxt1.Text) / 3 * 2,0 )
End Sub



--------------

round , rounds the number
Rolling Eyes

and Trunk just deletes the decimals
Back to top
View user's profile Send private message MSN Messenger
Wiw3K
Grandmaster Cheater
Reputation: 0

Joined: 09 Jul 2006
Posts: 762
Location: Poland.

PostPosted: Mon Dec 15, 2008 4:26 pm    Post subject: Reply with quote

gogodr wrote:

you can use
Round()
or
Trunk()

Private Sub Command1_Click()
Text2.Text = Round(Val(Tekxt1.Text) / 3 * 2,0 )
End Sub

or

Private Sub Command1_Click()
Text2.Text = Trunk(Val(Tekxt1.Text) / 3 * 2,0 )
End Sub



--------------

round , rounds the number
Rolling Eyes

and Trunk just deletes the decimals

Round method works wery vell Smile Thank you again.


Trunk ~ Gives error something not defined.
Back to top
View user's profile Send private message
hcavolsdsadgadsg
I'm a spammer
Reputation: 26

Joined: 11 Jun 2007
Posts: 5801

PostPosted: Mon Dec 15, 2008 6:02 pm    Post subject: Reply with quote

Don't use a floating point value
Back to top
View user's profile Send private message
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