473,396 Members | 1,843 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

keep a tally in Visual Basic 6

Hello,
I'm trying to keep a tally in visual basic 6.
Details of the case: I've created a random number function that produces a number between -3 to 3. and i'm generating a number for a 1000 times. I want to keep a tally so that I know how many times a number greater or equal to 0 was produced.
Oct 12 '11 #1
1 1850
Guido Geurs
767 Expert 512MB
Dim a variable for each number.
Just after the creation of the random number, add 1 to a variable.
after 1000 times, put the variales in a textbox.
Expand|Select|Wrap|Line Numbers
  1. Dim NMBRmin3 as integer
  2. Dim NMBRmin2 as integer
  3. ....
  4. .... 'code of creation number in variable with name  RANNMBR
  5. ...
  6. select case RANNMBR
  7. case -3
  8.    'Add count to counter NMBRmin3
  9.    NMBRmin3= NMBRmin3+1
  10. case -2   'Add count to counter NMBRmin2
  11.    NMBRmin2= NMBRmin2+1
  12. ....
  13. end select
  14. ....
  15. ...
  16.  
  17. 'after 1000 loops
  18. textbox1.text= "number -3 times = " & NMBRmin3 &  vbnewline & _
  19. "number -2 times = " & NMBRmin2 &  vbnewline & _
  20. .....
  21. ....
  22.  
  23.  
Oct 13 '11 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

10
by: John | last post by:
I have a problem, it's not with any code I have because... there is no code. When I run a blank visual basic 6 form, it opens up just fine. When I add a text box, a caption, and a button... it...
3
by: pix | last post by:
Hello, I would like to start learning Visual Basic, and I was wondering if there are any recomendations to any ebooks, or actual books for that matter. I have my eye on this book by John Smiley,...
2
by: AK | last post by:
I don't want any part of the previous discussion on Visual Basic versus Visual Basic.Net. My query is about using Visual Basic for Applications; and whether it is better to use Visual Basic 6 or...
5
by: john | last post by:
I searched http://www.sellsbrothers.com. and could not find anything about this subject. How do I make C# User Controls Visible to Visual Basic 6.0 Applications? Thanks, John
9
by: Jay Kim | last post by:
Hi, We're implementing a Windows application using Visual Basic .NET. One of the key features we need to implement is that we should be able to get the accurate byte offset of user selected...
4
by: LCAdeveloper | last post by:
I have had to move to Visual Studio.NET Pro. from Visual Basic 4.0 and am now starting to re-write our code. I was a bit surprised to find that Visual Basic.NET no longer supports fixed length...
3
by: Allen | last post by:
I have a CD Visual Basic .NET Resource Kit 1) I wonder if I should reinstall it now that I have VS2005. I still have VS2003 on the machine. 2) Any reason to keep VS2003 on the machine? ...
6
by: JimmyKoolPantz | last post by:
I have been given the task of converting a program from VFP (visual foxpro) to Visual Basic.net. My question is "Is it possible to generate a DBF file Dynamically(at runtime) using Visual...
0
by: monkeycool | last post by:
This is for my intro to computer programming class. Please help me solve these 2 assignments: For the following items, you are to write the source code solution to each problem using the...
97
by: Master Programmer | last post by:
An friend insider told me that VB is to be killled off within 18 months. I guess this makes sence now that C# is here. I believe it and am actualy surprised they ever even included it in VS 2003 in...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.