Recently Browsing 0 members
No registered users viewing this page.
I want to make my progress bar progress with the amount of File lines read.
How would I do this correctly. So far the code below can sometimes run in the middle of the progress bar and state completed.. and other times it can run into the 200%.
;======================================================================== ProgressOn("TITLE", "ACTION") ;======================================================================== For $count = 1 To _FileCountLines($FileRead) Step 1 $string = FileReadLine($FileRead, $count) $value1 = $input $value2 = $input $value3 = $input $value4 = $input $TM = FileWrite("C:\temp\test.txt", $value1 & " " & $value2 & " " & $value3 & " " & $value4 & @CRLF) ProgressSet($count, $count & "%") Next ;======================================================================== ; PROGRESS BAR OFF ;======================================================================== ProgressSet(_FileCountLines($FileRead), "Completed!") Sleep(750) ProgressOff() ;========================================================================
Here is the script for the variable I want to find:
Local $oSunHrsTD = _IETagNameGetCollection($oFrameobj, "span").item(138)
The Item(138) for the span elemets is a dynamic number based on the index of all span objects on the webpage I am trying to send inputs to.
Based on the span.item(#) the corresponding InnerText for that element is the value that I want to get. Which I use the following script:
Local $oSunHrs = $oSunHrsTD.InnerText
Global $otime = _IECreate ("https://somewebsite.banana") _IELoadWait($otime) Local $oFrameobj = _IEFrameGetObjByName($otime, "gsft_main") Local $oLinks = _IETagNameGetCollection($oFrameobj, "a") For $oLink In $oLinks If $oLink.ClassName = "linked formlink" Then _IEAction($oLink, "click") ExitLoop EndIf Next _IEloadWait($oFrameobj) Local $oMonHrsTD = _IETagNameGetCollection($oFrameobj, "span").item(139) Local $oMonHrs = $oMonHrsTD.InnerText _IELoadWait($oFrameobj) Local $oFrameobj = _IEFrameGetObjByName($otime, "gsft_main") Local $oMonHrs = _IETagNameGetCollection($oFrameobj, "SPAN") For $oMonHr In $oMonHrs If $oMonHr.ClassName = "aggregate_value" Then If $oMonHr.innertext >= "8" Then Local $oMonAdjHr = (8 - $oMonHR.Innertext) ConsoleWrite( $oMonHrs &@CRLF ) MsgBox (0, "Adjusted Value", $oMonAdjHr) ExitLoop EndIf EndIf Next
Where I get confused is how I find Item(#) if all I have is the InnerText. Since the InnerText is static and the Item# is dynamic:
$oSunHrsTD = _IETagNameGetCollection($oFrameobj, "span").item( "x").InnerText = ("sometext")
How can i get the X value??
Is it possible to get a variable on your For..Next loop?
Local $Lines1 = _FileCountLines(C:\temp\test.txt) Local $linesToCount2 = $Lines1 + 2 $var = Number($linesToCount2) For $count = 1 To _FileCountLines($FileRead2) Step 1 For $i = $var To $count Next ;Code does stuff here Next Somehow my code doesn't work even though I thought I could convert the variable to a Integer / Number.
This code I posted above does not move to the next value.
But the code below does... why is that?
For $count = 1 To _FileCountLines($FileRead2) Step 1 For $i = 2 To $count Next ;Code does stuff here Next
Why is the For loop resetting itself?
Is it because the program does not cache the variable and needs to keep on acquiring this variable each time?
If so , how would you make this variable static?
Dumb question, but say I have a loop:
dim $i Do sleep(1000) if $i = ; how do i do a function that enters this IF statement every 10 loops? ; do stuff every 10 EndIf Until $i = 100
- what commands in the if statement do I need to use to make it pass, and on every 10th loop, it enters the if statement. ?