hi to everyone
i need to convert the below VB6 Code to B4A language. any ideas will be appreciate a lot. the bluetooth printer now is working with cpcl emulation
i need to convert the below VB6 Code to B4A language. any ideas will be appreciate a lot. the bluetooth printer now is working with cpcl emulation
printdata = "! 0 200 200 584 1" & vbCrLf
printdata = printdata + "LABEL" & vbCrLf
printdata = printdata + "TONE " & CStr(modGlobal.PrinterTone) & vbCrLf
printdata = printdata + "SPEED 5" & vbCrLf
printdata = printdata + "PAGE-WIDTH 384" & vbCrLf
printdata = printdata + "BAR(-SENSE)" & vbCrLf
printdata = printdata + "PREFEED(0)" & vbCrLf
printdata = printdata + "POSTFEED(0)" & vbCrLf
printdata = printdata + "PRESENT-AT 0 2" & vbCrLf
printdata = printdata + "COUNTRY(UK)" & vbCrLf
printdata = printdata + "CHAR-SET7 " & "CP-737" & vbCrLf
printdata = printdata + "BT 7 1 0" & vbCrLf
printdata = printdata + "VB 128 1 0 85 130 534 " & txtLabelItemNo.Text & vbCrLf
printdata = printdata + "BT(OFF)" & vbCrLf
printdata = printdata + "SETMAG 2 3" & vbCrLf
printdata = printdata + "T90 7 3 145 160 " & itemprice & vbCrLf '180
printdata = printdata + "SETMAG 0 0" & vbCrLf
printdata = printdata + "T90 7 1 165 185 " & "=" & vbCrLf '205
printdata = printdata + "SETMAG 0 0" & vbCrLf
printdata = printdata + "T90 7 1 165 180 " & "C" & vbCrLf '200
printdata = printdata + "SETMAG 0 0" & vbCrLf
If Len(ppwstring) <> 0 Then
printdata = printdata + "T90 0 3 230 200 " & ppwstring & vbCrLf
printdata = printdata + "SETMAG 0 0" & vbCrLf
Else
If chkSpecialoffer.Checked Then
printdata = printdata + "T90 0 3 230 200 Special Offer" & vbCrLf
printdata = printdata + "SETMAG 0 0" & vbCrLf
End If
End If
If Len(DLine2) > 0 Then
printdata = printdata + "T90 7 1 0 534 " & DLine1 & vbCrLf
printdata = printdata + "SETMAG 0 0" & vbCrLf
printdata = printdata + "T90 7 1 40 534 " & DLine2 & vbCrLf
printdata = printdata + "SETMAG 0 0" & vbCrLf
If Len(Trim(Me.lblLabelItemLevel.Text)) > 1 Then
printdata = printdata + "T90 0 2 80 534 " & Me.lblLabelItemLevel.Text & vbCrLf
printdata = printdata + "SETMAG 0 0" & vbCrLf
End If
Else
printdata = printdata + "T90 7 1 20 534 " & DLine1 & vbCrLf
printdata = printdata + "SETMAG 0 0" & vbCrLf
If Len(Trim(Me.lblLabelItemLevel.Text)) > 1 Then
printdata = printdata + "T90 0 2 80 534 " & Me.lblLabelItemLevel.Text & vbCrLf
printdata = printdata + "SETMAG 0 0" & vbCrLf
End If
End If
printdata = printdata + "SETMAG 0 0" & vbCrLf
printdata = printdata + "FORM" & vbCrLf
printdata = printdata + "PRINT" & vbCrLf
''//here replace the Encoding "windows-1255" to greek/xxxx encoding
arrByte1253 = Encoding.GetEncoding("ibm737").GetBytes(printdata)
wSerialPort.Write(arrByte1253, 0, arrByte1253.Length)
wSerialPort.Close()