| View previous topic :: View next topic |
| Author |
Message |
Nesray Cheater
Reputation: 0
Joined: 25 Nov 2006 Posts: 47
|
Posted: Fri Oct 12, 2007 2:00 pm Post subject: Can someone tell me what's wrong with this?(VB6) |
|
|
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 |
|
 |
atom0s Moderator
Reputation: 205
Joined: 25 Jan 2006 Posts: 8587 Location: 127.0.0.1
|
Posted: Fri Oct 12, 2007 3:11 pm Post subject: |
|
|
| Can you give more info? Such as errors, or what it is supposed to do and isn't doing.
|
|
| Back to top |
|
 |
Nesray Cheater
Reputation: 0
Joined: 25 Nov 2006 Posts: 47
|
Posted: Fri Oct 12, 2007 4:29 pm Post subject: |
|
|
| It doesn't give me an error but just closes...
|
|
| Back to top |
|
 |
holyman Master Cheater
Reputation: 0
Joined: 08 Oct 2005 Posts: 347
|
Posted: Fri Oct 12, 2007 5:41 pm Post subject: |
|
|
what is after the "Next" at bottom ?
_________________
|
|
| Back to top |
|
 |
Heartless I post too much
Reputation: 0
Joined: 03 Dec 2006 Posts: 2436
|
Posted: Sat Oct 13, 2007 7:48 am Post subject: |
|
|
I think you have to use Single, not Integer.
_________________
What dosen't kill you, usually does the second time. |
|
| Back to top |
|
 |
atom0s Moderator
Reputation: 205
Joined: 25 Jan 2006 Posts: 8587 Location: 127.0.0.1
|
Posted: Sat Oct 13, 2007 10:09 am Post subject: |
|
|
| HornyAZNBoy wrote: |
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 |
|
 |
|