VERSION 5.00
Begin VB.Form Form1 
   Caption         =   "Form1"
   ClientHeight    =   3195
   ClientLeft      =   60
   ClientTop       =   345
   ClientWidth     =   4680
   BeginProperty Font 
      Name            =   "宋体"
      Size            =   14.25
      Charset         =   134
      Weight          =   400
      Underline       =   0   'False
      Italic          =   0   'False
      Strikethrough   =   0   'False
   EndProperty
   LinkTopic       =   "Form1"
   ScaleHeight     =   3195
   ScaleWidth      =   4680
   StartUpPosition =   3  '窗口缺省
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Form_Click()
  Dim A As String, B As String      '定义字符串变量A、B
  Cls                               '清除窗体文字
  A = "ABCDE"                       '为变量A赋值
  B = "12345"                       '为变量B赋值
  Print "主过程在调用子过程之前的原变量数据："; "A1="; A; "   "; "B1="; B
  Print "_____________________________________________________________"
  Print
  Sub1 A, B                         '调用子过程Sub1
  Print "主过程调用传址子过程之后的变量数据："; "A1="; A; "   "; "B1="; B
End Sub

Rem 传值子过程Sub1
Public Sub Sub1(X As String, Y As String)
    Dim T As String
    Rem 下面三行语句用于交换形参的值
    T = X
    X = Y
    Y = T
    Print "传址子过程中互换变量值后的变量数据："; "X1="; X; "   "; "Y1="; Y
    Print "_____________________________________________________________"
    Print
End Sub

