Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Decimal Point Determination
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00125594
Message ID:
00125938
Views:
35
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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform