Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Triggers don't fire - I think its a BUG...you?
Message
De
09/03/1997 12:03:34
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Triggers don't fire - I think its a BUG...you?
Divers
Thread ID:
00023514
Message ID:
00023514
Vues:
61
MS KB Article Q132467 basically, by way of example, shows the differences of "firing order" for rules and triggers depending on the buffering style chosen.

Since I find the VFP documentation to be clear as mud on this issue, I sought and found this article. It is hardly clearer, but at least affords a 'simple' way to find out for oneself. Needing to know, I followed its instructions.

Allowing for syntax errors I eventually learned that which I needed to know, and basically the results obtained were in accordance with what was outlined.

However, it dealt strictly with the simpler cases, and so I decided to use the set-up to do a little more testing. The results I obtained have been confirmed by one other person on their set-up, and the two of us agree that there is a serious bug.

Summarizing the test-cases I ran:
1) Empty file with buffering= 4 (or 5), BROWSE
- Ctrl-Y to append a record
- tab to "key" fld and type: aaaa
- Ctrl-Y to append another record
- tab to 'key' fld and type: bbbb
- move cursor (mouse) to delete-flag of first rec appended and click the flag
- move cursor to delete-flag of second rec appended and click flag
- move cursor (mouse) to ctl-box of brow-win and d-click (to close window)
- In Command Win., enter TABLEUPDATE(.T.)
- issue USE to close the table
- Issue CLEAR ALL to clear all
RESULT: NO TRIGGERS FIRED AT ALL (rules did fire) - no INSERT triggers, NO update triggers, NO delete triggers. Yes, the records were in the table.

2) Same empty file, buffering =4 (or 5), BROWSE
- CTRL-Y to APPEND a record
- Tab to "key' fld and type: aaaa
- (without hitting any other key) move cursor to the delete-flag of the only record and click flag
- d-click on Brow-win. ctl box to close window
- Issue TABLEUPDATE(.T.) in Command Window
- Issue USE to close table
- Issue CLEAR ALL to clear all
RESULT: NOTHING fired! - NO RULES, NO TRIGGERS OF ANY KIND. Yes, the record was in the table.

3) Same empty file, buffering=4 (or 5), BROWSE
- Ctrl-Y to append a record
- Tab to key fld and type: aaaa
- Ctrl-Y to append another record
- Tab to 'key' fld and type: bbbb
- cursor to delete-flag of first rec. appended, click flag
- d-click on ctl-box of BROW-win to close
- Issue TABLEUPDATE(.T.) in Command Win.
- Issue Use
- Issue CLEAR ALL
RESULT: Only INSERT TRIGGER (of triggers) for REC#-2 fires - NO TRIGGERS at all for REC# -1!!! Yes, *both* recs were found in the table (one was deleted).

Rationalizing that deletion of the record effectively "cancels it out" and thus supports the absence of the triggering really does not cut it, because my or yuor use of a trigger may have little or nothing to do with the "net effect" of the situation. For example, I might use the triggers to track operator's key-strokes, and these records represent key-strokes regardless of their net effect on the data.

Your opinion?
Répondre
Fil
Voir

Click here to load this message in the networking platform