Sign in to follow this  
Followers 0
BlackFog

Array variable subscript badly formatted

5 posts in this topic

#1 ·  Posted (edited)

Hi,

I was using that OCR Program but everytime I run the Script there is "Array variable subscript badly formatted" at

Dim $char[$width][$length]

Dim $char[$width][^ ERROR

My Code is that:

#include <ocr.au3>

HotKeySet("h","check")

while 1
    sleep(100)
WEnd

func check()
$test = _OCR("65", "55", "335", "35")
MsgBox(0,"something",$test,1)
EndFunc

The Directlink to the Function is here.

I hope that anybody can help me an sorry for my bad English :).

BlackFog

Edited by BlackFog

Share this post


Link to post
Share on other sites

#2 ·  Posted (edited)

Did you try (passing numbers without quotes):

#include 

HotKeySet("h","check")

while 1
    sleep(100)
WEnd

func check()
$test = _OCR(65, 55, 335, 35)
MsgBox(0,"something",$test,1)
EndFunc
Edited by weaponx

Share this post


Link to post
Share on other sites

Thank's for the fast Reply but this didn't change anything.

BlackFog

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

In your OCR function, $length is calculated as $length = $Dy - $Ay

Your are passing $length = 35 - 55 which is a negative number, this will not work.

Something like this might work: $test = _OCR("65", "55", "335", "60")

Edited by weaponx

Share this post


Link to post
Share on other sites

Thank you now it works perfect :)

Share this post


Link to post
Share on other sites

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
Sign in to follow this  
Followers 0