Question about For next and variable
Hi everyone!!!
Here is my problem:
I used the code of a graphic filther that I found on this site
(here's the code) |
|
V
For x = 1 To FrmDessin1.PictureDessin.ScaleHeight - 3
For y = 1 To FrmDessin1.PictureDessin.ScaleWidth - 3
pixval = FrmDessin1.PictureDessin.Point(y+ CInt(Rnd * 10), x + CInt(Rnd * 10))
red_val = "&h" & Mid$(CStr(Hex(pixval)), 5, 2)
green_val = "&h" & Mid$(CStr(Hex(pixval)), 3, 2)
blue_val = "&h" & Mid$(CStr(Hex(pixval)), 1, 2)
If red_val = "&h" Then red_val = "&h0"
If green_val = "&h" Then green_val = "&h0"
If blue_val = "&h" Then blue_val = "&h0"
FrmDessin1.PictureDessin.PSet (y, x), RGB(red_val, green_val, blue_val)
Next
Next
Now 1st when I used it, it worked fine but....I did something later
and now my Application won't compile. The error said that the variable x and y were not defined.
could someone tell me what could I have done wrong and how to
make it work again?