Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Decimal Point Determination
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00125594
Message ID:
00125938
Vues:
36
Hi Rixon,

The following might be a bit better.
lcexactstat = SET('EXACT')
SET EXACT ON
lnDotPosition = AT(".", This.ControlSource)
* Get the field name
lcfield = UPPER(SUBSTR(This.ControlSource, lnDotPosition + 1))
= AFIELDS(gaMyArray, "INVENTOR") && Create the array
lnoffset = ASCAN(gaMyArray, lcfield)
IF lnoffset > 0
  lnrow = ASUBSCRIPT(gaMyArray, lnoffset, 1)
  IF gaMyArray[lnrow, 4] = 2
    This.InputMask = "$$9,999.99"
  ENDIF
ENDIF
* Restore setting of EXACT
SET EXACT &lcexactstat
There is one "trick" you could use to improve this. In VFP 5.0, issue a SET LIBRARY TO FOXTOOLS (including the appropriate path). In 6.0 the following statement uses a function that will be part of the language. Then to retrieve the field name, you could use:

lcfield = UPPER(JUSTEXT(This.ControlSource))

JUSTEXT will, in both versions, properly return the field name.

hth,
George

Ubi caritas et amor, deus ibi est
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform