dbTalk Databases Forums  

D3 Callx - DICT trigger

comp.databases.pick comp.databases.pick


Discuss D3 Callx - DICT trigger in the comp.databases.pick forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
dtsig
 
Posts: n/a

Default D3 Callx - DICT trigger - 01-11-2007 , 04:48 PM






I have placed a trigger on the dict and data portions of a file as we
want to know of any changes dict or data.

It appears to work correct with the one exception that it does not get
triggered when object is changed.

Has anyone seen this?

thanks


Reply With Quote
  #2  
Old   
Scott Ballinger
 
Posts: n/a

Default Re: D3 Callx - DICT trigger - 01-11-2007 , 05:58 PM






I am guessing that you are being facetious when you say "appears to be
working correctly with the one exception..."

1. Are you using unix or nt?
2. I use callx triggers a lot (my experience is with D3/linux only) to
track changes to records. Here is the top of my standard callx
subroutine:

sub save.changes(new.rec)
if access(12) then new.rec = "" ;* delete
if access(16) then return ;* new
id = access(10)
fv = access(1)
read old.rec from fv,id else return
if old.rec eq new.rec then return

/Scott Ballinger
Pareto Corporation
Edmonds WA USA
206 713 6006

dtsig wrote:
Quote:
I have placed a trigger on the dict and data portions of a file as we
want to know of any changes dict or data.

It appears to work correct with the one exception that it does not get
triggered when object is changed.

Has anyone seen this?

thanks


Reply With Quote
  #3  
Old   
Mark Brown
 
Posts: n/a

Default Re: D3 Callx - DICT trigger - 01-11-2007 , 07:58 PM



That might be because the "object" code is NOT in the dictionary, the
pointer to the object code is.

Mark Brown


"dtsig" <dtsig (AT) hotmail (DOT) com> wrote

Quote:
I have placed a trigger on the dict and data portions of a file as we
want to know of any changes dict or data.

It appears to work correct with the one exception that it does not get
triggered when object is changed.

Has anyone seen this?

thanks




Reply With Quote
  #4  
Old   
Bill H
 
Posts: n/a

Default Re: D3 Callx - DICT trigger - 01-12-2007 , 12:46 AM



Dave:

I suspect you need to modify the "compile" or "basic" verb to resolve this.

Bill

"dtsig" <dtsig (AT) hotmail (DOT) com> wrote

Quote:
I have placed a trigger on the dict and data portions of a file as we
want to know of any changes dict or data.

It appears to work correct with the one exception that it does not get
triggered when object is changed.

Has anyone seen this?

thanks




Reply With Quote
  #5  
Old   
dtsig
 
Posts: n/a

Default Re: D3 Callx - DICT trigger - 01-12-2007 , 08:27 AM




Mark Brown wrote:
Quote:
That might be because the "object" code is NOT in the dictionary, the
pointer to the object code is.

Mark Brown


"dtsig" <dtsig (AT) hotmail (DOT) com> wrote in message
news:1168555695.208770.288860 (AT) i39g2000hsf (DOT) googlegroups.com...
I have placed a trigger on the dict and data portions of a file as we
want to know of any changes dict or data.

It appears to work correct with the one exception that it does not get
triggered when object is changed.

Has anyone seen this?

thanks

That would do it. Is there a way to 'trigger' on any change to object?

thanks



Reply With Quote
  #6  
Old   
dtsig
 
Posts: n/a

Default Re: D3 Callx - DICT trigger - 01-12-2007 , 08:30 AM



Not sure why would think i was being 'facetious'. The triggers appear
to work with the exception of object.

Mark pointed out my error in logic .. it is a pointer not the object.

thanks

Scott Ballinger wrote:
Quote:
I am guessing that you are being facetious when you say "appears to be
working correctly with the one exception..."

1. Are you using unix or nt?
2. I use callx triggers a lot (my experience is with D3/linux only) to
track changes to records. Here is the top of my standard callx
subroutine:

sub save.changes(new.rec)
if access(12) then new.rec = "" ;* delete
if access(16) then return ;* new
id = access(10)
fv = access(1)
read old.rec from fv,id else return
if old.rec eq new.rec then return

/Scott Ballinger
Pareto Corporation
Edmonds WA USA
206 713 6006

dtsig wrote:
I have placed a trigger on the dict and data portions of a file as we
want to know of any changes dict or data.

It appears to work correct with the one exception that it does not get
triggered when object is changed.

Has anyone seen this?

thanks


Reply With Quote
  #7  
Old   
Scott Ballinger
 
Posts: n/a

Default Re: D3 Callx - DICT trigger - 01-12-2007 , 09:08 AM



Why not put the trigger on the BP file?

/Scott


Reply With Quote
  #8  
Old   
Jeffrey Kaufman
 
Posts: n/a

Default Re: D3 Callx - DICT trigger - 01-12-2007 , 10:11 AM



I hope Tony G does not mind my posting this code snip that the he wrote and
we modified. This code replace the original compile program (copy compile to
orig.compile first). Add your code to the end for your logging.

COMPILE
001 $OPTIONS EXT
002 FIXED.OPTIONS = ""
003 CMD = OCONV(TRIM(SENTENCE()),'G1 99')
004 FL=FIELD(CMD," ",1)
005 PROG=FIELD(CMD," ",2)
006 PROG=FIELD(PROG," ",1)
007 ARGS = DCOUNT(CMD," ")
008 OPTIONS = FIELD(CMD," ",ARGS)
009 IF OPTIONS[1,1] = "(" THEN
010 * strip and replace options
011 CMD = OCONV(CMD, 'G0 'ARGS-1) )
012 END
013 IF FIXED.OPTIONS # "" THEN
014 CMD = CMD : " (" : FIXED.OPTIONS
015 END
016 * execute the compile and catalog
017 CMD = 'ORIG.COMPILE ':CMD
018 EXECUTE CMD
019 CMD = 'CATALOG ':FL:' ':PROG
020 EXECUTE CMD
021 * add your code here

Jeff

"Bill H" <you (AT) notreally (DOT) com> wrote

Quote:
Dave:

I suspect you need to modify the "compile" or "basic" verb to resolve
this.

Bill

"dtsig" <dtsig (AT) hotmail (DOT) com> wrote in message
news:1168555695.208770.288860 (AT) i39g2000hsf (DOT) googlegroups.com...
I have placed a trigger on the dict and data portions of a file as we
want to know of any changes dict or data.

It appears to work correct with the one exception that it does not get
triggered when object is changed.

Has anyone seen this?

thanks






Reply With Quote
  #9  
Old   
Scott Ballinger
 
Posts: n/a

Default Re: D3 Callx - DICT trigger - 01-12-2007 , 03:05 PM



Not to beat a dead horse here, but note that the system does maintain a
bunch of information regarding compiled items in the dict:

d3.doc compile.time.date.stamp.ap
token Compile stamps
syntax
category BASIC
type Definition
terse Obtaining the internal information about compiles in D3.
desc contains descriptive internal information about programs
compiled for FlashBASIC.

When a program is compiled, information is placed in the
dictionary level of the file in which the source program
resides. The structure of the information is as follows:

Attr Description
0 item-id
1 CC
2 starting frame number of object code
3 Pick/BASIC object frame count
4 date, internal, when last compiled
5 time in seconds, internal, when last compiled
6 port number of who compiled program last
7 user who compiled program last

9 release version from where program was last compiled
10 options used when last compiled, alphabetically
11 bytes in Pick/BASIC object code
12 FlashBASIC object frame count

e.g., I use attribute 12 to test if a program is currently flash
compiled, then automatically add the "(o" option to the compile command
to insure that it stays flashed (particularly handy for subroutines).
Also, <4> <5> <6> and <7> are handy for assigning blame when something
blows up.

/Scott Ballinger


Reply With Quote
  #10  
Old   
Mark Brown
 
Posts: n/a

Default Re: D3 Callx - DICT trigger - 01-12-2007 , 03:12 PM



Object code always reflects the current state of source code. If the source
code didn't change, who cares if the program is re-compiled. If the source
did change, you have a trigger to say it did. Maybe add a "Compile (y/N): "
to the trigger and disable compile-catalog, compile-run and :ccompile and
control it internally.

If you are changing INCLUDEs from another file and then recompiling, maybe
you just need to widen the scope of your source file triggers.

Mark


"dtsig" <dtsig (AT) hotmail (DOT) com> wrote

Quote:
Mark Brown wrote:
That might be because the "object" code is NOT in the dictionary, the
pointer to the object code is.

Mark Brown


"dtsig" <dtsig (AT) hotmail (DOT) com> wrote in message
news:1168555695.208770.288860 (AT) i39g2000hsf (DOT) googlegroups.com...
I have placed a trigger on the dict and data portions of a file as we
want to know of any changes dict or data.

It appears to work correct with the one exception that it does not get
triggered when object is changed.

Has anyone seen this?

thanks


That would do it. Is there a way to 'trigger' on any change to object?

thanks




Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.