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 Express Expec error

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
RoXoY
How do I cheat?
Reputation: 0

Joined: 08 Aug 2007
Posts: 0
Location: FBI department

PostPosted: Tue Aug 21, 2007 6:29 am    Post subject: VB Express Expec error Reply with quote

Hey,
i just began with VB, and im following a tutorial,
right now im making an Slot machine,
but i get an error, and i cant figure out why..
its called Expression Expected,
its located at the '' = ''.


Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
PictureBox1.Visible = False
Label1.Text = CStr(Int(Rnd() * 10))
Label2.Text = CStr(Int(Rnd() * 10))
Label3.Text = CStr(Int(Rnd() * 10))
If (Label1.Text =Here's the problem ''7'') Or (Label2.Text = ''7'') Or (Label3.Text = ''7'') Then
PictureBox1.Visible = True
End If
End Sub
End Class

I would have posted a Screenshot.. but i can't yet.
Please answer.

Thanks.

_________________
Oh and by the way, my English sucks.
Back to top
View user's profile Send private message
Zand
Master Cheater
Reputation: 0

Joined: 21 Jul 2006
Posts: 424

PostPosted: Tue Aug 21, 2007 7:07 am    Post subject: Reply with quote

Never randomize slot machines. Make it so that you always make money.
Back to top
View user's profile Send private message
nog_lorp
Grandmaster Cheater
Reputation: 0

Joined: 26 Feb 2006
Posts: 743

PostPosted: Tue Aug 21, 2007 7:20 am    Post subject: Reply with quote

Comparisons are done with ==, not =.

Should be If (blah == "7")

_________________
Mutilated lips give a kiss on the wrist of the worm-like tips of tentacles expanding in my mind
I'm fine accepting only fresh brine you can get another drop of this yeah you wish
Back to top
View user's profile Send private message
RoXoY
How do I cheat?
Reputation: 0

Joined: 08 Aug 2007
Posts: 0
Location: FBI department

PostPosted: Tue Aug 21, 2007 8:06 am    Post subject: Reply with quote

Wtf.. i just needed to Delete the '' in front and after the number 7, and it worked..
Thanks for reply tho

_________________
Oh and by the way, my English sucks.
Back to top
View user's profile Send private message
DeltaFlyer
Grandmaster Cheater
Reputation: 0

Joined: 22 Jul 2006
Posts: 666

PostPosted: Tue Aug 21, 2007 10:22 am    Post subject: Reply with quote

nog_lorp wrote:
Comparisons are done with ==, not =.

Should be If (blah == "7")


But this is VB, designed for someone who have never touched a programming language before and would never know the difference between == and =, or even the meaning of ==. Double equal signs don't exist in VB.

OP, your problem is that you used double single quotes instead of double quotes. Single quotes in VB signifies the start of a single line comment. By deleting the single quotes, you let VB do the work of converting the string into an int, thus you will never know that you can't compare a string to an integer directly.

Lesson: don't learn VB.

_________________

Wow.... still working at 827... what's INCA thinking?
zomg l33t hax at this place (IE only). Over 150 people have used it, what are YOU waiting for?
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