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
06/08/2001 03:44:39
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
To
06/08/2001 03:26:59
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00539357
Message ID:
00540031
Views:
14
>thnx for yr advice :o)
>
>the strange thing is tht the changing the memo field "properties" is working2 time.... once when i add my propertie and 2 when i chang it the first time.
>
>From tht moment it won't work anymore. But when i'm opening the scx file and cut and paste my own propertie, from tht moment when opening the form all the properties r all active again...

Kurt,
I tried it n times and worked in all. I made sure I find target line in each run first :
*locate target record 1st run
lnLine = atcline('caption',properties)
replace properties ;
  with stuff(properties, ;
   at(mline(properties,lnLine),properties), ;
  len(mline(properties,lnLine)), ;
  [Caption = "I hacked scx"]+chr(13)+chr(10)+[Forecolor = 255,255,0])
*modi form and change applied - modi something in any to force save
*locate target record 2nd run
lnLine = atcline('caption',properties)
replace properties ;
  with stuff(properties, ;
   at(mline(properties,lnLine),properties), ;
  len(mline(properties,lnLine)), ;
  [Caption = "I hacked scx again"]+chr(13)+chr(10)+[Backcolor = 0,255,255])
*modi form and change applied 
* repeat n times and all worked.
BTW when saying adding property we're talking about existing but at their default properties, right?
However as I said before instead of hacking the scx for this kind of job I prefer select multiple objects and change properties approach. If it would need some automated job then aselobj() approach. Modi form to get form to designer, click on labels go to command window and :
modi comm xx
lnObjects=aselobj(arrObjects)
for ix=1 to lnObjects
 oObject = arrObjects[ix]
* do whatever with object
endfor
With this approach you could also read-writemethod, cloneobject etc.
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
Reply
Map
View

Click here to load this message in the networking platform