Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Changing the properties field of a label in a scx file
Message
From
03/08/2001 10:54:50
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
To
03/08/2001 09:54:50
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00539357
Message ID:
00539388
Views:
15
>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
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform