Home RAP
New Blog Posts: Merging Reports - Part 1 and Part 2

Capture If LoadfromFile Fails

edited October 2005 in RAP
Hi guys

I have this code on the onPrint of a Image

image1.picture.LoadFromFile(DOCUMENT_HEADER['URL_PATH']);

If I try and load a compressed TIFF File sometimes it fails (using
GraphicEx).



I want to test if the LoadFromFile fails and if so just move on to next
record



Any help would be appreciated



Mark

Comments

  • edited October 2005

    There is not a way to catch an exception in RAP. Therefore, I suggest
    creating a pass-thru function that returns a boolean indicating a successful
    load. Define a function that takes two parameters: the TppImage object and a
    file name.

    --------------------------------------------------
    Article: Extending RAP
    ---------------------------------------------------

    There are two very simple and powerful techniques to extend the capabilities
    of RAP infinitely. These are summarized below and covered in more detail in
    the RAP.hlp online help. Demos and tutorials are installed to
    RBuilder\Demos\RAP. The tutorial text is located in RAP.hlp.


    1. RAP Pass-Through Functions

    These are functions that appear in the Language tab of RAP's Code Toolbox.
    These functions are written in Delphi and can be called from RAP. RAP's
    pass-through function architecture enable's developers to add new built-in
    functions to RAP's code toolbox.

    2. Extend RAP's RTTI

    RAP's Run-time Type information defines what classes and properties can be
    accessed via RAP. By default the published properties of any class that is
    registered with Delphi's RegisterClass procedure is recognized by RAP. In
    addition many of the public properties and methods of ReportBuilder classes
    are exposed.







    --
    Tech Support mailto:support@digital-metaphors.com
    Digital Metaphors http://www.digital-metaphors.com




    --
    Nard Moseley
    Digital Metaphors Corporation
    http://www.digital-metaphors.com



    Best regards,

    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com
This discussion has been closed.