Article View: comp.lang.basic.visual.3rdparty
Article #13Re: Reading Data from an RTB
From: James Roberts
Date: Thu, 26 Jul 2001 00:25
Date: Thu, 26 Jul 2001 00:25
84 lines
3895 bytes
3895 bytes
Does it need to be loaded into a Rich Text Box? Put it into a string then mid$ etc will work. The less you let things get in your way the better off you are. Look for examples of gettoken etc for hints on how to read. jr "Bobby Hicks" <b_hicks@alltel.net> wrote in message news:9jkr93$3n1$1@iac5.navix.net... > Hello everyone. > What I 'm trying to do is read in one word, one number(of any length. > 2,3,4+characters long), one character. > I kind of have the one character down, but the one word and one number is > baffling me. > I 'm using an RTB to store the information from the file, and at the end of > each line, there's the lf/cr codes(10/13 respectively). > > I know there "has" to be a simpler way of doing this. I've tried Mid/Instr, > but I can't get anywhere with it cuz the RTB is multilined. > > Any help would be greatly appreciated. > > TIA, > Bobby > > > Here are my functions: > Function fread_word(StartPos As Integer, strReturn As String) > Dim strTemp As String > strReturn = "" > rtfText.SelStart = StartPos > rtfText.SelLength = 1 > If Asc(rtfText.SelText) = 10 Or Asc(rtfText.SelText) = 13 Then > Do While Asc(rtfText.SelText) = 10 Or Asc(rtfText.SelText) = 13 > StartPos = StartPos + 1 > rtfText.SelStart = StartPos > rtfText.SelLength = 1 > Loop > End If > Do While Not rtfText.SelText = " " > strReturn = strReturn & rtfText.SelText > StartPos = StartPos + 1 > rtfText.SelStart = StartPos > rtfText.SelLength = 1 > Loop > If rtfText.SelText = " " Then > StartPos = StartPos + 1 > End If > End Function > > Function fread_char(StartPos As Integer, strReturn As String) > > rtfText.SelStart = StartPos > rtfText.SelLength = 1 > Do While Asc(rtfText.SelText) = 10 Or Asc(rtfText.SelText) = 13 > StartPos = StartPos + 1 > rtfText.SelStart = StartPos > rtfText.SelLength = 1 > Loop > rtfText.SelStart = StartPos > rtfText.SelLength = 1 > strReturn = rtfText.SelText > StartPos = StartPos + 1 > End Function > > Function fread_number(StartPos As Integer, intReturn As Integer) > Dim FindEndPos As Integer > Dim strTemp As String > Call fread_char(StartPos, strTemp) > FindEndPos = StartPos + 1 > rtfText.SelStart = StartPos > rtfText.SelLength = 1 > Do While IsNumeric(strTemp) > Call fread_char(StartPos, strTemp) > If IsNumeric(strTemp) Then > intReturn = intReturn & Str(strTemp) > End If > Loop > ' StartPos = StartPos - 1 > End Function > >
Technical Details
Message-ID:
<tluooaurgk8cc@corp.supernews.com>Path:
arc1-ca.pugleaf.net!archiver1.google.com!newsfeed.google.com!newsfeed.stanford.edu!sn-xit-01!sn-post-02!sn-post-01!supernews.com!corp.supernews.com!not-for-mailReferences:
<9jkr93$3n1$1@iac5.navix.net>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 110e3b,eeb66184795845be X-Google-Attributes: gid110e3b,public X-Google-Thread: 108062,eeb66184795845be X-Google-Attributes: gid108062,public X-Google-Thread: f5f6f,eeb66184795845be X-Google-Attributes: gidf5f6f,public X-Google-Thread: 10b997,eeb66184795845be X-Google-Attributes: gid10b997,public X-Google-ArrivalTime: 2001-07-25 17:25:39 PST Path: arc1-ca.pugleaf.net!archiver1.google.com!newsfeed.google.com!newsfeed.stanford.edu!sn-xit-01!sn-post-02!sn-post-01!supernews.com!corp.supernews.com!not-for-mail From: "James Roberts" <jroberts@interaccess.com> Newsgroups: comp.lang.basic.visual.3rdparty,comp.lang.basic.visual.misc,cz.comp.lang.basic.visual,it.comp.lang.visual-basic Subject: Re: Reading Data from an RTB Date: Wed, 25 Jul 2001 19:25:33 -0500 Organization: Posted via Supernews, http://www.supernews.com Message-ID: <tluooaurgk8cc@corp.supernews.com> References: <9jkr93$3n1$1@iac5.navix.net> X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.50.4522.1200 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4522.1200 X-Complaints-To: newsabuse@supernews.com Lines: 86