Go Back   PCMech Forums > Help & Discussion > Web Design / Development

Need Some Help? Type Your Keywords Here:

Reply
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
Old 04-17-2007, 07:56 PM   #1
Member (9 bit)
 
TeenPcknowit's Avatar
 
Join Date: Mar 2004
Location: Pittsburgh,PA
Posts: 319
Send a message via AIM to TeenPcknowit
Visual Basic Discrepancy. HELP!

I downloaded the Free VB 2005 Express Edition of visual basic and started a project.

I am picking up on a project which I stopped working on in VB 6.0Ultimately, I NEED to use VB 2005 Express Edition to compile this application.

To give a brief premise, I am making an alarm clock which has been fully functional in VB 6.0.

Here is the bit of code (which works in VB 6.0) that I need help with working in 2005 Express Edition.

-------------------------------------------------------------------------------------------------------------------
(General Declarations)
Dim intTotalSeconds As Integer
-------------------------------------------------------------------------------------------------------------------
Private Sub cmdStart_Click()
Timer1.Enabled = True
End Sub
---------------------------------------------------------------------------------------------------
Private Sub Timer1_Timer()
'Compute time and format display
intTotalSeconds = intTotalSeconds + 1
Minutes = Format(intTotalSeconds \ 60, "00")
Seconds = Format(intTotalSeconds Mod 60, "00")
lblClock.Text = Minutes & ":" & Seconds
End Sub


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Problem is...I cannot (to my knowledge) declare a variable in general declarations in VB 2005 Express Edition! Please Help.

The only other thing that is not true for both sets of code in each VB version is:

"Private Sub timSleep_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles timSleep.Tick"

Is the private sub statement in VB 2005.

Last edited by TeenPcknowit; 04-17-2007 at 08:15 PM.
TeenPcknowit is offline   Reply With Quote
Old 04-17-2007, 08:36 PM   #2
Member (9 bit)
 
TeenPcknowit's Avatar
 
Join Date: Mar 2004
Location: Pittsburgh,PA
Posts: 319
Send a message via AIM to TeenPcknowit
Good news!
I placed the declaration under the:
Public Class FrontEnd

(as I had tried before)

Then I realizsed that I was operating on a _tick event in VB 2005...as opposed to the _Timer that was default in VB 6.0.

:]

Foolish me.
TeenPcknowit is offline   Reply With Quote
Old 04-17-2007, 10:47 PM   #3
Come in Ray...
 
faulkner132's Avatar
 
Join Date: Sep 2004
Posts: 1,668
Quote:
Originally Posted by TeenPcknowit
Problem is...I cannot (to my knowledge) declare a variable in general declarations in VB 2005 Express Edition! Please Help.
For the same effect, you can use a Module. Just put a public declaration inside the Module open and close:

Public intMyInt as Integer
Public strMyString as String
faulkner132 is offline   Reply With Quote
Reply

Bookmarks

Still Need Help? Type Your Keywords Here:


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

BB code is On
Smilies are On
[IMG] code is On
HTML code is On
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Visual Basic Code cuzzzzzz Web Design / Development 4 02-20-2007 07:54 PM
Visual Basic compatability question waiting Software Discussion & Support 3 11-07-2004 08:45 PM
HOW do i make a program i written with visual basic 6 run with out visual basic 6 jaxson Web Design / Development 6 07-08-2003 09:39 AM
Visual Studio .NET install MikeeX Web Design / Development 19 09-27-2002 06:16 PM
scripts or visual basic or perl ? jchoy Web Design / Development 4 06-07-2002 08:43 AM


All times are GMT -5. The time now is 07:28 AM.
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2012, vBulletin Solutions, Inc.
SEO by vBSEO 3.6.0 PL2