Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Accessing A Property Fires the _Assign
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
01234049
Message ID:
01234052
Vues:
15
>Try this:
>
>
>SET STEP ON
>
>oForm = CREATEOBJECT("myForm")
>oForm.Show()
>
>DEFINE CLASS MyForm AS Form
>
>    PROCEDURE Show
>	
>        IF This.Height = 50
>        ENDIF
>	
>    ENDPROC
>
>    PROCEDURE Height_Assign
>        LPARAMETERS nHeight AS Integer
>        WAIT WINDOW "Height_Assign called" NOWAIT
>    ENDPROC
>
>ENDDEFINE
>
>
>When the IF This.Height = 50 line is fired, the _Assign code runs. nHeight in the _Assign
>is 250.
>
>What gives?

Looks like a bug to me for VFP native properties. I didn't get a message with custom property:
oForm = CREATEOBJECT("myForm")
oForm.Show()

DEFINE CLASS MyForm AS Form
    PROCEDURE Init
    this.AddProperty("nHeight",0)
    ENDPROC
    
    PROCEDURE Show

        IF This.Width == 50
        ENDIF

    ENDPROC

    PROCEDURE nHeight_Assign
        LPARAMETERS nHeight AS Integer
        MESSAGEBOX("Height_Assign called") 
    ENDPROC
    
    PROCEDURE Width_Assign
        LPARAMETERS nHeight AS Integer
        MESSAGEBOX("Width_Assign called") 
    ENDPROC
If it's not broken, fix it until it is.


My Blog
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform