generating pop up for error

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • shailee123
    Visitor
    • Aug 2015
    • 5

    generating pop up for error

    I am trying to generate a pop up for error in my script for comparing files in two folders. Please guide what should I write in the script so that an error window pops up.
  • Aaron
    Team Scooter
    • Oct 2007
    • 16011

    #2
    Hello,

    If you encounter a fatal error (such as a base folder that does not exist). Otherwise, add:
    option stop-on-error
    as the first line of your script to handle file operation errors and create a prompt.
    Aaron P Scooter Software

    Comment

    • shailee123
      Visitor
      • Aug 2015
      • 5

      #3
      Hi ,

      So, the script that I have implemented is below:

      log verbose "c:\temp\bclog.txt"
      criteria rules-based
      load %1 %2
      expand all
      select all.diff.files all.newer.files all.older.files
      text-report layout:side-by-side options:display-mismatches output-to:%3 output-options:html-color.

      I have 2 scenarios that I want to implement. First one is :

      1. If number of records are different in both the files. i.e if folder f1 has 2 files (book 1, book 2) and folder f2 (book1 ), what will happen ? Will it show some error? If yes , how do I include in my script.

      2. If folder f1 has file named book2015 and folder f2 has file book2016, I want to compare these 2 files because book is constant in both.

      Please guide how should I implement these two scenarios.

      Comment

      • Aaron
        Team Scooter
        • Oct 2007
        • 16011

        #4
        Hello,

        1. Two files that align that are different are not errors. That's a comparison status that you can report on (folder-report command or select different files as you have and generate a text-report). Errors would be actions like a failed copy because it is locked, or loading a base folder that does not exist.

        2. A Name difference will cause the items to not align, so they would appear as Orphans. We don't have a scripting command to align items of different names, but you could create a session in the graphical interface of your two folders and then (with Pro edition) use the Session Settings dialog, Misc tab, new Alignment Override to create a rule that will align "book2015" = "book2016". Then save the session, and in script: load "session name" instead of a folder pair to use the saved session settings.
        I would recommend setting up this session in the graphical interface first, to make sure items are aligned and comparing as you expect. You would need Pro edition for the Alignment Override feature.
        Aaron P Scooter Software

        Comment

        • shailee123
          Visitor
          • Aug 2015
          • 5

          #5
          Thanks Aaron for the reply. Let me explain you the first part :

          If number of records are different in both the files. i.e if folder f1 has 2 files (book 1, book 2) and folder f2 (book1 ), what will happen ? Will it show some error? If yes , how do I include in my script.

          I agree that it's not an error.
          I want to show is my report that Book 2 is not present in folder 2. How do I do this using my script?

          Comment

          • Aaron
            Team Scooter
            • Oct 2007
            • 16011

            #6
            Hello,

            For a file list of files not present on one side, but is on the other, you would generate a folder report and look for Orphans:
            load "c:\folder1" "c:\folder2"
            expand all
            folder-report layout:summary options:display-orphans output-to:"d:\orphans.txt"

            Orphans are files that appear on one side but are not aligned to a file on the other side. How does this work for you?
            Aaron P Scooter Software

            Comment

            Working...