Sistema 1
Código: Selecionar todos
Select 1
Use (vPrinterDBF) NEW Alias "DBFPrinter" Shared
If !File(vPrinterCDX)
Do While .t.
If travarqivo(5)
Index on Pedido tag key001 to (vPrinterCDX)
Index on NoMesa tag key002 to (vPrinterCDX)
Index on Atendent tag key003 to (vPrinterCDX)
Index on Status tag key004 to (vPrinterCDX)
Index on Pedido tag key005 to (vPrinterCDX) FOR STATUS="0"
//Index on Pedido tag key001 to (vPrinterCDX) FOR STATUS="0"
DbUnlock()
Else
Loop
Endif
Exit
Enddo
Else
dbsetindex((vPrinterCDX))
Endif
Código: Selecionar todos
DO WHILE .T.
SELECT 10
dbf:=xEndDados+"Printer.dbf"
ind:=xEndDados+"Printer.cdx"
if ABRE((dbf))
IF !FILE((ind))
do while .t.
if travarqivo(5)
Index on Pedido tag key001 to (IND)
Index on NoMesa tag key002 to (IND)
Index on Atendent tag key003 to (IND)
Index on Status tag key004 to (IND)
Index on Pedido tag key005 to (IND) FOR STATUS="0"
DBUNLOCK()
else
MSGSTOP("Arquivo sendo alterado no momento.")
loop
endif
exit
enddo
endif
else
MsgStop("Arquivo sendo alterado no momento.")
loop
ENDIF
DBSETINDEX((IND))
EXIT
ENDDO

