I have a FP 2.5a system. for the most part it runs without any major problems. The system runs on virtual Windows 98 machines. the files and tables are on the network (WS2K3) and foxpro is local on the 98 machine.
Lately the system will hang if we try to print invoices (a report). I haven't found out why this happens, but I can reproduce the problem on my local development copy.
One thing I noticed about the procedure to process invoices is the code looks like this
If I understand FP queries correctly. each Select is like a different container which a tale is opened in. If I want to read/write values to a table I need to select that container and then update the fields/columns.
however the containers are never closed. no code like this exists
should the containers be closed before exiting the procedure? would this be a source of a memory leak?
I know enough about FP to be dangerous. I spend the majority of time in C#, so FP 2.5a is very foreign to me.
one thing that has changed is the volume of data. each day the invoices older than 90 days are archived to another table to help keep the volume of data manageable. The volume of orders has increased so the overall table size has grown, despite the archiving process. Could this have an impact on the queries/reports/prints hanging?
.........
additional information
the system is a procedural code file the basic structure looks like this
the menus can be nest several procedures deep. The point of all this is to ask. would opening a Select container and not closing it cause a memory leak?
Jason Meckley
Programmer
Specialty Bakers, Inc.
faq855-7190
faq732-7259
Lately the system will hang if we try to print invoices (a report). I haven't found out why this happens, but I can reproduce the problem on my local development copy.
One thing I noticed about the procedure to process invoices is the code looks like this
Code:
procedure processinvoice
select 1
use customer.dbf
select 2
use orderheader.dbf
select 3
use orderdetail.dbf
set relations from orderheader to orderdetail
select 4
...
select 5
ordernumber = 0
get "enter order number: " ordernumber
select 2
locate orderheader.id = ordernumber
while .T.
process order and line items
endwhile
do printinvoice.qpr
select 1
update customer table
select 2
update orderheader table
return
however the containers are never closed. no code like this exists
Code:
select 1
use
select 2
use
...
select n
use
I know enough about FP to be dangerous. I spend the majority of time in C#, so FP 2.5a is very foreign to me.
one thing that has changed is the volume of data. each day the invoices older than 90 days are archived to another table to help keep the volume of data manageable. The volume of orders has increased so the overall table size has grown, despite the archiving process. Could this have an impact on the queries/reports/prints hanging?
.........
additional information
the system is a procedural code file the basic structure looks like this
Code:
say "main menu"
say "1. do this"
say "2. do that"
say "3. exit system"
get "enter option" option
do case
case option = 1
dothis
case option = 2
dothat
case option = 3
exit
endcase
procedure tothis
select 1
use a table.dbf
get "enter id" id
while locate table.column = id
do some work
endwhile
do report.frx
return
procedure tothat
say "1. do it like this"
say "2. do it like that"
say "3. return to main menu"
get "enter option" option
do case
case option = 1
a procedure similar to dothis
case option = 2
a procedure similar to dothat
case option = 3
return
endcase
Jason Meckley
Programmer
Specialty Bakers, Inc.
faq855-7190
faq732-7259