Home > Software engineering >  Why did the program prompts the lack of expression
Why did the program prompts the lack of expression

Time:11-22

Private Sub Command1_Click ()
'to generate the milling concave frustum of a cone program
Dim G_program As String
Rough machining software programming code:
D_program=G_program & amp; "Variable description:" & amp; VbCrLf
D_program=G_program & amp; "# 1=A//depth of the frustum of A cone" & amp; VbCrLf
D_program=G_program & amp; "# 2=B//big end radius" & amp; VbCrLf
D_program=G_program & amp; "# 3=C//the small end radius" & amp; VbCrLf
D_program=G_program & amp; "# 4=D//the total number of milling layer" & amp; VbCrLf
D_program=G_program & amp; "# 5=E//Z layer interval" & amp; VbCrLf
D_program=G_program & amp; "# 6=F//adjacent radius increase" & amp; VbCrLf
D_program=G_program & amp; "# 7=G/Z axis depth" & amp; VbCrLf
D_program=G_program & amp; "# 8=H/tool radius" & amp; VbCrLf
D_program=G_program & amp; VbCrLf
D_program=G_program & amp; "Rough machining program:" & amp; VbCrLf
D_program=G_program & amp; "O0001" & amp; VbCrLf
D_program=G_program & amp; "G15 G17 G21 G40 G49 G54 G80 G90 M03 S" & amp; Text5. Text & amp; VbCrLf
D_program=G_program & amp; "G90 G54 G00 X0 Y0 Z0" & amp; VbCrLf
D_program=G_program & amp; "A" & amp; Text1. Text & amp; VbCrLf
D_program=G_program & amp; "B" & amp; Text2. Text & amp; VbCrLf
D_program=G_program & amp; "C" & amp; Text3. Text & amp; VbCrLf
D_program=G_program & amp; "D" & amp; Text6. Text & amp; VbCrLf
D_program=G_program & amp; "E" & amp; Text7. Text & amp; VbCrLf
D_program=G_program & amp; "F" & amp; Text8. Text & amp; VbCrLf
D_program=G_program & amp; "G" & amp; Text9. Text & amp; VbCrLf
D_program=G_program & amp; "H" & amp; Text4. Text & amp; VbCrLf
D_program=G_program & amp; "N10 G01 Z # [9] F1000" & amp; VbCrLf
D_program=G_program & amp; "# 110=FIX the [[# 100-10]/1]" & amp; VbCrLf
D_program=G_program & amp; "G00 X [# 100-110 * # 1 - # 8] Y0" & amp; VbCrLf
D_program=G_program & amp; "WHILE [# 110 ge0] DO 1" & amp; VbCrLf
D_program=G_program & amp; "G01 X [# 2 - # 110 * 1) - # 8 Y0 F800" & amp; VbCrLf
D_program=G_program & amp; "G02 I - [# 2 - # 1 - # 110 * 8] F1200" & amp; VbCrLf
D_program=G_program & amp;="# 110 # 110-2" & amp; VbCrLf
D_program=G_program & amp; "The END" 1 & amp; VbCrLf
D_program=G_program & amp; "# 2=# 2 - # 7" & amp; VbCrLf
D_program=G_program & amp; "M05" & amp; VbCrLf
D_program=G_program & amp; "M09" & amp; VbCrLf
D_program=G_program & amp; "(" & amp; VbCrLf
Text16. Text=G_program
End Sub

CodePudding user response:

Lack of expression "tips"???????
Impossible!!!!!!!!!!!!!

If the modules are: the beginning Option Explicit
That is likely to prompt "variable is undefined,"
Because process defines G_program, whereas D_program didn't define,
(but does not rule out D_program module-level variables, or global variable)

According to the "general rule", is your D_program write wrong variable name the possibility of more G_program (should be);

If D_program is another variable, that you have a lot of assignment statements,
Only the last sentence: D_program=G_program & amp; "(" & amp; VbCrLf have work,
And the value assigned to D_program that last sentence, it is better to don't write...
Write directly Text16. Text="(" & amp; VBCRLF,

CodePudding user response:

Which line to see the first error, suggest compile the whole program at a time, so that we can find the wrong line

CodePudding user response:

The
refer to the original poster qq_35135907 response:
Private Sub Command1_Click ()
'to generate the milling concave frustum of a cone program
Dim G_program As String
Rough machining software programming code:
D_program=G_program & amp; "Variable description:" & amp; VbCrLf
D_program=G_program & amp; "# 1=A//depth of the frustum of A cone" & amp; VbCrLf
D_program=G_program & amp; "# 2=B//big end radius" & amp; VbCrLf
D_program=G_program & amp; "# 3=C//the small end radius" & amp; VbCrLf
D_program=G_program & amp; "# 4=D//the total number of milling layer" & amp; VbCrLf
D_program=G_program & amp; "# 5=E//Z layer interval" & amp; VbCrLf
D_program=G_program & amp; "# 6=F//adjacent radius increase" & amp; VbCrLf
D_program=G_program & amp; "# 7=G/Z axis depth" & amp; VbCrLf
D_program=G_program & amp; "# 8=H/tool radius" & amp; VbCrLf
D_program=G_program & amp; VbCrLf
D_program=G_program & amp; "Rough machining program:" & amp; VbCrLf
D_program=G_program & amp; "O0001" & amp; VbCrLf
D_program=G_program & amp; "G15 G17 G21 G40 G49 G54 G80 G90 M03 S" & amp; Text5. Text & amp; VbCrLf
D_program=G_program & amp; "G90 G54 G00 X0 Y0 Z0" & amp; VbCrLf
D_program=G_program & amp; "A" & amp; Text1. Text & amp; VbCrLf
D_program=G_program & amp; "B" & amp; Text2. Text & amp; VbCrLf
D_program=G_program & amp; "C" & amp; Text3. Text & amp; VbCrLf
D_program=G_program & amp; "D" & amp; Text6. Text & amp; VbCrLf
D_program=G_program & amp; "E" & amp; Text7. Text & amp; VbCrLf
D_program=G_program & amp; "F" & amp; Text8. Text & amp; VbCrLf
D_program=G_program & amp; "G" & amp; Text9. Text & amp; VbCrLf
D_program=G_program & amp; "H" & amp; Text4. Text & amp; VbCrLf
D_program=G_program & amp; "N10 G01 Z # [9] F1000" & amp; VbCrLf
D_program=G_program & amp; "# 110=FIX the [[# 100-10]/1]" & amp; VbCrLf
D_program=G_program & amp; "G00 X [# 100-110 * # 1 - # 8] Y0" & amp; VbCrLf
D_program=G_program & amp; "WHILE [# 110 ge0] DO 1" & amp; VbCrLf
D_program=G_program & amp; "G01 X [# 2 - # 110 * 1) - # 8 Y0 F800" & amp; VbCrLf
D_program=G_program & amp; "G02 I - [# 2 - # 1 - # 110 * 8] F1200" & amp; VbCrLf
D_program=G_program & amp;="# 110 # 110-2" & amp; VbCrLf
D_program=G_program & amp; "The END" 1 & amp; VbCrLf
D_program=G_program & amp; nullnullnullnullnullnullnullnull
  • Related