Page 1 of 1

DCREAD VALID

Posted: Sun Nov 04, 2012 9:22 am
by RDalzell
Hi Roger,

Something recently observed
The DCGET VALID does not get called if paired with WHEN

Using xBase++ 1.90 355 and eXpress 1.9 257

\

Code: Select all

  @  1.00,24.00 DCGET nJudge           Picture '9999'                                                                            PARENT oGroup3a          COLOR GRA_CLR_BLUE ;
               TABSTOP ;
               GETID "Get_nJudge" ;
                WHEN {|| nJudge == 0 } ;
                TABGROUP XBP_BEGIN_GROUP ;
                VALID {|| ValidateJudge(nJudge, GetList) } ;
                POPUP {|n| n := JudgeScan(nJudge, GetList) } ;
                MESSAGE 'Enter The Hearing Officer ID Number to be Maintained.' INTO oMsgBox
Rick

Re: DCREAD VALID

Posted: Sun Nov 04, 2012 9:57 am
by rdonnay
Valid codeblocks do not get evaluated if the WHEN clause code block returns a .f.

I'm reluctant to change this behavior because it has been the default behavior in eXpress++ for 12 years.

It appears that you do not want JUDGE to be edited after the first time a value is entered.

I can't think of a simple solution.

What does the validation do?

Re: DCREAD VALID

Posted: Sun Nov 04, 2012 11:45 am
by RDalzell
Simply return the values for the record to be edited.

It appears that the WHEN functions if it is not the specific value of the DCGET as in the following example:

Code: Select all

@  1.00,21.00 DCGET cCode       Picture '@!'                                                                                        PARENT oGroup       COLOR GRA_CLR_BLUE ;
				    TABSTOP ;
                GETID "Get_cCode" ;
                WHEN {|| nGroup == 1 } ;
                TABGROUP XBP_BEGIN_GROUP ;
                VALID {|| ValidateCode(cCode, cRecId, GetList) } ;
                POPUP {|c| c := GuiCodeScan(c, cRecId, cText, GetList) } ;
                MESSAGE 'Enter The ' + cText + ' Code To Be Maintained.' INTO oMsgBox
No problem, I can code around this.

How are the teeth feeling?

Thanks,
Rick

Re: DCREAD VALID

Posted: Sun Nov 04, 2012 1:47 pm
by rdonnay
I'm feeling great! After 3 trips to Mexico in 3 years I now have a pretty good set of teeth.

We're having another devcon in AZ next year in October. Hope you will be there.

Re: DCREAD VALID

Posted: Mon Nov 05, 2012 6:21 am
by RDalzell
I would have liked to been there this year, but the time frame conflicted with other events.

While I certainly missed seeing those attending, I was uncertain of the benefit of attending except the social aspect of seeing old friends.

I really liked your eXpress Devcon in Boise because xBase is the car, but eXpress is what drives us.

Glad to hear and looking forward to seeing your smile.

Rick

Re: DCREAD VALID

Posted: Mon Nov 05, 2012 7:37 pm
by GeneB
Valid codeblocks do not get evaluated if the WHEN clause code block returns a .f.
This solved a problem I worked on for hours. I finally discovered a VALID was changing a variable in another GET and I didn't know how to prevent it. After I saw this topic I used WHEN{||.f.} in tandem with HIDE{||.t.} and it worked as I wanted.

Please don't change the way it works. Perhaps a VALIDWHEN parameter could be added instead.

It isn't always asking questions that make this forum so valuable to me. Thank you and everyone for all your input. I learn from every question.

Re: DCREAD VALID

Posted: Mon Nov 05, 2012 8:09 pm
by bwolfsohn
RDalzell wrote:I really liked your eXpress Devcon in Boise because xBase is the car, but eXpress is what drives us.
Rick
Where's the damn like button on this BB ??
:clap:

Re: DCREAD VALID

Posted: Mon Nov 05, 2012 8:43 pm
by rdonnay
like.jpg
like.jpg (8.4 KiB) Viewed 10911 times