Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Variable disappears after REPORT FORM
Message
 
General information
Forum:
Visual FoxPro
Category:
Reports & Report designer
Miscellaneous
Thread ID:
00473072
Message ID:
00473153
Views:
21
>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
 local rpt013a, tmp_db_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	
>
>*** execute the report
>_SCREEN.Visible = .T.	
>SELECT rpt013a
>REPORT FORM rpt013a.frx &M_print && ????? What's M.Print
>	
>*** delete temp table file	
>Use in rpt013a
>DELETE FILE (rpt013a+".*")
>

Brenda,

See few changes in your code. Does it work now?

Sorry, forgot to close pre tag :(
If it's not broken, fix it until it is.


My Blog
Previous
Reply
Map
View

Click here to load this message in the networking platform