× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



To see the validity check program parameter you need to F9 or F10 on CRTCMD or CHGCMD.

What I've done is have a module that sets up the string that's returned by the choice program. Then I can use that same module in the validity checking program.

CHCPGM module CALLPRC to choice creation module
returns the value or prompt string to command
VCP module CALLPRC to choice creation module with 'P' in position 21 - may not need 1st 20 characters
checks if entered parameter is in list of valid values


Get to Chapter 9 (IIRC) of the CL Programming manual - VCP is a lot better than validating in the CPP. You end up sending 2 messages, a CPD0006 diagnostic with the error text (or one of your own defined as described in that chapter), and a CPF0002 exception.

There is no visual cue as to which parameter is in error, so put something in the message text.

BTW, a prompt override program can alter the values entered - I assume it could have a subfile or whatever for entry.

Luck

Vern

At 12:48 PM 3/4/2003 -0600, you wrote:
Doug -

Thanks for your response.

So how do I "attach" the VCP to the command?  There doesn't appear to be a
VCP option on either the command parms or the CRTCMD command.

Why couldn't my CPP function as a VCP?  Currently, I'm validating the input
in my CPP and sending back error messages with SNDPGMMSG but when an error
occurs, I can only send a message and cannot retain the command on-screen.

Thanks,

Steve

"Douglas Handy" <dhandy1@xxxxxxxxxxxxx> wrote in
message news:61r96vo4fthee30anut1jdh4qb0890gjv4@xxxxxxxxxx
> Steve,
>
> >Is there a
> >way to code to command parms so that the user must choose from one of the
> >choices provided by the "choice program" without using the CLP to
validate
> >the choice?
>
> No, that can only be done by a Validity Checking Program (or VCP), not by
the
> choice program.  In fact, the choice program doesn't even need to present
real
> choices -- it just provides output which gets listed.  For example, I have
a
> "choice program" which I use for date fields, and it displays calendars
for 12
> months instead of "choices".
>
> The really dumb thing about choice programs is there is no way to directly
> return a parameter value.  For example, the choice program can call a
windowed
> selection program to display a subfile from a database and allow the user
to
> select one with a '1' or 'X' or mouse etc.  But then you can't pass that
value
> back to the command prompter to fill in the keyword value. :(  The window
must
> pass it to the choice program to "list" on the display.
>
> I'd love to see the command prompter enhanced to allow (but not force) a
choice
> program to handle the UI and return a keyword value directly.  But its
been this
> way since the S/38 days and I don't consider it likely to change now...
>
> Doug
> _______________________________________________
> This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing
list
> To post a message email:
MIDRANGE-L@xxxxxxxxxxxx
> To subscribe, unsubscribe, or change list options,
> visit: http://lists.midrange.com/mailman/listinfo/midrange-l
> or email: MIDRANGE-L-request@xxxxxxxxxxxx
> Before posting, please take a moment to review the archives
> at http://archive.midrange.com/midrange-l.
>
>



_______________________________________________
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list
To post a message email: MIDRANGE-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/midrange-l.



As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.