Results 1 to 8 of 8

Thread: Quicky Programming ?

  1. #1
    FLAC IntellaWorks's Avatar
    Join Date
    Jun 2004
    Location
    NH
    Posts
    1,173

    Quicky Programming ?

    Argh I was wondering if you guys could help me out here. I've ben stumbling over this code for a few hours and I'm willing to bet one of you have the anwser. Any help would be great !

    ok, I'm using VB.Net and I for the life of me cannot convert this vb6 code:

    Code:
    Sub timeout(seconds As Double)
    Dim total As Double
    Dim current As Double
    Dim X As Double
    
    X = Timer
    
    Do
    DoEvents
    current = Timer
    total = current - X
    Loop Until total > seconds
    
    
    
    End Sub
    Progress [I will seriously never be done!]
    Via EPIA MII
    512MB RAM
    OEM GPS (embedded)
    nLite WinXP pro on
    1GB Extreme III CF card
    Carnetix 1260 startup/ DC-DC regulator
    Software: Still, re-Writing my existing front end in .Net

  2. #2
    Newbie
    Join Date
    Mar 2005
    Location
    CT
    Posts
    6
    Quote Originally Posted by IntellaWorks
    Argh I was wondering if you guys could help me out here. I've ben stumbling over this code for a few hours and I'm willing to bet one of you have the anwser. Any help would be great !

    ok, I'm using VB.Net and I for the life of me cannot convert this vb6 code:

    Code:
    Sub timeout(seconds As Double)
    Dim total As Double
    Dim current As Double
    Dim X As Double
    
    X = Timer
    
    Do
    DoEvents
    current = Timer
    total = current - X
    Loop Until total > seconds
    
    
    
    End Sub
    What is "Timer" ???. Don't see it declared . Are you just trying to loop for a certain amout of time and still process events ?

  3. #3
    My man uses Levitra. Peoples's Avatar
    Join Date
    Dec 2004
    Location
    Maryland
    Posts
    2,024
    VWmike, if your not familiar with VB6 then dont try to answer it....timer is the current cpu clock time
    PC Components:
    Lilliput; XPC/FLEX mobo; 1.7 ghz P4 Mobile;512 DDR; 160 gb HDD; opus 150; slot usb dvd-rw
    My work log

  4. #4
    My man uses Levitra. Peoples's Avatar
    Join Date
    Dec 2004
    Location
    Maryland
    Posts
    2,024
    i think this is close

    Imports System
    Imports System.Threading

    Public Class Form1
    Inherits System.Windows.Forms.Form

    Sub timeout(ByVal seconds As Double)
    Thread.Sleep(seconds * 1000)
    End Sub

    End Class
    PC Components:
    Lilliput; XPC/FLEX mobo; 1.7 ghz P4 Mobile;512 DDR; 160 gb HDD; opus 150; slot usb dvd-rw
    My work log

  5. #5
    FLAC IntellaWorks's Avatar
    Join Date
    Jun 2004
    Location
    NH
    Posts
    1,173

    .

    nope :-\ grrrrrr this is such an easy thing
    Progress [I will seriously never be done!]
    Via EPIA MII
    512MB RAM
    OEM GPS (embedded)
    nLite WinXP pro on
    1GB Extreme III CF card
    Carnetix 1260 startup/ DC-DC regulator
    Software: Still, re-Writing my existing front end in .Net

  6. #6
    My man uses Levitra. Peoples's Avatar
    Join Date
    Dec 2004
    Location
    Maryland
    Posts
    2,024
    here it is exactly

    Sub timeout(ByVal seconds As Double)
    Dim x, current, Total As Double
    x = Microsoft.VisualBasic.DateAndTime.Timer
    Do
    Application.DoEvents()
    current = Microsoft.VisualBasic.DateAndTime.Timer
    Total = current - x
    Loop Until Total > seconds
    End Sub
    PC Components:
    Lilliput; XPC/FLEX mobo; 1.7 ghz P4 Mobile;512 DDR; 160 gb HDD; opus 150; slot usb dvd-rw
    My work log

  7. #7
    FLAC IntellaWorks's Avatar
    Join Date
    Jun 2004
    Location
    NH
    Posts
    1,173

    awesome.

    Awesome.. thats where they hid the timer.... thanks a bunch !
    Progress [I will seriously never be done!]
    Via EPIA MII
    512MB RAM
    OEM GPS (embedded)
    nLite WinXP pro on
    1GB Extreme III CF card
    Carnetix 1260 startup/ DC-DC regulator
    Software: Still, re-Writing my existing front end in .Net

  8. #8
    My man uses Levitra. Peoples's Avatar
    Join Date
    Dec 2004
    Location
    Maryland
    Posts
    2,024
    no prob
    PC Components:
    Lilliput; XPC/FLEX mobo; 1.7 ghz P4 Mobile;512 DDR; 160 gb HDD; opus 150; slot usb dvd-rw
    My work log

Similar Threads

  1. Wanting to learn some programming, help me pick a language!
    By RS3RS in forum Software & Software Development
    Replies: 32
    Last Post: 10-15-2004, 05:38 PM
  2. C++: GUI Programming with >NET Framework
    By [iG] in forum Software & Software Development
    Replies: 3
    Last Post: 05-24-2004, 07:57 PM
  3. This may be more of a programming question.. but here goes
    By bklynkaos in forum General Hardware Discussion
    Replies: 1
    Last Post: 02-09-2004, 11:11 PM
  4. batch file programming LCD's
    By mosh in forum LCD/Display
    Replies: 6
    Last Post: 05-19-2002, 01:55 AM
  5. Need to start somewhere with Hardware programming
    By 168db in forum Software & Software Development
    Replies: 7
    Last Post: 01-11-2002, 09:35 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •