﻿Version=6.80
NumberOfForms=1
Form1=Form1
FormWidth=238
FormHeight=268
IconFile=
NumberOfDesktopIncludes=0
NumberOfDeviceIncludes=0
NumberOfObjects=0
NumberOfModules=0
Sub designer
addform(Form1,"Form1","",220,220,220)@
addlabel(form1,lblCount,140,20,75,25,"",192,192,192,0,0,0,True,True,9,False)@
addbutton(form1,btnCount,45,20,75,23,"Count",212,208,200,0,0,0,True,True,9)@
addtable(form1,Table1,45,60,125,190,"",245,245,245,0,0,0,True,True,9)@
End Sub
@EndOfDesignText@
Sub Globals
	'Declare the global variables here.

End Sub

Sub App_Start
	Form1.Show
	Table1.AddCol(cString,"Fruits",100)
	Table1.AddRow("Apples")
	Table1.AddRow("Oranges")
	Table1.AddRow("Oranges")
	Table1.AddRow("Oranges")
	Table1.AddRow("Apples")
	Table1.AddRow("Grapes")
	Table1.AddRow("Bananas")
	Table1.AddRow("Bananas")
End Sub

Sub btnCount_Click
	Dim i,n,txt
	
	Table1.TableSort("Fruits ASC")
	txt=Table1.Cell("Fruits",0)
	n=1
	For i=1 To Table1.RowCount-1
		If txt<>Table1.Cell("Fruits",i) then
			txt=Table1.Cell("Fruits",i)
			n=n+1
		End If
	Next
	Table1.TableSort("")
	lblCount.Text="N = "&n
End Sub