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

作者: mozziewu (moz)   2015-02-07 19:06:13
各位好小弟我因為學校關係有接觸到一個軟體
然後這軟體中貼著這段程式碼
可以幫小弟我看一下是不是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
作者: darkk6 (Mr. Pan)   2015-02-07 20:07:00
VB
作者: Killercat (殺人貓™)   2015-02-07 21:38:00
看起來不太像C 為什麼會看起來有機會是Java XD
作者: Kenqr (function(){})()   2015-02-07 21:51:00
應該是VB
作者: SKlee (小鯊SK)   2015-02-07 23:00:00
感覺像vb
作者: OrzOGC (洞八達人.拖哨天王)   2015-02-07 23:50:00
根本是VB
作者: alex817 (菜菜)   2015-02-08 00:07:00
VB(無誤)
作者: mozziewu (moz)   2015-02-08 01:45:00
感謝各位 因為小弟我只學過C java只學皮毛Vb完全沒碰過
作者: Killercat (殺人貓™)   2015-02-08 02:04:00
我想說的是,其實Java看起來跟C很像所以你覺得他壓根不像C的話 就不用考慮Java了
作者: Ansaga (奈燦)   2015-02-08 12:04:00
VB吧
作者: dragonyy (dragon)   2015-02-08 14:34:00
看到 DEFINE 就應該知道不是 Java 了吧?
作者: lucky1lk (賭到沒錢的人)   2015-02-09 08:05:00
既然有學過皮毛 還會認為是C 或JAVA?! 這是我疑惑的點!!
作者: GazerLahn (雷什)   2015-02-09 14:40:00
反過來說,或許覺得自己學的是皮毛,可能還沒學到(?
作者: blueshika (藍藍鹿)   2015-02-14 17:48:00
如果我沒猜錯應該是某家機器人廠商的vb,用來控制動作的
作者: rexdauder (something)   2015-03-03 12:41:00
Dim

Links booklink

Contact Us: admin [ a t ] ucptt.com