SysCompareText Class [AX 2012]

The SysCompareText class compares two strings and returns detailed information about their differences.

class SysCompareText

Run On

Server

  MethodDescription
Gg917126.protmethod(en-us,AX.60).gif addText Adds text to the result.
Gg917126.protmethod(en-us,AX.60).gif buildCRC Builds an array of hash keys from strings.
Gg917126.protmethod(en-us,AX.60).gif buildMatrix Builds a similarity matrix by comparing hash keys.
Gg917126.protmethod(en-us,AX.60).gif buildRef Populates the TmpCompareText table with information from the matrix.
Gg917126.protmethod(en-us,AX.60).gif buildResult Builds the results container.
Gg917126.pubmethod(en-us,AX.60).gif cancelTimeOut Cancels a previous method call to the setTimeOut method. (Inherited from Object.)
Gg917126.protmethod(en-us,AX.60).gif compare Compares two strings.
Gg917126.pubmethod(en-us,AX.60).gif equal Determines whether the specified object is equal to the current one. (Inherited from Object.)
Gg917126.protmethod(en-us,AX.60).gif getResult Returns the results of the comparison.
Gg917126.pubmethod(en-us,AX.60).gif getTimeOutTimerHandle Returns the timer handle for the object. (Inherited from Object.)
Gg917126.pubmethod(en-us,AX.60).gif handle Retrieves the handle of the class of the object. (Inherited from Object.)
Gg917126.protmethod(en-us,AX.60).gif init Initializes member variables for the text comparison.
Gg917126.pubmethod(en-us,AX.60).gif new Initializes a new instance of the Object class. (Inherited from Object.)
Gg917126.pubmethod(en-us,AX.60).gif notify Releases the hold on an object that has called the wait method on this object. (Inherited from Object.)
Gg917126.pubmethod(en-us,AX.60).gif notifyAll Releases a lock on the object that was issued by the wait method on this object. (Inherited from Object.)
Gg917126.pubmethod(en-us,AX.60).gif objectOnServer Determines whether the object is on a server. (Inherited from Object.)
Gg917126.pubmethod(en-us,AX.60).gif owner Returns the instance that owns the object. (Inherited from Object.)
Gg917126.protmethod(en-us,AX.60).gif parmAlternateLines Gets or sets the AlternateLines parameter.
Gg917126.protmethod(en-us,AX.60).gif parmCaseSensitive Gets or sets the CaseSensitive parameter.
Gg917126.protmethod(en-us,AX.60).gif parmLineNumbers Gets or sets the LineNumbers parameter.
Gg917126.protmethod(en-us,AX.60).gif parmSingleLine Gets or sets the SingleLine parameter.
Gg917126.protmethod(en-us,AX.60).gif parmSuppressWhiteSpace Gets or sets the SuppressWhiteSpace parameter.
Gg917126.pubmethod(en-us,AX.60).gif setTimeOut Sets up the scheduled execution of a specified method. (Inherited from Object.)
Gg917126.protmethod(en-us,AX.60).gif str2Con Converts text to a container that is ready for a comparison.
Gg917126.pubmethod(en-us,AX.60).gif toString Returns a string that represents the current object. (Inherited from Object.)
Gg917126.privmethod(en-us,AX.60).gif trimEnd
Gg917126.privmethod(en-us,AX.60).gif trimStart
Gg917126.pubmethod(en-us,AX.60).gif usageCount Returns the current number of references, that is, the value of the reference counter, that the object has. (Inherited from Object.)
Gg917126.pubmethod(en-us,AX.60).gif wait Pauses a process. (Inherited from Object.)
Gg917126.pubmethod(en-us,AX.60).gif xml Returns an XML string that represents the current object. (Inherited from Object.)
Gg917126.protmethod(en-us,AX.60).gif Gg917126.static(en-us,AX.60).gif ::construct Initializes a new instance of the SysCompareText class.
Gg917126.pubmethod(en-us,AX.60).gif Gg917126.static(en-us,AX.60).gif ::run Contains the code that does that actual job of the class.
Gg917126.privmethod(en-us,AX.60).gif Gg917126.static(en-us,AX.60).gif ::runCIL
Gg917126.privmethod(en-us,AX.60).gif Gg917126.static(en-us,AX.60).gif ::runInternal Provides the starting point for a text comparison.
Gg917126.pubmethod(en-us,AX.60).gif Gg917126.static(en-us,AX.60).gif ::suppressWhiteSpace Removes white space from text.
Top

This class uses the longest common subsequence problem algorithm.

The following example demonstrates the functionality of the SysCompareText class.

static void example() 
{ 
    str       text1 = 'A\nB\nC\nD'; 
    str       text2 = 'B\nE\nC\nA';  
    container compareResult = SysCompareText::run(text1, text2); 
} 
//compareResult is: 
//[ 
// [SysCompareType::Move1,     'A\n', 6],  Moved from here in text1 
//                                         to position 6 in text2 
// [SysCompareType::Identical, 'B\n'],     Identical in text1 and text2 
// [SysCompareType::Text2,     'E\n'],     Inserted in text2 
// [SysCompareType::Identical, 'C\n'],     Identical in text1 and text2 
// [SysCompareType::Text1,     'D\n'],     Inserted in text1 
// [SysCompareType::Move2,     'A\n', 1]   Moved to here in text2 from 
//                                         position 1 in text1 
//]

Object Class
  SysCompareText Class

Community Additions

ADD
Show: