home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / VISUAL_B / CODIGO_2 / XUDL / UDLDEMO.FRM (.txt) next >
Encoding:
Visual Basic Form  |  1993-08-14  |  3.9 KB  |  109 lines

  1. VERSION 2.00
  2. Begin Form frmXTALUDL_DEMO 
  3.    Caption         =   "XTALUDL Demo"
  4.    ClientHeight    =   1800
  5.    ClientLeft      =   1095
  6.    ClientTop       =   1485
  7.    ClientWidth     =   3420
  8.    Height          =   2205
  9.    Left            =   1035
  10.    LinkTopic       =   "Form1"
  11.    ScaleHeight     =   1800
  12.    ScaleWidth      =   3420
  13.    Top             =   1140
  14.    Width           =   3540
  15.    Begin TextBox txtXTALUDL_Status 
  16.       Height          =   300
  17.       Left            =   1890
  18.       TabIndex        =   1
  19.       Top             =   975
  20.       Width           =   1050
  21.    End
  22.    Begin CommandButton Command1 
  23.       Caption         =   "Update Report File"
  24.       Height          =   390
  25.       Left            =   660
  26.       TabIndex        =   0
  27.       Top             =   285
  28.       Width           =   2055
  29.    End
  30.    Begin Label Label2 
  31.       Caption         =   "(Status visible for demo)"
  32.       Height          =   270
  33.       Left            =   615
  34.       TabIndex        =   3
  35.       Top             =   1485
  36.       Width           =   2190
  37.    End
  38.    Begin Label Label1 
  39.       AutoSize        =   -1  'True
  40.       Caption         =   "XTALUDL Status:"
  41.       Height          =   195
  42.       Left            =   240
  43.       TabIndex        =   2
  44.       Top             =   1020
  45.       Width           =   1515
  46.    End
  47. Option Explicit
  48. ' XTAL User Defined Labels Demo
  49. ' Programmed by Robert J. Johnston, Burlingame, CA.
  50. ' Last Update 8/14/93
  51. ' XTALUDL.EXE
  52. ' Programmed by Robert J. Johnston, Burlingame, CA.
  53. ' Last Update 8/14/93
  54. Sub Command1_Click ()
  55.     Dim p As String
  56.     Dim x As Integer
  57.     ' I'm assuming that XTALUDL.EXE is in same directory
  58.     ' as your app.
  59.     p = app.Path
  60.     If Right$(p, 1) <> "\" Then
  61.        p = p & "\"
  62.     End If
  63.     p = p & "XTALUDL.EXE"
  64.     x = Shell(p, 1)         'XTALUDL form is beyond right edge of screen.
  65.     x = DoEvents()
  66.     AppActivate "XTALUDL"
  67.     SendKeys "I~"            'Initialize command
  68.     'Wait until initialization complete
  69.     txtXTALUDL_Status.LinkMode = 0
  70.     txtXTALUDL_Status.LinkTopic = "XTALUDL|form1"
  71.     txtXTALUDL_Status.LinkItem = "lblStatus"
  72.     txtXTALUDL_Status.LinkMode = 2
  73.     Do
  74.         txtXTALUDL_Status.LinkRequest
  75.     Loop Until txtXTALUDL_Status.Text = ""
  76.     '----------------------------------------------------
  77.     'The information between the lines is what you will
  78.     'have to create yourself based on information supplied
  79.     'by your users.
  80.     'First character is command:
  81.     SendKeys "Pf:\ha4qtest\x5.rpt~"  'full Path of report
  82.     SendKeys "L0.25~"                'Left margin
  83.     SendKeys "R0.25~"                'Right margin
  84.     SendKeys "T0.25~"                'Top margin
  85.     SendKeys "B0.25~"                'Bottom margin
  86.     SendKeys "W1.00~"                'label Width
  87.     SendKeys "H1.00~"                'label Height
  88.     SendKeys "Z0.50~"                'horiZontal Gap
  89.     SendKeys "V0.50~"                'Vertical gap
  90.     SendKeys "DD~"                   'Direction: D=DOWN A=ACROSS
  91.     '----------------------------------------------------
  92.     SendKeys "X~"                    'eXecute
  93.     ' Wait until report file is updated by XTALUDL
  94.     txtXTALUDL_Status.LinkMode = 0
  95.     txtXTALUDL_Status.LinkTopic = "XTALUDL|form1"
  96.     txtXTALUDL_Status.LinkItem = "lblStatus"
  97.     txtXTALUDL_Status.LinkMode = 2
  98.     Do
  99.         txtXTALUDL_Status.LinkRequest
  100.     Loop While txtXTALUDL_Status.Text = ""   'Holds error code. "0" if no error.
  101.     ' Unload XTALUDL.EXE"
  102.     AppActivate "XTALUDL"
  103.     SendKeys "U"                 'Unload command. This is
  104.                                  'the only command without
  105.                                  'a tilde ~. Infinite loop
  106.                                  'if you put one in.
  107.     ' Make sure to check txtXTALUDL_Status.text for error code.
  108. End Sub
  109.