For F = 1 To fz
Dim read As Int = SD.Stream.ReadBytes(tmp,0,1)
If read = 0 Then
Return ERR_FILE_EOF
End If
Select tmp(0)
Case 0X0D,0x0A
If BC.IndexOf(Buffer,"oooo".GetBytes) > 0 Then
parm = Str.ReplaceString(Buffer,"oooo".GetBytes,OwnerName) 'owner name field
else if BC.IndexOf(Buffer,"nnnn".GetBytes) > 0 Then
parm = Str.ReplaceString(Buffer,"nnnn".GetBytes,itn) 'item name field
else if BC.IndexOf(Buffer,"wwww".GetBytes) > 0 Then
parm = Str.ReplaceString(Buffer,"wwww".GetBytes,weight.GetBytes) 'weight
else If BC.IndexOf(Buffer, "pppp".GetBytes) > 0 Then
parm = Str.ReplaceString(Buffer, "pppp".GetBytes,ipr) ' item unit price
else If BC.IndexOf(Buffer, "gggg".GetBytes) > 0 Then
parm = Str.ReplaceString(Buffer, "gggg".GetBytes,NumberFormat(grs,1,2)) 'gross amount
else If BC.IndexOf(Buffer, "cccc".GetBytes) > 0 Then
LabelCounter = LabelCounter + 1
parm = Str.ReplaceString(Buffer, "cccc".GetBytes,NumberFormat(LabelCounter,1,0)) 'label counter
else if BC.IndexOf(Buffer,"tttt".GetBytes) > 0 Then
parm= Str.ReplaceString(Buffer,"tttt".GetBytes,"16:25".GetBytes) 'time, DS1302 not implemnted yet
else if BC.IndexOf(Buffer,"dddd".GetBytes) > 0 Then
parm= Str.ReplaceString(Buffer,"dddd".GetBytes,"06/06/17".GetBytes) 'date
else if BC.IndexOf(Buffer, "88888888888".GetBytes) > 0 Then
parm = Str.ReplaceString(Buffer, "88888888888".GetBytes,ItemAndWeight) 'item and weight barcode
else if BC.IndexOf(Buffer, "99999999999".GetBytes) > 0 Then
parm = Str.ReplaceString(Buffer, "99999999999".GetBytes,ItemAndPrice) 'item and price barcode
Else
parm = (Buffer) 'not parametric line, send it to printer as it is
End If
LabelPrinter.Write(parm)
'UploadArray(parm,LabelPrinter)
'RAF.CurrentPosition = 0
ArrayIndex = 0
For x = 0 To Buffer.Length - 1
Buffer(x) = 0
Next
Case Else
'RAF.WriteByte(tmp(0),RAF.CurrentPosition)
Buffer(ArrayIndex) = tmp(0)
ArrayIndex = ArrayIndex + 1
End Select
Next
SD.Close
SetSD(False)
Return ERR_NO_ERR