Breakpoint Info Dim txtval as byte = splitline(50) 首次加载表单时工作正常
在表单上有一个按钮,用于刷新再次运行例程的位置,以便从刷新数据的txt文件中读取。
声明然后在包含标题(字符串值)的txt文件行(0)上出错。 Err =从字符串到字节的转换无效
我尝试过的事情:
将变量声明为对象 接下来错误恢复 错误转到
任何建议。
Do While StrTxtScheduleStreamR1.Peek() > -1
Dim textline As String = StrTxtScheduleStreamR1.ReadLine
'Header Level
Dim splitline As String() = Split(textline, vbTab)
'Sub level
On Error Resume Next
Dim WIPsplitOrder As String = splitline(WIPRptOrder - 1) ' Production Order
Dim WIPSplitOpStat As String = splitline(WIPRptOpStatus - 1) ' Operation Status (REL,CRTD)
Dim WIPSplitWCDesc As String = splitline(WIPRptWCDesc - 1) ' Workcenter Description (KIT STATION)
Dim WIPSplitWorkCenter As String = splitline(WIPRptWcenter - 1) ' Workcenter Number (101)
Dim MatShtOrder As String = splitline(MatShtRptOrder - 1) ' Multilevel Production Order
Dim MatShtSmpDelDate As String = splitline(MatShtRptDelDate - 1) 'Multilevel Delivery Dates
Dim ConfRptOrder As String = splitline(CnfRptOrder - 1) ' Production Order Confirmation Report
Dim ConfRptWCDesc As String = splitline(CnfRptWCDesc - 1) ' Workcenter Description - Confirmation Report
Dim WIPsplitWorksOrder As String = splitline(WIPRptWorksOrder - 1) ' Works Order - Order Book
Dim WIPsplitEquiptDesc As String = splitline(WIPRptEquiptDesc - 1) ' Equiptment Description
Dim WipsplitValClass As String = splitline(WipRptValClass - 1) ' Equiptment Type - Order Book
Dim WipsplitOrdQty As String = splitline(WipRptOrdQty - 1) ' Outstanding Order Qty - Order Book
Dim txtval1 As byte = splitline(50 ) ' Remaining Production Hours - Order Book
Dim txtval2 As byte = splitline(51 ) - WipsplitRemCap ' All Op Calc Production Hours - Order Book
Dim BUFD As Date = splitline(32 - 1)
Dim WipsplitSerialNo As String ' Serial Number - Order Book
Dim WIPsplitOpInfo As String = splitline(WIPRptOpInfo - 1) 'Production Operation Description - Order Book
Dim SearchSpecialPaintWC