Drstein99 Posted September 26, 2003 Posted September 26, 2003 Ok, I'm trying to parse text in a rtf.text, and there are cr/lf's. when I get the .indexof(my) something like this: hello cr/lf cr/lf my name is it will return a value of 7, EXCLUDING the cr/lf's! How do i get the absolute index of instead of the bumped-down version that skew's the index? PLEASE HELP frustrating!!!! Quote www.DRSTEIN99.com www.RAIDGEAR.net www.THERE.com -> Tell them DrStein99 sent ya!
*Experts* Nerseus Posted September 27, 2003 *Experts* Posted September 27, 2003 Actually, you're not getting CR/LF, just CR (or LF, I can't remember my ASCII codes). Remember that IndexOf is 0 based. h=0 e=1 l=2 l=3 o=4 CR=5 CR=6 m=7 -Nerseus Quote "I want to stand as close to the edge as I can without going over. Out on the edge you see all the kinds of things you can't see from the center." - Kurt Vonnegut
Drstein99 Posted September 27, 2003 Author Posted September 27, 2003 I understand. How do you suggest I deal with this? I want to be able to get the absolute location of a specific string of text, INCLUDING any cr/lf's please help. Quote www.DRSTEIN99.com www.RAIDGEAR.net www.THERE.com -> Tell them DrStein99 sent ya!
Drstein99 Posted September 28, 2003 Author Posted September 28, 2003 In my program, if there are cr/lf's before the specific text i'm looking for, the instr command ADDS to the position, so i can't capture the text I'm looking for - its offset. Quote www.DRSTEIN99.com www.RAIDGEAR.net www.THERE.com -> Tell them DrStein99 sent ya!
*Experts* Nerseus Posted September 30, 2003 *Experts* Posted September 30, 2003 I'm not sure what you're saying. Did you read my post? Does it make sense? The IndexOf does include the position of the CR characters. When you use a RichTextbox and press enter, it doesn't store the LF - only the CR. And IndexOf DOES see those characters. What do you mean by "how do I deal with this" and "get the absolute location of a specific string of text"? I'd have to answer IndexOf... -nerseus Quote "I want to stand as close to the edge as I can without going over. Out on the edge you see all the kinds of things you can't see from the center." - Kurt Vonnegut
Drstein99 Posted September 30, 2003 Author Posted September 30, 2003 I actually figured out what was going on. I was taking the strings from a memo field in MSaccess. In MSaccess, I would type the memo text in, and use <ctrl-enter> as cr/lf. This must be translating differently - because it was causing the indexof command askew. My fix: I created a new application that used a text box, and wrote the contents of the text box to the memo field. this way i read the contents of memo field and indexof command worked as it should. I suppose I didnt word the question correctly, I apologize. Quote www.DRSTEIN99.com www.RAIDGEAR.net www.THERE.com -> Tell them DrStein99 sent ya!
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.