18 posts in this topic
I've just written a small script that compares two strings and returns the similarity of those two in %. I know of StringCompare, but I want to get a percentage and I also want to get in touch with Autoit.
Compiling doesn't cause any problems, but actually running it does. In line 20 it has a problem with the index and says "Subscript used on non-accessible variable". What's causing that problem, and how can I solve it? Thanks! And sorry for my ugly style
String quick select feature
Hello I have been going to this forum regularly for a couple weeks, getting all sorts of good info from you people.
So first off thanks, you are all gentlemen/women and scholars.
I just wanted to point out that I think it would be neat if you could double click either side of the quotation marks in the Scite editor to select the string of text within. Instead of having to manually select all the text within, which is not hard, but u may sometimes miss a extra character or something. Just like how you can select variables and single words by double clicking. Thanks to all those who have worked on and continue to work on Autoit, I love it.
How to configure a GUI Progress Bar by a double "for" loop
Hello again, my second post in 24 hs!
It's my first GUI... and my first progress bar also! Sorry if I make a newbie mistake.
I want to configure a GUI Progress Bar by a double "for" loop.
Here is my code with a specific annotation with what I want to do:
Edit: new problem, I have no idea how can I continue with the next $a as if the current $a, I do not skip it because the line is an element less (I need help with both problems):
#include <GUIConstantsEx.au3> #include <EditConstants.au3> #include <WinAPI.au3> #include <File.au3> #include <String.au3> #include <Array.au3> Local $idGUI = GUICreate("ProgressBar", 220, 130, 100, 200) Opt("GUIOnEventMode", 1) GUISetOnEvent($GUI_EVENT_CLOSE, "CLOSEButton") Local $idInput = GUICtrlCreateInput("",80,20,60,20,$ES_NUMBER) Local $idProgressBar = GUICtrlCreateProgress(10, 60, 200, 20) Local $idButton1 = GUICtrlCreateButton("Start",85,100,50) GUICtrlSetOnEvent($idButton1, "StartProgressBar") Local $aFileOpen = _WinAPI_GetOpenFileName("Open a text file", "Text Files (*.txt)") Local $idCountLines = _FileCountLines($aFileOpen) Local $idInputValue, $idSomething, $aFileResult, $idStringBetween GUISetState(@SW_SHOW, $idGUI) While 1 Sleep(20000) WEnd Func StartProgressBar() If StringInStr($aFileOpen, ".txt") = True Then $idInputValue = Int(GUICtrlRead($idInput)) If IsFloat($idCountLines/$idInputValue) = 1 Then $idStringBetween = _StringBetween(String($idCountLines/$idInputValue),"", ".") $idSomething = Number($idStringBetween) + 1 Else $idSomething = $idCountLines/$idInputValue EndIf For $i = 1 To $idSomething $aFileResult = @ScriptDir & "\result-" & $i & ".txt" _FileCreate($aFileResult) FileOpen($aFileResult,2) For $a = ( ( ( $i - 1 ) * $idInputValue ) + 1 ) To ( $i * $idInputValue ) If FileReadLine($aFileOpen, $a) = "" Then ; Here I have no idea how can I continue with the next $a as if the current $a, I do not skip it because the line is an element less EndIf FileWrite($aFileResult,FileReadLine($aFileOpen, $a) & " - ") ;Here I want to set the progress bar value = current percentage (line that it is currently reading) of the 100% (total of lines in the file opened) Next FileClose($aFileResult) Next MsgBox(0,"Done","Done") GUICtrlSetData($idProgressBar,0) Else MsgBox(0,"Hello :)","Please open a file :D") EndIf EndFunc Func CLOSEButton() Exit EndFunc
Thanks in advance.
I hate the Microsoft Windows search.
After trying the powerfull "Agent Ransack", i said to myself ; why not create a free alternative in AutoIt ?
StringFinder replace my old TinyAu3FilesSearch utility and will be added to the next version of SciTE Hopper
Unlike to TinyAu3FileSearch, you can search strings in any "Text" files.
Source and compiled Version are available in the Download Section.
StringFinder - Find String in Files.