home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / VISUAL_B / CODIGO_2 / STR_PLUS / TOKENS.FRM (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1994-07-19  |  2.6 KB  |  74 lines

  1. VERSION 2.00
  2. Begin Form Tokens 
  3.    BackColor       =   &H00C0C0C0&
  4.    BorderStyle     =   3  'Fixed Double
  5.    Caption         =   "Tokens"
  6.    ClientHeight    =   5460
  7.    ClientLeft      =   1095
  8.    ClientTop       =   1485
  9.    ClientWidth     =   7590
  10.    ControlBox      =   0   'False
  11.    Height          =   5865
  12.    Left            =   1035
  13.    LinkTopic       =   "Form2"
  14.    ScaleHeight     =   5460
  15.    ScaleWidth      =   7590
  16.    Top             =   1140
  17.    Width           =   7710
  18.    Begin CommandButton Command1 
  19.       BackColor       =   &H00C0C0C0&
  20.       Caption         =   "O &K A Y"
  21.       Height          =   375
  22.       Left            =   1800
  23.       TabIndex        =   1
  24.       Top             =   4800
  25.       Width           =   3975
  26.    End
  27.    Begin Label Label1 
  28.       Alignment       =   2  'Center
  29.       BackStyle       =   0  'Transparent
  30.       Caption         =   "Label1"
  31.       ForeColor       =   &H00000080&
  32.       Height          =   1335
  33.       Left            =   840
  34.       TabIndex        =   0
  35.       Top             =   3360
  36.       Width           =   5895
  37.    End
  38. Dim TheseAnimals$()
  39. Dim AnimalCount As Integer
  40. Dim TheseFruit$()
  41. Dim FruitCount As Integer
  42. Sub Command1_Click ()
  43.     Unload Me
  44. End Sub
  45. Sub Form_Load ()
  46.     FormCenterScreen Me
  47.     DataAnimals$ = "cat,dog,bat,aardvark,frog,elephant"
  48.     'TheseAnimals$() was declared as an open array in the 'general' procedure
  49.     'DataAnimals$ is the string with the data elements
  50.     'AnimalCount will contain the total count of elements upon completion
  51.     ReadData TheseAnimals$(), DataAnimals$, AnimalCount
  52.     'the elements are printed in the Paint event
  53.     SortArray TheseAnimals$(), LBound(TheseAnimals$), UBound(TheseAnimals$)
  54.     DataFruit$ = "banana,apple,cherry,date"
  55.     ReadData TheseFruit$(), DataFruit$, FruitCount
  56.     SortArray TheseFruit$(), LBound(TheseFruit$), UBound(TheseFruit$)
  57.     nl$ = Chr$(13) + Chr$(10)
  58.     msg$ = "These two lists were read as Data in a very similar" + nl$
  59.     msg$ = msg$ + "manner to the old BASIC Data/Read statements.  This" + nl$
  60.     msg$ = msg$ + "is accomplished by FIRST declaring the array with an open" + nl$
  61.     msg$ = msg$ + "dimension, e.g., dim Array$().  Then, use the ReadData Sub" + nl$
  62.     msg$ = msg$ + "(which uses the StrPlus.DLL GetToken Sub) to actually read" + nl$
  63.     msg$ = msg$ + "each item into the array."
  64.     label1.Caption = msg$
  65.     Screen.MousePointer = 0
  66. End Sub
  67. Sub Form_Paint ()
  68.     DoForm3D Me, sunken, 2, 5
  69.     Print
  70.     For x = 1 To AnimalCount: Print , TheseAnimals$(x): Next
  71.     Print : Print
  72.     For x = 1 To FruitCount: Print , TheseFruit$(x): Next
  73. End Sub
  74.