D3 FILE TRIGGER

52 views
Skip to first unread message

CDMI - Steve T

unread,
Jun 3, 2025, 11:22:21 AMJun 3
to Pick and MultiValue Databases
I am working with a client running D3/Windows version 10.2.2
I see this in <08> of DICT FILENAME FILENAME
CALLX PGM.FL PGMNAME

I am trying to see what the original record looks like.
the pgm has this (snippet)
ITEM     = ACCESS(3)
ID       = ACCESS(10)
DEL.FLAG = ACCESS(12)
IF DEL.FLAG THEN RETURN

I revised the code to:
 WRITE ITEM ON TMP.FL,ID

but I never see the ITEM get written to the TMP.FL
My question is, how to I tell D3 that the program in the trigger field of that file has changed?
Do I need to 'restart' D3?

Any ideas are appreciated.
be well all,
Steven T

philippe GRACIA

unread,
Jun 3, 2025, 11:49:36 AMJun 3
to mvd...@googlegroups.com
triggers in D3 windows work differently than linux ( but we didn't really understood how!)

in the manual:
"By default, when the FlashBASIC code for a trigger is recompiled, it is not immediately used by the application. All files using the trigger must be closed for the new copy of the code to be taken into account.
To change this behavior, use the Load Trigger at Each File Open check box in the FlashBASIC tab of the D3 Device Manager.
  • If the check box is not selected, then the default behavior will be used.

    You must close all files using the trigger before the latest version is used.

  • If the check box is selected, the alternate behavior will be used.

    You do not need to close files using the trigger before the latest version is used.

    The latest code is picked up the next time the trigger is run. Obsolete versions show a type of "Old" and will be released when all files using the trigger are closed.

Note: Recompiling a trigger many times while the file is in use can lead to many obsolete copies of the code in the FlashBASIC code section. There is no limit to the size of this section, and as it grows larger, it might consume swap space."

Jean lhomonnier from rocket said we have to use  nt_inv-flash. it works ( sometime): ex: nt_inv-flash  PGM.FL PGMNAME

we don't use access(3), but the doc says "  When used from a file-time subroutine, this is the working version of the item. When used from an attribute definition call, this is the item from the associated file. In either case, the item is in dynamic array format. Note that when used from a file-time subroutine, this dynamic array has the same contents as the argument that is passed to the subroutine."

so, as the modified version of the record is passed by param to the trigger, you can compare the existing record to the new by reading the old one

sample:
up bp callx.test
subroutine callx.text ( new)
open "","test" to f.test else stop
key=access(10)
read old from f.test,key else old=""
if new#old then
**** add your code here
end
return

my 2 cents...



--
You received this message because you are subscribed to
the "Pick and MultiValue Databases" group.
To post, email to: mvd...@googlegroups.com
To unsubscribe, email to: mvdbms+un...@googlegroups.com
For more options, visit http://groups.google.com/group/mvdbms
---
You received this message because you are subscribed to the Google Groups "Pick and MultiValue Databases" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mvdbms+un...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/mvdbms/ea8982db-c5d3-422a-bbec-2f704b944eb1n%40googlegroups.com.

Steven Martin Trimble

unread,
Jun 3, 2025, 12:29:48 PMJun 3
to mvd...@googlegroups.com
thanks so much
I will see what I can do.
I believe they have a running 'phantom' that might have this file open all the time.
Reading and writing from the file I am looking to investigate.

CDMI
Steven Trimble
(501) 772-3450 cell/text


Reply all
Reply to author
Forward
0 new messages