Jump to content
Sign in to follow this  
diikee

For loop question

Recommended Posts

diikee

<INPUT id=OidTB1.2.31 onchange=setEcam(this) value=5.00 size=8 name=OidTB1.2.31>

<INPUT onchange=setEcam(this) value=0.00 name=OidTB1.2.21>

$fps = _IETagNameGetCollection($oIE, "INPUT")

$sts = _IETagNameGetCollection($oIE, "INPUT")

For $st in $sts
;for $i = 0 to 2 step 1
        If String($st.name) = "OidTB1.2.21" Then
                for $fp in $fps
                    if String($fp.id) = "OidTB1.2.31" Then
                        _IEFormElementSetValue($fp, "5")
                        MsgBox(0,"test", "Got Here0")
                        Sleep(1000)
                        _IEFormElementSetValue  ($st, "0")
                        MsgBox(0,"test", "Got Here1")
                        Sleep(1000)
                        _IEFormElementSetValue($fp, "10")
                        MsgBox(0,"test", "Got Here2")
                        Sleep(1000)
                        _IEFormElementSetValue  ($st, "0.75")
                        MsgBox(0,"test", "Got Here3")
                        Sleep(1000)
                        _IEFormElementSetValue($fp, "0")
                        MsgBox(0,"test", "Got Here4")
                        Sleep(1000)
                        _IEFormElementSetValue  ($st, "1.5")
                        MsgBox(0,"test", "Got Here5")
                        Sleep(1000)
                        _IEFormElementSetValue($fp, "5")
                        MsgBox(0,"test", "Got Here6")
                        Sleep(1000)
                        _IEFormElementSetValue  ($st, "1.99")
                        MsgBox(0,"test", "Got Here7")
                        Sleep(1000)
                    EndIf
                Next
        EndIf
        
;Next
Next

C:\Program Files\AutoIt3\Examples\Helpfile\iqtest.au3 (440) : ==> The requested action with this object has failed.:

if String($fp.id) = "OidTB1.2.31" Then

if String($fp.id^ ERROR

->12:19:14 AutoIT3.exe ended.rc:1

what is wrong with the function above, Any help???

Edited by diikee

Share this post


Link to post
Share on other sites
diikee

Anyone willing to look at it??

Share this post


Link to post
Share on other sites
PsaltyDS

<INPUT id=OidTB1.2.31 onchange=setEcam(this) value=5.00 size=8 name=OidTB1.2.31>

<INPUT onchange=setEcam(this) value=0.00 name=OidTB1.2.21>

C:\Program Files\AutoIt3\Examples\Helpfile\iqtest.au3 (440) : ==> The requested action with this object has failed.: 
if String($fp.id) = "OidTB1.2.31" Then 
if String($fp.id^ ERROR
->12:19:14 AutoIT3.exe ended.rc:1

what is wrong with the function above, Any help???

Please put "code, /code" tags around your code to preserve indentation, and forget you ever saw color tags!

What was this supposed to do? Both $sts and $fps contain the exact same collections, so what is the nesting for?

:)


Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

Share this post


Link to post
Share on other sites
diikee

The nesting is for populating one text box after the other one

I want toggle between the 2 txt boxes which are distinguished by name which has different name

Edited by diikee

Share this post


Link to post
Share on other sites
diikee

for $st in $sts 
    for $i = 1 to 15 step 3
        If String($st.name) = "OidTB1.2.31" Then
            _IEFormElementSetValue($st, "" & $i, 1)
            sleep(6000)
            
        EndIf
    Next
Next

If I use the $f_fireEvent=0 the settings increment by 3 but onchange is not initiated

whereas

If I use the $f_fireEvent=1 the the value = 1 is set in the textbox and onchange is initiated, but it never increments to 4

rather errors with

C:\Program Files\AutoIt3\Examples\Helpfile\iqtest.au3 (394) : ==> The requested action with this object has failed.:

If String($st.name) = "OidTB1.2.31" Then

If String($st.name^ ERROR

->15:20:58 AutoIT3.exe ended.rc:1

Share this post


Link to post
Share on other sites
diikee

<TD class=input>max frame rate (fps) <INPUT id=OidTB1.2.31 onchange=setEcam(this) value=10.00 size=8 name=OidTB1.2.31></TD>

$sts = _IETagNameGetCollection($oIE, "input")

for $st in $sts 
;for $i = 5 to 15 step 3
    ;If String($st.id) = "OidTB1.2.31" Then
            if String($st.type) = "text" Then
            ;if String(_IEPropertyGet($st, "name")) = "OidTB1.2.31" Then
                    if String($st.name) = "OidTB1.2.31" Then
                ;_IEFormElementSetValue($st, "" & $i, 1)
                    _IEFormElementSetValue($st, "10{TAB}")
                    _IELoadWait($oIE)
                    Sleep(1000)
                    _IEFormElementSetValue($st, "5{TAB}")
                    _IELoadWait($oIE)
                    Sleep(1000)
                    _IEFormElementSetValue($st, "8{TAB}")
                    _IELoadWait($oIE)
                ;_IEFormElementSetValue($st.value, "10")
                ;_IELoadWait($oIE)
                ;Sleep(5000)
                EndIf
            EndIf
                    
    ;EndIf
;Next

if String($st.type) = "text" Then

if String($st.type^ ERROR

Can someone take a peek at this???

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.