[問題] 誰可以幫我看看這是不是Java

看板java作者 (moz)時間10年前 (2015/02/07 19:06), 編輯推噓5(5010)
留言15則, 13人參與, 最新討論串1/1
各位好小弟我因為學校關係有接觸到一個軟體 然後這軟體中貼著這段程式碼 可以幫小弟我看一下是不是Java嗎 ? 因為看起來不太像是C語言 如果願意的話可以幫我大概看一下它的功能嗎? 謝謝 以下是源碼 Peripheral mySer As ServoRunnerA @ 0 #DEFINE ID0 0 #DEFINE ID1 1 #DEFINE ID2 2 #DEFINE ID3 3 #DEFINE ID4 4 Dim x,y,z,xx,zz,yy As Byte Dim ID As Byte Dim Pos As Word Sub MAIN() RunFrame(0) Pause 800 Do renew() Select Case x Case 0 RunFrame(0) Pause 800 Case 1 RunFrame(1) Pause 800 Case 2 RunFrame(2) Pause 800 Case 3 RunFrame(3) Pause 800 Pause 800 Case 4 RunFrame(4) Pause 800 Case 5 RunFrame(5) Pause 800 Pause 800 Case 6 RunFrame(6) Pause 800 Case 7 RunFrame(7) Pause 800 Case 8 RunFrame(8) Pause 800 Case 9 RunFrame(9) Pause 800 Case 10 RunFrame(10) Pause 800 Case 11 RunFrame(11) Pause 800 Case 12 RunFrame(12) Pause 800 Case 13 RunFrame(13) Pause 800 Case 14 RunFrame(14) Pause 800 Case 15 Debug "MM",CR MM() End Select Pause 500 Debug CLS Loop End Sub Sub MM() Debug "手動模式",CR ID = 0 Debug "ID=0",CR MA: renew() Select Case x Case 1 Debug "向前或夾",CR forward() Case 2 Debug "向後或鬆",CR Rever() Case 8 ID=0 Debug "ID=0",CR Case 9 ID=1 Debug "ID=1",CR Case 10 ID=2 Debug "ID=2",CR Case 11 ID=3 Debug "ID=3",CR End Select If x<>15 Then Goto MA End If Debug "自動模式",CR End Sub Sub forward() FR: Select Case ID Case 0 Myser.GetNowPos(ID0,Pos) ' Pos = Pos - 100 myser.SetPosTimeAndRun(ID0,Pos,800) ' Pause 800 Case 1 Myser.GetNowPos(ID1,Pos) ' Pos = Pos - 100 myser.SetPosTimeAndRun(ID1,Pos,800) ' Pause 800 Case 2 Myser.GetNowPos(ID2,Pos) ' Pos = Pos + 100 myser.SetPosTimeAndRun(ID2,Pos,800) ' Pause 800 Case 3 Myser.GetNowPos(ID3,Pos) ' Pos = Pos + 100 myser.SetPosTimeAndRun(ID3,Pos,800) ' Myser.GetNowPos(ID4,Pos) ' Pos = Pos - 100 myser.SetPosTimeAndRun(ID4,Pos,800) ' Pause 800 End Select Debug "ID=",ID,CR Debug "Pos=",pOS,CR renew2() If xx=1 Then Goto FR End If End Sub Sub Rever() RE: Select Case ID Case 0 Myser.GetNowPos(ID0,Pos) Pos = Pos + 100 myser.SetPosTimeAndRun(ID0,Pos,800) ' Pause 800 Case 1 Myser.GetNowPos(ID1,Pos) Pos = Pos + 100 myser.SetPosTimeAndRun(ID1,Pos,800) ' Pause 800 Case 2 Myser.GetNowPos(ID2,Pos) Pos = Pos - 100 myser.SetPosTimeAndRun(ID2,Pos,800) ' Pause 800 Case 3 Myser.GetNowPos(ID3,Pos) Pos = Pos - 100 myser.SetPosTimeAndRun(ID3,Pos,800) ' Myser.GetNowPos(ID4,Pos) ' Pos = Pos + 100 myser.SetPosTimeAndRun(ID4,Pos,800) ' Pause 800 End Select Debug "ID=",ID,CR Debug "Pos=",pOS,CR renew2() If xx=2 Then Goto RE End If End Sub Sub RunFrame(ID As Byte) Myser.LoadFrame(ID) Myser.Runallservo() End Sub Sub renew() A0: z=2 A1: x = Readport0 x = x And 15 Debug CSRXY(1,1), %BIN8 x If y=x Then Goto A0 End If Pause 100 z=z-1 If z<>0 Then Goto A1 End If y = x End Sub Sub renew2() B0: zz=0 B1: xx = Readport0 xx = xx And 15 Debug CSRXY(1,2), %BIN8 xx If zz=2 Then Goto B2 End If If yy=xx Then zz=zz+1 Pause 10 Goto B1 End If yy=xx Goto B0 B2: End Sub -- ※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 101.8.153.231 ※ 文章網址: https://www.ptt.cc/bbs/java/M.1423307175.A.5C0.html

02/07 20:07, , 1F
VB
02/07 20:07, 1F

02/07 21:38, , 2F
看起來不太像C 為什麼會看起來有機會是Java XD
02/07 21:38, 2F

02/07 21:51, , 3F
應該是VB
02/07 21:51, 3F

02/07 23:00, , 4F
感覺像vb
02/07 23:00, 4F

02/07 23:50, , 5F
根本是VB
02/07 23:50, 5F

02/08 00:07, , 6F
VB(無誤)
02/08 00:07, 6F

02/08 01:45, , 7F
感謝各位 因為小弟我只學過C java只學皮毛Vb完全沒碰過
02/08 01:45, 7F

02/08 02:04, , 8F
我想說的是,其實Java看起來跟C很像
02/08 02:04, 8F

02/08 02:04, , 9F
所以你覺得他壓根不像C的話 就不用考慮Java了
02/08 02:04, 9F

02/08 12:04, , 10F
VB吧
02/08 12:04, 10F

02/08 14:34, , 11F
看到 DEFINE 就應該知道不是 Java 了吧?
02/08 14:34, 11F

02/09 08:05, , 12F
既然有學過皮毛 還會認為是C 或JAVA?! 這是我疑惑的點!!
02/09 08:05, 12F

02/09 14:40, , 13F
反過來說,或許覺得自己學的是皮毛,可能還沒學到(?
02/09 14:40, 13F

02/14 17:48, , 14F
如果我沒猜錯應該是某家機器人廠商的vb,用來控制動作的
02/14 17:48, 14F

03/03 12:41, , 15F
Dim
03/03 12:41, 15F
文章代碼(AID): #1KrV6dN0 (java)
文章代碼(AID): #1KrV6dN0 (java)