Sign in to follow this  
Followers 0
GameIDevelp

How i can use again array .?

7 posts in this topic

The script work but on 2 round not see the file ,, how I can use again "$v[1] , $v[2] - $v[5] ..?

I can use on code fore return the $v[1] to -1 if $v[1] find the file .?

How I cand use the array another , another again ..?

#Include <File.au3>
#Include <Array.au3>
#NoTrayIcon

$v=_FileListToArray("D:\Documents1", '*', 2)
If @Error=1 Then
    MsgBox (0,"","Error ")
    Exit
EndIf

$bLoop = 1
While $bLoop = 1
    
            
            $bos = "D:\Documents1\" & $v[1] 
             $search1 = FileFindFirstFile($bos &"\index_06[1]oooooooooo.gif")           
        if $search1=1 Then
            MsgBox(0,"ok-1","Find")
        Else        
        ;MsgBox(0,"else-1",$bos)
        ;---next-folder
                $bos2 = "D:\Documents1\" & $v[2] 
                $search2 = FileFindFirstFile($bos2 &"\index_06[1]oooooooooo.gif")           
            if $search2=1 Then
                 MsgBox(0,"ok-2","Find")
            Else        
                ;MsgBox(0,"ddddd",$search2)
                ;---next-folder
                    $bos3 = "D:\Documents1\" & $v[3] 
                    $search3 = FileFindFirstFile($bos3 &"\index_06[1]oooooooooo.gif")           
                if $search3=1 Then
                    MsgBox(0,"ok-3","Find")
                Else        
                  ;MsgBox(0,"ddddd",$search3)
                ;--next-folder---3
                         $bos4 = "D:\Documents1\" & $v[4] 
                         $search4 = FileFindFirstFile($bos4 &"\index_06[1]oooooooooo.gif")          
                    if $search4=1 Then
                         MsgBox(0,"ok-4","Find")
                    Else        
                    ;MsgBox(0,"ddddd",$search4)
                    ;--next-folder-4
                             $bos5 = "D:\Documents1\" & $v[5] 
                             $search5 = FileFindFirstFile($bos5 &"\index_06[1]oooooooooo.gif")          
                        
                      EndIf
                EndIf
            EndIf
        EndIf
        

             MsgBox(0,"kk","tura")
             Sleep(3000)
             $bLoop = 1
        
WEnd

Share this post


Link to post
Share on other sites



As much as I can understand this script purpose....

First, your code include unnecessary comparisons and statements. For example the $bLoop is completely unnecessary, use While 1...WEnd instead and if you want to finish the loop use the ExitLoop statement. Second, "If $search2=1 Then" is equivalent to "If $search2 Then" and faster.

If you want to find specific file using the FileFindFirstFile...FileFindNextFile....FileClose, it required recursive function because you probably don't know all the folder and where it can be found so use recursive function with FileGetAttrib to check if a file is folder or not...

Good-luck.

Share this post


Link to post
Share on other sites

thanks for replay ,

This code I use to search 1 file intro the 5 folders , shee work but at round 2 or more rounds "$v[1] return -1 ,,, why.?

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

Use FileExist instead if you know the paths.

Edit: Don't forget that you need to check whether the file is folder or simple file. In case you didn't know there are two other files in each folder (root is exception) ---> '.' and '..' so these two are also included in the returned array I think

Edited by Authenticity

Share this post


Link to post
Share on other sites

I use ,,

sleep(5000)

ShellExecute("myprog.exe")

exit

and shee run the myprog then exit and run then exit ,,, again and again , :) ,

Share this post


Link to post
Share on other sites
:) More code please because it's exactly what you ask the script to do heh, what else should it?

Share this post


Link to post
Share on other sites

:) its like :

Run(@ScriptFullPath)
ExitoÝ÷ Ù«­¢+Ù%¹½ÐÁɽÍÍá¥ÍÑÌ¡Õѽ¥ÑA%¤Ñ¡¸)IÕ¸¡MÉ¥ÁÑÕ±±AÑ ¤)¹%)á¥

Cheers, FireFox.


 

OS : Win XP SP2 (32 bits) / Win 7 SP1 (64 bits) / Win 8 (64 bits) | Autoit version: latest stable / beta.
Hardware : Intel(R) Core(TM) i5-2400 CPU @ 3.10Ghz / 8 GiB RAM DDR3.

My UDFs : Skype UDF | TrayIconEx UDF | GUI Panel UDF | Excel XML UDF | Is_Pressed_UDF

My Projects : YouTube Multi-downloader | FTP Easy-UP | Lock'n | WinKill | AVICapture | Skype TM | Tap Maker | ShellNew | Scriptner | Const Replacer | FT_Pocket | Chrome theme maker

My Examples : Capture toolIP Camera | Crosshair | Draw Captured Region | Picture Screensaver | Jscreenfix | Drivetemp | Picture viewer

My Snippets : Basic TCP | Systray_GetIconIndex | Intercept End task | Winpcap various | Advanced HotKeySet | Transparent Edit control

 

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  
Followers 0