Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
BeforeRowColChange issue
Message
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
01373519
Message ID:
01373539
Views:
68
I've had this issue a couple of times already and it causes me a headhache now. I want to put a validation everytime the user is moving in the grid. I've put a BeforeRowColChange and the flag wouldn't pass if I change the value. On the other hand, the weirdest thing is that if I go line by line in the debugger, the flag will pass and pop me the wait window! I don't understand why it would work in the debugger, but not if I just go normally. Is that a bug or is there something I don't understand about it?
  Procedure Valid
    If ! This.ValidateCurrentRow()
      Return 0
    Endif
  Endproc

  Procedure BeforeRowColChange
    Lparameters nColIndex
    With This
      If Inlist( .RowColChange, 1, 3 )
        *** If we are trying to move to a new row
        *** validate the current row
        If Not Eof( .RecordSource ) And Reccount( .RecordSource ) > Recno( .RecordSource )
          *** Do not allow the move if the validation fails
          If .ValidateCurrentRow()
            *** peachy keen go ahead and move off the row
          Else
            Nodefault
          Endif
        Endif
      Endif
    Endwith
  Endproc


  *-- Called from AfterRowColChange if the row has changed to validate the prefious row and prevent changing to the new row if necessary
  Procedure ValidateCurrentRow
  Endproc
Previous
Reply
Map
View

Click here to load this message in the networking platform