2 Replies Latest reply on Nov 1, 2011 2:11 PM by stevenkw

    Script or calculation to verify status of container field.

    stevenkw

      Title

      Script or calculation to verify status of container field.

      Post

      Hello All,

      I have a database that displays images that are in a folder. The problem is if the file is missing or if the file is corrupt there is a text message in the container field explaining why the image can not be displayed.

      Is there anyway to get this text message out of the container field and into a field I can search on?

      The container says "The file cannot be displayed:" is the file is corrupt or damaged and " The file cannot be found:" if the file is missing.

      I really need to be able to find all the "The file cannot be displayed:" and " The file cannot be found:" records so I know how many there are of each.

      there are anywhere from 75k to 290k records and paging through them is not really an option. :)

       

      Thank you,

      --StevenKW

       

      Screen_shot_2011-11-01_at_12.43.16_PM.jpg

        • 1. Re: Script or calculation to verify status of container field.
          philmodjunk

          Define an additional container field. You can make it global.

          Put it on a layout based on your table of container fields.

          Use this test in a script that loops through your records to validate the container references:

          Set Variable [$Path ; Value: GetValue ( YourTable::ImageContainerField ; 3 ) ]
          Go to field [YourTable::globalContainerField]
          Insert Picture [Reference ; $Path]
          Set Variable [$Error ; value: get ( LastError ) ]
          IF [ $Error > 0 //invalid reference ]
             Set Field [Yourtable::ErrorFlag ; $Error ]
          End If

          error code of 100 will be file not found, which tells you the file is missing or has been renamed.

          Don't have a corrupt image to test this with so don't know if this will catch those errors or not.

          • 2. Re: Script or calculation to verify status of container field.
            stevenkw

            Nice work as always!

            I reused a script I used to export the images. Not quite as nice as your but it did the trick. I like that you used the global field as a test container and that I didn't need to export all the images over again. Also I think I would have been able to catch the undisplayable ones.

            missing image = error code 100

            undisplayable image = error code 735

            image OK =error code 0

            Thanks for the help!

            --StevenKW