Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Saving alert message
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
01046454
Message ID:
01046461
Vues:
18
>I using pessimistic table buffering 4 in cursor in my form and a button
>tableupdate()
>
>How can I display a message like (save data before leaving ? )
>if user forget to press save button

You can check GetFldState()

The following example is from one of my Forms that has a method IsChanged()

it checks for all Checkboxes and Textboxes in the main container on the form.
LOCAL lc_Alias, lc_Field, ll_Retval, ln_Dot, ln_Status, lo_Object

*acti screen
*-- clear


ll_Retval = .F.
with this

    for each lo_Object in .cntMain.Objects
        with lo_Object
            if inlist(lower(.baseClass), "textbox", "checkbox")
                ln_Dot    = at(".", .ControlSource)
                lc_Field  = substr(.ControlSource, ln_Dot + 1)
                lc_Alias  = iif(ln_Dot > 0, left(.controlSource, ln_Dot-1), alias())
                
                ln_Status = GetFldState(lc_Field, lc_Alias)
                
                *-- wurde nicht wirklich etwas geändert,
                *-- dann den status zurücksetzen
                if ln_Status > 1
                    if eval(.ControlSource) == OldVal(lc_Field, lc_Alias)
                        =SetFldState(lc_Field, 1, lc_Alias)
                        ln_Status = 1
                    endif                        
                endif
                
                if ln_Status > 1
                    ll_Retval = .T.
                    *? "Geändert: "+ lc_Field +" ["+ allt(str(ln_Status)) +"]"                                    
                else
                    *? "Nicht geändert: "+ lc_Field +" ["+ allt(str(ln_Status)) +"]"                                                        
                endif
                lo_Object.BackColor = iif(ln_Status > 1, rgb(0,255,0),rgb(255,255,255))
            endif                

        endwith  && lo_Object
    endfor &&* each lo_Objet in .Objects

endwith

return ll_Retval
Regards from Berlin

Frank

Dietrich Datentechnik (Berlin)
Softwarekombinat Teltow (Teltow)

Frank.Dietrich@dd-tech.de
DFPUG # 327
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform