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:
00473088
Vues:
21
Brenda, did you try to change the variable name?
myreport = "rpt013a"
REPORT FORM (myReport)

&rpt013a is macro substitution and (rpt013a) is a name expression.

VFP Help says: Whenever possible, use a name expression instead of macro substitution. A name expression operates like macro substitution. However, a name expression is limited to passing character strings as names. Use a name expression for significantly faster processing if a command or function accepts a name (a file name, window name, menu name, and so on).

>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
>
Nick Neklioudov
Universal Thread Consultant
3 times Microsoft MVP - Visual FoxPro

"I have not failed. I've just found 10,000 ways that don't work." - Thomas Edison
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform