I have to change some contents within a memo field programmatically.

For example , the contents of a memo field are

Name = "lblV_partybuzlist_cAbbr"
Caption = "Abbr"
Left = 9
Top = 14
cfield = V_PARTYBUZLIST.CABBR
lgetcaption = .T.
Name = "lblV_partybuzlist_cAbbr"

I want to change the lgetcaption = .T. to .F. I have written some codes to
do it but I feel it is a bit clumsy.
Does everyone has any better ideas ?

the code I have written is as follows:

REPLACE apresent.properties WITH ;
SUBSTR(apresent.properties, 1, ATCC("lgetcaption = "),
apresent.properties) + 13) ;
+ ".F." + ;
SUBSTR(apresent.properties, ATCC("lgetcaption = "), apresent.properties)
+ 17)

Any comments are welcome.
Matthew

Re: modify contents within a memo field by HGC

HGC
Mon Aug 04 23:50:19 CDT 2003

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 .



Re: modify contents within a memo field by wanadoo

wanadoo
Tue Aug 05 04:21:27 CDT 2003

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 .
>
>


Re: modify contents within a memo field by HGC

HGC
Tue Aug 05 20:39:50 CDT 2003

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 .
> >
> >
>



Re: modify contents within a memo field by Stefan

Stefan
Wed Aug 06 04:40:32 CDT 2003

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 .
> > >
> > >
> >
>
>


Re: modify contents within a memo field by HGC

HGC
Wed Aug 06 05:37:27 CDT 2003

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 .
> > > >
> > > >
> > >
> >
> >
>



Re: modify contents within a memo field by Stefan

Stefan
Wed Aug 06 06:17:11 CDT 2003

Oops, sorry <s>

-Stefan

"HGC NET-YAN" <tokaho@bcluster.on-nets.com> schrieb im Newsbeitrag
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 .
> > > > >
> > > > >
> > > >
> > >
> > >
> >
>
>


Re: modify contents within a memo field by wanadoo

wanadoo
Wed Aug 06 19:46:37 CDT 2003

You can use the same kind of coding :

REPLACE apresent.properties WITH ;
STUFF(apresent.properties,ATC("caption = ",apresent.properties)+10,4,"Short Name")

Gérard.



Re: modify contents within a memo field by HGC

HGC
Wed Aug 06 22:02:50 CDT 2003

Hi Stefan,

No need to be sorry. As I said that any comments are welcome.

Thanks

Matthew

"Stefan Wuebbe" <stefan.wuebbe@gmx.de> ???
news:efIUTyAXDHA.3232@tk2msftngp13.phx.gbl ???...
> Oops, sorry <s>
>
> -Stefan
>
> "HGC NET-YAN" <tokaho@bcluster.on-nets.com> schrieb im Newsbeitrag
> 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 .
> > > > > >
> > > > > >
> > > > >
> > > >
> > > >
> > >
> >
> >
>



Re: modify contents within a memo field by HGC

HGC
Wed Aug 06 22:03:14 CDT 2003

Hi Gerard,

Thanks again for your help.

Matthew

"@wanadoo.fr" <g-lochon@wanadoo.fr> ???
news:%23QeHZ8HXDHA.2632@TK2MSFTNGP09.phx.gbl ???...
> You can use the same kind of coding :
>
> REPLACE apresent.properties WITH ;
> STUFF(apresent.properties,ATC("caption =
",apresent.properties)+10,4,"Short Name")
>
> Gérard.
>
>



Re: modify contents within a memo field by Rush

Rush
Wed Aug 06 11:06:16 CDT 2003

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 .
> > > > >
> > > > >
> > > >
> > >
> > >
> >
>
>



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 .
> > > > > >
> > > > > >
> > > > >
> > > >
> > > >
> > >
> >
> >
>
>