![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#11 |
|
I eat cake for breakfast.
![]() ![]() ![]() ![]() Join Date: Jul 2004
Location: In my box.
Posts: 4,434
Rep Power: 9
![]() |
You're declaring your variable inside the function. Every time you call the function, the variable intNumber is created, incremented and destroyed. You can work around this in one of two ways: you can use a global variable, which is created when the application starts and destroyed on exit, and declared outside of any function (usually at the top of Form or Module code), or you can declare the variable as static, which will tell it to retain its value even after the function finishes:
Static intNumber As Integer |
|
|
|
|
|
#12 |
|
Newbie
Join Date: Nov 2005
Posts: 5
Rep Power: 0
![]() |
So like:
Dim intNumber As Integer Private Sub btnClick_Click() intNumber = intNumber + 1 lblCount.Caption = "Count: " & intNumber End Sub Edit: YES!! It works!! Well it's the end of the night for me, I'll be back soon!! Thanks!! |
|
|
|
|
|
#13 |
|
Man Bear Pig Hunter
Join Date: Jul 2005
Location: NorCal, USA
Posts: 295
Rep Power: 4
![]() |
12 Post for something that counts when you press a button....only in VB
|
|
|
|
|
|
#14 | |
|
Newbie
Join Date: Nov 2005
Posts: 5
Rep Power: 0
![]() |
Okay, lost again. I posted this in the online course bullitin too, but it seems you guys respond faster.
![]() Quote:
|
|
|
|
|
|
|
#15 |
|
Expert Programmer
|
If I may comment, why in the **** would any school waste there time teaching people how to program in visual basic? It did nothing but mess my mind up, back in the day that is
. Could someone explain the purpose(please don't say well there are a lot of visual basic programmers needed). Its pathetic to use visual basic to write any program in my OPINION.(not refering to .NET)
__________________
"When in Rome, Do as the Romans Do" "Beauty is in the eye of the BEER holder" "Save your breath your going to need it for your blow up doll later" SearchLores.org |
|
|
|
|
|
#16 | |
|
The Supreme Ruler
![]() Join Date: May 2004
Location: Houston
Posts: 1,476
Rep Power: 6
![]() |
Quote:
__________________
"Every gun that is made, every warship launched, every rocket signifies, in the final sense, a theft from those who hunger and are not fed, from those who are cold and are not clothed. The world in arms is not spending money alone. It is spending the sweat of its laborers, the genius of its scientists, the hopes of its children." - Dwight D. Eisenhower |
|
|
|
|
|
|
#17 |
|
Expert Programmer
|
Yes that would be a reason to teach 'Visual Basic', but not school. Teaching languages in school is for knowledge of languages used in everyday programming jobs. Teaching a friend visual basic, i would have to agree with you. But as far as teaching them it, to send them out into the real world thinking they know something in my OPINION is messed up.
__________________
"When in Rome, Do as the Romans Do" "Beauty is in the eye of the BEER holder" "Save your breath your going to need it for your blow up doll later" SearchLores.org |
|
|
|
|
|
#18 |
|
Expert Programmer
|
I don't know about Visual Basic, but at my school they start off teaching Scheme (a form of Lisp) with a custom API designed by the authors of the book they use. This is a good language choice because it teaches not only class abstraction (like Java) but also functional and syntactic abstraction (for example, you can pass a method as a parameter to another method, or redefine the + symbol). In my opinion, abstraction may be the most important thing to understand for any form of programming, so this is a good choice. Of course, it is not really useful for anything but understanding concepts.
|
|
|
|
|
|
#19 | |
|
SEXY SHOELESS GOD OF WAR!
![]() Join Date: Jun 2005
Location: Wet west coast of Canada
Posts: 1,183
Rep Power: 5
![]() |
Quote:
As a prototyping tool, VB is one of the languages of choice, if not the language. It's just so damn easy and quick to slap something together that would otherwise take a good deal longer. When you sit down with a client, and start whipping up UIs for them, and adding a bit of code to connect to their database so they can see what's happening, they want to see results right away. Having these skills lets you give them that. Then there's also the fact that many (mainly trivial) applications are not processor intensive. When your program spends 99.99% of its time waiting for the user to press a key or move the mouse, performance really isn't an issue. Size still is, but all the .NET languages compile down fairly small, thanks to the .NET framework. I agree wholeheartedly that many larger real-world applications cannot be written in VB and expected to meet performance requirements. I also agree that VB allows for lazy coding practices, what with the autoformatting and 'intellisense' thing going on. Still, I believe it's a language that definitely has its place in the industry, and as a teaching tool, what Mjordan2nd said is hard to overstress. Seeing immediate or short-term success is a strong motivating factor in learning (or any endeavor, for that matter). Why do you think one of the major factors of project success is having small milestones/early deliverables? It keeps the team motivated.
__________________
And once again, Probability proves itself willing to sneak into a back alley and service Drama as would a copper-piece harlot. - Vaarsuvius, Order of the Stick |
|
|
|
|
|
|
#20 |
|
Expert Programmer
|
@lectricpharaoh: I would agree with you now that we are not referring to .NET lol. If you are that into VB .NET (for RAD and Simplicity) I highly recommend (in opinion) you drop VB and take up C#.
![]()
__________________
"When in Rome, Do as the Romans Do" "Beauty is in the eye of the BEER holder" "Save your breath your going to need it for your blow up doll later" SearchLores.org |
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|