🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.basic.visual.3rdparty
Article #12

Reading Data from an RTB

#12
From: Bobby Hicks
Date: Tue, 24 Jul 2001 22:00
71 lines
3566 bytes
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: <9jkr93$3n1$1@iac5.navix.net>
Path: arc1-ca.pugleaf.net!archiver1.google.com!newsfeed.google.com!newsfeed.stanford.edu!paloalto-snf1.gtei.net!news.gtei.net!news.compaq.com!uunet!sac.uu.net!lax.uu.net!news.navix.net!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f5f6f,eeb66184795845be,start
X-Google-Attributes: gidf5f6f,public
X-Google-Thread: 110e3b,eeb66184795845be,start
X-Google-Attributes: gid110e3b,public
X-Google-Thread: 10b997,eeb66184795845be,start
X-Google-Attributes: gid10b997,public
X-Google-Thread: 108062,eeb66184795845be,start
X-Google-Attributes: gid108062,public
X-Google-ArrivalTime: 2001-07-24 15:02:19 PST
Path: arc1-ca.pugleaf.net!archiver1.google.com!newsfeed.google.com!newsfeed.stanford.edu!paloalto-snf1.gtei.net!news.gtei.net!news.compaq.com!uunet!sac.uu.net!lax.uu.net!news.navix.net!not-for-mail
From: "Bobby Hicks" <b_hicks@alltel.net>
Newsgroups: comp.lang.basic.visual.3rdparty,comp.lang.basic.visual.misc,cz.comp.lang.basic.visual,it.comp.lang.visual-basic
Subject: Reading Data from an RTB
Date: Tue, 24 Jul 2001 18:00:56 -0400
Organization: Navix Internet Subscribers
Lines: 73
Message-ID: <9jkr93$3n1$1@iac5.navix.net>
NNTP-Posting-Host: gvfl2pp20.alltel.net
X-Trace: iac5.navix.net 996012131 3809 166.102.134.85 (24 Jul 2001 22:02:11 GMT)
X-Complaints-To: abuse@navix.net
NNTP-Posting-Date: 24 Jul 2001 22:02:11 GMT
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