CPD2.1 table driven data validation 
Author Message
 CPD2.1 table driven data validation

Hi all Clarioneers,

While working with a CPD2.1 app, I ran across a simple field validation (lookup)
function I was using and thought I'd share it with you.  It may be old news, but
seems to work out well for me.  Feel free to pass on any better ways to handle
this type of situation.

Instead of settting up a separate Clarion file for every different field type to
be edited (which is how I've seen it done in the mini & mainframe world alot) or
worse, hard-coding the application, I setup a System Edit file that contains a
field describing what I'm trying to edit, the actual data value to be edited,
and the return value (if found) from the lookup.  I've attached the source code
for the function and a sample app and data files for your review (sysed.zip).

I goes something like this.  On the EDIT line of an entry field in designer (or
hand coded into the source, place the following syntax

IF RDSYSED('EMPSTATUS', TES:STATUS) <> 0 THEN SELECT(?); CYCLE.

This says validate that TES:STATUS is a valid employee status code.  If not,
then remain on this field.  Now you can add new data edits by maintaining a file
instead of hard-coding your application, or having a bunch of different data
files to maintain.  Hope this may be of help to someone.

Thanks,

John Farmer


<---- Begin Attached File ---->
begin 644 SYSED.ZIP
<uuencoded_portion_removed>
:+DLP,5!+!08`````!P`'`(L!``#E"`(````
`
end
<---- End Attached File ---->



Thu, 10 Jun 1999 03:00:00 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. converting CPD2.o tables to ...

2. data validation and data format

3. data validation and data format

4. Undelete CPD2.1 Clarion data

5. Converting data from TPS table to MS SQL 7 table getting wrong values

6. Error Code:36 Invalid Data File (CPD2.1)

7. WHERE? Table driven assembler in C

8. table driven parser

9. Logical drives table info

10. table driven code [was: Breaking String into Values]

11. event driven state table for modem handling

12. #losingFocus callback for data validation (again)

 

 
Powered by phpBB® Forum Software