Quantcast
Channel: AutoIt v3 - General Help and Support
Viewing all articles
Browse latest Browse all 12506

Adding functionality to my mini-search engine (powered by RecFileListToArray)

$
0
0

Alright, so I've implemented the SE at my place of work and the boss is engines-to-full-speed about it. He wants to see me add some functionality to it.

Currently the code is as shown:

 

AutoIt         
#Region ;**** Directives created by AutoIt3Wrapper_GUI **** #AutoIt3Wrapper_Icon=SCCicon.ico #AutoIt3Wrapper_Outfile=StormCopperTSE.exe #AutoIt3Wrapper_Res_Comment=To be used only by StormCopper #AutoIt3Wrapper_Res_Description=Enhanced search engine #AutoIt3Wrapper_Res_Language=1033 #AutoIt3Wrapper_Res_requestedExecutionLevel=highestAvailable #AutoIt3Wrapper_Run_AU3Check=n #AutoIt3Wrapper_Tidy_Stop_OnError=n #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI **** #include <ButtonConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #include <RecFileListToArray.au3> #include <Array.au3> Opt("GUIOnEventMode", 1) Opt("GUIResizeMode", $GUI_DOCKAUTO + $GUI_DOCKRIGHT + $GUI_DOCKBOTTOM) Opt("GUIResizeMode", $GUI_DOCKAUTO + $GUI_DOCKRIGHT + $GUI_DOCKBOTTOM) Opt("GUIResizeMode", $GUI_DOCKAUTO + $GUI_DOCKRIGHT + $GUI_DOCKBOTTOM) Opt("GUIResizeMode", $GUI_DOCKAUTO + $GUI_DOCKRIGHT + $GUI_DOCKBOTTOM) Opt("GUIResizeMode", $GUI_DOCKAUTO + $GUI_DOCKRIGHT + $GUI_DOCKBOTTOM) Opt("GUIResizeMode", $GUI_DOCKAUTO + $GUI_DOCKRIGHT + $GUI_DOCKBOTTOM) Opt("GUIResizeMode", $GUI_DOCKAUTO + $GUI_DOCKRIGHT + $GUI_DOCKBOTTOM) Opt("GUIResizeMode", $GUI_DOCKAUTO + $GUI_DOCKRIGHT + $GUI_DOCKBOTTOM) Opt("GUIResizeMode", $GUI_DOCKAUTO + $GUI_DOCKRIGHT + $GUI_DOCKBOTTOM) Opt("GUIResizeMode", $GUI_DOCKAUTO + $GUI_DOCKRIGHT + $GUI_DOCKBOTTOM) Opt("GUIResizeMode", $GUI_DOCKAUTO + $GUI_DOCKRIGHT + $GUI_DOCKBOTTOM) Opt("GUIResizeMode", $GUI_DOCKAUTO + $GUI_DOCKRIGHT + $GUI_DOCKBOTTOM) Opt("GUIResizeMode", $GUI_DOCKAUTO + $GUI_DOCKRIGHT + $GUI_DOCKBOTTOM) Opt("GUIResizeMode", $GUI_DOCKAUTO + $GUI_DOCKRIGHT + $GUI_DOCKBOTTOM) #region ### START Koda GUI section ### Form=C:\Users\Wombat\StormCopper Work\stormcopper search engine.kxf $Form1_1 = GUICreate("Trumpf500 Search Engin", 312, 149, 753, 520) GUISetOnEvent($GUI_EVENT_CLOSE, "Form1_1Close") GUISetOnEvent($GUI_EVENT_MINIMIZE, "Form1_1Minimize") GUISetOnEvent($GUI_EVENT_MAXIMIZE, "Form1_1Maximize") GUISetOnEvent($GUI_EVENT_RESTORE, "Form1_1Restore") $Label1 = GUICtrlCreateLabel("Trumpf500 Search Engine", 8, 8, 213, 24) GUICtrlSetFont(-1, 12, 800, 0, "MS Sans Serif") GUICtrlSetColor(-1, 0x3399FF) GUICtrlSetOnEvent(-1, "Label1Click") $Input1 = GUICtrlCreateInput("*.au3", 8, 40, 209, 21) GUICtrlSetOnEvent(-1, "Input1Change") $Button2 = GUICtrlCreateButton("SEARCH", 32, 72, 161, 57) GUICtrlSetOnEvent(-1, "Button2Click") $Button1 = GUICtrlCreateButton("Close", 248, 8, 59, 25) GUICtrlSetOnEvent(-1, "Button1Click") GUISetState(@SW_SHOW) #endregion ### END Koda GUI section ### While 1     Sleep(100) WEnd Func Button1Click()     Exit EndFunc   ;==>Button1Click Func Button2Click()     $ReadInput1 = GUICtrlRead($Input1)     $aList = _RecFileListToArray(@HomeDrive, $ReadInput1, 1, 1, 1, 2)     If IsArray($aList) Then         _ArrayDisplay($aList, "$FileList")     EndIf EndFunc   ;==>Button2Click Func Form1_1Close()     Exit EndFunc   ;==>Form1_1Close Func Form1_1Maximize() EndFunc   ;==>Form1_1Maximize Func Form1_1Minimize() EndFunc   ;==>Form1_1Minimize Func Form1_1Restore() EndFunc   ;==>Form1_1Restore Func Input1Change() EndFunc   ;==>Input1Change Func Label1Click() EndFunc   ;==>Label1Click

It displays the results with _ArrayDisplay as you can see. I have done my studies and found that you cannot add functionailty to this as it stops your script from running. So, if i'm on the right track, I must temporarily store the results to be referenced by a custom GUI with said desired functionalities...correct? or no?

pointers, tips, criticisms welcome!
by the way THANK YOU MELBA23 ! and the members who have helped me get this far!

 

 

Edit: and no I'm not getting paid for this coding, I get paid to run one of these:
trumpf.jpg
 

 

Here are some of the things I would like to change:
 - The wildcard * is needed after whatever the user types into the input field, I would like to have this automatically added by the code rather than hoping the user knows that they need a wildcard, much less what one is or even that * is one. So how can I have the code structured so as that it adds a * at the end of the users input?

 

 - A normal return presents something similar to this:
        

         ExampleFile.txt
         ExampleFile.lst
         ExampleFile.html

 

This is because the files we use have a text doc, a program file, and a html spreadsheet like file. I need to add functionalities unique to each file type. So how do I take the results (which in my case i believe would be $aList) and store them as retrievable variables or arrays?


Viewing all articles
Browse latest Browse all 12506

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>