2 FIP>

Technical support and scripting issues

Moderators: JRL, Dorian (MJT support)

Post Reply
hoangvo81
Pro Scripter
Posts: 69
Joined: Tue Feb 07, 2012 8:02 pm

2 FIP>

Post by hoangvo81 » Mon Feb 25, 2013 4:54 pm

Hi,

Looking for some help. I m abit confused since the script portion works fine when I go through it line by line via the puttin a breakpoint below the else.

here's the code,

Code: Select all

    wwo>Fixed Ops Sales Manager
    if>WW_RESULT=FALSE
        let>fName=OpenFixedOps - cannot find FOSM.
        gosub>WriteToLog
    else

        gosub>WriteToLog
        setfocus>Fixed Ops Sales Manager
        let>count=1
Label>CheckLoadFosm
        fip>%SCRIPT_DIR%\BMP_DIR\FOSMCloseBtn.bmp,WINDOW:Fixed Ops Sales Manager,10,0,x,y,n
        fip>%SCRIPT_DIR%\BMP_DIR\FOSMRecord.bmp,WINDOW:Fixed Ops Sales Manager,10,0,r,s,p
        if>{(%n%>0) and (%p%>0)}
        **BREAKPOINT**
            gettime>end
            let>fName=OpenFixedOpsImageSearch
            gosub>WriteToLog
            setfocus>Fixed Ops Sales Manager
            let>SRTResult=TRUE
        else
            if>count>10
                goto>CheckLoadFosm
                add>count,1
                wait>1.5
            else
                let>fName=OpenFixedOps - Cannot find Close and Record button/label
                gosub>WriteToLog
            endif
        endif

    endif

the above if statement is where the it failed if I just let the program run. But if i take the breakpoint above the two FIP, and step through the code it pass without a problem.

anyone experiencing this?

Thanks,

Hoang

EnderFFX
Pro Scripter
Posts: 92
Joined: Mon Mar 08, 2004 6:17 am

Post by EnderFFX » Mon Feb 25, 2013 6:29 pm

Would a slight time delay in between the fip statements fix it? Anytime I run a debugger and the program works step by step but doesn't work in real time usually means I need a time delay for some processing.

hoangvo81
Pro Scripter
Posts: 69
Joined: Tue Feb 07, 2012 8:02 pm

Post by hoangvo81 » Mon Feb 25, 2013 7:34 pm

Hi,

you are right - i found the problem was in the:
If>count>10

it never made it there because count=1
changed it to :
if>count<10

this way it now wait 1.5, add 1 go to teh label and repeat the process until it finds it or until it reaches 10 tries.


Thanks,

Hoang

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts