I don't know where I have went wrong.
I am having a very strange problem. Valid is getting evaluated only once. After I click the button,the valid's are not getting triggered
I have 3 gets in the Dialog with valid statement !empty(cVar). Initially it works fine. But after I click the Save button, if I try to make the get's empty, the valid is not getting fired.
I am herewith pasting an example code
Pls note: The problem occurs only after clicking the save button
- Code: Select all Expand view
#include "FiveWin.ch"
*-----------------------------------------*
Function Main()
*-----------------------------------------*
Local oDlg, oBtnSave, oBtnCancel
Local cAcName:=spac(30), cAddr1:=space(50), cAddr2:=space(50)
Local aOGets:={nil,nil,nil}
DEFINE DIALOG oDlg TITLE "Add New Account Heads" from 1,1 to 19,80
@01 ,04 say "A/c Name *" OF oDlg RIGHT SIZE 45, 12
@02 ,04 say "Address Line 1 " OF oDlg RIGHT SIZE 45, 12
@03 ,04 say "Address Line 2 " OF oDlg RIGHT SIZE 45, 12
@01.2,10 get aOGets[1] VAR cAcName OF oDlg valid !empty(cAcName)
aOGets[1]:cToolTip := "Please Type in the Account Name"
@02.3,10 get aOGets[2] VAR cAddr1 of oDlg Valid !empty(cAddr1)
@03.4,10 get aOGets[3] VAR cAddr2 of oDlg Valid !empty(cAddr2)
@05,02 BUTTON oBtnSave PROMPT "Save" SIZE 50,15 OF oDlg
@05,15 BUTTON oBtnCancel PROMPT "Cancel" SIZE 50,15 OF oDlg CANCEL ACTION oDlg:End()
ACTIVATE DIALOG oDlg ;
VALID ( oDlg:=NIL,;
.T.)
Return NIL
Regards
Anser