What is the best method for comparing the text in two textboxes?

I suggest you use the following method. It ignores empty lines at the end of the texts.

// Enter test textsTextBox (10,0) (20,40) name=T1

TextBox (10,41) (20,81) name=T2


// compare the 2 texts

// start with line 1

Set V[i] 1

// end flags

Set V[end1] ""

Set V[end2] ""

label compline

 if not V[end1=X]

  CopyText fromText=T1 toString=s1 line="&V[i]"

   if not Q[ok]

    Set V[end1] "X"



if not V[end2=X]

CopyText fromText=T2 toString=s2 line="&V[i]"

 if not Q[ok]

   Set V[end2] "X"




// end of both texts reached?

if V[end1=X] and V[end2=X]

Message "equal"

goto done



// different lines?

if not V[s1=&V[s2]] -strict

  Message "different"

  goto done



// next line

Set V[i] &V[i] + 1

goto compline

label done

Without the "-strict" option in the last "if" statement, the comparison would not be case sensitive.