Jump to content
Sign in to follow this  

object / array related error handling problem

Recommended Posts


hey guys, sorry if this a little noobish of me, i know their is alot of documentation about error obj handling.

but i thought i'd post my problem anyways, maybe someone with better unstanding can help me.

thus far in my script i have been able to avoid any error obj handling with simple IsObj and IsArray use.

Local $BAcom = ObjCreate("BettingAssistantCom.Application.ComClass")

IsObj($BAcom) returns 1 (all is well)

$getBets_obj = $BAcom.getBets()

Documentation states getBets() returns an object, however IsObj($getBets_obj) returns 0, but also IsArray($getBets_obj) returns 1.

i dont know why IsObj returns 0, as i have to use

For $Element In $getBets_obj

$getBets[$int][1] = $Element.Selection


to obtain the data from $getBets_obj, which surely makes it an object?

now the problem comes with trying to gather the size of $getBets_obj,

here are some example calls depending on number of elements (i know the number of elements because i can set them manualy)


0 elements = 1

1 element = 1

2 element = 2


0 elements = 1

1 element = 1

2 element = 1


0 elements = 0

1 element = 0

2 element = 0

applogies for the lengthy post btw, so the problem i have is that i cant detect in ubound() = 1 arrays if the first $Element.Selection exists

without bottling out with autoit error.

i know i can use

Global $oMyError = ObjEvent("AutoIt.Error","MyErrFunc")

to detect this error, but im more leaning towards maybe detecting if just $Element.Selection returns an error, as i would rather not have

the error handler for my entire program just because i cant get past this wall.

if their is a simple solution to this, please dont flame me ^^

Edited by laffo16

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  


Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.