Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Netexpress 3.1/Dialog System:Validate

Status
Not open for further replies.

mfcobol2002

Programmer
Feb 3, 2003
73
BR
Respected Gentlemen

Let us imagine that the option Null didn't
exist in Validate.
As it would be a program to check NULL using the option User Defined.

Respectfully


Marcos Antonio de Souza
Brasil
 
Netexpress 3.1/Dialog System
Quention: Validate in Dialog System - User defined
 
Could still do with a bit more - you're not really asking anything!
 
User-defined validation allows you to specify a program name which will be called as part of the normal validation process of an entry field or a Window.

This allows you greater flexibility in validating options such as "does the value exist in a file?".

solution of the problem. my gratefulness to all.


When you specify a user-defined validation program, you must write the program and it should include the copy file "dsusrval.cpy" along with your standard screenset datablock copy file.

The callout will be made from Dialog System as follows:

CALL "USER-VALIDATION-PROGRAM"
using DS-USER-VALIDATION-LINKAGE
DATA-BLOCK

so the called program must provide a linkage section and procedure division using statement that match this description.

When your program has done its validation it then sets the DS-UV- RETURN-STATUS to one of the following values:

78 DS-UV-FIELD-VALID value 0.
78 DS-UV-FIELD-INVALID value 1.
78 DS-UV-USE-ERROR-MSG-NO value 2.
78 DS-UV-USE-ERROR-MSG value 4.

If the field is valid then move DS-UV-FIELD-VALID to DS-UV-RETURN- STATUS. If it is invalid then move DS-UV-FIELD-INVALID to DS-UV- RETURN-STATUS.

If you want to specify an error message to be displayed other than the default message defined in the data definition then you can override this by adding the DS-UV-USE-ERROR-MSG-NO or DS-UV-USE-ERROR-MSG value to the DS-UV-FIELD-INVALID value and placing the result in DS-UV- RETURN-STATUS.

If you are overriding the message number then the number passed back to Dialog System in the DS-UV-ERROR-MSG-NO field will be used to identify the correct error-message to display.

If you are overriding the message text then the text passed back to Dialog System in the DS-UV-ERROR-MSG field will be used as the error message text to display.

I have attached an example program which demonstrates the use of this feature.

TESTVAL.GS contains a window with an entry field and a push button. The only values allowed in the entry field by the validation routine are "12345" and "ABCDE". Enter an invalid value and then press the "Validate" button. This will cause the validation program "dsusrval.dll" to be called to validate the contents of the entry field. An error message will then be displayed in a message box.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top