Jump to content

Recommended Posts

Posted (edited)

Don't laugh, I probably have so much weird crap wrong but I like lost myself in my own code. Line 10 is messed up. Please help

Func _ControlUnderMouse()
   Opt("MouseCoordMode", 0)
   $currentwin = WinGetTitle("")
   $currentwinclasses = WinGetClassList($currentwin)
   $classes = StringSplit($currentwinclasses, @LF)
   For $i = 1 to $classes[0]
      $pos = ControlGetPos($currentwin, "", $classes[$i])
      If IsArray($pos) = 1 Then
         $mousepos = MouseGetPos()
         If $mousepos[0] => $pos[0] and $mousepos[0] <= ($pos[0] + $pos[2]) and $mousepos[1] => $pos[1] and $mousepos[1] <= ($pos[1] + $pos[3]) Then
            Return $class[$i]
         EndIf
      EndIf
   Next
   Opt("MouseCoordMode", 1)
EndFunc
Edited by the_lord_mephy
My site for HTML Help :)[quote name='Valik' date='Oct 15 2004, 12:29 PM']Maybe nobody is an "elite uber-coder" like me because thinking is a capital offense in today's online-world?[right][snapback]36427[/snapback][/right][/quote]
Guest Guidosoft
Posted (edited)

($pos[0] + $pos[2])

Does $Pos[2] exist?

If that is not the prob i will keep lookin.

O well, I tried. I am oblivious to what it is suppost to do so it is harder to look for the error.

You know what, now I am sure that is not the problem. O well, I suck at finding bugs in things. Now beating myself with a pole.

What does @LF stand for. Low fat?

Edited by Guidosoft
Posted

Don't laugh, I probably have so much weird crap wrong but I like lost myself in my own code. Line 10 is messed up. Please help

Func _ControlUnderMouse()
   Opt("MouseCoordMode", 0)
   $currentwin = WinGetTitle("")
   $currentwinclasses = WinGetClassList($currentwin)
   $classes = StringSplit($currentwinclasses, @LF)
   For $i = 1 to $classes[0]
      $pos = ControlGetPos($currentwin, "", $classes[$i])
      If IsArray($pos) = 1 Then
         $mousepos = MouseGetPos()
         If $mousepos[0] => $pos[0] and $mousepos[0] <= ($pos[0] + $pos[2]) and $mousepos[1] => $pos[1] and $mousepos[1] <= ($pos[1] + $pos[3]) Then
            Return $class[$i]
         EndIf
      EndIf
   Next
   Opt("MouseCoordMode", 1)
EndFunc

<{POST_SNAPBACK}>

1. The Equal Sign must follow the Greater Than symbol.

2. $class[$i] spelled wrong. Should be $Classes[$i].

I used the SciTE editor to pinpoint these errors via the Syntax Check option.

Phillip

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...