Visual Basic Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreVisual Basic Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
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  
Old May 1st, 2008, 07:52 AM
IMaVBNoob's Avatar
IMaVBNoob IMaVBNoob is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2006
Posts: 64 IMaVBNoob User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 19 h 29 m 17 sec
Reputation Power: 3
Send a message via MSN to IMaVBNoob
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.

Reply With Quote
  #2  
Old May 1st, 2008, 11:11 AM
medialint's Avatar
medialint medialint is offline
spirit duplicator
Click here for more information.
 
Join Date: Apr 2004
Location: \\Firecrate\
Posts: 12,304 medialint User rank is General 24th Grade (Above 100000 Reputation Level)medialint User rank is General 24th Grade (Above 100000 Reputation Level)medialint User rank is General 24th Grade (Above 100000 Reputation Level)medialint User rank is General 24th Grade (Above 100000 Reputation Level)medialint User rank is General 24th Grade (Above 100000 Reputation Level)medialint User rank is General 24th Grade (Above 100000 Reputation Level)medialint User rank is General 24th Grade (Above 100000 Reputation Level)medialint User rank is General 24th Grade (Above 100000 Reputation Level)medialint User rank is General 24th Grade (Above 100000 Reputation Level)medialint User rank is General 24th Grade (Above 100000 Reputation Level)medialint User rank is General 24th Grade (Above 100000 Reputation Level)medialint User rank is General 24th Grade (Above 100000 Reputation Level)medialint User rank is General 24th Grade (Above 100000 Reputation Level)medialint User rank is General 24th Grade (Above 100000 Reputation Level)medialint User rank is General 24th Grade (Above 100000 Reputation Level)medialint User rank is General 24th Grade (Above 100000 Reputation Level)  Folding Points: 232775 Folding Title: Super Ultimate Folder - Level 1Folding Points: 232775 Folding Title: Super Ultimate Folder - Level 1Folding Points: 232775 Folding Title: Super Ultimate Folder - Level 1Folding Points: 232775 Folding Title: Super Ultimate Folder - Level 1Folding Points: 232775 Folding Title: Super Ultimate Folder - Level 1Folding Points: 232775 Folding Title: Super Ultimate Folder - Level 1
Time spent in forums: 4 Months 3 Weeks 6 h 50 m 9 sec
Reputation Power: 2575
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?
Comments on this post
IMaVBNoob agrees!
__________________
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.

Reply With Quote
  #3  
Old May 2nd, 2008, 03:10 AM
IMaVBNoob's Avatar
IMaVBNoob IMaVBNoob is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2006
Posts: 64 IMaVBNoob User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 19 h 29 m 17 sec
Reputation Power: 3
Send a message via MSN to IMaVBNoob
U r the man.....

Quote:
Originally Posted by medialint
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?


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

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreVisual Basic Programming > Problem when doublclicking a listbox


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway