|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
|||||
|
|||||
|
Re: Visual Basic
Quote:
What do you mean by "sample code of cash registers"? Also, what edition and version of VB are you using? EE has a bunch of helpful controls. And how do you plan to store data about products? Like name, ID, price, etc. And what 'distribution' method are you going to do? LAN, DDE, multi form, what? All of this effects what you use and how you do it. |
|
#2
|
||||
|
||||
|
Quote:
|
|
#3
|
||||
|
||||
|
Can we see your code??? Or is it a secret?
|
|
#4
|
||||||
|
||||||
|
Re: Visual Basic
are you compileing your variables before you try and sum them or is it an after affect
ie. function sample(x,y,z,p,d,q) sum = x+Y+Z+P+D+Q or sum1 = x+y+z sum2 = P+D+Q Total = sum1 + sum2 i have found that doing inbetween steps like example 2 under each part of your program works better |
|
#5
|
|||||
|
|||||
|
Quote:
Use a text box, first of all. The Text property is the equivelent of Value.Are you using Quanity textboxes, too? say:
So: Code:
const RC_Price as currency = 500 'Sub type of variant const Bat_Price as currency = 100 dim RC_Quanity as long, RC_Total as Currency dim Bat_Quanity as long, Bat_Total as currency dim Total as currency private sub Form_Load () RC_Quanity = 0 Bat_Quanity = 0 Update end sub Public sub Update() RC_Total = RC_Price * RC_Quanity Bat_Total = Bat_Price * Bat_Quanity Total = RC_Total + Bat_Total tbRC_Quanity = RC_Quanity tbRC_Total = RC_Total lblRC_Price = RC_Price tbBat_Quanity = Bat_Quanity tbBat_Total = Bat_Total lblBat_Price = Bat_Price tbTotal = Total end sub |
|
#6
|
||||
|
||||
|
I agree with Astronouth7303 200% what are you doing using a picture box!!!???!!?!!?!!? If you don't want people to be able to change the value then even using a label would be better then a picture box!
|
|
#7
|
||||
|
||||
|
Re: Visual Basic
probably because he is using Print() so that he doesn't have to deal with linebreaks and the previous contents. however, i agree that a textbox is probably better here - the small amount of extra code is worth it.
i'd probably recommend a global variable to keep a running total in. |
|
#8
|
|||||
|
|||||
|
Re: Visual Basic
If you look at my code, I use variables for storing values and controls to display them. You could use the controls for storing values (VB handles conversions). But this introduces errors (possibly).
|
|
#9
|
|||||
|
|||||
|
Re: Visual Basic
I just found something out about VB: it's predictable!
lolmy brother (Bro) has been doing VC++ for a few months and has totally forgoten how to use VB, and I'm helping him make a control (Or: telling him he has to use "Not A" instead of "!A") |
|
#10
|
||||
|
||||
|
Re: Visual Basic
Quote:
P.S. VB gives me shivers. Go Java and C++. ![]() |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Help programming in Visual Basic | xxlshortys | Programming | 0 | 06-04-2003 08:54 |
| Visual Basic 6 Dashboard | LBK Rules | Programming | 1 | 22-01-2003 13:06 |
| Dashreader.dll: A Visual Basic .NET user control to read the dashboard port | Ameya | Programming | 4 | 12-01-2003 23:40 |
| Visual Basic - Drag and Drop | Gope | Programming | 11 | 06-01-2003 09:42 |
| Computer Graphics and Visual Basic Programing | Gope | General Forum | 0 | 26-10-2002 13:44 |