Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How do you display a variable on a FORM?
Message
De
11/05/2000 19:47:18
 
 
À
10/05/2000 21:45:45
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00368321
Message ID:
00368899
Vues:
16
>>Because I'm a "legacy" programmer with lots of FPW code to convert, I wrote a label class call "say" which has a "sayrefresh" method. When added to my form class it registers itself , and so whenever the form is refreshed the "say" label's sayrefresh method runs - usually to simply change it's caption.
>>eg
>>proc myLbl.sayrefresh
>>this.caption= ORDER('myalias')
>>
>>If you want to head down this path just ask.
>>
>>>In vfp50, I would like to display ORDER() on my FORM.
>>>I do not want to use ?ORDER() or @10,10 SAY ORDER().
>>>The reason why I want to display the ORDER() is becase, I
>>>want to see want the index order is set too
>>>Does somebody know another say?
>---
>Hey David,
>Yea, I would like to check it out. Just email it to me.
>Thanks, and please send the source code. :))

Well I thought, FWIW, that I put it here so others might find useful.
This will get you rolling. Adapt to suit your needs, style, etc
***********************************************
*Create a class based on label with following init method
* lblSay.init method...
*----------------------
this.caption= ''
* register with form...
thisform.sayadd(this)

* Add a method called refreshCap to this class
procedure refreshCap
*-------------------
* in your instances of the class put code in here like..
this.caption=order('myalias')

* In your form base class (yours, not VFPs:-) add
* form.sayAdd()
*----------------
lparameter oSay
* this registers a "SAY" label with the form for auto refreshing...
* requires two form properties, n_say default 0, and a_say[1] (an array)
with thisform
.n_say= .n_say + 1
dimension .a_say[.n_say]
.a_say[.n_say]= oSay
endwith

* in the same form class add to refresh method...
* form.refresh()
*---------------
local i
* this will refresh any labels....
for i = 1 to thisform.n_say
thisform.a_say[m.i].refreshCap()
endfor
******************************************

Now when you drop a saylabel object from your project manager on to a form, you just fill out the refreshCap() method and voila!
Much less overhead than a text box!

I also generally set my "saylabel" to a different colour from normal labels to distinguish dynamic text from static text to the user.
HTH
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform