by Vital » Thu Sep 27, 2007 2:46 pm
Yo lo tengo asi :
FUNCTION CreaTemporal1(cFile)
Local aTempora := {}, nFile
DO WHILE .T.
nFile := cTempFile()
nFile := SubStr(nFile,1,At(".",nFile)-1)
IF Len(nFile)>6
nFile := SubStr(nFile,1,6)
ELSE
nFile := nFile+Replicate("0",6-Len(nFile))
ENDIF
nFile := "TM"+nFile+".DBF"
IF File(nFile)
Loop
ENDIF
EXIT
ENDDO
AADD(aTempora,{"PRODUCTO","C",16,0})
AADD(aTempora,{"NOMBRE" ,"C",35,0})
AADD(aTempora,{"CANTIDAD","N",10,2})
AADD(aTempora,{"PRECIO" ,"N",10,2})
AADD(aTempora,{"IMPORTE" ,"N",10,2})
DbCreate(nFile,aTempora)
nFile := SubStr(nFile,1,8)
RETURN nFile