⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 传值与传址.frm

📁 蒋加伏主编VB程序设计第四版PPT及全部课本源码 北京邮电大学出版社 Visual Basic 程序设计教程(第四版) 主编 蒋加伏 张林峰 找了好久的(不带密码的)
💻 FRM
字号:
VERSION 5.00
Begin VB.Form Form1 
   Caption         =   "例[8-8]传址和传值"
   ClientHeight    =   1890
   ClientLeft      =   60
   ClientTop       =   345
   ClientWidth     =   5415
   LinkTopic       =   "Form1"
   ScaleHeight     =   1890
   ScaleWidth      =   5415
   StartUpPosition =   3  '窗口缺省
   Begin VB.CommandButton Command2 
      Caption         =   "退出"
      Height          =   615
      Left            =   4560
      TabIndex        =   13
      Top             =   1058
      Width           =   735
   End
   Begin VB.OptionButton Option1 
      Caption         =   "传值"
      Height          =   495
      Left            =   3480
      TabIndex        =   12
      Top             =   360
      Width           =   735
   End
   Begin VB.OptionButton Option2 
      Caption         =   "传址"
      Height          =   495
      Left            =   3480
      TabIndex        =   11
      Top             =   1080
      Width           =   735
   End
   Begin VB.Frame Frame1 
      Caption         =   "方式"
      Height          =   1575
      Left            =   3360
      TabIndex        =   10
      Top             =   120
      Width           =   975
   End
   Begin VB.CommandButton Command1 
      Caption         =   "调用"
      Height          =   615
      Left            =   4560
      TabIndex        =   9
      Top             =   218
      Width           =   735
   End
   Begin VB.TextBox Text2 
      Height          =   375
      Left            =   2280
      TabIndex        =   4
      Top             =   240
      Width           =   855
   End
   Begin VB.TextBox Text1 
      Height          =   375
      Left            =   1200
      TabIndex        =   3
      Top             =   240
      Width           =   855
   End
   Begin VB.Label Label7 
      Height          =   375
      Left            =   2280
      TabIndex        =   8
      Top             =   1200
      Width           =   855
   End
   Begin VB.Label Label6 
      Height          =   375
      Left            =   1200
      TabIndex        =   7
      Top             =   1200
      Width           =   855
   End
   Begin VB.Label Label5 
      Height          =   375
      Left            =   2280
      TabIndex        =   6
      Top             =   720
      Width           =   855
   End
   Begin VB.Label Label4 
      Height          =   375
      Left            =   1200
      TabIndex        =   5
      Top             =   720
      Width           =   855
   End
   Begin VB.Label Label3 
      Caption         =   "调用后实参"
      Height          =   375
      Left            =   120
      TabIndex        =   2
      Top             =   1200
      Width           =   1095
   End
   Begin VB.Label Label2 
      Caption         =   "调用中形参"
      Height          =   495
      Left            =   120
      TabIndex        =   1
      Top             =   720
      Width           =   975
   End
   Begin VB.Label Label1 
      Caption         =   "调用前实参"
      Height          =   495
      Left            =   120
      TabIndex        =   0
      Top             =   240
      Width           =   1215
   End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Private Sub Command1_Click()
  Dim a As Single, b As Single
  a = Val(Text1.Text)
  b = Val(Text2.Text)
  If Option1.Value = True Then    '传值调用
    Call testcall1(a, b)
  Else
    Call testcall(a, b)           '传址调用
  End If
  Label6.Caption = Str(a)
  Label7.Caption = Str(b)
End Sub
Private Sub testcall1(ByVal a As Single, ByVal b As Single)
  a = 8
  b = 9
  Label4.Caption = Str(a)
  Label5.Caption = Str(b)
End Sub
Private Sub testcall(aa As Single, bb As Single)
  aa = 8
  bb = 9
  Label4.Caption = Str(aa)
  Label5.Caption = Str(bb)
End Sub
Private Sub Command2_Click()
  End
End Sub

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -