Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Form option works with Debugger on, doesn't work with it
Message
De
03/03/2000 04:03:44
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00340811
Message ID:
00341123
Vues:
21
>I have an option object with four buttons. On changing the option's value, certain actions take place. When I run the debugger, the sequence works correctly. When I'm not running the debugger, the actions behave as if the value of the option were being changed to the PREVIOUS value, not the new value. 'Tis quite bothersome.
>
>Here is the Interactive Change method:
>
>SET STEP ON
>DO CASE
> CASE gnDebitOption = 1
> m.CC_Debit = .F.
> m.bank_Debit = ' '
>*!* REPLACE lvf_leadcontracts.CC_Debit WITH .F.
>*!* REPLACE lvf_leadcontracts.bank_debit WITH ' '
> IF !EMPTY(lvf_leadcontracts.cc_acct) .OR. !EMPTY(lvf_leadcontracts.bankacctno)
> lnOption = MESSAGEBOX('Clear the Existing Debit account number?', 52)
> IF lnOption = 6
> m.cc_Acct = ""
> m.bankAcctNo = ""
>*!* REPLACE lvf_leadcontracts.cc_acct WITH ""
>*!* REPLACE lvf_leadcontracts.bankacctno WITH ""
> ENDIF
> ENDIF
> This.Parent.cntBankDebit.ENABLED = .F.
> This.Parent.cntBankDebit.VISIBLE = .F.
> This.Parent.cntCCDebit.ENABLED = .F.
> This.Parent.cntCCDebit.VISIBLE = .F.
>
> This.Parent.cntBankDebit.Refresh
> This.Parent.cntCCDebit.Refresh
>
> CASE gnDebitOption = 2 && Debit Checking Account
> m.CC_Debit = .F.
> m.bank_Debit = 'C'
>*!* REPLACE lvf_leadcontracts.CC_Debit WITH .F.
>*!* REPLACE lvf_leadcontracts.bank_debit WITH 'C'
> This.Parent.cntBankDebit.ENABLED = .T.
> This.Parent.cntBankDebit.VISIBLE = .T.
> This.Parent.cntCCDebit.ENABLED = .F.
> This.Parent.cntCCDebit.VISIBLE = .F.
>
> This.Parent.cntBankDebit.Refresh
> This.Parent.cntCCDebit.Refresh
> This.Parent.cntBankDebit.txtABARouting.SetFocus
>
> CASE gnDebitOption = 3 && Debit Savings Account
> m.CC_Debit = .F.
> m.bank_Debit = 'S'
>*!* REPLACE lvf_leadcontracts.CC_Debit WITH .F.
>*!* REPLACE lvf_leadcontracts.bank_debit WITH 'S'
> This.Parent.cntBankDebit.ENABLED = .T.
> This.Parent.cntBankDebit.VISIBLE = .T.
>
> This.Parent.cntCCDebit.ENABLED = .F.
> This.Parent.cntCCDebit.VISIBLE = .F.
>
> This.Parent.cntBankDebit.Refresh
> This.Parent.cntCCDebit.Refresh
> This.Parent.cntBankDebit.txtABARouting.SetFocus
>
> CASE gnDebitOption = 4 && Debit Credit Card
> m.CC_Debit = .T.
> m.Bank_Debit = ' '
>*!* REPLACE lvf_leadcontracts.CC_Debit WITH .T.
>*!* REPLACE lvf_leadcontracts.bank_debit WITH ' '
> This.Parent.cntBankDebit.ENABLED = .F.
> This.Parent.cntBankDebit.VISIBLE = .F.
> This.Parent.cntCCDebit.ENABLED = .T.
> This.Parent.cntCCDebit.VISIBLE = .T.
>
> This.Parent.cntBankDebit.Refresh
> This.Parent.cntCCDebit.Refresh
> This.Parent.cntCCDebit.cboCredCard.SetFocus
>ENDCASE
>
>
>End Code Block.
>
>


Sounds like the problem is you're using too many memvars (not the count, necessity and actually you might use as many as you like and could manage). In the first place I'd try changing "gnDebitOption" to "this.Value" as I sensed it (where it's set?) :
With this.Parent
  m.bank_Debit = iif( this.value = 2, 'C', iif( this.value = 3, 'S', ' ') )
  store inlist( this.value, 2, 3 ) ;
        to .cntBankDebit.ENABLED, .cntBankDebit.VISIBLE
  store ( this.value = 4 ) ;
        to .cntCCDebit.ENABLED, .cntCCDebit.VISIBLE, m.CC_Debit
  .cntBankDebit.Refresh
  .cntCCDebit.Refresh
  Do CASE
    Case this.value = 1
      *!*	REPLACE lvf_leadcontracts.CC_Debit WITH .F.
      *!*	REPLACE lvf_leadcontracts.bank_debit WITH ' '
      If !EMPTY(lvf_leadcontracts.cc_acct) ;
         .OR. !EMPTY(lvf_leadcontracts.bankacctno)
        If MESSAGEBOX('Clear the Existing Debit account number?', 52) = 6
          m.cc_acct	= ""
          m.bankacctno	= ""
          *!*	REPLACE lvf_leadcontracts.cc_acct WITH ""
          *!*	REPLACE lvf_leadcontracts.bankacctno WITH ""
        Endif
      Endif
    Case this.value = 2  && Debit Checking Account
      *!*	REPLACE lvf_leadcontracts.CC_Debit WITH .F.
      *!*	REPLACE lvf_leadcontracts.bank_debit WITH 'C'
      .cntBankDebit.txtABARouting.SetFocus

    Case this.value = 3  && Debit Savings Account
      *!*	REPLACE lvf_leadcontracts.CC_Debit WITH .F.
      *!*	REPLACE lvf_leadcontracts.bank_debit WITH 'S'
      .cntBankDebit.txtABARouting.SetFocus

    Case this.value = 4  && Debit Credit Card
      *!*	REPLACE lvf_leadcontracts.CC_Debit WITH .T.
      *!*	REPLACE lvf_leadcontracts.bank_debit WITH ' '
      .cntCCDebit.cboCredCard.SetFocus
  Endcase
Endwith
Do you really need other memvars (which sound to be global)?
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform