AA
Mon Aug 14 05:22:34 CDT 2006
You could extract the contents to VFP cursors or tables. As I see it there,
there are headers and lines.
Lines have two colons ( : ) preceded by varying-length codes like LA: or RA:
or LT. CYTOSPINS:
The text part following the code: ends with a full stop dot.
Headers are texts like
PROSTATE, CORE BIOPSIES WITH CYTOSPINS:
These header lines end with a single : and have no dots.
The headers should go in a cursor with a structure like
CREATE TABLE Headers (headerid Int AutoInc , headertext C(100))
The rest would be insterted n a table with the structure
CREATE TABLE xx (headerid Int , code Char(30), linetext C(100))
Lines in a VFP memo end with a linebreak character, chr(13).
You can scan a memo using the functions MEMLINES(), MLINE() and speed up
performance by using _MLINE
LOCAL lcLine
_MLINE=0
FOR i = 1 TO MEMLINES(tablename.memoname)
lcLine = MLINE(tablename.memoname, 1,_MLINE)
* analyze lcLine
NEXT
You analyze each line with OCCURS(), AT and extract parts with LEFT(),
RIGHT(), SUBSTR() and perhaps simpler with STREXTR()
lcLine="LA: BENIGN PROSTATIC TISSUE. RA: BENIGN PROSTATIC TISSUE;"
? STREXTRACT(line,'',':')
LA
? STREXTRACT(line,':','.',1)
FOCAL CHRONIC PROSTATITIS
? LTRIM(STREXTRACT(line,'.',':',1))
RA
? STREXTRACT(line,':','',2)
BENIGN PROSTATIC TISSUE.
Once the data has been properly structered and stored you can create VFP
reports that will print them any way you want.
-Anders
"Thanks" <louis_sorbera@DONOTSPAM.msn.com> skrev i meddelandet
news:eXRq4X0vGHA.4872@TK2MSFTNGP02.phx.gbl...
> What I needs to be done is to calculate the tabs that are less than a set
> length and convert those to their spaces, then use the strt to replace the
> rest. Tabs count as one character
>
> What do you think of this?
>
> I need to do this for a memo, so the first thing is to bering in the memo
> one line at a time. How do I do that? Assuming I did, and the line is
> line,
>
> line = 'LA: FOCAL CHRONIC PROSTATITIS. RA: BENIGN PROSTATIC TISSUE.'
>
> loca for chr(9) $ line
>
> if found()
>
> t1=at(chr(9), line, 1)
> if found()
> lineA= left(line, t1-1)
> lineB= right(line, len(line) -t1)
> t1R= t1/5
> t1Rs= str(t1r, 4,1)
> t1Rd= substr(t1Rs, at('.', t1Rs)+1, 1)
>
>
> do case
> case t1Rd = 1 or t1Rd = 6 && tab is 5 spaces
> line = lineA + space(5) + LineB
>
> do case
> case t1Rd = 2 or t1Rd = 7 && tab is 4 spaces
> line = lineA + space(4) + LineB
>
> do case
> case t1Rd = 3 or t1Rd = 8 && tab is 3 spaces
> line = lineA + space(3) + LineB
>
> do case
> case t1Rd = 4 or t1Rd = 9 && tab is 2 spaces
> line = lineA + space(2) + LineB
>
> do case
> case t1Rd = 0 or t1Rd = 5 && tab is 1 space
> line = lineA + space(1) + LineB
>
> endcase
>
> etc. Help me out
>
> I also found the untabify method, but don't know how to get it into Fox
>
>
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vcug98/html/_asug_untabify_method.asp
>
>