I have a line count function in a text box but when I get up to 500 to 600 lines I get an overflow when I try to lode the text from the beginning to the current position into a variable. I'm doing it by counting chr(13)'s from the beginning to the current cursor position. Can I trap this error so my app doesn't crash. I'm very unfamiliar with error handleing. Any help would be very appreciated. I think the error number is 6 but the following code does nothing:
Code:if err.number = 6 then exit function end if Checkline = mid(text1.text, 0, text1.selstart)




Reply With Quote