Here is a chunk of code I use to parse the MfgComment (which may have
multiple SMTypes in it).
/*SMType*/
strt = INDEX((PartRev.MfgComment),"S/M Type").
DO WHILE (strt>0):
EndLine = INDEX((PartRev.MfgComment),CHR(10),strt).
EndLine2 = INDEX((PartRev.MfgComment),CHR(13),strt).
IF EndLine2 <> 0 AND EndLine2 < EndLine THEN
EndLine = EndLine2.
IF EndLine = 0 THEN DO:
EndLine = LENGTH((PartRev.MfgComment), "CHARACTER").
END.
ELSE DO:
if GetNextLine(EndLine + 1) <> 0 then
NextLineAfterSMType =
SUBSTRING((PartRev.MfgComment),strt,GetNextLine(EndLine + 1) - strt).
END.
SMType = SUBSTRING((PartRev.MfgComment),strt,EndLine -
strt).
Export DELIMITER ","
PartNum
RevisionNum
ApprovedBy
ApprovedDate
SMType
NextLineAfterSMType.
SMType = "".
NextLineAfterSMType = "".
strt = INDEX((PartRev.MfgComment),"S/M Type",EndLine).
END.
Instead of Exporting were I do you could go find the records you need
and gather them to a temp table or such.
4GL beats SQL hands down for pulling adhoc relationships on the fly out
of a database.
Jeff Lewis
-----Original Message-----
From: Lonnie Drew [mailto:lonniedrew@...]
Sent: Tuesday, April 20, 2004 2:53 PM
To: vantage@yahoogroups.com
Subject: [Vantage] Re: New Progress Code Question
Oops, I forgot to specify the starting point, 1, for getting
partnum...
/* get the partnum */
ThePartnum = substring(LastPartOfMemo,1,EndPoint - 1).
--- In vantage@yahoogroups.com, "Lonnie Drew" <lonniedrew@c...>
wrote:
that
in
to
multiple SMTypes in it).
/*SMType*/
strt = INDEX((PartRev.MfgComment),"S/M Type").
DO WHILE (strt>0):
EndLine = INDEX((PartRev.MfgComment),CHR(10),strt).
EndLine2 = INDEX((PartRev.MfgComment),CHR(13),strt).
IF EndLine2 <> 0 AND EndLine2 < EndLine THEN
EndLine = EndLine2.
IF EndLine = 0 THEN DO:
EndLine = LENGTH((PartRev.MfgComment), "CHARACTER").
END.
ELSE DO:
if GetNextLine(EndLine + 1) <> 0 then
NextLineAfterSMType =
SUBSTRING((PartRev.MfgComment),strt,GetNextLine(EndLine + 1) - strt).
END.
SMType = SUBSTRING((PartRev.MfgComment),strt,EndLine -
strt).
Export DELIMITER ","
PartNum
RevisionNum
ApprovedBy
ApprovedDate
SMType
NextLineAfterSMType.
SMType = "".
NextLineAfterSMType = "".
strt = INDEX((PartRev.MfgComment),"S/M Type",EndLine).
END.
Instead of Exporting were I do you could go find the records you need
and gather them to a temp table or such.
4GL beats SQL hands down for pulling adhoc relationships on the fly out
of a database.
Jeff Lewis
-----Original Message-----
From: Lonnie Drew [mailto:lonniedrew@...]
Sent: Tuesday, April 20, 2004 2:53 PM
To: vantage@yahoogroups.com
Subject: [Vantage] Re: New Progress Code Question
Oops, I forgot to specify the starting point, 1, for getting
partnum...
/* get the partnum */
ThePartnum = substring(LastPartOfMemo,1,EndPoint - 1).
--- In vantage@yahoogroups.com, "Lonnie Drew" <lonniedrew@c...>
wrote:
> This might get you started. If the partnumber is alwayspreceded
> by "Part:" and followed by ","...5)).
>
> /* trim memo to position past "part:" */
> LastPartOfMemo = substring(memofield,index(memofield,"Part:" +
>not be
> /* locate position of "," signaling end of partnum */
> EndPoint = Index(LastPartOfMemo,",").
>
> /* get the partnum */
> ThePartnum = substring(LastPartOfMemo,EndPoint - 1).
>
> ...I'm treating the memo field as any text field, which may
> the case.code
>
> Lonnie
>
> --- In vantage@yahoogroups.com, "othyghost" <Eric@o...> wrote:
> > Ok this one has me stumped. I am tring to write progress
that
> > will be able to read through a memo field and pick out asentence
> > then assign that to a variable to find the corrispondingrecord
in
> > another table. For example. The Memotext =PartOper
> > "Source-BOM
> > Part:00, Rev:MOM7
> > User: ERIC, Date: 04/14/04, Time: 10:48 AM"
> >
> > Basically what I am trying to do is link the JobOper to a
> > record but the part number I need is in this memo field. Ineed
to
> > be able to pull out the text after the Part: and assign itto a
> > variable. I believe their is always a comma after the partnumber
> > so that would be easy to stop it at.[Non-text portions of this message have been removed]
> >
> > Thanks
> >
> > Eric