Certas coisas parecem tão simples, mas as vezes me quebram a cabeça.
A questão é a seguinte: no código abaixo, quando informo um valor qualquer, por exemplo "004", sempre dá o erro:
Error BASE/1003 Variable does not exist: PCRED004.DBF
Código: Selecionar todos
*--------------------------------------
Function Main()
*------------------------------------------------------------
*
SetColor("0/22,0/15,0,3")
*
wvw_nopenwindow('PLANO DE CONTAS - INCLUSAO',2,2,25,75)
MontaTela3()
*
wvw_lclosewindow()
return nil
*--------------------------------------
Function MontaTela3()
*------------------------------------------------------------
*
Private vcodi, vtitu, vdebi, vcred, vhst1, vhst2, vtipo, vdpro, vcpro
Private nPlanoContas, nPlanoIndex
*
@ 1, 2 SAY "C¢digo :"
@ 3, 2 SAY "Descri‡ao:"
*
DO WHILE .T.
*
vcodi:=space(03)
*
nPlanoContas:=SPACE(12)
nPlanoIndex :=SPACE(12)
*
@ 1, 13 GET vcodi PICTURE "999"
*
READ
*
IF LASTKEY()=27
*
EXIT
*
ENDIF
*
nPlanoContas:="PCRED"+vcodi+".DBF"
nPlanoIndex :="PCRED"+vcodi+".CDX"
*
IF!FILE('&nPlanoContas')
DbCreate( &nPlanoContas ,{ { "CODI","N", 4, 0 }, ;
{ "TITU","C",40, 0 } } )
Use &nPlanoContas
INDEX ON Codi TAG Codigo TO &nPlanoIndex
INDEX ON Titu TAG Titulo TO &nPlanoIndex
USE
USE &nPlanoContas Alias Cta SHARED NEW
SET ORDER TO TAG Codigo
GO TOP
Else
Exit
EndIf
alert('arquivo criado...')
exit
*
ENDDO
*
RETURN
Agradecimentos,
Gilvandi

