Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Setall for label
Message
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
01247069
Message ID:
01247154
Views:
23
>>>>I have about 20 labels on a form for credits and thay are aptly named
>>>>LBLCREDIT11,LBLCREDIT21,LBLCREDIT31......LBLCREDIT21 and all the captions are the same, the word "credit". I want to use setall to chg them to another caption, "AMT" for example. I do not want to mess with various other labels on this form however.
>>>
>>>for lnI = 1 to 20
>>>   store 'new caption' to ('thisform.lblCredit' + transform(m.lnI))
>>>next
>>>
>>>If they are on a different pages, then it would be harder if they are not based on some extra class.
>>
>>Naomi, Upon re examine my labels are named following( my mistake)LBLCREDIT11,LBLCREDIT21,LBLCREDIT31, LBLCREDIT41....etc
>>I have this line for testing
>>abc=1
>> store 'AMT' to ('thisform.lblCredit1' + transform(m.kkk))
>>but it bombs out.
>
>So, change the loop.
>
>It should be
>
>for lnI = 11 to 41 step 10 && (how many do you have?)
> You may also check first for
> type('thisform.lblCredit' + transform(m.kkk)+ '.name') = 'C' before attempting to set a property
>
>I also seem to forget .Caption in my previous code, e.g.
>
>store 'AMT' to ('thisform.lblCredit1' + transform(m.kkk) + '.Caption')


Why not (I didn't follow whole thread, so I am not sure from where kkk comes):
FOR lnI = 1 TO 20
    lcLblName = [lblCredit]+TRANSFORM(lnI)+[1]
    IF PEMSTATUS(thisform,lcLblName,5)
       store [AMT] to ([thisform.]+lblName+[.Caption])
    ENDIF
NEXT
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform