Home > Software engineering >  Please note the code comments
Please note the code comments

Time:11-19

I just self-study VB, nearly 50 this year, the unit of the tender wrote some code, no comment, would you please give a comment, the code is as follows:
If UBound (ReceiveBuffer) & gt; Then 103
Datatemp2=Hex (ReceiveBuffer (3)) & amp; "" & amp; Hex (ReceiveBuffer (4))
=ReceiveBuffer datatemp (8) (23)
Datatemp (10)=ReceiveBuffer (26)
Datatemp (0)=(ReceiveBuffer ReceiveBuffer (4) + (3) * 256) * 0.1
Datatemp (1)=(ReceiveBuffer ReceiveBuffer (6) + (5) * 256 * 0.1
Datatemp (2)=(ReceiveBuffer (8) + ReceiveBuffer (7) * 256) * 0.1
Datatemp (3)=(ReceiveBuffer (10) + ReceiveBuffer (9) * 256 * 0.0001 * 10 ^ datatemp (8)
Datatemp (4)=(ReceiveBuffer (12) + ReceiveBuffer (11) * 256 * 0.0001 * 10 ^ datatemp (8)
Datatemp (5)=(ReceiveBuffer (14) + ReceiveBuffer (13) * 256 * 0.0001 * 10 ^ datatemp (8)
Datatemp (6)=(ReceiveBuffer (16) + ReceiveBuffer (15) * 256 * 0.0000001 * 10 ^ datatemp (10)
Datatemp (7)=(ReceiveBuffer (18) + ReceiveBuffer (17) * 256 * 0.0000001 * 10 ^ datatemp (10)
Datatemp (9)=(ReceiveBuffer (30) + ReceiveBuffer (29) * 256 + ReceiveBuffer (28) * 65536 * 0.001 * (ReceiveBuffer + ReceiveBuffer (102) (101) * 256)
End the If
If num & lt; 10 Then
Text1 (num - 1). The Text Format of=$(datatemp (0), the "0.0")
Text2 (num - 1). The Text Format of=$(datatemp (3), "0.000")
Text3 (num - 1). The Text Format of=$(datatemp (1), "0.0")
Text4 (num - 1). The Text Format of=$(datatemp (4), "0.000")
Text6 (num - 1). The Text Format of=$(datatemp (5), "0.000")
Text5 (num - 1). The Text Format of=$(datatemp (2), "0.0")
Text7 (num - 1). The Text Format of=$(datatemp (6), "0.00")
Text8 (num - 1). The Text Format of=$(datatemp (9), "0.00")
End the If
If num & gt; 9 Then
Form1. Text1 (num - 10). The Text Format of=$(datatemp (0), the "0.0")
Form1. Text2 (num - 10). The Text Format of=$(datatemp (3), "0.000")
Form1. Text3 (num - 10). The Text Format of=$(datatemp (1), "0.0")
Form1. Text4 (num - 10). The Text Format of=$(datatemp (4), "0.000")
Form1. Text6 (num - 10). The Text Format of=$(datatemp (5), "0.000")
Form1. Text5 (num - 10). The Text Format of=$(datatemp (2), "0.0")
Form1. Text7 (num - 10). The Text Format of=$(datatemp (6), "0.00")
Form1. Text8 (num - 10). The Text Format of=$(datatemp (9), "0.00")
End the If



Datap (num)=datatemp (9)
There is a
If MSComm. PortOpen=True Then
Call CommandApply
End the If
If num=17 Then

'data2=Val (Text1 (0). The Text) + Val (Text1. (1) the Text) + Val (Text1. (2) the Text) + Val (Text1. (3) the Text) + Val (Text1. (4) the Text) + Val (Text1. (5) Text) + Val (Text1 (6). The Text) + Val (Text1 (7). The Text) + Val (Text1 (8). The Text) + Val (Form1. Text1 (0). The Text) + Val (Form1, Text1. (1) the Text) + Val (Form1, Text1. (2) the Text) + Val (Form1, Text1. (3) the Text) + Val (Form1, Text1. (4) the Text) + Val (Form1, Text1. (5) Text) + Val (Form1, Text1 (6). The Text) + Val (Form1. Text1 (7). The Text) + Val (Form1, Text1 (8). The Text)
Data2=Val (Text7 (0). The Text) + Val (Text7 (1). The Text) + Val (Text7 (2). The Text) + Val (Text7 (3). The Text) + Val (Text7 (4). The Text) + Val (Text7 (5). The Text) + Val (Text7 (6). The Text) + Val (Text7 (7). The Text) + Val (Text7 (8). The Text) + Val (Form1. Text7 (0). The Text) + Val (Form1. Text7 (1). The Text) + Val (Form1. Text7 (2). The Text) + Val (Form1. Text7 (3). The Text) + Val (Form1. Text7 (4). The Text) + Val (Form1. Text7 (5). The Text) + Val (Form1. Text7 (6). The Text) + Val (Form1. Text7 (7). The Text) + Val (Form1. Text7 (8). The Text)

For I=0 To 19 '????????
Data3=data3 + datap (I)
Next I
Text9 (0). The Text Format of=$(data3, respectively, "0.0")
Text9 (1). The Text Format of=$(data2, "0.0")
Form1. Text9. The Text Format of=$(data2, "0.0")
Data2=0
Data3=0

For I=0 To 19 '????????
Datap (I)=0
Next I

End the If


Num=num + 1
If num & gt; 18 Then
Num=0
End the If
'For I=0 To 20'????????????????
'ReceiveBuffer (I)=0
'Next I

CodePudding user response:

Let him to add a comment...

CodePudding user response:

RTFC!!!!!
  • Related