早教吧作业答案频道 -->其他-->
请教:下面程序中的ifcon=1thend3=0endif是什么意思?OptionExplicitDimcon,draw,a,topx,leftx,d3,bPrivateSubFormKeyDown(KeyCodeAsInteger,ShiftAsInteger)Ifd3=0ThenGoToskipEndIfIfKeyCode=vbKeyPThenb=0
题目详情
请教:下面程序中的if con=1 then d3=0 end if是什么意思?
Option Explicit
Dim con, draw, a, topx, leftx, d3, b
Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
If d3 = 0 Then
GoTo skip
End If
If KeyCode = vbKeyP Then
b = 0
Printer.Orientation = vbPRORLandscape
back:
b = b + 1
Printer.Line (lneDraw(b).X1, lneDraw(b).Y1)-(lneDraw(b).X2, lneDraw(b).Y2)
If lne3D1(1).Visible = True Then
Printer.Line (lne3D1(b).X1, lne3D1(b).Y1)-(lne3D1(b).X2, lne3D1(b).Y2), &H808080
Printer.Line (lne3D2(b).X1, lne3D2(b).Y1)-(lne3D2(b).X2, lne3D2(b).Y2), &H808080
End If
If Not b = draw Then
GoTo back
End If
Printer.EndDoc
End If
If KeyCode = vbKeyUp Then
topx = topx - 15
ElseIf KeyCode = vbKeyDown Then
topx = topx + 15
ElseIf KeyCode = vbKeyLeft Then
leftx = leftx - 15
ElseIf KeyCode = vbKeyRight Then
leftx = leftx + 15
End If
For a = 1 To draw
lne3D1(a).Visible = True
lne3D1(a).X1 = shpConnector(a).Left + leftx + 60
lne3D1(a).Y1 = shpConnector(a).Top + topx + 60
lne3D1(a).X2 = shpConnector(a + 1).Left + leftx + 60
lne3D1(a).Y2 = shpConnector(a + 1).Top + topx + 60
lne3D2(a).Visible = True
lne3D2(a).X1 = shpConnector(a).Left + 60
lne3D2(a).Y1 = shpConnector(a).Top + 60
lne3D2(a).X2 = lne3D1(a).X1
lne3D2(a).Y2 = lne3D1(a).Y1
Next a
lne3D2(draw + 1).Visible = True
lne3D2(draw + 1).X1 = shpConnector(con).Left + 60
lne3D2(draw + 1).Y1 = shpConnector(con).Top + 60
lne3D2(draw + 1).X2 = lne3D1(draw).X2
lne3D2(draw + 1).Y2 = lne3D1(draw).Y2
skip:
End Sub
Private Sub Form_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button = 2 Then
If con > 0 Then
shpConnector(con).Visible = False
lne3D2(con).Visible = False
con = con - 1
End If
If con = 1 Then
d3 = 0
End If
If con = 0 Then
leftx = 0
topx = 0
End If
If draw > 0 Then
lneDraw(draw).Visible = False
lne3D1(draw).Visible = False
draw = draw - 1
End If
Else
If con = 199 Then
GoTo skip2
End If
con = con + 1
shpConnector(con).Visible = True
shpConnector(con).Left = X - 60
shpConnector(con).Top = Y - 60
If con > 1 Then
d3 = 1
draw = draw + 1
lneDraw(draw).Visible = True
lneDraw(draw).X1 = shpConnector(con - 1).Left + 60
lneDraw(draw).Y1 = shpConnector(con - 1).Top + 60
lneDraw(draw).X2 = shpConnector(con).Left + 60
lneDraw(draw).Y2 = shpConnector(con).Top + 60
End If
End If
skip2:
End Sub
Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
Form1.Caption = "三维制图 [X: " & X & " Y: " & Y & "]"
End Sub
Option Explicit
Dim con, draw, a, topx, leftx, d3, b
Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
If d3 = 0 Then
GoTo skip
End If
If KeyCode = vbKeyP Then
b = 0
Printer.Orientation = vbPRORLandscape
back:
b = b + 1
Printer.Line (lneDraw(b).X1, lneDraw(b).Y1)-(lneDraw(b).X2, lneDraw(b).Y2)
If lne3D1(1).Visible = True Then
Printer.Line (lne3D1(b).X1, lne3D1(b).Y1)-(lne3D1(b).X2, lne3D1(b).Y2), &H808080
Printer.Line (lne3D2(b).X1, lne3D2(b).Y1)-(lne3D2(b).X2, lne3D2(b).Y2), &H808080
End If
If Not b = draw Then
GoTo back
End If
Printer.EndDoc
End If
If KeyCode = vbKeyUp Then
topx = topx - 15
ElseIf KeyCode = vbKeyDown Then
topx = topx + 15
ElseIf KeyCode = vbKeyLeft Then
leftx = leftx - 15
ElseIf KeyCode = vbKeyRight Then
leftx = leftx + 15
End If
For a = 1 To draw
lne3D1(a).Visible = True
lne3D1(a).X1 = shpConnector(a).Left + leftx + 60
lne3D1(a).Y1 = shpConnector(a).Top + topx + 60
lne3D1(a).X2 = shpConnector(a + 1).Left + leftx + 60
lne3D1(a).Y2 = shpConnector(a + 1).Top + topx + 60
lne3D2(a).Visible = True
lne3D2(a).X1 = shpConnector(a).Left + 60
lne3D2(a).Y1 = shpConnector(a).Top + 60
lne3D2(a).X2 = lne3D1(a).X1
lne3D2(a).Y2 = lne3D1(a).Y1
Next a
lne3D2(draw + 1).Visible = True
lne3D2(draw + 1).X1 = shpConnector(con).Left + 60
lne3D2(draw + 1).Y1 = shpConnector(con).Top + 60
lne3D2(draw + 1).X2 = lne3D1(draw).X2
lne3D2(draw + 1).Y2 = lne3D1(draw).Y2
skip:
End Sub
Private Sub Form_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button = 2 Then
If con > 0 Then
shpConnector(con).Visible = False
lne3D2(con).Visible = False
con = con - 1
End If
If con = 1 Then
d3 = 0
End If
If con = 0 Then
leftx = 0
topx = 0
End If
If draw > 0 Then
lneDraw(draw).Visible = False
lne3D1(draw).Visible = False
draw = draw - 1
End If
Else
If con = 199 Then
GoTo skip2
End If
con = con + 1
shpConnector(con).Visible = True
shpConnector(con).Left = X - 60
shpConnector(con).Top = Y - 60
If con > 1 Then
d3 = 1
draw = draw + 1
lneDraw(draw).Visible = True
lneDraw(draw).X1 = shpConnector(con - 1).Left + 60
lneDraw(draw).Y1 = shpConnector(con - 1).Top + 60
lneDraw(draw).X2 = shpConnector(con).Left + 60
lneDraw(draw).Y2 = shpConnector(con).Top + 60
End If
End If
skip2:
End Sub
Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
Form1.Caption = "三维制图 [X: " & X & " Y: " & Y & "]"
End Sub
▼优质解答
答案和解析
选择ExplicitDim案子,画,leftx topx,d3,bPrivate子Form_KeyDown(转换为整数,转变为整数)如果d3 = 0然后GoTo skipEnd IfIf键码= vbKeyP然后b = 0打印机.定向= vbPRORLandscapeback:b = b + 1打印机.线(lneDraw(b).X1,y1 lneDraw(b))-(lneDraw(b).X2,y2)lneDraw(b)如果lne3D1(1).可见= True那么打印机.线(lne3D1(b).X1,y1 lne3D1(b))-(lne3D1(b).X2,y2)lne3D1(b),&H808080打印机.线(lne3D2(b).X1,y1 lne3D2(b))-(lne3D2(b).X2,y2)lne3D2(b),&H808080结束如果如果不是b =画然后转到后端如果打印机.EndDocEnd IfIf键码= vbKeyUp然后topx = topx - 15 elseif键码= vbKeyDown然后topx = topx + 15 elseif键码= vbKeyLeft然后leftx = leftx - 15 elseif键码= vbKeyRight然后leftx = leftx + 15 IfFor结束一个= 1来吸引lne3D1(一个).可见lne3D1 = True().X1 = shpConnector(一个).左+ leftx + 60 lne3D1(一个).Y1 = shpConnector(a).顶级+ topx + 60 lne3D1(一个).X2 = shpConnector(+ 1)左+ leftx + 60 lne3D1(一个).Y2 = shpConnector(+ 1)最高+ topx + 60 lne3D2(一个).可见lne3D2 = True().X1 = shpConnector(一个).左+ 60 lne3D2(一个).Y1 = shpConnector(a).顶级+ 60 lne3D2(一个).X2 = lne3D1(一个).X1 lne3D2(一个).Y2 = lne3D1(一个).Y1Next alne3D2(画+ 1)可见= Truelne3D2(画+ 1)x1 = shpConnector(反对).左+ 60 lne3d2(画+ 1)y1 = shpConnector(体质).顶级+ 60 lne3d2(画+ 1)x2 = lne3D1(吸引).X2lne3D2(画+ 1)y2 = lne3D1(吸引).Y2skip:结束SubPrivate子Form_MouseDown(按钮作为整数,转变为整数,X,Y是作为一个单独的单)如果按钮= 2然后如果反对> 0然后shpConnector(反对).可见= False lne3D2(反对).可见= False con = con - 1结束如果如果反对= 1然后d3 = 0结束如果如果反对= 0然后leftx = 0 topx = 0结束如果如果画> 0然后lneDraw(吸引).可见= False lne3D1(吸引).可见= False画=画- 1结束IfElse如果反对= 199然后GoTo skip2结束如果反对=体质+ 1 shpConnector(反对).可见shpConnector = True(反对).左= X - 60 shpConnector(反对).顶级= Y - 60如果反对> 1然后d3 = 1平局=画+ 1 lneDraw(吸引).可见lneDraw = True(吸引).X1 = shpConnector(con - 1)左+ 60 lneDraw(吸引).Y1 = shpConnector(con - 1)最高+ 60 lneDraw(吸引).X2 = shpConnector(反对).左+ 60 lneDraw(吸引).Y2 = shpConnector(反对).顶级+ 60结束IfEnd Ifskip2:结束SubPrivate子Form_MouseMove(按钮作为整数,转变为整数,X,Y是作为一个单独的单)Form1.标题= \"三维制图[X:“& X和Y:“& Y &“]”端接头
看了 请教:下面程序中的ifcon...的网友还看了以下:
位于短周期的四种元素A,B,C,D,原子序数依次增大,已知A,C位于同一主族,A在周期表中原子半径 2020-04-08 …
在其最好情况下的算法时间复杂度为O(n)。A.插入排序B.归并排序C.快速排序D.堆排序 2020-05-26 …
A.冒泡排序B.插入排序C.快速排序D.堆排序 2020-05-26 …
A.为决策而增加的工序B.为计算方便而增加的工序C.工序间的时间顺序关系D.该工序是关键工序 2020-05-26 …
下列排序算法中()算法在进行一趟相应的排序处理结束后不一定能选出一个元素放到其最终位置上.A直选择 2020-07-23 …
在最坏的情况下,下列排序方法中时间复杂度最小的是()A.冒泡排序B.快速排序C.插入排序D.堆排序 2020-07-23 …
若有以下程序#include“stdio.h”main(){inta=1,b=2,c=3,d=4; 2020-07-23 …
..C语言逗号有以下程序main(){chara1='M',a2='m';printf("%c\n" 2020-11-23 …
一道二级C题目设有以下程序段:intx=0,s=0;while(!=0)s+=++x;printf( 2020-12-07 …
数据结构排序如果只想得到1000个元素组成的序列中第5个最小元素之前的部分排序的序列,用()方法最快 2020-12-14 …