>I’m trying to add a propertie (and if the propertie exists change it) in a label. That label is stored in the .scx file of the form.
>
>After opening the scx file first thing I do is setting a filter to the baseclass=”mylabel”
>Second is seeking if the propertie exists via atcline()
>If the propertie doesn’t exists then I replace the memo properties with properties + the propertie I need for my label. That is working ok.
>
>The problem begins when that propertie already exists:
>Then I take a copy of all the properties, putting them one by one in a variable skipping my propertie that is already existing in the memofile.
>
>Then I replace the memo “properties” with the values in the variable adding at the end “my propertie” as a string.
>
>That works one time.
>
>The second time I do this the memofield “properties” in the scx file is taking the change but when I run my form the label didn’t take the changement I’ve made in the file. Worse when I open the form and look at the properties in the propertie window of my label then none of the properties are there (even the original properties are set to default value).
>
>The strange thing is that when I’m opening the scx file of the form ther the memo field “properties” has changed all the changements.
Kurt,
Hacking scx works (assuming baseclass="mylabel" is a typo). Maybe you're missing CRLF combination or using old mline(). ie: suppose you found caption property at line 3 and no forecolor property is set :
replace properties ;
with stuff(properties, ;
at(mline(properties,3),properties), ;
len(mline(properties,3)), ;
[Caption = "I hacked scx"]+chr(13)+chr(10)+[Forecolor = 255,255,0])
Remember if you force form to be saved by any change then next time you try this order of properties might be changed by VFP. You have to locate in each change. And you should query each mline separately.
OTOH using aselobj(), setall() on design form might be more easier.
Cetin