home *** CD-ROM | disk | FTP | other *** search
/ Programming Tool Box / SIMS_2.iso / vb_tools / vbabk / vba_stri.frm < prev   
Text File  |  1994-07-03  |  4KB  |  142 lines

  1. VERSION 2.00
  2. Begin Form VBA_STRINGS 
  3.    Caption         =   "String Functions"
  4.    ClientHeight    =   2280
  5.    ClientLeft      =   -15
  6.    ClientTop       =   840
  7.    ClientWidth     =   5280
  8.    Height          =   2685
  9.    Left            =   -75
  10.    LinkTopic       =   "Form1"
  11.    ScaleHeight     =   2280
  12.    ScaleWidth      =   5280
  13.    Top             =   495
  14.    Width           =   5400
  15.    Begin TextBox nth 
  16.       Height          =   285
  17.       Left            =   3720
  18.       TabIndex        =   10
  19.       Text            =   "2"
  20.       Top             =   1680
  21.       Width           =   375
  22.    End
  23.    Begin OptionButton Option1 
  24.       Caption         =   "nthCol($,%)"
  25.       Height          =   255
  26.       Index           =   4
  27.       Left            =   2160
  28.       TabIndex        =   9
  29.       Top             =   1800
  30.       Width           =   1455
  31.    End
  32.    Begin OptionButton Option1 
  33.       Caption         =   "nthRow($,%)"
  34.       Height          =   255
  35.       Index           =   3
  36.       Left            =   2160
  37.       TabIndex        =   8
  38.       Top             =   1560
  39.       Width           =   1455
  40.    End
  41.    Begin OptionButton Option1 
  42.       Caption         =   "Empty($)"
  43.       Height          =   255
  44.       Index           =   2
  45.       Left            =   120
  46.       TabIndex        =   7
  47.       Top             =   2040
  48.       Width           =   1215
  49.    End
  50.    Begin OptionButton Option1 
  51.       Caption         =   "AllTrim($)"
  52.       Height          =   255
  53.       Index           =   1
  54.       Left            =   120
  55.       TabIndex        =   6
  56.       Top             =   1800
  57.       Width           =   1215
  58.    End
  59.    Begin TextBox CountChar 
  60.       Height          =   285
  61.       Left            =   1680
  62.       TabIndex        =   5
  63.       Text            =   "?"
  64.       Top             =   1560
  65.       Width           =   255
  66.    End
  67.    Begin OptionButton Option1 
  68.       Caption         =   "CountStr($,$)"
  69.       Height          =   255
  70.       Index           =   0
  71.       Left            =   120
  72.       TabIndex        =   4
  73.       Top             =   1560
  74.       Width           =   1455
  75.    End
  76.    Begin TextBox OutputTxt 
  77.       Height          =   285
  78.       Left            =   720
  79.       TabIndex        =   3
  80.       Text            =   "Text2"
  81.       Top             =   1200
  82.       Width           =   4455
  83.    End
  84.    Begin TextBox InputTxt 
  85.       Height          =   975
  86.       Left            =   720
  87.       MultiLine       =   -1  'True
  88.       ScrollBars      =   2  'Vertical
  89.       TabIndex        =   2
  90.       Text            =   "Text1"
  91.       Top             =   120
  92.       Width           =   4455
  93.    End
  94.    Begin Label Label1 
  95.       AutoSize        =   -1  'True
  96.       Caption         =   "Output"
  97.       Height          =   195
  98.       Index           =   1
  99.       Left            =   120
  100.       TabIndex        =   1
  101.       Top             =   1200
  102.       Width           =   585
  103.    End
  104.    Begin Label Label1 
  105.       AutoSize        =   -1  'True
  106.       Caption         =   "Input:"
  107.       Height          =   195
  108.       Index           =   0
  109.       Left            =   120
  110.       TabIndex        =   0
  111.       Top             =   120
  112.       Width           =   510
  113.    End
  114. End
  115. Sub Form_Load ()
  116. t$ = Chr$(9)
  117. InputTxt = "     Row1" + t$ + "Cell2" + t$ + "Cell3" + t$ + "Cell4" + Chr(13) + Chr$(10) + "Row2" + Chr(13) + Chr$(10) + "Row3"
  118. End Sub
  119.  
  120. Sub Option1_Click (Index As Integer)
  121. Select Case Index
  122. Case 0
  123. OutputTxt = Format(CountStr(InputTxt, CountChar))
  124. Case 1
  125.     OutputTxt = AllTrim(InputTxt)
  126. Case 2
  127.     If Empty(InputTxt) Then
  128.         OutputTxt = "-1 (True) -- no signifcant text"
  129.     Else
  130.         OutputTxt = "0 (False) -- Characters/Numbers etc..."
  131.     End If
  132. Case 3
  133.  
  134.     OutputTxt = NthRow(InputTxt, Val(nth))
  135. Case 4
  136.     OutputTxt = NthCol(InputTxt, Val(nth))
  137.  
  138. End Select
  139.  
  140. End Sub
  141.  
  142.