Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Variable disappears after REPORT FORM
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire de rapports & Rapports
Divers
Thread ID:
00473072
Message ID:
00473432
Vues:
17
My code has rpt013a assigned to the tmp_db_name+'.dbf' then I delete &rpt013a. So I am deleting the file assinged to tmp_db_name, right? It is confusing because my alias, filename variable, and report all have the same name. Actually I never thought it was confusing until I realized it did not work.

rpt013a = tmp_db_name+'.DBF'
DELETE FILE &rpt013a

What does the NOFILTER do? I have never used it. I am using a table because I have to do some REPLACE FOR statements.

Brenda


> BEGIN
Brenda,
I think you're looking at the wrong problem. The table you call "rpt013a" is really called by the name assigned to tmp_db_name. you need to delete THAT file.

Why don't you use a cursor instead of a table? That way it would be deleted as soon as you close it. Be sure you use the NOFILTER clause to get a true cursor and not a filtered table.

*** select records into cursor
SELECT * FROM custinfo INTO cursor rpt013a NOFILTER
** Note the NOFILTER clause, and that "rpt03a" doesn't need the "&"
SELECT rpt013a

*** execute the report
_SCREEN.Visible = .T.
SELECT rpt013a
REPORT FORM rpt013a.frx &M_print && ??? What is M.Print???
USE in rpt013a
No temporary files to worry about deleting this way.

HTH
Barbara

> END

>> BEGIN
>I create a temporary table with a random file name. The file name is stored in variable rpt013a (the alias, report name are also rpt013a). After i return from REPORT FORM rpt013a expression can not be evaluated in the debugger. My DELETE FILE does not get an error, but it also does not delete the file. What is the REPORT FORM doing that it wipes out my rpt013a variable. When I return from REPORT FORM all my Watch Window variables are deleted from the window. The testrpt013a variable does not get wiped out. It seems only rpt013a variable gets wiped out.
>
>Also, what is the difference between &rpt013a and (rpt013a)?
>
>thanks
>
>brenda
>
>*** get a temporary random file name
>tmp_db_name = rpath+"\tempdbfs\"+left(sys(2015),8)
>DO WHILE FILE(tmp_db_name+'.DBF')
> tmp_db_name = rpath+"\tempdbfs\"+left(sys(2015),8)
>ENDDO
>rpt013a = tmp_db_name+'.DBF'
>testrpt013a = rpt013a
>
>*** select records into a temporary table
>SELECT * FROM custinfo INTO TABLE &rpt013a
>
>*** close then open the table with a meaningful alias
>USE
>USE &rpt013a IN 0 ALIAS rpt013a
>SELECT rpt013a
>
>*** execute the report
>_SCREEN.Visible = .T.
>SELECT rpt013a
>REPORT FORM rpt013a.frx &M_print
>
>*** delete temp table file
>SELECT rpt013a
>USE
>DELETE FILE &rpt013a
>
>> END
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform