public void CommentStringChars(int startAddress, DecodeCharacter decodeChar, StringTerminationType terminationType, int expectedLength, byte terminationChar) { int stringLength = 0; StringTerminationTest terminationTest = b => stringLength == expectedLength; if (terminationType == StringTerminationType.InvertedChar) { terminationTest = b => b >= 128; } else if (terminationType == StringTerminationType.SpecialChar) { terminationTest = b => b == terminationChar; } int firstLineNumber = GetLineFromAddress(startAddress).LineNumber; for (int lineNumber = firstLineNumber; ; lineNumber++) { ProgramLine currentLine = Lines[lineNumber - 1]; byte charCode = currentLine.MemoryBytes[0]; stringLength++; if (terminationTest(charCode)) { return; } else { AppendCommentToProgramLine(currentLine.LineAddress, decodeChar(charCode)); } } }
public void CommentStringChars(int startAddress, DecodeCharacter decodeChar, StringTerminationType terminationType, int expectedLength, byte terminationChar) { int stringLength = 0; StringTerminationTest terminationTest = b => stringLength == expectedLength; if (terminationType == StringTerminationType.InvertedChar) { terminationTest = b => b >= 128; } else if (terminationType == StringTerminationType.SpecialChar) { terminationTest = b => b == terminationChar; } int firstLineNumber = GetLineFromAddress(startAddress).LineNumber; for (int lineNumber = firstLineNumber; ; lineNumber++) { ProgramLine currentLine = Lines[lineNumber-1]; byte charCode = currentLine.MemoryBytes[0]; stringLength++; if (terminationTest(charCode)) { return; } else { AppendCommentToProgramLine(currentLine.LineAddress, decodeChar(charCode)); } } }