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 someone tell me what's wrong with this?(VB6)

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

Joined: 25 Nov 2006
Posts: 47

PostPosted: Fri Oct 12, 2007 2:00 pm    Post subject: Can someone tell me what's wrong with this?(VB6) Reply with quote

I know it's probably something really easy and I just keep missing it or whatever.. But here's the code:

Code:
Dim i As Integer, x As Integer, y As Integer
Dim Row As Integer, Col As Integer
Dim X2 As Integer, Y2 As Integer
Dim validity As Boolean
For i = 0 To 80
 If Len(tile(i)) = 1 And Not tile(i).Locked Then
     validity = True
     IndexToXY i, x, y
     For X2 = 1 To 9
     If X2 <> x Then If tile(XYtoIndex(X2, y)) = tile(i) Then validity False: Exit For
     If X2 <> y Then If tile(XYtoIndex(x, X2)) = tile(i) Then validity False: Exit For
     For Y2 = (Int((y - 1) / 3) * 3) + 1 To (Int((y - 1) / 3) * 3) + 3
      For X2 = (Int((x - 1) / 3) * 3) + 1 To (Int((x - 1) / 3) * 3) + 3
       If (X2 <> x And Y2 <> y) And tile(XYtoIndex(X2, Y2)) = tile(i) Then validity False: Exit For
      Next
      If Not validity Then Exit For
     Next
     
     If Not validity Then
      CheckMaths = False
      tile(i).BackColor = 255
     End If
 End If
Next
Back to top
View user's profile Send private message
atom0s
Moderator
Reputation: 205

Joined: 25 Jan 2006
Posts: 8587
Location: 127.0.0.1

PostPosted: Fri Oct 12, 2007 3:11 pm    Post subject: Reply with quote

Can you give more info? Such as errors, or what it is supposed to do and isn't doing.
Back to top
View user's profile Send private message Visit poster's website
Nesray
Cheater
Reputation: 0

Joined: 25 Nov 2006
Posts: 47

PostPosted: Fri Oct 12, 2007 4:29 pm    Post subject: Reply with quote

It doesn't give me an error but just closes...
Back to top
View user's profile Send private message
holyman
Master Cheater
Reputation: 0

Joined: 08 Oct 2005
Posts: 347

PostPosted: Fri Oct 12, 2007 5:41 pm    Post subject: Reply with quote

what is after the "Next" at bottom ?
_________________




Back to top
View user's profile Send private message
Heartless
I post too much
Reputation: 0

Joined: 03 Dec 2006
Posts: 2436

PostPosted: Sat Oct 13, 2007 7:48 am    Post subject: Reply with quote

Code:
Dim i As Single


I think you have to use Single, not Integer.

_________________
What dosen't kill you, usually does the second time.
Back to top
View user's profile Send private message
atom0s
Moderator
Reputation: 205

Joined: 25 Jan 2006
Posts: 8587
Location: 127.0.0.1

PostPosted: Sat Oct 13, 2007 10:09 am    Post subject: Reply with quote

HornyAZNBoy wrote:
Code:
Dim i As Single


I think you have to use Single, not Integer.


For his/her above code, i only equals all the numbers between 0 to 80 which are integer values. If anything, if that would be all it will ever equal, should be using byte.

After looking at the code, I can't really determine what it's for and such or able to test it myself without seeing the rest of the code thats with it, but I think you missed a 'Next' in there.

4 'For'
3 'Next'

Looks like it should be after:
Code:
      If Not validity Then
         CheckMaths = False
         tile(i).BackColor = 255
      End If
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