local lnLines, i, lcString lnLines=memlines(this.value) store 0 to _mline for i=1 to lnLines && Loop through all lines lcString=alltrim(mline(this.value,1,_mline)) && each line if len(lcString)<>5 or type(lcString)<>'N' && typo occurs! =messagebox('You must type only 5 digits in each line!',48,'Error') return .f. endif nextVery simple and works fine! As I said, I assume, that there are no more 5-6 lines, which users will type. So, what's the reason to switch? :)