[comp.databases] URGENT: Foxbase procedure help

ms7u+@andrew.cmu.edu (Michael C. Sanders) (11/20/89)

HELP!!

We are writing a very big application which makes use of several different
.prg's.  Within each .prg are many procedures.  We use the set procedure to
command to tell foxbase where to find the procedures.  The problem is, however,
that if we type set procedure to, with nothing after it, we get an error which
says that the file is in use.  Here is a code excerpt:

set procedure to a.prg
	.
	.
  do proc1 && procedure in a.prg
	.
	.
set procedure to
set procedure to b.prg
   do proc2 && procedure in b.prg
set procedure to a.prg
   do proc3 && procedure in a.prg

It crashes when it hits the blank set procedure to line.  We tried it without
that line, but it then crashed on the next line.  Without any set procedures,
it says that the file does not exist.

HELP -- This is very URGENT.

Thank you,

Michael Sanders
ms7u@andrew.cmu.edu
Carnegie Mellon University
Pittsburgh, PA

timk@xenitec.on.ca (Tim Kuehn) (11/21/89)

In article <UZNu5cS00WB6IN7EUu@andrew.cmu.edu> ms7u+@andrew.cmu.edu (Michael C. Sanders) writes:
>HELP!!
>
>We are writing a very big application which makes use of several different
>.prg's.  Within each .prg are many procedures.  We use the set procedure to
>command to tell foxbase where to find the procedures. 

Why are you using several PRG's for your application? The fox doc's say that 
as long as the individual procedure's aren't more than 64K long compiled
you can have as many as you want (or are you running out of names?)

>The problem is, however,
>that if we type set procedure to, with nothing after it, we get an error which
>says that the file is in use.  Here is a code excerpt:
>
>set procedure to a.prg
>	.
>	.
>  do proc1 && procedure in a.prg
>	.
>	.
>set procedure to
>set procedure to b.prg
>   do proc2 && procedure in b.prg
>set procedure to a.prg
>   do proc3 && procedure in a.prg
>
>It crashes when it hits the blank set procedure to line.  We tried it without
>that line, but it then crashed on the next line.  Without any set procedures,
>it says that the file does not exist.

First off - are how are the procedures nested? Are you trying to 'set procedure
to' when you're already in a procedure in a procedure file? For example, if 
you're doing something like: 

....code....
set procedure to first

do <some procedure in first>

and <some procedure in first> says 
do <a prg somewhere>

Now strictly speaking the .prg isn't a procedure file, so if in the .prg you 
then say 'set procedure to <anything>' you're probably going to get an error 
since then foxbase won't be able to track back to the original procedure 
file that made the call in the first place. 

My first advice would be for you to take ALL your procedures and combine
them into one big file, have your program 'set procedure' to that one file, 
and then see what happens. Using a bunch of 'set procedure to's is a pretty 
kludgy way of going at it.

+-----------------------------------------------------------------------------+
|Timothy D. Kuehn	       			       timk@xenitec.on.ca     |
|TDK Consulting Services			       !watmath!xenitec!timk  |
|871 Victoria St. North, Suite 217A					      |
|Kitchener, Ontario, Canada N2B 3S4 		       (519)-741-3623 	      |
|DOS/Xenix - SW/HW. uC, uP, DBMS. 		       Satisfaction Guaranteed|
+-----------------------------------------------------------------------------+