On Wed, 17 Jun 2009, Angel Pais wrote:
> This program:
> proc main()
> > dbCreate( "_tst", { { "F","C",10,0 } } )
> > use _tst alias "" new shared
> > ? select(), used(), "["+alias()+"]"
> > use _tst alias "" new shared
> > ? select(), used(), "["+alias()+"]"
> > wait
> > return
> returns:
> 1 Y []
> 2 Y [_2]
> Xbase++ forces a new alias in same thread.
It's not Clipper compatible and it's done in hidden way.
> You can have same alias on diferent Threads but not on the same.
I think that using WorkSpaceEval() function we can exploit above
rule and create two workareas with the same alias or at least we
will have runtime error. Can you check this code:
proc main()
dbCreate( "_tst", { { "F","C",10,0 } } )
use _tst alias "tst1" new shared
dbRelease()
use _tst alias "tst1" new shared
WorkSpaceEval( {|| doTest() } )
return
proc doTest()
local i, n
n := select()
? "Current workarea: ", ltrim( str( n ) ), "alias:", alias(), ;
"(verify:" + ltrim( str( select( alias() ) ) ) + ")"
? "All active workareas in thread workspace:"
for i := 1 to 255
select( i )
if used()
? " workarea:", ltrim( str( i ) ), "alias:", alias()
endif
next
select( n )
return
best regards,
Przemek
_______________________________________________
Harbour mailing list
[email protected]
http://lists.harbour-project.org/mailman/listinfo/harbour