FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Test to see if text is in column 1
Posts: 933
Joined: Sun Oct 09, 2005 01:05 PM
Test to see if text is in column 1
Posted: Fri Sep 08, 2017 02:05 PM

I have a text string that I grab from a Memo field.
What I need to do is find out if certain text in that string is located in the first column of whatever line it may appear in.

Example of the text:

>>
Hello, this is a TEST.
This is another line.
TEST again.
Some other text in the string.
<<

In this case, the word TEST shows up twice. I need to somehow be able to know if TEST starts at column 1.

Thanks,

Jeff Barnes



(FWH 16.11, xHarbour 1.2.3, Bcc730)
Posts: 3358
Joined: Fri Oct 07, 2005 08:20 PM
Re: Test to see if text is in column 1
Posted: Fri Sep 08, 2017 02:55 PM
Jeff:

Perhaps the AT() function can helps.

Sample
Code (fw): Select all Collapse
       nAtRE    := AT("&RE=",oWrk:TXT)


Regards
SOI, s.a. de c.v.
estbucarm@gmail.com
http://www.soisa.mex.tl/
http://sqlcmd.blogspot.com/
Tel. (722) 174 44 45
Carpe diem quam minimum credula postero
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Re: Test to see if text is in column 1
Posted: Fri Sep 08, 2017 04:21 PM
Jeff,

Something like this:

Code (fw): Select all Collapse
FOR i = 1 TO MLCOUNT( cMemo )
    cLine = MEMOLINE( cMemo, , i )

    IF cLine = cTxt
        // Found!
    ENDIF
NEXT


EMG
Posts: 933
Joined: Sun Oct 09, 2005 01:05 PM
Re: Test to see if text is in column 1
Posted: Fri Sep 08, 2017 06:33 PM

Thanks :)

Thanks,

Jeff Barnes



(FWH 16.11, xHarbour 1.2.3, Bcc730)

Continue the discussion