Hi Kate,

As another suggestion (if only tracking changes by 'ED') why not wrap
the 'ED' function and catalog it under a new name?

Eg: catalog the below code as 'ED' and re-catalog 'ED' as some ambiguous
name.

------------------------------------------------------------------------
     PROGRAM WRAP.ED                                        
*                                                           
     CMD = SENTENCE()                                       
*                                                           
     PROGRAM.NAME = FIELD(CMD, ' ', 1)                      
     FILENAME = FIELD(CMD, ' ', 2)                          
     REC.ID = FIELD(CMD, ' ', 3)                            
*                                                           
     OPEN '',FILENAME TO F.FILE THEN                        
                                                            
        ;* read in record before editing so we can compare  
        ;* results at the end of editing                    
        READ ORIG.REC FROM F.FILE, REC.ID ELSE ORIG.REC = ""
                                                            
        ;* execute our original 'ED' re-cataloged            
        ;* as a new name "ORIG.ED"                          
        EXECUTE "ORIG.ED ":FILENAME:" ":REC.ID              
*                                                           
        ;* read in record after editing to compare results  
        READ REC FROM F.FILE, REC.ID ELSE REC = ""          
                                                            
        ;* if the records are different then                
        ;* write out our log.                               
        IF ORIG.REC # REC THEN                              
           CRT "Records changed! Write out our log!!!!"     
        END                                                 
     END                                                    
                                                            
*                                                           
RETURN                                                      
------------------------------------------------------------------------


Regards,
Dave.



-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Kate Stanton
Sent: Monday, October 13, 2008 8:41 AM
To: u2-users@listserver.u2ug.org
Subject: Re: [U2] Universe Triggers

We are hoping to implement triggers (to catch the rotters who change
data 
using ED!!!), so are following this with interest.

Our interpretation of that advice was to have a single subroutine called
by 
all triggers.  This single subroutine would all the trigger data,
including 
reference to the file, to another subroutine which then decided which 
trigger action subroutine(s) should be called, probably based on file
name.

The trick will be determining the data to be passed from that single 
triggers subroutine, and if there are things which can only be done
within 
the trigger subroutine (so an action code would need to be returned).

Suggestions/comment welcome!

Cheers, Kate

Kate Stanton
Walstan Systems Ltd
4 Kelmarna Ave, Herne Bay, Auckland 1011, New Zealand
Ph: +64 9 360 5310  Fax: +64 9 376 0750  Mobile: +64 21 499 486
Email: [EMAIL PROTECTED]

----- Original Message ----- 
From: "Bill Haskett" <[EMAIL PROTECTED]>
To: <u2-users@listserver.u2ug.org>
Sent: Saturday, October 11, 2008 2:50 AM
Subject: RE: [U2] Universe Triggers


> Stuart:
>
> Are you saying one should create a single trigger program like...
>
> MASTER.TRIGGER.U
> 001 SUBROUTINE MASTER.TRIGGER.U (ExecStat, DictFlag, atFILENAME, atID,
> atRECORD)
> 002 COMMON \trFILES\ TABLE.FV
> 003 IF FILEINFO(TABLE.FV, 0) = 0 THEN   ; ** UD version
> 004    OPEN '', 'TABLE' TO TABLE.FV ELSE
> 005       ExecStat = 0                  ; ** don't update file
> 006       RETURN
> 007    END
> 008 END
> 009 READ TriggerRec FROM TABLE.FV, 'TRIGGER.CONF' ELSE RETURN
> 010 TriggerFiles   = TriggerRec<1>
> 011 TriggerUpdates = TriggerRec<2>
> 012 TriggerDeletes = TriggerRec<3>
> 013 LOCATE(atFILENAME, TriggerFiles, 1; Pos) THEN
> 014    TriggerToRun = TriggerUpdates<1,Pos>
> 015    CALL @TriggerToRun
> 016 END
>
> ...that essentially reads a table...
>
> TRIGGER.CONF
> 001 APVENDOR]ARCUSTOMER
> 002 U2.TRIGGER.SUB.U]U2.TRIGGER.SUB.U
> 003 U2.TRIGGER.SUB.D]U2.TRIGGER.SUB.D
>
> ...for the file and globally cataloged subroutine to run.   Then one
> should...
>
>>CREATE.TRIGGER APVENDOR MASTER.TRIGGER.U UPDATE
>>CREATE.TRIGGER ARCUSTOMER MASTER.TRIGGER.U UPDATE
>>CREATE.TRIGGER APVENDOR MASTER.TRIGGER.D DELETE
>>CREATE.TRIGGER ARCUSTOMER MASTER.TRIGGER.D DELETE
>
> Thanks,
>
> Bill
>
<snip> 
-------
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/

No virus found in this incoming message.
Checked by AVG - http://www.avg.com 
Version: 8.0.173 / Virus Database: 270.8.0/1721 - Release Date:
10/12/2008 12:00 PM

The information contained in this email and any attached files are strictly
private and confidential. This email should be read by the intended addressee
only.  If the recipient of this message is not the intended addressee, please
call Corporate Express Australia Limited on +61 2 9335 0555 or Corporate Express
New Zealand Limited on +64 9 279 2555 and promptly delete this email and any
attachments.  The intended recipient of this email may only use, reproduce,
disclose or distribute the information contained in this email and any attached
files with Corporate Express' permission. If you are not the intended addressee,
you are strictly prohibited from using, reproducing, disclosing or distributing
the information contained in this email and any attached files.  Corporate
Express advises that this email and any attached files should be scanned to
detect viruses. Corporate Express accepts no liability for loss or damage
(whether caused by negligence or not) resulting from the use of any attached
files.
-------
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/

Reply via email to