Is there a way to add a List Iterate to the IF then. It works to some extent. Here is what I am doing
I am Iterating through all the folders to a network location. I will then check to see if that folder is part of an exlcusion list. If it is not then I will check the date time of the folder to see if it matches a date time comparison and if it matches I will perform a copy of it to another location.
Right now I have a Folder iterator with and If...Then with Many expressions. I would like to only have one expression to a list! and have it check that and then if it is not found on the list perform the functions stated above.
Thanks for your post. In recent FB 5.5 builds (definitely in the latest official build) there are two new comparison types - "Is substring of" and "Is member of comma-separated list". There are also two converse comparisons (is NOT substring.../is NOT member...)
Another way to do it is to set a variable like %Exclude% to “no”, then do a list iterator over your exclusion list, that contains an IF … THEN that checks to see if the folder matches the iteration variable, and if so, sets %Exclude% to “yes”. After the list iterator is done, you check the value of %Exclude%, and if the folder matched anything on your exclusion list, it will be set to “yes”.
It will be a lot slower tham using the comparisons that Angus mentioned, but if those won’t work in your case, this method can probably be made to work.
Thanks, for the feedback I will see if this works for us, but slowness does hinder us with our applications. Our applications are quite lengthy and just to build 1 of the packages out of 20 packages could take 4 hours to build. so where speed is a virtue, I try to expediate where I can.
Right now if I coded in vbscript. my build for the projects took 2 hours total. if file additions and deletes the over all time went to 4 hours.
Currently with FInalbuilder we have increased the time by 1-2 hours more.
The one projects where speed is critical increased by 35 minutes using finalbuilder.
I use part of the time increase to the use of finalbuilder instead of the vbscripts we used to use.
You may be right about slowness, although there are other benefits from FB (like full hierarchical logging.) Some suggestions for improving speed are:
- Use FBCMD instead of the IDE to run builds
- Use FBCMD with the /S option to disable writing to the FinalBuilder log file, if you don’t need it.
- Use VBScript and the Run Script action to recode any “tight loop” sections of your project, if you absolutely need performance (an example of a “tight loop” would be an iterator with just one or two children, doing several thousand iterations.)
- Upgrade to the next major version of FB when it comes available, because performance improvements are a priority for that version. :-).
We are using FBCMD instead of IDE. We log the run with export at the end, will the /S cause issues there. Overall I have it down to adding only 1 hour extra for the total time with Finalbuilder. This is comparison to running via Vbscripts. with the same build process. The oen area that seems to increase the time is when we have a iterate to Robocopy or the other is the comparison we have to do to strip away files that already are part of another package.
If you need Export Log then unfortunately you can't use /S.
The slower operations you describe are the kind of thing we are concentating on optimising intensely for the next major release of FB. It will never be as fast as dedicated script, though, because of the overhead of logging.
Another possibility that I forgot to mention last week is to use Async Action Groups to run some portions of your build in parallel. For many operations, this will dramatically cut down the build time.
Thanks, Async Action will not work since most are dependent on a previous action to run For example, Once our Binaries are compiled,
I run: Sync fileset, Build Package Deploy Package Create Media.
As you can tell each one depends on the previous to finish. The area that is mostly the slow area is the Sync Fileset.
Here is a script i used a long time ago and this worked well. I compared files and removed from the one compare location.
'-------------------------------------------------------------------- 'SubFilesComp - Compare Source files to Local Files '-------------------------------------------------------------------- Sub SubFilesComp(StrSourceFolder,strDestFolder,strProcess,DicName,FlagSet,ItemsList) On Error Resume Next
Dim s, strCurrentFolder, fsofile, sArray, t, FileNameOnly Dim objFile, objFile1 Dim NewFileCount, DeletedFileCount, OutSyncCount
Set DeleteDictionary = CreateObject(“Scripting.Dictionary”) DeleteDictionary.CompareMode= VBTextMode
’ Parameters used when counting items found. NewFileCount=0 DeletedFileCount=0 OutSyncCount=0
For s = 0 to DicName.Count-1 'Convert Source location to Destination Folder strCurrentFolder = Replace(LCase(ItemsList(s)),LCase(StrSourceFolder),LCase(strDestFolder)) For Each fsoFile In oFileSystem.GetFolder(ItemsList(s)).Files sArray =Split(fsoFile, “”) t =UBound(sArray) FileNameOnly =sArray(t) ’ Comparing Source and Destimation locations files Select Case strProcess Case “Delete” If oFileSystem.FileExists(strCurrentFolder & “”& FileNameOnly) Then DeleteFile (strCurrentFolder & “”& FileNameOnly): CheckError (“Delete File Add: " & strCurrentFolder & “”& FileNameOnly & " Failed.”) Else message=VBCRLF & strCurrentFolder & “”& FileNameOnly & VBCRLF & " does not exsit." n=writeafile(logfile,message) End If Case “NoDelete” Select Case FlagSet Case “New2LastBuild” If Not oFileSystem.FileExists(strCurrentFolder & “”& FileNameOnly) Then DeletedFileCount = DeletedFileCount + 1 message=VBCRLF & "File has Been Deleted: "& fsoFile & “.” n=writeafile(DeletedFileLog,message) Else Set objFile = oFileSystem.GetFile(fsoFile) Set objFile1 = oFileSystem.GetFile(strCurrentFolder & “”& FileNameOnly)
If objFile1.DateLastModified <> objFile.DateLastModified Then OutSyncCount= OutSyncCount + 1 message=VBCRLF & “Files Out of Sync:” & VBCRLF & _ objFile1.Path & " , " & objFile1.DateLastModified & _ VBCRLF & objFile.Path & " , " & objFile.DateLastModified & “.” n=writeafile(OutSynclog,message) End If End If Case “LastBuild2New” If Not oFileSystem.FileExists(strCurrentFolder & “”& FileNameOnly) Then NewFileCount= NewFileCount + 1 message= VBCRLF & "File is new: "& fsoFile & “.” n=writeafile(NewFileLog,message) Else Set objFile =oFileSystem.GetFile(fsoFile) Set objFile1 =oFileSystem.GetFile(strCurrentFolder & “”& FileNameOnly)
If objFile1.DateLastModified <> objFile.DateLastModified Then OutSyncCount= OutSyncCount + 1 message=VBCRLF & “Files Out of Sync:” & VBCRLF & _ objFile1.Path & " , " & objFile1.DateLastModified & _ VBCRLF & objFile.Path & " , " & objFile.DateLastModified & “.” n=writeafile(OutSynclog,message) End If End If Case Else message=VBCRLF & “No Changes” & VBCRLF & fsoFile & “.” n=writeafile(logfile,message) End Select End Select Next Next