Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Determining maximum number of workareas
Message
From
16/10/2002 18:20:03
 
 
To
16/10/2002 18:04:17
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00711750
Message ID:
00712052
Views:
11
Steve,

No, I don't ever do that in code I write. I either:
select 0
use mytable

or use mytable in 0

but, unfortunately a lot of code that I have to maintain, which was written by other developers, does. And the system that I am thinking of was originally written in fox 25 for dos, ported to 2.6 for windows, and then to vfp5, and now might be recompiled in 6 or 7, so I'm not sure when the code that says:
for i = 1 to 255 was introduced, and, also, different versions are still running on different machines, so I'm not sure on which foxpro version the 255 is accurate for, and further, I'm not sure when aused() was introduced. So, I think the best thing to do, rather than rewriting all the functions, is to find out what the maxworkarea value is - per version, then just write something that checks the version() and returns the appropriate value, or, I could use your concept of select(1) prior to any tables being open, and store that to a public variable. Then I could do some global replaces, without having to rewrite functions.

BTW - is there any good document out there that lists, per foxpro command and function, when it was introduced and/or changed, and also lists the evolution of other system limits such as table size, max work areas, etc.



Thanks for your suggestions.





>Hello David,
>
>I understand your original question is practical. I was asking if you ever actually:
>
>
select 255
>use mytable
>
>
>and I was proposing an alternative. If you USE mytable IN 0, SELECT(1) returns a meaningful result. Also, you can set a variable to the result of SELECT(1) when your application fires up, before any tables are open.
>
>Why not rewrite the function using aused()? Are you dealing with some versions of Foxpro that don't have that function?
>
>>Steve,
>>
>>No. Actually practical. I didn't know about the aused() function, which Sergey and others told me about. I had written a function that used a for loop - for i = 1 to 255, to check to see if a table was open in the work area, and then close it, except if it was in a list of aliases to keep open. But the thing is that I have some older systems that use this and similar functions, where I'm not sure if 255 is the highest number work area that can be specified - in fact in my tests today on vfp6 - the highest work area # you can specify is 32767, beyond that you get table number is invalid.
>>
>>I wanted to be able to change my existing functions to use a maxvalue number, rather than having to rewrite the function(s) to utilize aused(), and also, I'm not sure in what version of foxpro aused() was introduced. Actually, I guess what would help the most is to know the max # of work areas per foxpro version or per operating system, if that has any role.
>>
>>
>>
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform