PDA

View Full Version : Select command



Quailco
2014-01-05, 18:57
Is there a place I can find detailed descriptions of each commands execution.

I have a set of code using select that works in vfp but it gives me a "no more work areas available" and i cant tell how to detect that so I can exit.
he code is:

FOR X=1 TO 32767
SELE (X)
IF USED()
SCATT MEMV
ENDI
ENDF

It simple cks all possible work areas for data. The programs here are built to not care what databases are available or whats open or what application there working in thats why its so generic.

TIA

Jim

woody-soft
2014-01-05, 20:25
Hi Jim,
not sure that I understand what you want to do with that code, since it looks like you are creating memory variables for all open tables? This could give you a hell of debug, if two tables would have a field with the same name.

But instead of iterating over all possible select areas, why don't you use the AUSED() function, which tells you how many workareas are really in use?

FOR i = 1 TO AUSED(aTables)
SELECT (aTables(i,2))
SCATTER MEMVAR
ENDFOR

barrymavin
2014-01-05, 21:53
In the console type:

? select(1)

That will tell you how many work areas are available. It currently defaults to 100 which is normally adequate for most applications. I have bumped this up to 256 in the next build.

Quailco
2014-01-06, 02:01
lol Woody I have been writing business apps for about 30 yrs. I think I can handle it and yes I know that MS does not recommend my methods but I have strict standards and an OO framework that makes it all easy across a bunch of industries.

Thanks though for the different method that looks good i will check it out!

Jim

Quailco
2014-01-06, 02:02
thanks Barry