openFileOpen "c:\sample.txt" For Input As #1 唔明For Input As #1???? #1係咩來?Input #1, variable1 這句係唔係講 Input=variable(變數)?Text1.Text = variable1 Close #1 點解要終止#1saveFilePrivate Sub Command1_Click Dim hFile as Long ???
Dim sFilename as String ?? sFilename = "c:\demo.txt"
hFile = FreeFile ????
Open sFilename For Output As #hFile ???
Print #hFile, Text1.Text ???????
Close #hFile ???
End Sub(Index As Integer)點解?
VB寫MSComm1.Output & MSComm1.Input Delay點寫??因為本用來send 0 1 2 3 4 to rs232 到8051但如果我按11我8051果到就收到唔知咩來所以我就想加個Delay各位高手可以幫幫手
Dim sFilename as String ?? sFilename = "c:\demo.txt"
hFile = FreeFile ????
Open sFilename For Output As #hFile ???
Print #hFile, Text1.Text ???????
Close #hFile ???
End Sub(Index As Integer)點解?
VB寫MSComm1.Output & MSComm1.Input Delay點寫??因為本用來send 0 1 2 3 4 to rs232 到8051但如果我按11我8051果到就收到唔知咩來所以我就想加個Delay各位高手可以幫幫手
Low SoLow So#Low SoPrivate Sub SEND_DATA_Click()
Dim st As String
st = Text_send.Text
Select Case st
Case "Low So"
st = "0"
Case "Low So#"
st = "1"
Case "MLow LA"
st = "2"
Case "Low LA#"
st = "3"
Case "Low TI"
st = "4"
Case "Mid Do"
st = "5"
End Select
Text_send.Text = st
If MSComm1.PortOpen = True Then MSComm1.Output = Text_send.Text
End Sub
但我想改成以下Low SoLow So#Low SoPrivate Sub SEND_DATA_Click()
Dim st As String
st = Text.Text
Select Case st
Case "Do"
st = "1"
Case "Re"
st = "2"
Case "Fa"
st = "3"
Case "Mo"
st = "4"
Case "So"
st = "5"
End Select
Text.Text = st
If MSComm1.PortOpen = True Then MSComm1.Output = Text.Text
End Sub
Text 入 Do左終端機( Hypertrm )收到就係1 但我入DoRe左終端機( Hypertrm )收到就係DoRe出唔到12
dim st1 as string,st2 as string
st1=Trim(Text.Text)
for i=1 to len(st1)
st2=st2 & cstr(instr(st1,mid(st1,i,2)+1)/2)
next
if mscomm1.portopen=true and len(st2)>0 then mscomm1.output=st2需要注意的是,text.text中不能包含空格,否则结构不准确。
st1=Trim(Text.Text)
for i=1 to len(st1)
st2=st2 & cstr(instr(st1,mid(st1,i,2)+1)/2)
next
if mscomm1.portopen=true and len(st2)>0 then mscomm1.output=st2
用唔到出error---- st2=st2 & cstr(instr(st1,mid(st1,i,2)+1)/2) ????????????
for i=1 to len(st1) step 2