Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
I want an error for VFP Open dialog
Message
De
18/03/2004 09:18:59
 
 
À
18/03/2004 03:24:35
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00885697
Message ID:
00887473
Vues:
30


I'd like to help but the construct made no sense.

SELECT 0
SELECT * FROM ALIAS()


Huh?? First off, SELECT 0 changes the work area to one where a cursor is not open. Craig pointed this out.
Now, if the first line was SELECT SELECT() it might make a bit more sense.


This is only a simple repro code for fire the Open Dialog.


So, explain further and maybe I can help: Why is this an issue?


It is very simple:
Perfect programs not exists.

If the program is perfect with any measure instrumentations
- testing
- debugging
- retestig
- release beta 1, beta 2 , ... beta n
- call the top world guru
- read all the books
- prayer recites one
the situation not change, it is true for the past and the present.
Then: program is not perfect
because the conditioned probability of one future error is not zero.

A simple example:
- write a complex program with timers ( with multithread the situation is more clear )
- on the default dir you have two tables
tableA
tableB
with STRUCTURE(tableA)=STRUCTURE(tableB) AND INFORMATION(tableA)<>INFORMATION(tableB).

I known the Open Dialog problem,
then write this defensive code:
USE tableA ALIAS myCursor
.....
* next is the defensive code for prevent Open Dialog
SELECT myCursor && THIS FIRE A ERROR IF ALIAS NOT EXISTS
* BUT now a Timer event occur ( or a thread slice ) 
* and an error, not measured, close the myCursor
* next line open the dialog, and the user select TableB !
SELECT * FROM myCursor WHERE lcondition INTO ARRAY aBank
* now THE PROGRAM USE BAD data without errors 
* and without possibility of control 
* because the application is not shrewed of null
After two months the customer call me:
"Hello, incompetent, your application have destroy by bank information!"

John, you can explains to me as I make to find the error?

I want implement a NORMAL defensive code ( like defensive is the CPU/OS exception traps)
on my program, like any good program:
* main
try
 * application
catch
  * uncatched error, rollback all, audit the error and quit
endtry
You have write recently su XP SP2, and the new NX CPU flag.
NX is a defensive status for buffer overrun.
If the programs and the O/S are perfects,
and any write operation is checked for buffer overrun,
NX is not necessary.

I hope you have catch the problem.
This is not a simple behaviour for lazy programmers,
it is the first rule of programmation:
i must have the control of exceptions

If this is not clear, with my bad english i try to found other examples for you.

Fabio
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform