Forum Discussion

rmnrdi's avatar
rmnrdi
Contributor
7 years ago

compare object

I have a program that I need to check the properties of in two different states. TC only allows one object to be captured by object spy at a time.   Is there any way to do a side by side comparison...
  • tristaanogre's avatar
    tristaanogre
    7 years ago

    No additional save, just a refresh of the variable as per below.

     

     

    procedure CompareObjects;
    var
    tracePanel, PropertyNames, CollectionName, tfrmModifyTrace2 : OleVariant;
    begin
    //Get panel object
    tracePanel := Aliases.SettingsNavigator.frmModifyTrace2.VCLObject('Panel3');
    
    // Sets the name of the property collection
    CollectionName := 'TracePanelProps';
    
    // I want it to check all properties, so I leave the property name blank.
    Objects.Save(tracePanel, CollectionName);
    
    tfrmModifyTrace2 := Aliases.SettingsNavigator.frmModifyTrace2;
    tfrmModifyTrace2.MainMenu.Click('Manage|Get Library Trace');
    tfrmModifyTrace2.pnlLibLookup.isLibName.Keys('[Enter]');
    
    tracePanel := Aliases.SettingsNavigator.frmModifyTrace2.VCLObject('Panel3');
    
    Objects.Compare(tracePanel, CollectionName, true, lmMessage);
    
    Objects.Remove(CollectionName); 

     Additionally... there is more information in the error than just "Object Compare error".  Any additional info/text would be useful.