multiple locations.

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts
  • wasim21k
    Forum Member
    • Oct 2006
    • 210

    multiple locations.

    again.
    i m trying to figure out how to add exra drives and locations in drive i mean if folder not found on c drive how i can add to go to d drive or some other locations i was trying elseif but couldnt get it working.
    can one can suggest or give hint or anyting?

    fname = Input.GetText("Input1");
    -- Set the drive to search
    drive = "c:\\";
    -- Set the folder to search for
    folder = fname;
    -- Search the specified drive for folders named enterd
    -- Display the status dialog
    StatusDlg.Show(0, false);
    search_results = Folder.Find(drive, folder, false, FindCallBack);
    --Check to see if an error occurred during the search. If it did, display the error message.
    error = Application.GetLastError();
    StatusDlg.Hide();
    if error ~= 0 then
    Dialog.Message("Error",_tblErrorMessages[error]);
    else
    -- If no directories were found, inform the user
    if (search_results == nil) then
    Dialog.Message("Notice", "There is no folder named '" .. folder .. "' on system '" .. drive .. "'.");
    -- If folders were found, display a dialog containing a list of their locations.
    else
    message = "A User named '" .. folder .. "' was found at the following location(s):\r\n\r\n";
    for index, path in search_results do
    message = String.Concat(message, path.."\r\n");
    end
    Dialog.Message("File Search Results", message, MB_OK, MB_ICONINFORMATION, MB_DEFBUTTON1);
    end
    end

  • nals
    Forum Member
    • Feb 2007
    • 206

    #2
    maybe this is similer to what you want:


    PHP Code:
    if Folder.DoesExist("C:\\test"then
    File
    .Copy("AutoPlay\\Docs\\file.txt""C:\\test\\"truetruefalsetruenil);
    elseif 
    Folder.DoesExist("D:\\test"then 
    File
    .Copy("AutoPlay\\Docs\\file.txt""D:\\test\\"truetruefalsetruenil);
    else
    Dialog.Message ("Error""Ohh no...... Test Folder Does Not Exist ");
    end 

    Comment

    • mz241508
      Forum Member
      • Oct 2006
      • 351

      #3
      Do you have the FindCallBack function

      if no replace the Folder.Find function with:
      search_results = Folder.Find(drive, folder, false, nil);

      Comment

      • nals
        Forum Member
        • Feb 2007
        • 206

        #4
        what does that do?

        Comment

        • mz241508
          Forum Member
          • Oct 2006
          • 351

          #5
          First you might wanna check where you got the Folder.Find function from and you will find what the FindCallBack function does.

          Comment

          • wasim21k
            Forum Member
            • Oct 2006
            • 210

            #6
            am i missing something?????????

            so here is little script to find folder on c drive


            PHP Code:
            fname Input.GetText("Input1");
            drive "C:\\";
            folder fname;
            search_results Folder.Find(drivefolderfalsenil);

            if (
            search_results == nilthen
                Dialog
            .Message("Notice""There is no Folder named " .. folder .." ");
            elseif (
            search_results ~= nilthen
                Dialog
            .Message("Notice""Folder Locations is " ..drive.. " "..folder.. ".");
            end 


            i changed that to this to add h drive as well in search but its not working, am i missing something?




            PHP Code:
            fname Input.GetText("Input1");
            drive "C:\\";
            folder fname;
            search_results Folder.Find(drivefolderfalsenil);

            if (
            search_results == nilthen
                drive 
            "H:\\";
                
            folder fname;
                
            search_results Folder.Find(drivefolderfalsenil);
            elseif (
            search_results == nilthen        
                Dialog
            .Message("Notice""There is no Folder named " .. folder .." ");
            elseif (
            search_results ~= nilthen
                Dialog
            .Message("Notice""Folder Locations is " ..drive.. " "..folder.. ".");
            end 
            Last edited by wasim21k; 04-02-2007, 08:36 AM.

            Comment

            • wasim21k
              Forum Member
              • Oct 2006
              • 210

              #7
              any help

              guys any help?

              Comment

              • mz241508
                Forum Member
                • Oct 2006
                • 351

                #8
                Try this code:

                PHP Code:
                fname Input.GetText("Input1");
                drive "C:\\";
                folder fname;
                search_results Folder.Find(drivefolderfalsenil);

                if (
                search_results == nilthen
                drive 
                "H:\\";
                folder fname;
                    
                search_results2 Folder.Find(drivefolderfalsenil);
                    if (
                search_results2 == nilthen        
                    Dialog
                .Message("Notice""There is no Folder named " .. folder .." ");
                    elseif (
                search_results2 ~= nilthen
                    Dialog
                .Message("Notice""Folder Locations is " ..drive.. " "..folder.. ".");
                    
                end
                end 

                Comment

                • wasim21k
                  Forum Member
                  • Oct 2006
                  • 210

                  #9
                  nop

                  nop i m tring to find folder which is there but dont show or give locations.
                  or simpley this did work.

                  Comment

                  • nals
                    Forum Member
                    • Feb 2007
                    • 206

                    #10
                    but sub folders wont show

                    Comment

                    • RizlaUK
                      Indigo Rose Customer
                      • May 2006
                      • 5552

                      #11
                      here, i just threw this function together for you, it will search all fixed drives for the folder in the function call

                      put this in globals
                      Code:
                      01 
                      02 [b][COLOR='#0000FF']function[/COLOR][/b] FindFolder[COLOR='#FF0000']([/COLOR]folder[COLOR='#FF0000'])[/COLOR] 
                      03 Drives [COLOR='#FF0000']=[/COLOR] Drive[COLOR='#FF0000'].[/COLOR]Enumerate[COLOR='#FF0000']([/COLOR][COLOR='#FF0000'])[/COLOR]; 
                      04 StatusDlg[COLOR='#FF0000'].[/COLOR]Show[COLOR='#FF0000']([/COLOR][COLOR='#FF0000'])[/COLOR]; 
                      05 StatusDlg[COLOR='#FF0000'].[/COLOR]ShowProgressMeter[COLOR='#FF0000']([/COLOR]false[COLOR='#FF0000'])[/COLOR]; 
                      06 	[b][COLOR='#0000FF']for[/COLOR][/b] i[COLOR='#FF0000'],[/COLOR]v [b][COLOR='#0000FF']in[/COLOR][/b] Drives [b][COLOR='#0000FF']do[/COLOR][/b] 
                      07 	[b][COLOR='#0000FF']type[/COLOR][/b] [COLOR='#FF0000']=[/COLOR] Drive[COLOR='#FF0000'].[/COLOR]GetType[COLOR='#FF0000']([/COLOR]Drives[COLOR='#FF0000'][[/COLOR]i[COLOR='#FF0000']][/COLOR][COLOR='#FF0000'])[/COLOR]; 
                      08 		[b][COLOR='#0000FF']if[/COLOR][/b] [b][COLOR='#0000FF']type[/COLOR][/b] [COLOR='#FF0000']=[/COLOR][COLOR='#FF0000']=[/COLOR] 3 [b][COLOR='#0000FF']then[/COLOR][/b] 
                      09 		find[COLOR='#FF0000']=[/COLOR]Folder[COLOR='#FF0000'].[/COLOR]Find[COLOR='#FF0000']([/COLOR]Drives[COLOR='#FF0000'][[/COLOR]i[COLOR='#FF0000']][/COLOR][COLOR='#FF0000'],[/COLOR] folder[COLOR='#FF0000'],[/COLOR] true[COLOR='#FF0000'],[/COLOR] [b][COLOR='#0000FF']nil[/COLOR][/b][COLOR='#FF0000'])[/COLOR]; 
                      10 		[b][COLOR='#0000FF']end[/COLOR][/b] 
                      11 	[b][COLOR='#0000FF']end[/COLOR][/b] 
                      12 	StatusDlg[COLOR='#FF0000'].[/COLOR]Hide[COLOR='#FF0000']([/COLOR][COLOR='#FF0000'])[/COLOR]; 
                      13 	[b][COLOR='#0000FF']if[/COLOR][/b] find [b][COLOR='#0000FF']then[/COLOR][/b] 
                      14 	Dialog[COLOR='#FF0000'].[/COLOR]Message[COLOR='#FF0000']([/COLOR] [COLOR='#800080']"FOUND!!"[/COLOR][COLOR='#FF0000'],[/COLOR] [COLOR='#800080']"The folder was found at\r\n"[/COLOR][COLOR='#FF0000'].[/COLOR][COLOR='#FF0000'].[/COLOR]find[COLOR='#FF0000'][[/COLOR]1[COLOR='#FF0000']][/COLOR][COLOR='#FF0000'],[/COLOR] MB_OK[COLOR='#FF0000'])[/COLOR]; 
                      15 	[b][COLOR='#0000FF']else[/COLOR][/b] 
                      16 	Dialog[COLOR='#FF0000'].[/COLOR]Message[COLOR='#FF0000']([/COLOR] [COLOR='#800080']"NOT FOUND!!"[/COLOR][COLOR='#FF0000'],[/COLOR] [COLOR='#800080']"The folder was NOT found"[/COLOR][COLOR='#FF0000'],[/COLOR] MB_OK[COLOR='#FF0000'])[/COLOR]; 
                      17 	[b][COLOR='#0000FF']end[/COLOR][/b] 
                      18 [b][COLOR='#0000FF']end[/COLOR][/b] 
                      19 
                      20  	
                      21
                      and call like this (with the name of your folder)

                      Code:
                      01 FindFolder[COLOR='#FF0000']([/COLOR] [COLOR='#800080']"myfolder"[/COLOR][COLOR='#FF0000'])[/COLOR]; 
                      02 
                      03  	
                      04

                      EDIT: copy n paste friendly unformatted version

                      Code:
                      function FindFolder(folder)
                      Drives = Drive.Enumerate();
                      StatusDlg.Show();
                      StatusDlg.ShowProgressMeter(false);
                      	for i,v in Drives do
                      	type = Drive.GetType(Drives[i]);
                      		if type == 3 then
                      		find=Folder.Find(Drives[i], folder, true, nil);
                      		end
                      	end
                      	StatusDlg.Hide();
                      	if find then
                      	Dialog.Message("FOUND!!", "The folder was found at\r\n"..find[1], MB_OK);
                      	else
                      	Dialog.Message("NOT FOUND!!", "The folder was NOT found", MB_OK);
                      	end
                      end
                      
                       	
                      FindFolder("myfolder");
                      Last edited by RizlaUK; 04-02-2007, 05:36 PM.
                      Embrace change in your life, you never know, it could all work out for the best

                      Comment

                      • nals
                        Forum Member
                        • Feb 2007
                        • 206

                        #12
                        That works RizlaUK, and how to add a cancel or a stop search for that, if you want to stop or cancel in the middle of searching?

                        Thanks RizlaUK



                        :yes

                        Comment

                        • wasim21k
                          Forum Member
                          • Oct 2006
                          • 210

                          #13
                          thanks

                          thanks for local drive
                          now i want to add multiple network locations.
                          like \\dbserver\public\
                          \\crkserver\public\
                          ????
                          nals
                          to add cancel button is not a problem here.

                          Comment

                          • wasim21k
                            Forum Member
                            • Oct 2006
                            • 210

                            #14
                            here is little script i was trying to figure out

                            thanks for every one who helped me in this script i found solution for my problem but if any one of you have other idea i mean to reduce script size u r welcome.
                            PHP Code:
                            fname Input.GetText("Input1");
                            drive "c:\\";
                            folder fname;
                            search_results Folder.Find(drivefolderfalsenil);

                            if (
                            search_results == nilthen
                                fname 
                            Input.GetText("Input1");
                                
                            drive "d:\\";
                                
                            folder fname;
                                
                            search_results Folder.Find(drivefolderfalsenil);
                                    if (
                            search_results == nilthen
                                        fname 
                            Input.GetText("Input1");
                                        
                            drive "e:\\";
                                        
                            folder fname;
                                        
                            search_results Folder.Find(drivefolderfalsenil);    
                                            if (
                            search_results == nilthen
                                                fname 
                            Input.GetText("Input1");
                                                
                            drive "f:\\";
                                                
                            folder fname;
                                                
                            search_results Folder.Find(drivefolderfalsenil);    
                                                    if (
                            search_results == nilthen
                                                        fname 
                            Input.GetText("Input1");
                                                        
                            drive "G:\\";
                                                        
                            folder fname;
                                                        
                            search_results Folder.Find(drivefolderfalsenil);    
                                                            if (
                            search_results == nilthen
                                                                fname 
                            Input.GetText("Input1");
                                                                
                            drive "h:\\";
                                                                
                            folder fname;
                                                                
                            search_results Folder.Find(drivefolderfalsenil);
                                                                    if (
                            search_results == nilthen
                                                                        fname 
                            Input.GetText("Input1");
                                                                        
                            drive "I:\\";
                                                                        
                            folder fname;
                                                                        
                            search_results Folder.Find(drivefolderfalsenil);
                                                                            if (
                            search_results == nilthen
                                                                                fname 
                            Input.GetText("Input1");
                                                                                
                            drive "\\\\dubserver\\public";
                                                                                
                            folder fname;
                                                                                
                            search_results Folder.Find(drivefolderfalsenil);
                                                                                    if (
                            search_results == nilthen
                                                                                        fname 
                            Input.GetText("Input1");
                                                                                        
                            drive "\\\\CRKServer\Temp";
                                                                                        
                            folder fname;
                                                                                        
                            search_results Folder.Find(drivefolderfalsenil);
                                                                                            if (
                            search_results == nilthen
                                                                                                fname 
                            Input.GetText("Input1");
                                                                                                
                            drive "J:\\";
                                                                                                
                            folder fname;
                                                                                                
                            search_results Folder.Find(drivefolderfalsenil);
                                                                                                    if (
                            search_results == nilthen
                                                                                                        fname 
                            Input.GetText("Input1");
                                                                                                        
                            drive "K:\\";
                                                                                                        
                            folder fname;
                                                                                                        
                            search_results Folder.Find(drivefolderfalsenil);
                                                                                                            if (
                            search_results == nilthen
                                                                                                                Dialog
                            .Message("Notice""There is No Folder "  ..folder.. " on Network.");    
                                                                                                            else
                                                                                                            
                            Dialog.Message("Notice""Folder Locations is " ..drive.. " "..folder.. ".");
                                                                                                            
                            end
                                                                                                    
                            else
                                                                                                    
                            Dialog.Message("Notice""Folder Locations is " ..drive.. " "..folder.. ".");
                                                                                                    
                            end
                                                                                            
                            else
                                                                                            
                            Dialog.Message("Notice""Folder Locations is " ..drive.. " "..folder.. ".");
                                                                                            
                            end
                                                                                    
                            else
                                                                                    
                            Dialog.Message("Notice""Folder Locations is " ..drive.. " "..folder.. ".");
                                                                                    
                            end
                                                                            
                            else
                                                                            
                            Dialog.Message("Notice""Folder Locations is " ..drive.. " "..folder.. ".");
                                                                            
                            end
                                                                    
                            else
                                                                    
                            Dialog.Message("Notice""Folder Locations is " ..drive.. " "..folder.. ".");
                                                                    
                            end    
                                                            
                            else
                                                            
                            Dialog.Message("Notice""Folder Locations is " ..drive.. " "..folder.. ".");
                                                            
                            end
                                                    
                            else
                                                    
                            Dialog.Message("Notice""Folder Locations is " ..drive.. " "..folder.. ".");
                                                    
                            end
                                            
                            else 
                                            
                            Dialog.Message("Notice""Folder Locations is " ..drive.. " "..folder.. ".");
                                            
                            end
                                    
                            else
                                    
                            Dialog.Message("Notice""Folder Locations is " ..drive.. " "..folder.. ".");
                                    
                            end
                            else
                            Dialog.Message("Notice""Folder Locations is " ..drive.. " "..folder.. ".");
                            end 
                            and for getting focus on input
                            i enter in page on show
                            PHP Code:
                            Page.SetFocus("Input1"); 
                            Last edited by wasim21k; 04-03-2007, 06:43 AM.

                            Comment

                            • RizlaUK
                              Indigo Rose Customer
                              • May 2006
                              • 5552

                              #15
                              heres a condensed version of your code useing a table and elseif
                              Code:
                              01 fname [COLOR='#FF0000']=[/COLOR] Input[COLOR='#FF0000'].[/COLOR]GetText[COLOR='#FF0000']([/COLOR] [COLOR='#800080']"Input1"[/COLOR][COLOR='#FF0000'])[/COLOR]; 
                              02 
                              03 tbDrives[COLOR='#FF0000']=[/COLOR][COLOR='#FF0000']{[/COLOR][COLOR='#FF0000']}[/COLOR]; 
                              04 tbDrives[COLOR='#FF0000'][[/COLOR]1[COLOR='#FF0000']][/COLOR] [COLOR='#FF0000']=[/COLOR] [COLOR='#800080']"c:\\";"[/COLOR]
                              05 tbDrives[COLOR='#FF0000'][[/COLOR]2[COLOR='#FF0000']][/COLOR] [COLOR='#FF0000']=[/COLOR] [COLOR='#800080']"d:\\";"[/COLOR]
                              06 tbDrives[COLOR='#FF0000'][[/COLOR]3[COLOR='#FF0000']][/COLOR] [COLOR='#FF0000']=[/COLOR] [COLOR='#800080']"e:\\";"[/COLOR]
                              07 tbDrives[COLOR='#FF0000'][[/COLOR]4[COLOR='#FF0000']][/COLOR] [COLOR='#FF0000']=[/COLOR] [COLOR='#800080']"f:\\";"[/COLOR]
                              08 tbDrives[COLOR='#FF0000'][[/COLOR]5[COLOR='#FF0000']][/COLOR] [COLOR='#FF0000']=[/COLOR] [COLOR='#800080']"G:\\";"[/COLOR]
                              09 tbDrives[COLOR='#FF0000'][[/COLOR]6[COLOR='#FF0000']][/COLOR] [COLOR='#FF0000']=[/COLOR] [COLOR='#800080']"h:\\";"[/COLOR]
                              10 tbDrives[COLOR='#FF0000'][[/COLOR]7[COLOR='#FF0000']][/COLOR] [COLOR='#FF0000']=[/COLOR] [COLOR='#800080']"i:\\";"[/COLOR]
                              11 tbDrives[COLOR='#FF0000'][[/COLOR]8[COLOR='#FF0000']][/COLOR] [COLOR='#FF0000']=[/COLOR] [COLOR='#800080']"\\\\dubserver\\public"[/COLOR]; 
                              12 tbDrives[COLOR='#FF0000'][[/COLOR]9[COLOR='#FF0000']][/COLOR] [COLOR='#FF0000']=[/COLOR] [COLOR='#800080']"\\\\CRKServer\Temp"[/COLOR]; 
                              13 tbDrives[COLOR='#FF0000'][[/COLOR]10[COLOR='#FF0000']][/COLOR] [COLOR='#FF0000']=[/COLOR] [COLOR='#800080']"J:\\";"[/COLOR]
                              14 tbDrives[COLOR='#FF0000'][[/COLOR]11[COLOR='#FF0000']][/COLOR] [COLOR='#FF0000']=[/COLOR] [COLOR='#800080']"K:\\";"[/COLOR]
                              15 
                              16 search_results [COLOR='#FF0000']=[/COLOR] Folder[COLOR='#FF0000'].[/COLOR]Find[COLOR='#FF0000']([/COLOR]tbDrives[COLOR='#FF0000'][[/COLOR]1[COLOR='#FF0000']][/COLOR][COLOR='#FF0000'],[/COLOR] fname[COLOR='#FF0000'],[/COLOR] false[COLOR='#FF0000'],[/COLOR] [b][COLOR='#0000FF']nil[/COLOR][/b][COLOR='#FF0000'])[/COLOR]; 
                              17 [b][COLOR='#0000FF']if[/COLOR][/b] [COLOR='#FF0000']([/COLOR]search_results [COLOR='#FF0000']=[/COLOR][COLOR='#FF0000']=[/COLOR] [b][COLOR='#0000FF']nil[/COLOR][/b][COLOR='#FF0000'])[/COLOR] [b][COLOR='#0000FF']then[/COLOR][/b] 
                              18 search_results [COLOR='#FF0000']=[/COLOR] Folder[COLOR='#FF0000'].[/COLOR]Find[COLOR='#FF0000']([/COLOR]tbDrives[COLOR='#FF0000'][[/COLOR]2[COLOR='#FF0000']][/COLOR][COLOR='#FF0000'],[/COLOR] fname[COLOR='#FF0000'],[/COLOR] false[COLOR='#FF0000'],[/COLOR] [b][COLOR='#0000FF']nil[/COLOR][/b][COLOR='#FF0000'])[/COLOR]; 
                              19 [b][COLOR='#0000FF']elseif[/COLOR][/b] [COLOR='#FF0000']([/COLOR]search_results [COLOR='#FF0000']=[/COLOR][COLOR='#FF0000']=[/COLOR] [b][COLOR='#0000FF']nil[/COLOR][/b][COLOR='#FF0000'])[/COLOR] [b][COLOR='#0000FF']then[/COLOR][/b] 
                              20 search_results [COLOR='#FF0000']=[/COLOR] Folder[COLOR='#FF0000'].[/COLOR]Find[COLOR='#FF0000']([/COLOR]tbDrives[COLOR='#FF0000'][[/COLOR]3[COLOR='#FF0000']][/COLOR][COLOR='#FF0000'],[/COLOR] fname[COLOR='#FF0000'],[/COLOR] false[COLOR='#FF0000'],[/COLOR] [b][COLOR='#0000FF']nil[/COLOR][/b][COLOR='#FF0000'])[/COLOR];    
                              21 [b][COLOR='#0000FF']elseif[/COLOR][/b] [COLOR='#FF0000']([/COLOR]search_results [COLOR='#FF0000']=[/COLOR][COLOR='#FF0000']=[/COLOR] [b][COLOR='#0000FF']nil[/COLOR][/b][COLOR='#FF0000'])[/COLOR] [b][COLOR='#0000FF']then[/COLOR][/b] 
                              22 search_results [COLOR='#FF0000']=[/COLOR] Folder[COLOR='#FF0000'].[/COLOR]Find[COLOR='#FF0000']([/COLOR]tbDrives[COLOR='#FF0000'][[/COLOR]4[COLOR='#FF0000']][/COLOR][COLOR='#FF0000'],[/COLOR] fname[COLOR='#FF0000'],[/COLOR] false[COLOR='#FF0000'],[/COLOR] [b][COLOR='#0000FF']nil[/COLOR][/b][COLOR='#FF0000'])[/COLOR];    
                              23 [b][COLOR='#0000FF']elseif[/COLOR][/b] [COLOR='#FF0000']([/COLOR]search_results [COLOR='#FF0000']=[/COLOR][COLOR='#FF0000']=[/COLOR] [b][COLOR='#0000FF']nil[/COLOR][/b][COLOR='#FF0000'])[/COLOR] [b][COLOR='#0000FF']then[/COLOR][/b] 
                              24 search_results [COLOR='#FF0000']=[/COLOR] Folder[COLOR='#FF0000'].[/COLOR]Find[COLOR='#FF0000']([/COLOR]tbDrives[COLOR='#FF0000'][[/COLOR]5[COLOR='#FF0000']][/COLOR][COLOR='#FF0000'],[/COLOR] fname[COLOR='#FF0000'],[/COLOR] false[COLOR='#FF0000'],[/COLOR] [b][COLOR='#0000FF']nil[/COLOR][/b][COLOR='#FF0000'])[/COLOR];    
                              25 [b][COLOR='#0000FF']elseif[/COLOR][/b] [COLOR='#FF0000']([/COLOR]search_results [COLOR='#FF0000']=[/COLOR][COLOR='#FF0000']=[/COLOR] [b][COLOR='#0000FF']nil[/COLOR][/b][COLOR='#FF0000'])[/COLOR] [b][COLOR='#0000FF']then[/COLOR][/b] 
                              26 search_results [COLOR='#FF0000']=[/COLOR] Folder[COLOR='#FF0000'].[/COLOR]Find[COLOR='#FF0000']([/COLOR]tbDrives[COLOR='#FF0000'][[/COLOR]6[COLOR='#FF0000']][/COLOR][COLOR='#FF0000'],[/COLOR] fname[COLOR='#FF0000'],[/COLOR] false[COLOR='#FF0000'],[/COLOR] [b][COLOR='#0000FF']nil[/COLOR][/b][COLOR='#FF0000'])[/COLOR]; 
                              27 [b][COLOR='#0000FF']elseif[/COLOR][/b] [COLOR='#FF0000']([/COLOR]search_results [COLOR='#FF0000']=[/COLOR][COLOR='#FF0000']=[/COLOR] [b][COLOR='#0000FF']nil[/COLOR][/b][COLOR='#FF0000'])[/COLOR] [b][COLOR='#0000FF']then[/COLOR][/b] 
                              28 search_results [COLOR='#FF0000']=[/COLOR] Folder[COLOR='#FF0000'].[/COLOR]Find[COLOR='#FF0000']([/COLOR]tbDrives[COLOR='#FF0000'][[/COLOR]7[COLOR='#FF0000']][/COLOR][COLOR='#FF0000'],[/COLOR] fname[COLOR='#FF0000'],[/COLOR] false[COLOR='#FF0000'],[/COLOR] [b][COLOR='#0000FF']nil[/COLOR][/b][COLOR='#FF0000'])[/COLOR]; 
                              29 [b][COLOR='#0000FF']elseif[/COLOR][/b] [COLOR='#FF0000']([/COLOR]search_results [COLOR='#FF0000']=[/COLOR][COLOR='#FF0000']=[/COLOR] [b][COLOR='#0000FF']nil[/COLOR][/b][COLOR='#FF0000'])[/COLOR] [b][COLOR='#0000FF']then[/COLOR][/b] 
                              30 search_results [COLOR='#FF0000']=[/COLOR] Folder[COLOR='#FF0000'].[/COLOR]Find[COLOR='#FF0000']([/COLOR]tbDrives[COLOR='#FF0000'][[/COLOR]8[COLOR='#FF0000']][/COLOR][COLOR='#FF0000'],[/COLOR] fname[COLOR='#FF0000'],[/COLOR] false[COLOR='#FF0000'],[/COLOR] [b][COLOR='#0000FF']nil[/COLOR][/b][COLOR='#FF0000'])[/COLOR]; 
                              31 [b][COLOR='#0000FF']elseif[/COLOR][/b] [COLOR='#FF0000']([/COLOR]search_results [COLOR='#FF0000']=[/COLOR][COLOR='#FF0000']=[/COLOR] [b][COLOR='#0000FF']nil[/COLOR][/b][COLOR='#FF0000'])[/COLOR] [b][COLOR='#0000FF']then[/COLOR][/b] 
                              32 search_results [COLOR='#FF0000']=[/COLOR] Folder[COLOR='#FF0000'].[/COLOR]Find[COLOR='#FF0000']([/COLOR]tbDrives[COLOR='#FF0000'][[/COLOR]9[COLOR='#FF0000']][/COLOR][COLOR='#FF0000'],[/COLOR] fname[COLOR='#FF0000'],[/COLOR] false[COLOR='#FF0000'],[/COLOR] [b][COLOR='#0000FF']nil[/COLOR][/b][COLOR='#FF0000'])[/COLOR]; 
                              33 [b][COLOR='#0000FF']elseif[/COLOR][/b] [COLOR='#FF0000']([/COLOR]search_results [COLOR='#FF0000']=[/COLOR][COLOR='#FF0000']=[/COLOR] [b][COLOR='#0000FF']nil[/COLOR][/b][COLOR='#FF0000'])[/COLOR] [b][COLOR='#0000FF']then[/COLOR][/b] 
                              34 search_results [COLOR='#FF0000']=[/COLOR] Folder[COLOR='#FF0000'].[/COLOR]Find[COLOR='#FF0000']([/COLOR]tbDrives[COLOR='#FF0000'][[/COLOR]10[COLOR='#FF0000']][/COLOR][COLOR='#FF0000'],[/COLOR] fname[COLOR='#FF0000'],[/COLOR] false[COLOR='#FF0000'],[/COLOR] [b][COLOR='#0000FF']nil[/COLOR][/b][COLOR='#FF0000'])[/COLOR]; 
                              35 [b][COLOR='#0000FF']elseif[/COLOR][/b] [COLOR='#FF0000']([/COLOR]search_results [COLOR='#FF0000']=[/COLOR][COLOR='#FF0000']=[/COLOR] [b][COLOR='#0000FF']nil[/COLOR][/b][COLOR='#FF0000'])[/COLOR] [b][COLOR='#0000FF']then[/COLOR][/b] 
                              36 search_results [COLOR='#FF0000']=[/COLOR] Folder[COLOR='#FF0000'].[/COLOR]Find[COLOR='#FF0000']([/COLOR]tbDrives[COLOR='#FF0000'][[/COLOR]11[COLOR='#FF0000']][/COLOR][COLOR='#FF0000'],[/COLOR] fname[COLOR='#FF0000'],[/COLOR] false[COLOR='#FF0000'],[/COLOR] [b][COLOR='#0000FF']nil[/COLOR][/b][COLOR='#FF0000'])[/COLOR]; 
                              37 [b][COLOR='#0000FF']elseif[/COLOR][/b] [COLOR='#FF0000']([/COLOR]search_results [COLOR='#FF0000']=[/COLOR][COLOR='#FF0000']=[/COLOR] [b][COLOR='#0000FF']nil[/COLOR][/b][COLOR='#FF0000'])[/COLOR] [b][COLOR='#0000FF']then[/COLOR][/b] 
                              38 Dialog[COLOR='#FF0000'].[/COLOR]Message[COLOR='#FF0000']([/COLOR] [COLOR='#800080']"Notice"[/COLOR][COLOR='#FF0000'],[/COLOR] [COLOR='#800080']"There is No Folder "[/COLOR]  [COLOR='#FF0000'].[/COLOR][COLOR='#FF0000'].[/COLOR]fname[COLOR='#FF0000'].[/COLOR][COLOR='#FF0000'].[/COLOR] [COLOR='#800080']" on Network."[/COLOR][COLOR='#FF0000'])[/COLOR];    
                              39 [b][COLOR='#0000FF']else[/COLOR][/b] 
                              40 Dialog[COLOR='#FF0000'].[/COLOR]Message[COLOR='#FF0000']([/COLOR] [COLOR='#800080']"Notice"[/COLOR][COLOR='#FF0000'],[/COLOR] [COLOR='#800080']"Folder Locations is "[/COLOR] [COLOR='#FF0000'].[/COLOR][COLOR='#FF0000'].[/COLOR]search_results[COLOR='#FF0000'][[/COLOR]1[COLOR='#FF0000']][/COLOR][COLOR='#FF0000'].[/COLOR][COLOR='#FF0000'].[/COLOR] [COLOR='#800080']" "[/COLOR][COLOR='#FF0000'].[/COLOR][COLOR='#FF0000'].[/COLOR]fname[COLOR='#FF0000'].[/COLOR][COLOR='#FF0000'].[/COLOR] [COLOR='#800080']"."[/COLOR][COLOR='#FF0000'])[/COLOR]; 
                              41 [b][COLOR='#0000FF']end[/COLOR][/b]


                              copy n paste friendly version
                              Code:
                              fname = Input.GetText("Input1");
                              
                              tbDrives={};
                              tbDrives[1] = "c:\\";
                              tbDrives[2] = "d:\\";
                              tbDrives[3] = "e:\\";
                              tbDrives[4] = "f:\\";
                              tbDrives[5] = "G:\\";
                              tbDrives[6] = "h:\\";
                              tbDrives[7] = "i:\\";
                              tbDrives[8] = "\\\\dubserver\\public";
                              tbDrives[9] = "\\\\CRKServer\Temp";
                              tbDrives[10] = "J:\\";
                              tbDrives[11] = "K:\\";
                              
                              search_results = Folder.Find(tbDrives[1], fname, false, nil);
                              if (search_results == nil) then
                              search_results = Folder.Find(tbDrives[2], fname, false, nil);
                              elseif (search_results == nil) then
                              search_results = Folder.Find(tbDrives[3], fname, false, nil);    
                              elseif (search_results == nil) then
                              search_results = Folder.Find(tbDrives[4], fname, false, nil);    
                              elseif (search_results == nil) then
                              search_results = Folder.Find(tbDrives[5], fname, false, nil);    
                              elseif (search_results == nil) then
                              search_results = Folder.Find(tbDrives[6], fname, false, nil);
                              elseif (search_results == nil) then
                              search_results = Folder.Find(tbDrives[7], fname, false, nil);
                              elseif (search_results == nil) then
                              search_results = Folder.Find(tbDrives[8], fname, false, nil);
                              elseif (search_results == nil) then
                              search_results = Folder.Find(tbDrives[9], fname, false, nil);
                              elseif (search_results == nil) then
                              search_results = Folder.Find(tbDrives[10], fname, false, nil);
                              elseif (search_results == nil) then
                              search_results = Folder.Find(tbDrives[11], fname, false, nil);
                              elseif (search_results == nil) then
                              Dialog.Message("Notice", "There is No Folder "  ..fname.. " on Network.");    
                              else
                              Dialog.Message("Notice", "Folder Locations is " ..search_results[1].. " "..fname.. ".");
                              end
                              Embrace change in your life, you never know, it could all work out for the best

                              Comment

                              Working...
                              X