Ernesto_Paez
MIS
Hello everyone
i am printing labels and i would like to have a txt file where all the content of each label printed, can be in a txt file by appending to it, each time
i print a label so i can use later the log file to review it and see if i actually did not forget to print labels for a particular sales order details
so here is my code, please see if i used "STRTOFILE() " correct ?
i am not able to find the filename "PrintLblLog.txt", in the path specified, can anyone help me out to straight this out and tell me what is wrong ?
By the way the "LOG" folder exist in the c:\ and i have full access to it
Thanks in advance
i am printing labels and i would like to have a txt file where all the content of each label printed, can be in a txt file by appending to it, each time
i print a label so i can use later the log file to review it and see if i actually did not forget to print labels for a particular sales order details
so here is my code, please see if i used "STRTOFILE() " correct ?
i am not able to find the filename "PrintLblLog.txt", in the path specified, can anyone help me out to straight this out and tell me what is wrong ?
By the way the "LOG" folder exist in the c:\ and i have full access to it
Thanks in advance
Code:
Select sono, Left(Alltrim(Getwordnum(Desc,1)),10) As apexpart, Left(Getwordnum(Desc,2),30)+" "+Left(Getwordnum(Desc,3),30)As Descrip,;
QTYORD From junkso Where xtick = .T. Into Cursor junkrep READWRITE && NOFILTER
If _Tally>0
Set Printer To Name (_Screen.Printer)
For lnloop = 1 To Thisform.spinner1.Value
Label Form label1.lbx Noconsole To Printer
Next
Thisform.spinner1.Value = 1
** to create a log text file of labels printed
LOCAL cFileName,cText
cFileName = SYS(5)+"LOG"+"\"+"PrintLblLog.txt"
SELECT junkrep &&IN 2 ALIAS MYJUNKREP
GO top
SCAN &&FOR xtick =.T.
cText = sono + "," + apexpart + " "+ ALLTRIM(Descrip) +" "+STR(QTYORD)+ " "+ DTOC(DATE()) + CHR(13)
STRTOFILE(m.cText, m.cFileName, 1)
ENDSCAN && end here
Else
Messagebox("Nothing to print yet!")
Endif