|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Get inside! Sample the range of functionality easily built with JMSL Library for Time Series Data Analysis, Heat Maps, Portfolio Optimization, Monte Carlo Simulation, Stock Price Charting and more. Download Now! |
|
#1
|
||||
|
||||
|
Problem when doublclicking a listbox
For some odd reason the second time i double click this list box "GetBulletin" ends up with a different result its like it skips the first character it finds and sets the next one to the variable .. when it is supposed to set the first one. any idea's???
Code:
Public Test As String
Public wtt As Integer
Public WD As String
Public Stest As String
Private Sub ListBox7_DoubleClick(ByVal sender As Object, ByVal e As System.EventArgs) Handles ListBox7.DoubleClick
WD = ""
Stest = ""
FindDate = ""
BrowserState = "PrevBulletin"
OpenHead = "Bulletin"
FindDate = ListBox7.SelectedItem.ToString
Zfinder(FindDate, "-")
FindDate = WD
FoundTime = Stest
FoundTime = Replace(FoundTime, " ", "", 1)
FoundTime = Replace(FoundTime, "AM", "", 1)
FoundTime = Replace(FoundTime, ":", "", 1)
Zfinder(FindDate, " ")
FindDate = WD
FoundDate = Stest
FoundDate = Replace(FoundDate, " ", "", 1)
FoundDate = Replace(FoundDate, "/", "", 1)
GetBulletin = FoundDate & FoundTime
WebBrowser1.Navigate("http://soulmagazine.freehostia.com/Data/" & GetBulletin & ".txt")
End Sub
and heres zfinder<--- this should be find i have used it many times in the past it is a function to find a chartacter in a string and set what is to the right of the character to a variable "WD" and to the left "Stest". i did not right this function my buddy did.. i put it here for reference purposes. Code:
Public Sub Zfinder(ByVal File As String, ByVal look As String)
On Error GoTo oppsaerror
Do Until Left(Test, 1) = look
wtt = wtt + 1
If wtt > 500 Then Exit Sub
Test = Right(File, wtt)
Loop
Stest = Right(Test, Len(Test) - 1)
On Error GoTo exb
If File = Test Then GoTo exb
WD = Left(File, Len(File) - Len(Test))
exb:
Exit Sub
oppsaerror:
Select Case Err.Number
Case 13
MsgBox("Error while using Zfinder - Type mismatch")
Case Else
MsgBox("Error while using Zfinder" & Err.Description, vbCritical)
End Select
Exit Sub
End Sub
Last edited by IMaVBNoob : May 1st, 2008 at 08:07 AM. |
|
#2
|
||||
|
||||
|
Offhand I see that you never reset wtt* anywhere so this just keeps getting bigger. I also don't see where var Test is ever assigned a value.
* which I guess stands for what the thing?
__________________
medialint.com "Energy has the opportunity to change the climate if it's done right." - Sen. John Ensign, R-Nev. (quoted out of context) Last edited by medialint : May 1st, 2008 at 11:13 AM. |
|
#3
|
||||
|
||||
|
U r the man.....
Quote:
I figured it out.. in vb2005 i have to set the var Test = "" first as in vb6 it doesnt have to be set first. and the wtt didnt have a value thanks a million man... i dont think i would have noticed that. and just remember i havent went to school for this you guys are teaching me....... lol |
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > Visual Basic Programming > Problem when doublclicking a listbox |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|