Re: modify contents within a memo field by HGC
HGC
Thu Aug 07 20:34:07 CDT 2003
Hi Rush,
Thanks for your help. Then I don't need to worry about the length of the
replacement. This method needs a little bit of coding but it will be more
easy to use.
Thanks again to all .
Matthew
"Rush Strong" <rush.strong]@[verizon.net> ¦b¶l¥ó
news:u9bseSQXDHA.608@TK2MSFTNGP12.phx.gbl ¤¤¼¶¼g...
> Another option is to write a class which would parse the memo field into
an
> array containing the individual lines, identify the line containing the
> desired property, replace it with the new property, and then reassemble
the
> lines back into the memo field.
>
> Some rough code:
>
> nLines = ALINES(aProps, 'Properties') && 'Properties' is the name
of
> the memo field
> cString = ''
>
> FOR i = 1 TO nLines
> IF 'LGETCAPTION' $ UPPER(aProps[i])
> aProps[i] = 'lGetProps = .F.'
> ENDIF
> cString = cString [+ CR +LF] + aProps[i]
> ENDFOR
>
> REPLACE Properties with cString
>
> - Rush
>
> "HGC NET-YAN" <tokaho@bcluster.on-nets.com> wrote in message
> news:bgqmo5$9v4$1@news.hgc.com.hk...
> > Hi Stefan,
> >
> > Thanks for your help. You are right in the design. But I am dealing
with
> a
> > vcx that is already fixed in a framework.
> >
> > Matthew
> >
> > "Stefan Wuebbe" <stefan.wuebbe@gmx.de> ???
> > news:u6vQB$$WDHA.1888@TK2MSFTNGP10.phx.gbl ???...
> > > Hi,
> > > You could use STRTRAN()
> > >
> > > (I think in general it would be easier for you to use separate
> > > fields instead of a memo field containing various infos.)
> > >
> > >
> > > -Stefan
> > >
> > >
> > > "HGC NET-YAN" <tokaho@bcluster.on-nets.com> schrieb im Newsbeitrag
> > > news:bgpn81$2pu1$1@news.hgc.com.hk...
> > > > Hi Gérard
> > > >
> > > > Thanks for your help. The code becomes more readable.
> > > > One more question, what if the replacement is not exactly the same
> > length.
> > > > i.e. I want to change the line ,Caption = "Abbr" to Caption = "Short
> > > Name".
> > > >
> > > > Matthew
> > > >
> > > >
> > > > "@wanadoo.fr" <g-lochon@wanadoo.fr> ???
> > > > news:urHEkNzWDHA.652@tk2msftngp13.phx.gbl ???...
> > > > > REPLACE apresent.properties WITH ;
> > > > > STUFF(apresent.properties,ATC("lgetcaption =
> > ",apresent.properties)
> > > > +14,3,".F.")
> > > > >
> > > > >
> > > > > Gérard.
> > > > >
> > > > >
> > > > > "HGC NET-YAN" <tokaho@bcluster.on-nets.com> a écrit dans le
message
> > > news:
> > > > bgne18$1h8l$1@news.hgc.com.hk...
> > > > > > I forgot to mention the version of VFP, since some commands are
> > > > different in
> > > > > > different version even with same command name.
> > > > > >
> > > > > > It is VFP 6 .
> > > > > >
> > > > > >
> > > > >
> > > >
> > > >
> > >
> >
> >
>
>