home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Source Code / Visual Basic Source Code.iso / vbsource / wg_lib / strfrm.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1995-09-06  |  3.8 KB  |  135 lines

  1. VERSION 2.00
  2. Begin Form StrFrm 
  3.    BackColor       =   &H00C0C0C0&
  4.    Caption         =   "String Tests"
  5.    ClientHeight    =   3210
  6.    ClientLeft      =   2145
  7.    ClientTop       =   2025
  8.    ClientWidth     =   5160
  9.    Height          =   3615
  10.    Left            =   2085
  11.    LinkMode        =   1  'Source
  12.    LinkTopic       =   "Form1"
  13.    ScaleHeight     =   3210
  14.    ScaleWidth      =   5160
  15.    Top             =   1680
  16.    Width           =   5280
  17.    Begin CommandButton UpdCmd 
  18.       Caption         =   "Update"
  19.       Height          =   495
  20.       Left            =   3240
  21.       TabIndex        =   6
  22.       Top             =   2040
  23.       Width           =   1095
  24.    End
  25.    Begin Frame Frame1 
  26.       Caption         =   "String Type"
  27.       Height          =   1455
  28.       Left            =   840
  29.       TabIndex        =   2
  30.       Top             =   1440
  31.       Width           =   1575
  32.       Begin CheckBox Chk 
  33.          Caption         =   "IsStrAlNum"
  34.          Height          =   255
  35.          Index           =   3
  36.          Left            =   120
  37.          TabIndex        =   5
  38.          Top             =   1080
  39.          Width           =   1215
  40.       End
  41.       Begin CheckBox Chk 
  42.          Caption         =   "IsStrAlph"
  43.          Height          =   255
  44.          Index           =   2
  45.          Left            =   120
  46.          TabIndex        =   4
  47.          Top             =   720
  48.          Width           =   1095
  49.       End
  50.       Begin CheckBox Chk 
  51.          Caption         =   "IsStrText"
  52.          Height          =   255
  53.          Index           =   1
  54.          Left            =   120
  55.          TabIndex        =   3
  56.          Top             =   360
  57.          Width           =   1215
  58.       End
  59.    End
  60.    Begin TextBox Text2 
  61.       Height          =   375
  62.       Left            =   3000
  63.       TabIndex        =   8
  64.       Text            =   "def"
  65.       Top             =   720
  66.       Width           =   1935
  67.    End
  68.    Begin TextBox Text1 
  69.       Height          =   375
  70.       Left            =   360
  71.       TabIndex        =   0
  72.       Text            =   "Abdcefghi"
  73.       Top             =   720
  74.       Width           =   2415
  75.    End
  76.    Begin Label Label3 
  77.       BackColor       =   &H00C0C0C0&
  78.       Height          =   255
  79.       Left            =   3000
  80.       TabIndex        =   9
  81.       Top             =   1320
  82.       Width           =   1935
  83.    End
  84.    Begin Label Label2 
  85.       BackColor       =   &H00C0C0C0&
  86.       Caption         =   "INSTRI Find$:"
  87.       Height          =   255
  88.       Left            =   3000
  89.       TabIndex        =   7
  90.       Top             =   360
  91.       Width           =   1335
  92.    End
  93.    Begin Label Label1 
  94.       BackColor       =   &H00C0C0C0&
  95.       Caption         =   "Text String:"
  96.       Height          =   255
  97.       Left            =   360
  98.       TabIndex        =   1
  99.       Top             =   360
  100.       Width           =   1095
  101.    End
  102. defint a-z
  103. Sub Form_Paint ()
  104.     ConvexFrm StrFrm, 5
  105.     ConcaveCtl Text1, 3
  106.     ConcaveCtl Frame1, 3
  107.     ConcaveCtl Text1, 3
  108.     ConcaveCtl Text2, 3
  109.     ConvexCtl Label3, 3
  110. End Sub
  111. Sub UpdCmd_Click ()
  112.       
  113.     For x = 1 To 3
  114.         chk(x).value = 0
  115.     Next x
  116.     s$ = LTrim$(RTrim$(Text1.text))
  117.     If Len(s$) Then
  118.         If IsStrText(s$) Then chk(1).value = 1
  119.         If IsStrAlph(s$) Then chk(2).value = 1
  120.         If IsStrAlNum(s$) Then chk(3).value = 1
  121.         f$ = LTrim$(RTrim$(Text2.text))
  122.         If Len(f$) Then
  123.             j = instri(0, s$, f$)
  124.             If j Then
  125.                 Label3.Caption = "Find$ found at pos" + Str$(j)
  126.             Else
  127.                 Label3.Caption = "Not found"
  128.             End If
  129.         Else
  130.             Label3.Caption = "No FIND$"
  131.         End If
  132.     End If
  133.     Text1.SetFocus
  134. End Sub
  135.