Resolved Application.CalMasterBias - error

Discussion in 'Scripting and Programming' started by CraigNZ, Dec 7, 2019.

  1. CraigNZ

    CraigNZ Cyanogen Customer

    Joined:
    Dec 29, 2014
    Messages:
    86
    Location:
    Ngutunui, New Zealand
    I am writing a script using Free Pascal and the Lazarus development environment.

    This call results in an error:

    MaximDLApplicationObject.CalMasterBias(MaximDLDocumentObject)

    where MaximDLDocumentObject is declared a "Variant".

    The error I get is: EOleSysError: Type mismatch

    so I am passing the wrong variable to CalMasterBias.

    Does anyone have a Pascal example (or any example) of how to call this function?

    Craig
     
  2. CraigNZ

    CraigNZ Cyanogen Customer

    Joined:
    Dec 29, 2014
    Messages:
    86
    Location:
    Ngutunui, New Zealand
    Resolved,

    this failed: MaximDLApplicationObject.CalMasterBias(MaximDLDocumentObject)

    this worked: MaximDLDocumentObject := MaximDLApplicationObject.CalMasterBias

    Craig
     
  3. Colin Haig

    Colin Haig Staff Member

    Joined:
    Oct 27, 2014
    Messages:
    3,574
    Thanks for letting us know.
     
  4. Bob Denny

    Bob Denny Cyanogen Customer

    Joined:
    Oct 12, 2014
    Messages:
    801
    Location:
    DC-3 Dreams, SP, Mesa, Arizona +1 480 396 9700
    For reference, this is a property not a method (function), so you are reading the CalMasterBias document (a property of the application) from the Application and saving that MaxIm.Document object to the Pascal variable MaxImDLDocumentObject. Cool huh?

    Snap2.png
     
  5. CraigNZ

    CraigNZ Cyanogen Customer

    Joined:
    Dec 29, 2014
    Messages:
    86
    Location:
    Ngutunui, New Zealand
    Thanks Bob,

    Craig
     

Share This Page