home *** CD-ROM | disk | FTP | other *** search
/ Programming Tool Box / SIMS_2.iso / vb_code1 / dispatch / form1.frm < prev    next >
Text File  |  1993-08-31  |  3KB  |  110 lines

  1. VERSION 2.00
  2. Begin Form Form1 
  3.    BackColor       =   &H00C0C0C0&
  4.    Caption         =   "Form1"
  5.    ClientHeight    =   4005
  6.    ClientLeft      =   1740
  7.    ClientTop       =   2670
  8.    ClientWidth     =   4695
  9.    Height          =   4410
  10.    Left            =   1680
  11.    LinkTopic       =   "Form1"
  12.    ScaleHeight     =   4005
  13.    ScaleWidth      =   4695
  14.    Top             =   2325
  15.    Width           =   4815
  16.    Begin TextBox Arg 
  17.       BackColor       =   &H00FFFFFF&
  18.       Height          =   285
  19.       Left            =   2385
  20.       TabIndex        =   0
  21.       Text            =   "Text1"
  22.       Top             =   360
  23.       Width           =   975
  24.    End
  25.    Begin CommandButton Command3 
  26.       Caption         =   "Sub 1"
  27.       Height          =   555
  28.       Index           =   0
  29.       Left            =   1560
  30.       TabIndex        =   1
  31.       Top             =   780
  32.       Width           =   1575
  33.    End
  34.    Begin CommandButton Command3 
  35.       Caption         =   "Exit"
  36.       Height          =   555
  37.       Index           =   2
  38.       Left            =   1560
  39.       TabIndex        =   3
  40.       Top             =   2850
  41.       Width           =   1575
  42.    End
  43.    Begin CommandButton Command3 
  44.       Caption         =   "Sub 2"
  45.       Height          =   555
  46.       Index           =   1
  47.       Left            =   1560
  48.       TabIndex        =   2
  49.       Top             =   1455
  50.       Width           =   1575
  51.    End
  52.    Begin Label ret 
  53.       BackStyle       =   0  'Transparent
  54.       BorderStyle     =   1  'Fixed Single
  55.       Caption         =   "Label3"
  56.       DataField       =   "Name"
  57.       DataSource      =   "BankCtrl"
  58.       Height          =   240
  59.       Left            =   2640
  60.       TabIndex        =   6
  61.       Top             =   2400
  62.       Width           =   1215
  63.    End
  64.    Begin Label Label2 
  65.       Alignment       =   1  'Right Justify
  66.       BackStyle       =   0  'Transparent
  67.       Caption         =   "Form2 returned:"
  68.       Height          =   240
  69.       Left            =   540
  70.       TabIndex        =   5
  71.       Top             =   2400
  72.       Width           =   1815
  73.    End
  74.    Begin Label Label1 
  75.       Alignment       =   1  'Right Justify
  76.       BackStyle       =   0  'Transparent
  77.       Caption         =   "Enter Arg:"
  78.       Height          =   240
  79.       Left            =   1125
  80.       TabIndex        =   4
  81.       Top             =   405
  82.       Width           =   1035
  83.    End
  84. End
  85. Option Explicit
  86.  
  87. Sub Command3_Click (index As Integer)
  88.  
  89.     Load form2
  90.  
  91.     Select Case index
  92.         Case 0:      ' call Sub1 in form2 with argument arg
  93.             Call dispatch1(form2, "Sub1", arg)
  94.  
  95.         Case 1:      ' call Sub2 in form2 with argument arg
  96.             Call dispatch1(form2, "Sub2", arg)
  97.         Case 2:
  98.             End
  99.     End Select
  100.  
  101.     ' wait until dispatched sub returns a value
  102.     Call dispatchWait
  103.  
  104.     ' show the returned value
  105.     ret = dispatchGetVal()
  106.  
  107.     
  108. End Sub
  109.  
  110.