invoke code这个控件,感觉像一个方法体。我们可以在里面写函数,方法。定义类的语句好像就不行了。
亲测,亲测,replace方法不可用。
documentdate=Mid(tmp,20,15) 从tmp里第20个字符开始,截取15个字符
companycode=Split(tmp,"TO:"+vbNewLine)(1) 从tmp里"TO:+\n"截取,取第二块值
For i=0 To ii-1 for嵌套if的语句
If checkdt.Rows(i)(0).ToString = companycode Then
companycode=checkdt.Rows(i)(1).ToString
EXIT FOR 退出for循环的key
End If
Next
If month = " JAN" Then 土办法,还可以用case
month="01"
Else If month =" FEB" Then
month="02"
Else If month=" MAR" Then
month="03"
Else If month=" APL" Then
month="04"
Else If month=" MAY" Then
month="05"
Else If month=" JAN" Then
month="06"
Else If month=" JUL" Then
month="07"
Else If month=" AUG" Then
month="08"
Else If month=" SEP" Then
month="09"
Else If month=" OCT" Then
month="10"
Else If month=" NOV" Then
month="11"
Else If month=" DEC" Then
month="12"
End If
//case方法 也是可用的
Select Case month
Case "1"
month="Jan"
Case "2"
month="Feb"
Case "7"
month="Jul"
Case Else
month="error"
End Select
While i<>0 while语句
documentnumber=datasource.Substring(i,10)'查找documentnumber
datasource=Split(datasource,documentnumber)(1)
'console.WriteLine(documentnumber)'''''''''''''''''
id=id+","+documentnumber
i=InStr(datasource," 1930")
End While