Hi,
You are not the first who was confused here.
For next developers to clarify this in code, lets copy/paste and save this code in a PRG in console with ED USEXAMPLE.
Execute it in console with DO USEXAMPLE.
Code:
clear
close databases
open database southwind
? '#1 case: BEFORE USEs'
? [used('orders')=]+transform(used('orders'))
use orders
use shippers
? 'AFTER USE orders and shippers without specify numbers or 0=next available'
? [used('orders')=]+transform(used('orders'))
? [used('shippers')=]+transform(used('shippers'))
? 'all USEs were made on the same workarea number and only last wins'
close databases
open database southwind
?
? '#2 case: BEFORE USEs'
? [used('orders')=]+transform(used('orders'))
use orders in 0
use shippers in 0
? 'AFTER USE orders and shippers with 0=next available'
? [used('orders')=]+transform(used('orders'))
? [used('shippers')=]+transform(used('shippers'))
? 'Every USE was made in NEXT AVAILABLE workarea number and all are live'
?
? '#3 case: How to close one of them'
select orders
use
? 'AFTER SELECT and USE '
? [used('orders')=]+transform(used('orders'))
The result will be:
Code:
#1 case: BEFORE USEs
used('orders')=.F.
AFTER USE orders and shippers without specify numbers or 0=next available
used('orders')=.F.
used('shippers')=.T.
all USEs were made on the same workarea number and only last wins
#2 case: BEFORE USEs
used('orders')=.F.
AFTER USE orders and shippers with 0=next available
used('orders')=.T.
used('shippers')=.T.
Every USE was made in NEXT AVAILABLE workarea number and all are live
#3 case: How to close one of them
AFTER SELECT and USE
used('orders')=.F.
The trick is:
Code:
USE 'somename' IN 0
In VFP you can close it in 1 step: (use in 'orders')
Lianja needs 2 steps (select + use).
Maybe this is for ER ticket?
Bookmarks