#139709 - 2005-05-14 12:45 AM
Where is my logic wrong
|
Gargoyle
MM club member
Registered: 2004-03-09
Posts: 1597
Loc: Valley of the Sun (Arizona, US...
|
I am trying to read some very large log files and put them into a graphical interface to make it easier for the average tech to read them.
I am having a problem with the incrementation of my counter in the functions of Increase() and Decrease().
I am sure that I have my logic messed up somewhere but I just am not getting it. Please help.
Here is the code Code:
Break On Global $D[], $T[], $E[], $C[], $TE[], $BY, $count Dim $Input, $file, $read, $DT, $er[], $rb[]
;Later add text box to let user specify the file they want to read
$File = "Unity_TSP.txt" $Count = 0 $System = CreateObject("Kixtart.System")
;KD START
$Form = $System.Form() $Form.BackColor = 212,208,200 $Form.Height = 432 $Form.Left = 233 $Form.Text = "Error Log Reader" $Form.Top = 55 $Form.Width = 678
$Server = $Form.Controls.Label() $Server.BackColor = 212,208,200 $Server.Height = 23 $Server.Left = 105 $Server.Text = "" $Server.Top = 15 $Server.Width = 100
$Label3 = $Form.Controls.Label() $Label3.BackColor = 212,208,200 $Label3.Height = 23 $Label3.Left = 0 $Label3.Text = "Date" $Label3.Top = 45 $Label3.Width = 100
$Label4 = $Form.Controls.Label() $Label4.BackColor = 212,208,200 $Label4.Height = 23 $Label4.Left = 0 $Label4.Text = "Server Name" $Label4.Top = 15 $Label4.Width = 100
$Date = $Form.Controls.Label() $Date.BackColor = 212,208,200 $Date.Height = 23 $Date.Left = 105 $Date.Text = "" $Date.Top = 45 $Date.Width = 100
$Label6 = $Form.Controls.Label() $Label6.BackColor = 212,208,200 $Label6.Height = 23 $Label6.Left = 225 $Label6.Text = "Time" $Label6.Top = 45 $Label6.Width = 100
$Time = $Form.Controls.Label() $Time.BackColor = 212,208,200 $Time.Height = 23 $Time.Left = 330 $Time.Text = "" $Time.Top = 45 $Time.Width = 100
$Label8 = $Form.Controls.Label() $Label8.BackColor = 212,208,200 $Label8.Height = 23 $Label8.Left = 0 $Label8.Text = "Error Type" $Label8.Top = 75 $Label8.Width = 100
$LER = $Form.Controls.Label() $LER.BackColor = 212,208,200 $LER.Height = 23 $LER.Left = 105 $LER.Text = "" $LER.Top = 75 $LER.Width = 100
$Label10 = $Form.Controls.Label() $Label10.BackColor = 212,208,200 $Label10.Height = 23 $Label10.Left = 0 $Label10.Text = "Reported By:" $Label10.Top = 105 $Label10.Width = 100
$Reporter = $Form.Controls.Label() $Reporter.BackColor = 212,208,200 $Reporter.Height = 23 $Reporter.Left = 105 $Reporter.Text = "" $Reporter.Top = 105 $Reporter.Width = 100
$Label12 = $Form.Controls.Label() $Label12.BackColor = 212,208,200 $Label12.Height = 23 $Label12.Left = 0 $Label12.Text = "Error Message" $Label12.Top = 150 $Label12.Width = 100
$Record = $Form.Controls.Label() $Record.BackColor = 212,208,200 $Record.Height = 23 $Record.Left = 225 $Record.Top = 150 $Record.Width = 100 $Record.Text = ""
$EC = $Form.Controls.Label() $EC.BackColor = 212,208,200 $EC.Height = 178 $EC.Left = 15 $EC.Text = "" $EC.Top = 180 $EC.Width = 634
$Button1 = $Form.Controls.Button() $Button1.FontSize = 12 $Button1.Height = 23 $Button1.Left = 90 $Button1.Text = "<<" $Button1.Top = 375 $Button1.Width = 75 $Button1.OnClick = "Decrease($count)"
$Button2 = $Form.Controls.Button() $Button2.FontSize = 12 $Button2.Height = 23 $Button2.Left = 240 $Button2.Text = ">>" $Button2.Top = 375 $Button2.Width = 75 $Button2.OnClick = "Increase($count)"
$Button3 = $Form.Controls.Button() $Button3.Height = 23 $Button3.Left = 495 $Button3.Text = "Exit" $Button3.Top = 375 $Button3.Width = 75 $Button3.OnClick = "Cancel()"
;KD END
;Build Arrays. ;+++++++
Open(1,$file) $input = Readline(1) While @Error = 0 Redim Preserve $D[$count] Redim Preserve $T[$count] Redim Preserve $E[$count] Redim Preserve $C[$count] Redim Preserve $TE[$count] Redim Preserve $BY[$count] $read = Split($input," ") $DT = Split($read[0]," ") $Er = Split($read[1],".") $RB = Split($read[3],":") $D[$count] = $DT[0] $T[$count] = $DT[1] $E[$count] = $Er[1] $C[$count] = $read[2] $TE[$count] = $read[3] $BY[$count] = $RB[0] $count = $count +1 $input = Readline(1) Loop Close (1)
$count = 0 Update($count)
$Form.Show
While $Form.Visible $=Execute($Form.DoEvents()) Loop Exit 1
Function Update ($count) If $count = 0 $Button1.Enable = "False" Else $Button1.Enable = "True" EndIf If $Count = Ubound($TE) $Button2.Enable = "False" Else $Button2.Enable = "True" EndIf $Server.Text = $C[$count] $Date.Text = $D[$count] $Time.Text = $T[$count] $Reporter.Text = $BY[$count] $LER.Text = $E[$count] $EC.Text = $TE[$count] $Record.Text = "Record "+($count+1)+" of "+Ubound($TE) EndFunction
Function Increase($count) $count = $count+1 Update($count) EndFunction
Function Decrease($count) $count = $count-1 update($count) EndFunction
Function Cancel() Quit(1) EndFunction
Here is a sample input line from the file (it is a single line, broken here to prevent window scrolling) 2005-05-11 10:24:52 Daemon.Warning hcphxuvm00000 CiscoUnity_TSP: N/A: Cisco Unity-CM TSP device 4 (Cisco Unity port 1): Failed blind transfer to extension 74400. Busy tone detected. If this is a persistent problem, it may indicate a problem on the Cisco Unity and/or Cisco CallManager. Verify that transfers are working. For more information, click: http://www.CiscoUnitySupport.com/find.php
[Long line removed by NTDOC]
Edited by NTDOC (2005-05-14 01:20 AM)
|
Top
|
|
|
|
#139722 - 2005-05-16 06:30 PM
Re: Where is my logic wrong
|
NTDOC
Administrator
Registered: 2000-07-28
Posts: 11624
Loc: CA
|
From the Manual
Quote:
Remarks The Object object supports dynamic (expando) properties, or properties that can be added and removed while the script is running. These properties can have any name, including numbers. A name of a property that is a simple identifier can be written after a period that follows the object name, such as:
$Object = $System.Object()
; Add two expando properties, 'Name' and 'Age'
$Object.Name = "Fred" $Object.Age = 53
|
Top
|
|
|
|
#139725 - 2005-05-16 07:55 PM
Re: Where is my logic wrong
|
Gargoyle
MM club member
Registered: 2004-03-09
Posts: 1597
Loc: Valley of the Sun (Arizona, US...
|
Okay. Now I just have to play around a bit to see how to make it work for me.
Now onto another point...
In this same script I have several arrays, that I would like to be able to scan and build a combobox list from. I know that I could do a for each, but there is alot of repition within each of the array's. How would you suggest that I build a list that would only contain one instance of each type of item within the array.
For example the $C[] array holds the name of a server for each element.
I just am not sure of how I want to sort out and only get one instance from the array.
Here is the newest version of the code at this time.
Code:
Break On Global $D[], $T[], $E[], $C[], $TE[], $BY, $count Dim $Input, $file, $read, $DT, $er[], $rb[], $listing
$Count = 0 $System = CreateObject("Kixtart.System")
;KD START
$Form = $System.Form() $Form.BackColor = 212,208,200 $Form.Height = 432 $Form.Left = 233 $Form.Text = "Error Log Reader" $Form.Top = 55 $Form.Width = 678
$Server = $Form.Controls.Label() $Server.BackColor = 212,208,200 $Server.Height = 23 $Server.Left = 105 $Server.Text = "" $Server.Top = 15 $Server.Width = 200
$Label3 = $Form.Controls.Label() $Label3.BackColor = 212,208,200 $Label3.Height = 23 $Label3.Left = 0 $Label3.Text = "Date" $Label3.Top = 45 $Label3.Width = 100
$Label4 = $Form.Controls.Label() $Label4.BackColor = 212,208,200 $Label4.Height = 23 $Label4.Left = 0 $Label4.Text = "Server Name" $Label4.Top = 15 $Label4.Width = 100
$Date = $Form.Controls.Label() $Date.BackColor = 212,208,200 $Date.Height = 23 $Date.Left = 105 $Date.Text = "" $Date.Top = 45 $Date.Width = 100
$Label6 = $Form.Controls.Label() $Label6.BackColor = 212,208,200 $Label6.Height = 23 $Label6.Left = 225 $Label6.Text = "Time" $Label6.Top = 45 $Label6.Width = 100
$Time = $Form.Controls.Label() $Time.BackColor = 212,208,200 $Time.Height = 23 $Time.Left = 330 $Time.Text = "" $Time.Top = 45 $Time.Width = 100
$Label8 = $Form.Controls.Label() $Label8.BackColor = 212,208,200 $Label8.Height = 23 $Label8.Left = 0 $Label8.Text = "Error Type" $Label8.Top = 75 $Label8.Width = 100
$LER = $Form.Controls.Label() $LER.BackColor = 212,208,200 $LER.Height = 23 $LER.Left = 105 $LER.Text = "" $LER.Top = 75 $LER.Width = 100
$Label10 = $Form.Controls.Label() $Label10.BackColor = 212,208,200 $Label10.Height = 23 $Label10.Left = 0 $Label10.Text = "Reported By:" $Label10.Top = 105 $Label10.Width = 100
$Reporter = $Form.Controls.Label() $Reporter.BackColor = 212,208,200 $Reporter.Height = 23 $Reporter.Left = 105 $Reporter.Text = "" $Reporter.Top = 105 $Reporter.Width = 200
$Label12 = $Form.Controls.Label() $Label12.BackColor = 212,208,200 $Label12.Height = 23 $Label12.Left = 0 $Label12.Text = "Error Message" $Label12.Top = 225 $Label12.Width = 100
$Record = $Form.Controls.Label() $Record.BackColor = 212,208,200 $Record.Height = 23 $Record.Left = 345 $Record.Top = 375 $Record.Width = 100 $Record.Text = ""
$EC = $Form.Controls.Label() $EC.BackColor = 212,208,200 $EC.Height = 100 $EC.Left = 15 $EC.Text = "" $EC.Top = 255 $EC.Width = 634
$Button1 = $Form.Controls.Button() $Button1.FontSize = 12 $Button1.Height = 23 $Button1.Left = 90 $Button1.Text = "<<" $Button1.Top = 375 $Button1.Width = 75 $Button1.OnClick = "Decrease()"
$Button2 = $Form.Controls.Button() $Button2.FontSize = 12 $Button2.Height = 23 $Button2.Left = 240 $Button2.Text = ">>" $Button2.Top = 375 $Button2.Width = 75 $Button2.OnClick = "Increase()"
$Button3 = $Form.Controls.Button() $Button3.Height = 23 $Button3.Left = 495 $Button3.Text = "Exit" $Button3.Top = 375 $Button3.Width = 75 $Button3.OnClick = "Cancel()"
$DirList = $Form.Controls.ComboBox() $DirList.DropDownStyle = 2 $DirList.DropDownWidth = 156 $DirList.Height = 21 $DirList.Left = 495 $DirList.Sorted = "False" $DirList.Text = "" $DirList.Top = 15 $DirList.Width = 156 $DirList.OnSelectedIndexChanged = "Build()"
$Label14 = $Form.Controls.Label() $Label14.BackColor = 212,208,200 $Label14.Height = 19 $Label14.Left = 375 $Label14.Text = "Please select log file" $Label14.Top = 15 $Label14.Width = 113
$Label15 = $Form.Controls.Label() $Label15.BackColor = 212,208,200 $Label15.Height = 23 $Label15.Left = 255 $Label15.Text = "Search Criteria" $Label15.Top = 135 $Label15.Width = 100
$ComboBox2 = $Form.Controls.ComboBox() $ComboBox2.DropDownWidth = 121 $ComboBox2.Height = 21 $ComboBox2.Left = 105 $ComboBox2.Sorted = "False" $ComboBox2.Top = 180 $ComboBox2.Width = 121
$ComboBox3 = $Form.Controls.ComboBox() $ComboBox3.DropDownWidth = 121 $ComboBox3.Height = 21 $ComboBox3.Left = 345 $ComboBox3.Sorted = "False" $ComboBox3.Top = 180 $ComboBox3.Width = 121
$Label16 = $Form.Controls.Label() $Label16.BackColor = 212,208,200 $Label16.Height = 23 $Label16.Left = 0 $Label16.Text = "Server" $Label16.Top = 180 $Label16.Width = 100
$Label17 = $Form.Controls.Label() $Label17.BackColor = 212,208,200 $Label17.Height = 23 $Label17.Left = 240 $Label17.Text = "Error Type" $Label17.Top = 180 $Label17.Width = 100
$Label18 = $Form.Controls.Label() $Label18.BackColor = 212,208,200 $Label18.Height = 17 $Label18.Left = 465 $Label18.Text = "Reported By" $Label18.Top = 180 $Label18.Width = 81
$ComboBox4 = $Form.Controls.ComboBox() $ComboBox4.DropDownWidth = 121 $ComboBox4.Height = 21 $ComboBox4.Left = 550 $ComboBox4.Sorted = "False" $ComboBox4.Top = 180 $ComboBox4.Width = 121
;KD END
;Get log file from user Listing() $DirList.SelectedIndex = 0
$Form.Show
While $Form.Visible $=Execute($Form.DoEvents()) Loop Exit 1
Function Listing () $temp = Dir(@scriptdir+"\*.txt") While $temp <> "" and @error = 0 $DirList.AddItem($temp) $temp = Dir() Loop EndFunction
Function Build() ;Build Arrays. ;+++++++
Open(1,$DirList.Text) $input = Readline(1) While @Error = 0 Redim Preserve $D[$count] Redim Preserve $T[$count] Redim Preserve $E[$count] Redim Preserve $C[$count] Redim Preserve $TE[$count] Redim Preserve $BY[$count] $read = Split($input," ") $DT = Split($read[0]," ") $Er = Split($read[1],".") $RB = Split($read[3],":") $D[$count] = $DT[0] $T[$count] = $DT[1] $E[$count] = $Er[1] $C[$count] = $read[2] $TE[$count] = $read[3] $BY[$count] = $RB[0] $count = $count +1 $input = Readline(1) Loop Close (1)
$count = 0 Update()
EndFunction
Function Update () If $count = 0 $Button1.Enabled = "False" Else $Button1.Enabled = "True" EndIf If $Count = Ubound($TE) $Button2.Enabled = "False" Else $Button2.Enabled = "True" EndIf $Server.Text = $C[$count] $Date.Text = $D[$count] $Time.Text = $T[$count] $Reporter.Text = $BY[$count] $LER.Text = $E[$count] $EC.Text = $TE[$count] $Record.Text = "Record "+($count+1)+" of "+Ubound($TE) EndFunction
Function Increase() $count = $count+1 Update() EndFunction
Function Decrease() $count = $count-1 update() EndFunction
Function Cancel() Quit(1) EndFunction
_________________________
Today is the tomorrow you worried about yesterday.
|
Top
|
|
|
|
#139727 - 2005-05-19 10:39 PM
Re: Where is my logic wrong
|
Gargoyle
MM club member
Registered: 2004-03-09
Posts: 1597
Loc: Valley of the Sun (Arizona, US...
|
Well I got the issue with the sorting into combo fields figured out.
But now I am trying to build some filters that will sort throught the array's and only return the specified information to another array for display.
I have it doing one sort just fine (the Filter() UDF), but I am stumped on how to make it do multi filter process.
Code:
Break On SetOption(NoVarsinStrings, ON) SetOption(WrapatEOL, ON)
Global $D[], $T[], $E[], $C[], $TE[], $BY[], $count, $Flag Global $D1[], $T1[], $E1[], $C1[], $TE1[], $BY1[] Dim $Input, $file, $read, $DT, $er[], $rb[], $listing
$System = CreateObject("Kixtart.System")
;KD START
$Form = $System.Form() $Form.BackColor = 212,208,200 $Form.Height = 432 $Form.Left = 233 $Form.Text = "Error Log Reader" $Form.Top = 55 $Form.Width = 678
$Server = $Form.Controls.Label() $Server.BackColor = 212,208,200 $Server.Height = 23 $Server.Left = 105 $Server.Text = "" $Server.Top = 15 $Server.Width = 200
$Label3 = $Form.Controls.Label() $Label3.BackColor = 212,208,200 $Label3.Height = 23 $Label3.Left = 0 $Label3.Text = "Date" $Label3.Top = 45 $Label3.Width = 100
$Label4 = $Form.Controls.Label() $Label4.BackColor = 212,208,200 $Label4.Height = 23 $Label4.Left = 0 $Label4.Text = "Server Name" $Label4.Top = 15 $Label4.Width = 100
$Date = $Form.Controls.Label() $Date.BackColor = 212,208,200 $Date.Height = 23 $Date.Left = 105 $Date.Text = "" $Date.Top = 45 $Date.Width = 100
$Label6 = $Form.Controls.Label() $Label6.BackColor = 212,208,200 $Label6.Height = 23 $Label6.Left = 225 $Label6.Text = "Time" $Label6.Top = 45 $Label6.Width = 100
$Time = $Form.Controls.Label() $Time.BackColor = 212,208,200 $Time.Height = 23 $Time.Left = 330 $Time.Text = "" $Time.Top = 45 $Time.Width = 100
$Label8 = $Form.Controls.Label() $Label8.BackColor = 212,208,200 $Label8.Height = 23 $Label8.Left = 0 $Label8.Text = "Error Type" $Label8.Top = 75 $Label8.Width = 100
$LER = $Form.Controls.Label() $LER.BackColor = 212,208,200 $LER.Height = 23 $LER.Left = 105 $LER.Text = "" $LER.Top = 75 $LER.Width = 100
$Label10 = $Form.Controls.Label() $Label10.BackColor = 212,208,200 $Label10.Height = 23 $Label10.Left = 0 $Label10.Text = "Reported By:" $Label10.Top = 105 $Label10.Width = 100
$Reporter = $Form.Controls.Label() $Reporter.BackColor = 212,208,200 $Reporter.Height = 23 $Reporter.Left = 105 $Reporter.Text = "" $Reporter.Top = 105 $Reporter.Width = 200
$Label12 = $Form.Controls.Label() $Label12.BackColor = 212,208,200 $Label12.Height = 23 $Label12.Left = 0 $Label12.Text = "Error Message" $Label12.Top = 225 $Label12.Width = 100
$Record = $Form.Controls.Label() $Record.BackColor = 212,208,200 $Record.Height = 23 $Record.Left = 345 $Record.Top = 375 $Record.Width = 100 $Record.Text = ""
$EC = $Form.Controls.Label() $EC.BackColor = 212,208,200 $EC.Height = 100 $EC.Left = 15 $EC.Text = "" $EC.Top = 255 $EC.Width = 634
$Button1 = $Form.Controls.Button() $Button1.FontSize = 12 $Button1.Height = 23 $Button1.Left = 90 $Button1.Text = "<<" $Button1.Top = 375 $Button1.Width = 75 $Button1.OnClick = "Decrease()"
$Button2 = $Form.Controls.Button() $Button2.FontSize = 12 $Button2.Height = 23 $Button2.Left = 240 $Button2.Text = ">>" $Button2.Top = 375 $Button2.Width = 75 $Button2.OnClick = "Increase()"
$Button3 = $Form.Controls.Button() $Button3.Height = 23 $Button3.Left = 495 $Button3.Text = "Exit" $Button3.Top = 375 $Button3.Width = 75 $Button3.OnClick = "Cancel()"
$DirList = $Form.Controls.ComboBox() $DirList.DropDownStyle = 2 $DirList.DropDownWidth = 156 $DirList.Height = 21 $DirList.Left = 495 $DirList.Sorted = "False" $DirList.Text = "" $DirList.Top = 15 $DirList.Width = 156 $DirList.OnSelectedIndexChanged = "Build()"
$Label14 = $Form.Controls.Label() $Label14.BackColor = 212,208,200 $Label14.Height = 19 $Label14.Left = 375 $Label14.Text = "Please select log file" $Label14.Top = 15 $Label14.Width = 113
$Label15 = $Form.Controls.Label() $Label15.BackColor = 212,208,200 $Label15.Height = 23 $Label15.Left = 255 $Label15.Text = "Search Criteria" $Label15.Top = 135 $Label15.Width = 100
$ServSort = $Form.Controls.ComboBox() $ServSort.DropDownWidth = 121 $ServSort.Height = 21 $ServSort.Left = 105 $ServSort.Sorted = "False" $ServSort.Top = 180 $ServSort.Width = 121 $ServSort.OnSelectedIndexChanged = "Filter()"
$ErrorSort = $Form.Controls.ComboBox() $ErrorSort.DropDownWidth = 121 $ErrorSort.Height = 21 $ErrorSort.Left = 345 $ErrorSort.Sorted = "False" $ErrorSort.Top = 180 $ErrorSort.Width = 121 $ErrorSort.OnSelectedIndexChanged = "Filter()"
$Label16 = $Form.Controls.Label() $Label16.BackColor = 212,208,200 $Label16.Height = 23 $Label16.Left = 0 $Label16.Text = "Server" $Label16.Top = 180 $Label16.Width = 100
$Label17 = $Form.Controls.Label() $Label17.BackColor = 212,208,200 $Label17.Height = 23 $Label17.Left = 240 $Label17.Text = "Error Type" $Label17.Top = 180 $Label17.Width = 100
$Label18 = $Form.Controls.Label() $Label18.BackColor = 212,208,200 $Label18.Height = 17 $Label18.Left = 465 $Label18.Text = "Reported By" $Label18.Top = 180 $Label18.Width = 81
$ReportSort = $Form.Controls.ComboBox() $ReportSort.DropDownWidth = 121 $ReportSort.Height = 21 $ReportSort.Left = 550 $ReportSort.Sorted = "False" $ReportSort.Top = 180 $ReportSort.Width = 121 $ReportSort.SelectedIndexChanged = "Filter()"
;KD END
$Count = 0
Listing()
$ServSort.Additem("None",0) $ErrorSort.Additem("None",0) $ReportSort.Additem("None",0)
$DirList.SelectedIndex = -1 $ServSort.SelectedIndex = 0 $ErrorSort.SelectedIndex = 0 $ReportSort.SelectedIndex = 0
$Form.Show
While $Form.Visible $=Execute($Form.DoEvents()) Loop
Exit 1
; ;++++++++++++++++++++++++++++++++++++++++++++++++++++++ ; Functions ;++++++++++++++++++++++++++++++++++++++++++++++++++++++
Function Listing () $temp = Dir("k:\scripts\parsing\*.txt") While $temp <> "" and @ERROR = 0 $DirList.AddItem($temp) $temp = Dir() Loop EndFunction
;====================================================== Function Build()
Open(1,$DirList.Text) $input = ReadLine(1) While @ERROR = 0 ReDIM Preserve $D[$count] ReDIM Preserve $T[$count] ReDIM Preserve $E[$count] ReDIM Preserve $C[$count] ReDIM Preserve $TE[$count] ReDIM Preserve $BY[$count] $read = Split($input," ") $DT = Split($read[0]," ") $Er = Split($read[1],".") $RB = Split($read[3],":") $D[$count] = $DT[0] $T[$count] = $DT[1] $E[$count] = $Er[1] $C[$count] = $read[2] $TE[$count] = $read[3] $BY[$count] = $RB[0] $count = $count +1 $input = ReadLine(1) Loop Close (1)
$count = 0 Update() For Each $Name In $C Sort($ServSort, $Name) Next For Each $Name In $E Sort($ErrorSort, $Name) Next For Each $Name In $BY Sort($ReportSort, $Name) Next EndFunction
;====================================================== Function Sort($CtrlName, $Name)
$Exist = "False" For $lstIndex = 0 to $CtrlName.ListCount $CtrlName.ListIndex = $lstIndex If $CtrlName.Text = $Name $Exist = "True" Exit() EndIf Next If $Exist = "False" $CtrlName.AddItem ($Name) EndIf
EndFunction
;====================================================== Function Filter()
$Flag = "True" $Count = 0 $Count2 = 0 For Each $Server In $C If $ServSort.Text = $Server ReDIM Preserve $D1[$Count] ReDIM Preserve $T1[$Count] ReDIM Preserve $E1[$Count] ReDIM Preserve $C1[$count] ReDIM Preserve $TE1[$Count] ReDIM Preserve $BY1[$count] $D1[$Count] = $D[$Count2] $T1[$Count] = $T[$Count2] $E1[$Count] = $E[$Count2] $C1[$Count] = $C[$Count2] $TE1[$Count] = $TE[$Count2] $By1[$Count] = $BY[$Count2] $count = $count + 1 EndIf $Count2 = $Count2 + 1 Next $Count = 0 Update2 ()
EndFunction
;====================================================== Function Update () If $count = 0 $Button1.Enabled = "False" Else $Button1.Enabled = "True" EndIf If $Count = UBound($TE) $Button2.Enabled = "False" Else $Button2.Enabled = "True" EndIf
$Server.Text = $C[$count] $Date.Text = $D[$count] $Time.Text = $T[$count] $Reporter.Text = $BY[$count] $LER.Text = $E[$count] $EC.Text = $TE[$count] $Record.Text = "Record "+($count+1)+" of "+UBound($TE) EndFunction
;====================================================== Function Update2 ()
If $count = 0 $Button1.Enabled = "False" Else $Button1.Enabled = "True" EndIf If $Count = UBound($TE1) $Button2.Enabled = "False" Else $Button2.Enabled = "True" EndIf $Server.Text = $C1[$count] $Date.Text = $D1[$count] $Time.Text = $T1[$count] $Reporter.Text = $BY1[$count] $LER.Text = $E1[$count] $EC.Text = $TE1[$count] $Record.Text = "Record "+($count+1)+" of "+UBound($TE1) EndFunction
;====================================================== Function Increase()
$count = $count+1 If $Flag = "False" Update() Else Update2() EndIf EndFunction
;====================================================== Function Decrease()
$count = $count-1 If $Flag = "False" update() Else Update2() EndIf EndFunction
;====================================================== Function Cancel()
Quit(1) EndFunction
_________________________
Today is the tomorrow you worried about yesterday.
|
Top
|
|
|
|
#139728 - 2005-05-20 09:51 AM
Re: Where is my logic wrong
|
Richard H.
Administrator
Registered: 2000-01-24
Posts: 4946
Loc: Leatherhead, Surrey, UK
|
Code:
I have it doing one sort just fine (the Filter() UDF), but I am stumped on how to make it do multi filter process.
Provide a simple example of what you are tying to do. It doesn't need to be a full working script - you can use pseudo code if you like.
|
Top
|
|
|
|
Moderator: Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart
|
0 registered
and 918 anonymous users online.
|
|
|