Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Problem with Alias does not exist
Message
General information
Forum:
Visual FoxPro
Category:
Troubleshooting
Miscellaneous
Thread ID:
01684254
Message ID:
01684287
Views:
38
This:
OLDVAL( cControlSource )
will not work IF you are not in the proper area
CLEAR
CREATE CURSOR bbb (Fld1 C(10))
CREATE CURSOR aaa (Fld1 C(10))
APPEND BLANK
REPLACE Fld1 WITH "aaaa"
CURSORSETPROP("Buffering", 5,"Aaa")
REPLACE Fld1 WITH "bbbb"
SELECT bbb
? Aaa.Fld1, OLDVAL("Aaa.Fld1")
Try something like this
IF !EMPTY( this.control_source )
    cAlias = GETWORDNUM(this.control_source,1,".")
    cFld   = GETWORDNUM(this.control_source,2,".")

    * 1. Check to see if cAlias is blank
    IF EMPTY(cAlias)
        = MESSAGEBOX("cAlias is empty", 0, "test")
    ELSE
        * 2. A different approach to checking if workarea is open
        IF NOT USED( cAlias )
            = MESSAGEBOX("Alias "+cAlias+" not open!", 0, "test")
        ELSE
            cControlSource = ALLTRIM( this.control_source )
            IF EVALUATE( cControlSource ) == OLDVAL(cFld, cAlias)
                RETURN .T.
            ENDIF 
        ENDIF
    ENDIF
ENDIF
>Yesterday I made the change to the code, as was suggested by John Ryan. I also set TRY / CATCH around the entire code. This will allow me to catch an error, if it happens and save it into a hidden log. I installed this code at 6 customers PCs. I will be looking at the hidden log from time to time to see if the problem occurs.
>Thank you.
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