Sign in to follow this  
Followers 0
Schoening

Multiple Select Case Problem {SOLVED}

17 posts in this topic

#1 ·  Posted (edited)

While i am waiting for Better Solutions for Finding Multiple @error Cases and React according to them, i am hoping that some1 could explain me what my problem in this (time consuming) function is..

The Idea is that i check for @Errors from the 3 PixelSearch i am doing, and give Message according to it.

I am changing Colors In Paint for Every Loop To Test If the Color Searches Are Correct.

All Cases are Working Fine, and the Right MsgBoxes are Triggered, Except the Case where all 3 Colors are Missing:

HotKeySet("{ESC}", "End")
Global $pixelSearchError1 = @error
Global $pixelSearchError2 = @error
Global $pixelSearchError3 = @error
While 1
Sleep(10)
$pixelsearch1 = PixelSearch(100,300,200,512,0x0000ff,10) ;Blue
$pixelSearchError1 = @error
$pixelsearch2 = PixelSearch(250,310,400,512,0xfa0000,10) ;Red
$pixelSearchError2 = @error
$pixelsearch3 = PixelSearch(500,300,600,512,0x00ff00,10) ;Green
$pixelSearchError3 = @error
Call("_errorcheck")
WEnd
Func _errorcheck()
    Sleep(100)
Select                                                        ;Check for Blue Color, Then Proceed.
        Case Not $pixelSearchError1                              ;Found Blue
            MsgBox(0,"Message","Blue Pixel Found!")
   Select                                                 ;Blue Found.  Now check for Red
    Case Not $pixelSearchError2                           ;Found Blue and Red
     MsgBox(0,"Message","Blue and Red Pixel Found!")
     Select                                       ;Blue and Red found. Now check for Green
      Case Not $pixelSearchError3                     ;Found Blue, Red and Green
        MsgBox(0,"Message","Blue,Red and Green Pixel Found!")
      Case $pixelSearchError3                             ;Blue, Red  But not Green
        MsgBox(0,"Message","Found Blue, Red But Not Green")
      EndSelect
    Case $pixelSearchError2          ;Blue Found, But Not Red
      MsgBox(0,"Message","Blue Found, But Not Red")
         Select                                       ;Blue and Red found. Now check for Green
          Case Not $pixelSearchError3                     ;Found Blue, Green But not Red
        MsgBox(0,"Message","Found Blue, Green But Not Red")
       Case $pixelSearchError3                          ;Blue, But not Red or Green
        MsgBox(0,"Message","Could only Find Blue")
      EndSelect
    EndSelect
  Case $pixelSearchError1                                    ;Blue Not Found
         MsgBox(0,"Message","Blue Pixel Not Found")
            Select                                                ;Blue Not Found.  Now check for Red
    Case Not $pixelSearchError2                           ;Found Red, But not Blue
     MsgBox(0,"Message","Found Red, But not Blue")
     Select                                       ;Found Red, But not Blue Now check for Green
      Case Not $pixelSearchError3                     ;Red and Green, but not Blue
        MsgBox(0,"Message","Red,Green But not Blue")
      Case $pixelSearchError3                             ;Red, But not  Blue or Green
        MsgBox(0,"Message","Could only Find Red")
      EndSelect
    Case $pixelSearchError2          ;Could not find Blue or Red
      MsgBox(0,"Message","Could not Find Blue and Red")
     Select                                       ;Blue and Red Not found. Now check for Green
      Case Not $pixelsearch3                      ;Only found Green
        MsgBox(0,"Message","Only found Green")
      Case $pixelSearchError3                           ;Did not Find Blue,Red or Green
        MsgBox(0,"Message","No Color was found")
     EndSelect
            EndSelect
    EndSelect
    Sleep(10)
EndFunc

I Made a Picture that should make it far easier to see where one Select Case Starts and Ends :D Check the Link Below.

http://imageshack.us/f/9/selectcasegreenerror.gif/

I can't see why the Last Case is not working.. When Blue,Red AND Green are Missing i still get the "Only found Green"

Please Help :)

Also, Building the Cases Like this takes up allot of Time and Space, so if you have a Easier way please Tell :)

Like:

If Not @error 1 And @error 2  And @error 3 Then

But i don't think that Works.

I probably want to run 5 PixelSearches and that would mean 5 Select an 32 Cases !!!1!!11

So it would be Great if there was another way of doing this ;)

If not, Please do still tell what the problem of my Function is ;)

Edited by Schoening

Share this post


Link to post
Share on other sites



Just Click the Picture from the Link :)

Makes it far easier to figure out ;)

Share this post


Link to post
Share on other sites

I usually don't work with pixels -- but perhaps something like this with a numbering system might give you an idea.

HotKeySet('{ESC}', 'End')
;
Local $aBlue, $aGreen, $aRed, $number, $string
;
While 1
    $number = 0

    $aBlue = PixelSearch(100, 300, 200, 512, 0x0000ff, 10); Blue
    If @error = 0 Then $number += 1
    $aRed = PixelSearch(250, 310, 400, 512, 0xfa0000, 10); Red
    If @error = 0 Then $number += 2
    $aGreen = PixelSearch(500, 300, 600, 512, 0x00ff00, 10); Green
    If @error = 0 Then $number += 4

    Switch $number
        Case 1
            $string = 'Blue'
        Case 2
            $string = 'Red'
        Case 3
            $string = 'Blue and Red'
        Case 4
            $string = 'Green'
        Case 5
            $string = 'Blue and Green'
        Case 6
            $string = 'Red and Green'
        Case 7
            $string = 'Blue, Red and Green'
        Case Else
            $string = 'No Matching Color'
    EndSwitch

    MsgBox(0, '', $string, 1)

    Sleep(10)
WEnd
;
Func End()
    Exit
EndFunc
;

"The mediocre teacher tells. The Good teacher explains. The superior teacher demonstrates. The great teacher inspires." -William Arthur Ward

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

Where?

Look when you typed your Message, and when i had my Last Edit o.O i can't see it

Edited by Schoening

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

Ah hah, look at the word in the first tab. "Bot".

If you can proof this topic is directly related to that file ... otherwise ... you just jumped the gun.

Where?

Screenshot. "*bot.1.au3" Edited by MvGulik

"Straight_and_Crooked_Thinking" : A "classic guide to ferreting out untruths, half-truths, and other distortions of facts in political and social discussions."
"The Secrets of Quantum Physics" : New and excellent 2 part documentary on Quantum Physics by Jim Al-Khalili. (Dec 2014)

"Believing what you know ain't so" ...

Knock Knock ...
 

Share this post


Link to post
Share on other sites

Aha.:) Not related, found the code in attempt to find Pixelsearch information. I don't think i should link to it here since it is source code of Bot.

Though.. i can't prove that either can i ;)

Share this post


Link to post
Share on other sites

Guys,

While we are grateful that you all try to keep this forum the kind of place we all want it to be, please do not be too aggressive - particularly to newer members. If there is some doubt as to the legality of the subject (which does not seem to be the case here) just report the thread so that a Mod can take a look - that is why we are here. :)

M23


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites

Thx Melba ^^

Uhm... can any1 find my Error ? xD Now that i even have drawn a Helpful Picture !

Share this post


Link to post
Share on other sites

Nice picture indeed.

Although I'm not really getting the problem. I suggest you take a look at how to use" Not( And Or )" and maybe also take a look at ContinueCase. That should allow you to flatten than monster (eek!) of nested selects. :)

Note the Not($var1 And/or $varN+1) use. The brackets are important here.

http://www.autoitscript.com/autoit3/docs/keywords/ContinueCase.htm

http://www.autoitscript.com/autoit3/docs/intro/lang_operators.htm


"Straight_and_Crooked_Thinking" : A "classic guide to ferreting out untruths, half-truths, and other distortions of facts in political and social discussions."
"The Secrets of Quantum Physics" : New and excellent 2 part documentary on Quantum Physics by Jim Al-Khalili. (Dec 2014)

"Believing what you know ain't so" ...

Knock Knock ...
 

Share this post


Link to post
Share on other sites

Forgive me for asking this but would you mind posting a true picture of the app you are wanting to work with instead of an generic example? It may be helpful in that we may see a better way to optimize your search method.

This is all i got so far..

The only problem is that the Select Case @error Blue @error Red and @error Green Triggers Only Green ! And Not No Color Found.

I have Run all possibilities a few times.. and dont get it to work.

Share this post


Link to post
Share on other sites

Could PixelSearch be a bit bugged?

I have now added a "Reset" after the Function:

While 1
Sleep(10)
$pixelsearch1 = PixelSearch(100,300,200,512,0x0000ff,10) ;Blue
$pixelSearchError1 = @error
$pixelsearch2 = PixelSearch(250,310,400,512,0xfa0000,10) ;Red
$pixelSearchError2 = @error
Call("_errorcheck")
$pixelSearchError1 = 0
$pixelSearchError2 = 0
$pixelSearchError3 = 0
$pixelsearch1 = 0
$pixelsearch2 = 0
$pixelsearch3 = 0
WEnd

But still the same problem

Share this post


Link to post
Share on other sites

FIXET ! ;) I knew it was a simple Error xD

Just Used a Wrong Variable !

Typical !

Thx for all the Support, like allways ! :D and thx

MvGulik

i Look into Flattening the Code Down :)

Any Admin may {Solved} this one

Share this post


Link to post
Share on other sites

#16 ·  Posted (edited)

Good to see you found the problem.

Any Admin may {Solved} this one

You got the post count to do it yourself. Just go to your first post in this topic, switch to full edit mode for that post, and change the title to your liking. Edited by MvGulik

"Straight_and_Crooked_Thinking" : A "classic guide to ferreting out untruths, half-truths, and other distortions of facts in political and social discussions."
"The Secrets of Quantum Physics" : New and excellent 2 part documentary on Quantum Physics by Jim Al-Khalili. (Dec 2014)

"Believing what you know ain't so" ...

Knock Knock ...
 

Share this post


Link to post
Share on other sites

Ty :)

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

  • Similar Content

    • MrCheese
      By MrCheese
      Hey Guys,
       
      So, the functions work, where primarygui() accurately determines the evaluation of the status of the checkboxes - the msgbox picks this up.
       
      However, later on, when we re-enter a 'for $i = 0 to ubound($checkbox)' loop, then in the 'batchinitial' function it doesn't picked up that the status&$i = 1, so it jumps out, then within the While 1 loop, it exits the loop in the first row, again because the status& $i= 0
      The "assign" line within the primarygui funtion, is this only a local assignment? if so, how can I make it cross function?
       
      Thank in adv for your help
       
       
      Func excelsheetlist() $i = 0 Global $aWorkSheets = _Excel_SheetList($oWorkbook1) If @error Then Exit MsgBox($MB_SYSTEMMODAL, "Excel UDF: _Excel_SheetList Example 1", "Error listing Worksheets." & @CRLF & "@error = " & @error & ", @extended = " & @extended) ;_ArrayDisplay($aWorkSheets, "Excel UDF: _Excel_SheetList Example 1") ;_ArrayDisplay($aWorkSheets, "Array") Global $iRows = UBound($aWorkSheets, $UBOUND_ROWS) ; Total number of rows. In this example it will be 10. Global $iCols = UBound($aWorkSheets, $UBOUND_COLUMNS) ; Total number of columns. In this example it will be 20. Global $iDimension = UBound($aWorkSheets, $UBOUND_DIMENSIONS) ; The dimension of the array e.g. 1/2/3 dimensional. MsgBox($MB_SYSTEMMODAL, "", "The array is a " & $iDimension & " dimensional array with " & _ $iRows & " row(s) & " & $iCols & " column(s).") Dim $checkbox[$iRows] EndFunc ;==>excelsheetlist Func primarygui() ; Create a GUI with various controls. Local $hGUI = GUICreate("Script Controller", 300, ($iRows * 24)) ; Create a checkbox control. ;Local $idCheckbox = GUICtrlCreateCheckbox("Standard Checkbox", 10, 10, 185, 25) Local $Button2 = GUICtrlCreateButton("Close", 210, 200, 85, 25) Local $Button3 = GUICtrlCreateButton("Run", 210, 170, 85, 25) Local $Button1 = GUICtrlCreateButton("Discharge", 210, 140, 85, 25) For $i = 0 To UBound($checkbox) - 1 $checkbox[$i] = GUICtrlCreateCheckbox($aWorkSheets[$i][0], 8, 0 + ($i * 24)) ;, 81, 17) Next ; Display the GUI. GUISetState(@SW_SHOW, $hGUI) ; Loop until the user exits. While 1 $nMsg = GUIGetMsg() Select Case $nMsg = $GUI_EVENT_CLOSE Exit Case $nMsg = $Button2 ;Close Exit Case $nMsg = $Button1 MsgBox(0, "Discharge Button not configured", "Now Exiting") Exit Case $nMsg = $Button3 ;Run $fSelection = False For $i = 0 To UBound($checkbox) - 1 If BitAND(GUICtrlRead($checkbox[$i]), $GUI_CHECKED) Then $fSelection = True ExitLoop EndIf Next If $fSelection Then For $i = 0 To UBound($checkbox) - 1 Assign("status" & $i, GUICtrlRead($checkbox[$i])) Next $batchcount = 0 For $i = 0 To UBound($checkbox) - 1 If Eval("status" & $i) = 1 Then $batchcount = $batchcount + 1 ;Call ("o" & $i & "copy") ; if you want to call the functions directly, remove ; before the call and comment or delete the following DirCopy statement MsgBox(0, "Checking", "Checking that: " & $checkbox[$i] & " no, with title: " & $aWorkSheets[$i][0] & " was selected, Batch count: " & $batchcount) ; if you need only the DirCopy EndIf Next ExitLoop Else MsgBox(48, 'No Items Selected', 'You have not selected any Patients to Load, Please select from the list') EndIf EndSelect WEnd ; Delete the previous GUI and all controls. GUIDelete($hGUI) EndFunc ;==>primarygui Func _IsChecked($idControlID) Return BitAND(GUICtrlRead($idControlID), $GUI_CHECKED) = $GUI_CHECKED EndFunc ;==>_IsChecked Func batchinitial() If Eval("status" & $i) = 1 Then debugbox() $oWorkbook1.Sheets(1).Activate $bigloop = $bigloop + 1 $sheet = $aWorkSheets[$i][0] $oWorkbook1.Sheets($sheet).Activate debugbox() EndIf EndFunc ;==>batchinitial OpenExcel() excelsheetlist() primarygui() For $i = 0 To UBound($checkbox) - 1 batchinitial() While 1 If Eval("status" & $i) = 0 Then ExitLoop ;all the rest of my script loops etc WEnd Next  
    • MrMajorThorburn
      By MrMajorThorburn
      Using sample code:
      #include <MsgBoxConstants.au3> ; Find a pure red pixel in the range 0,0-20,300
      Local $aCoord = PixelSearch(0, 0, 20, 300, 0xFF0000)
      If Not @error Then
          MsgBox($MB_SYSTEMMODAL, "", "X and Y are: " & $aCoord[0] & "," & $aCoord[1])
      Else
          MsgBox($MB_SYSTEMMODAL, "", "Pure Not Found")
      EndIf ; Find a pure red pixel or a red pixel within 10 shades variations of pure red
      $aCoord = PixelSearch(0, 0, 20, 300, 0xFF0000, 10)
      If Not @error Then
          MsgBox($MB_SYSTEMMODAL, "", "X and Y are: " & $aCoord[0] & "," & $aCoord[1])
      Else
          MsgBox($MB_SYSTEMMODAL, "", "Variant Not Found")
      EndIf   and the attached screenshot which has Pure Red (FF0000) in one icon in the area being searched. Would someone please check this out for me?
    • Skysnake
      By Skysnake
      From From here, bottom of the post
      I am not arguing the logic of this, merely would like to point out that if there is such a rule, it is not documented...  Are there other such rules?
      Skysnake
    • damon
      By damon
      @JLogan3o13 I apologize, I did not think of it that way.  I have attached all the code and the Ini File information.  Please let me know if I need to add anything else to help understand what is happening.  thank you.
       
       
       
      Guys, I apologize in advance as I did not search for my answer before posting.  I just could not figure out a way to search that made since so I decided to go ahead and post my question.
       
      Getting to it.
      Background: this is being used to validate file names before moving to a new location.  though i have not included all the code, below is what i am having a problem with.
       I have an ini file that i am reading values from. Func ConfigDefineVars() -- I read the value of $ValidationRDA and everything is good then I set 
      $CaseRDALocationCheck = '$SplitFile[$ValidationRDALocation]' <> $ValidationRDA
      the code that will be used in the select case in Func FileSplitCount().  The problem i have is that even though the numbers = each other they are not recognizing as =.  
      This is what i am getting in my log file i create.
      2017-12-04 14:09:53 : RDA was 2403 should have been 2403:
      If I move $SplitFile[$ValidationRDALocation] <> $ValidationRDA to the Case line under the function it works correctly.
       
      I think this has to do with my use of ' ' around the '$SplitFile[$ValidationRDALocation]' but  i don't know what option i have in Func ConfigDefineVars I am not ready to define $SplitFile.  I have tried adding it to my Global Vars at the top of my script but that did not seem to help.
      There will be more fail this is just the first one in the select case.
       
      Any help or ideas would be greatly appreciated.
       
      thanks,
      Damon
      Example of a filename used.
      DWRSSD-37087-95-026.%-064.00-Tatum Family %-%-1230 Academy Rd-%-PERM-TRUE-2403.pdf
      This file will fail on the 95, it should be 095.  The problem i am getting is with the 2403 it fails even though the ini file value ValidationRDA = 2403 
       
       
      Ini File:
      [SSD_FolderPaths]
      pendingFolder=C:\Users\bg01152\Desktop\SSD Test\pending
      reviewFolder=C:\Users\bg01152\Desktop\SSD Test\review
      completedFolder=C:\Users\bg01152\Desktop\SSD Test\Completed
      FileNetProperties=DocumentTitle,ZipCode,County,MapAndGroupID,ParcelID,PropertyOwner,Subdivision,StreetAddress,LotNumber,DocumentType,Approved,RDANumber
      ValidationDocumentTitle=DWRSSD
      ValidationDocumentTitleLocation=1
      ValidationCountyCodeLocation=3
      ValidationRDA=2403
      ValidationRDALocation=12
      Validation3=TRUE
      Validation3Location=11
      Validation4=PERM
      Validation4Location=10
       
       
      #include <Array.au3> #include <File.au3> #include <MsgBoxConstants.au3> ;------------Global Vars --------------------- Global $SplitFile, $aFileList, $FileLog, $dFolder, $sFolder, $cFolder, $ConfigFile, $t Global $ValidationDocumentTitle, $ValidationDocumentTitleLocation, $ValidationCountyCodeLocation, $ValidationRDA Global $ValidationRDALocation, $Validation3, $Validation3Location, $Validation4, $Validation4Location, $FileNetPropertiesSplit Global $CaseCountyCheck, $CaseRDALocationCheck, $CaseValidation3LocationCheck, $CaseValidation4LocationCheck, $SplitFile ;;--------------------------------Check and Read Config files-------------------------------- $SysConfigFile = @ScriptDir & "\SysConfig.ini" ;----------------PreCheck for Config File-------------- If FileExists ($SysConfigFile) <> 1 Then Exit EndIf ;----------------End PreCheck-------------------------- $FileNetEXE = @ScriptDir & "\" & IniRead ($SysConfigFile, "FileNetUploader","FileName","") $delimiter = IniRead ($SysConfigFile, "FileInformation", "Delimiter","") $Filter = IniRead ($SysConfigFile, "FileInformation", "Filter", "") $ConfigFile = @ScriptDir & "\Config.ini" ;----------------PreCheck for Config File-------------- If FileExists ($ConfigFile) <> 1 Then Exit EndIf ;----------------End PreCheck-------------------------- ;;-------------------------------------------------------------------------------------------- $Sections = IniReadSectionNames ($ConfigFile) ;MsgBox (0,"test", $Sections[0] & @CRLF & $Sections[1] & @CRLF & $Sections[2] & @CRLF & $Sections[3] & @CRLF & $Sections[4]);TESTING ONLY - DELETE WHEN DONE $p = 0 Do $t = 0 ;used for precheck $p = $p + 1 ConfigDefineVars($Sections[$p]) ;MsgBox(0,"ConfigDefineVars", $sFolder & @CRLF & $dFolder & @CRLF & $cFolder);TESTING ONLY - DELETE WHEN DONE PreCheck($dFolder, $sFolder, $cFolder) ;Runs a Pre-check to make sure folder structure exists before running the program If $t = 0 Then ;MsgBox(0,"PreCheck Run", "Running next functions");TESTING ONLY - DELETE WHEN DONE ListArray($sFolder, $Filter) ;Puts File Names in String Array ;_ArrayDisplay ($aFileList, $Sections[$p]) If $t = 0 Then FileSplitCount($dFolder, $aFileList) ;Takes filename String Array and splits by $delimiter ;MsgBox(0,"PreCheck Run2", "Running split function");TESTING ONLY - DELETE WHEN DONE Else ;MsgBox(0,"PreCheck Run2", "Skipping split function");TESTING ONLY - DELETE WHEN DONE EndIf Else ;MsgBox(0,"PreCheck Run", "Skipping next functions");TESTING ONLY - DELETE WHEN DONE EndIf Until $p = $Sections[0] ExitScript() ;Exit script Function Func ConfigDefineVars($SectionsNum);Defines Variables from config file Sections $sFolder = IniRead ($ConfigFile, $SectionsNum, "pendingFolder","") ;Pending Folder, Folder that is awaiting the process $dFolder = IniRead ($ConfigFile, $SectionsNum, "reviewFolder","") ;Review Folder, Files that did not pass validation check and division needs to review $cFolder = IniRead ($ConfigFile, $SectionsNum, "completedFolder","") ;Completed Folder, Once process is completed this would be location files get moved to $FileNetProperties = IniRead ($ConfigFile, $SectionsNum, "FileNetProperties","") $FileNetPropertiesSplit = StringSplit ($FileNetProperties,",") $ValidationDocumentTitle = IniRead ($ConfigFile, $SectionsNum, "ValidationDocumentTitle","") $ValidationDocumentTitleLocation = IniRead ($ConfigFile, $SectionsNum, "ValidationDocumentTitleLocation","") $ValidationCountyCodeLocation = IniRead ($ConfigFile, $SectionsNum, "ValidationCountyCodeLocation","") $ValidationRDA = IniRead ($ConfigFile, $SectionsNum, "ValidationRDA","") $ValidationRDALocation = IniRead ($ConfigFile, $SectionsNum, "ValidationRDALocation","") $Validation3 = IniRead ($ConfigFile, $SectionsNum, "Validation3","") $Validation3Location = IniRead ($ConfigFile, $SectionsNum, "Validation3Location","") $Validation4 = IniRead ($ConfigFile, $SectionsNum, "Validation4","") $Validation4Location = IniRead ($ConfigFile, $SectionsNum, "Validation4Location","") If $ValidationCountyCodeLocation = 999 Then $CaseCountyCheck = 1 <> 1 Else ;MsgBox (0,"test of county code", "location = " &$ValidationCountyCodeLocation) $CaseCountyCheck = StringLen('$SplitFile[$ValidationCountyCodeLocation]') <> 3 ; Checks for 3 digit County Code EndIf If $ValidationRDALocation = 999 Then $CaseRDALocationCheck = 1 <> 1 Else $CaseRDALocationCheck = '$SplitFile[$ValidationRDALocation]' <> $ValidationRDA ; Checks for 4 Digit RDA EndIf If $Validation3Location = 999 Then $CaseValidation3LocationCheck = 1 <> 1 Else $CaseValidation3LocationCheck = '$SplitFile[$Validation3Location]' <> $Validation3 ; Checks that Approved = True EndIf If $Validation4Location = 999 Then $CaseValidation4LocationCheck = 1 <> 1 Else $CaseValidation3LocationCheck = '$SplitFile[$Validation4Location]' <> $Validation4 ; Checks that Document Type = PERM EndIf EndFunc Func ValidationCheck ($check1) $blank = StringLen ($check1) If $check1 Then EndIf EndFunc Func PreCheck($dFolder, $sFolder, $cFolder) ;----------------PreCheck for Destination Folder-------------- If FileExists ($dFolder) <> 1 Then $t = 1 Return Else $FileLog = FileOpen($dFolder & "\FileLog.log", 1) EndIf ;----------------End PreCheck-------------------------- ;----------------PreCheck for Source Folder-------------- If FileExists ($sFolder) <> 1 Then _FileWriteLog($FileLog, "Path to Pending Folder -- " & $sFolder & " -- does not exist") $t = 1 Return EndIf ;----------------End PreCheck-------------------------- ;----------------PreCheck for Completed Folder--------- If FileExists ($cFolder) <> 1 Then _FileWriteLog($FileLog, "Path to Completed Folder -- " & $cFolder & " -- does not exist") $t = 1 Return EndIf ;----------------End PreCheck-------------------------- EndFunc Func ListArray($sFolder, $Filter) $aFileList = _FileListToArray($sFolder, $Filter, 1) ;Create an array of files from the source folder filtering by filetype ;in the config.ini files for the specified section If @error = 1 Then ;MsgBox($MB_SYSTEMMODAL, "", "Path was invalid.") _FileWriteLog($FileLog, "Path to File(s) is Invalid") $t = 1 Return EndIf If @error = 4 Then ;MsgBox($MB_SYSTEMMODAL, "", "No file(s) were found.") _FileWriteLog($FileLog, "No File(s) were found, exiting.") $t = 1 Return EndIf EndFunc ;==>ListArray