Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Intermittent error with data
Message
De
19/05/2017 11:24:30
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Intermittent error with data
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows 10
Network:
Windows Server 2012
Database:
Visual FoxPro
Application:
Desktop
Virtual environment:
VMWare
Divers
Thread ID:
01651228
Message ID:
01651228
Vues:
65
Hi all,

I am using EVALUATE() to run procedures stored in a table and am getting intermittent errors.

Basically the table contains a Word template name and then a field that can contain procedures to run (because of the number of templates, it was easier to have this all in a table then to hard-code each one).

Before the template it loaded, I dig out the procedure(s) listing from the table and run it with:
IF NOT EMPTY(lcProcsToRun)

    TRY
        STORE EVALUATE(lcProcsToRun) TO llDataOkay
   CATCH
      WAIT WINDOW "Error when trying to run process in template" TIMEOUT 5
      STORE .F. TO llDataOkay
   ENDTRY

ENDIF
- it pretty well always runs on my desktop (with local data)
- before I wrapped the above in a TRY/CATCH it sometimes would fail indicating it could not find the view for the data (the procedures often just grab a bunch of data from local views from the current form and sometimes run UDF functions to look up other data (e.g. the currently logged in user's name etc)
- it *seems* (although cannot conclusively test) that if I preface all field names with the view name, that it works better. Usually if I have a bunch of fields to dig out and format, I instead change to that view (SELECT v_SomeView) to save prefacing all the field names; this seems to indicate that the process is still running in the correct data session but something is switching work areas on me
- sometimes a form also gets called during this process to do things like ask the user to pick a partner from this company; but these forms run in the current data session so it should not be changing work areas
- all the UDF functions that get called always reset the current workspace after they finish (other than some that just select out some values into an array - which I always thought did not change the workspace)

- have run out of ideas
- have not yet tried changing the EVAL() statements to macro expanded - I always assumed they both did the same thing

Albert
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform