Go to Post Use sensors to collect data about the surrounding environment, then discard it and drive into walls. - Jared Russell [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Closed Thread
 
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 11-03-2004, 09:10
dddriveman's Avatar
dddriveman dddriveman is offline
Former Driver 1038, 979
AKA: Driveman
FRC #1038 (Thunderhawks)
Team Role: Alumni
 
Join Date: Feb 2003
Rookie Year: 2001
Location: Dayton
Posts: 142
dddriveman has a spectacular aura aboutdddriveman has a spectacular aura about
Send a message via AIM to dddriveman
Question Re: Visual Basic

Quote:
Originally Posted by Astronouth7303
I do lots o' VB. (just ask about MSCOMM.)

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.
I am just trying to click on commmand buttons that say Robot COntroller or Battery and they list the price in a picture box. I have all of that done but i cannot get the program to total all of the parts that i have selected becasue my variables will not carry over from the sub command for the command buttons when i press my total button. I am using vb6.0
__________________
"I'm sorry, after all he is just a wookie!"
  #2   Spotlight this post!  
Unread 11-03-2004, 09:45
CrashZero's Avatar
CrashZero CrashZero is offline
Computer Nerd
#1352 (Huskie Robotics)
Team Role: Programmer
 
Join Date: Mar 2004
Location: Stratford Northwestern
Posts: 44
CrashZero will become famous soon enoughCrashZero will become famous soon enough
Question Re: Visual Basic

Can we see your code??? Or is it a secret?
  #3   Spotlight this post!  
Unread 11-03-2004, 12:46
Greg Needel's Avatar Unsung FIRST Hero
Greg Needel Greg Needel is offline
REVving up for a new season
FRC #2848 (All-sparks)
Team Role: Engineer
 
Join Date: Jan 2002
Rookie Year: 2002
Location: Dallas, TX
Posts: 3,108
Greg Needel has a reputation beyond reputeGreg Needel has a reputation beyond reputeGreg Needel has a reputation beyond reputeGreg Needel has a reputation beyond reputeGreg Needel has a reputation beyond reputeGreg Needel has a reputation beyond reputeGreg Needel has a reputation beyond reputeGreg Needel has a reputation beyond reputeGreg Needel has a reputation beyond reputeGreg Needel has a reputation beyond reputeGreg Needel has a reputation beyond repute
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
  #4   Spotlight this post!  
Unread 11-03-2004, 14:12
Astronouth7303's Avatar
Astronouth7303 Astronouth7303 is offline
Why did I come back?
AKA: Jamie Bliss
FRC #4967 (That ONE Team)
Team Role: Mentor
 
Join Date: Jan 2004
Rookie Year: 2004
Location: Grand Rapids, MI
Posts: 2,071
Astronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud of
Exclamation Re: Visual Basic

Quote:
Originally Posted by dddriveman
I am just trying to click on commmand buttons that say Robot COntroller or Battery and they list the price in a picture box. I have all of that done but i cannot get the program to total all of the parts that i have selected becasue my variables will not carry over from the sub command for the command buttons when i press my total button. I am using vb6.0
PICTURE BOX?!?!?!?!? Use a text box, first of all. The Text property is the equivelent of Value.

Are you using Quanity textboxes, too?

say:
  • cbRC_Add as CommandButton
  • cbBat_Add as CommandButton
  • tbRC_Quanity as Textbox
  • lblRC_Total as Label
  • lblRC_Price as Label
  • tbBat_Quanity as Textbox
  • lblBat_Total as Label
  • lblBat_Price as Label
  • tbTotal as Label
These are the controls on your form.

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
Be sure to insert Event hadlers for the command buttons and text boxes (Check for correct type).
  #5   Spotlight this post!  
Unread 11-03-2004, 15:08
CrashZero's Avatar
CrashZero CrashZero is offline
Computer Nerd
#1352 (Huskie Robotics)
Team Role: Programmer
 
Join Date: Mar 2004
Location: Stratford Northwestern
Posts: 44
CrashZero will become famous soon enoughCrashZero will become famous soon enough
Cool Re: Visual Basic

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!
__________________
This is our world now... the world of the electron and the switch, the beauty of the baud. We make use of a service already existing without paying for what could be dirt-cheap if it wasn't run by profiteering gluttons, and you call us criminals. We explore... and you call us criminals. We seek after knowledge... and you call us criminals. We exist without skin color, without nationality, without religious bias... and you call us criminals. You build atomic bombs, you wage wars, you murder, cheat, and lie to us and try to make us believe it's for our own good, yet we're the criminals. Yes, I am a criminal. My crime is that of curiosity. My crime is that of judging people by what they say and think, not what they look like. My crime is that of outsmarting you, something that you will never forgive me for. I am a hacker, and this is my manifesto. You may stop me, but you can't stop us all...

quote from:

+++ The Mentor +++
  #6   Spotlight this post!  
Unread 17-03-2004, 10:36
deltacoder1020's Avatar
deltacoder1020 deltacoder1020 is offline
Computer Guy
AKA: Dav
#1020 (The Indiana Prank Monkeys)
Team Role: Programmer
 
Join Date: Jan 2004
Location: Muncie, Indiana
Posts: 340
deltacoder1020 has a spectacular aura aboutdeltacoder1020 has a spectacular aura about
Send a message via AIM to deltacoder1020
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.
__________________
Team 1020, the Indiana Prank Monkeys (www.team1020.org)
  #7   Spotlight this post!  
Unread 17-03-2004, 14:56
Astronouth7303's Avatar
Astronouth7303 Astronouth7303 is offline
Why did I come back?
AKA: Jamie Bliss
FRC #4967 (That ONE Team)
Team Role: Mentor
 
Join Date: Jan 2004
Rookie Year: 2004
Location: Grand Rapids, MI
Posts: 2,071
Astronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud of
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).
  #8   Spotlight this post!  
Unread 19-03-2004, 20:06
Astronouth7303's Avatar
Astronouth7303 Astronouth7303 is offline
Why did I come back?
AKA: Jamie Bliss
FRC #4967 (That ONE Team)
Team Role: Mentor
 
Join Date: Jan 2004
Rookie Year: 2004
Location: Grand Rapids, MI
Posts: 2,071
Astronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud of
Re: Visual Basic

I just found something out about VB: it's predictable! lol

my 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")
  #9   Spotlight this post!  
Unread 20-03-2004, 13:03
Ryan M. Ryan M. is offline
Programming User
FRC #1317 (Digital Fusion)
Team Role: Programmer
 
Join Date: Jan 2004
Rookie Year: 2004
Location: Ohio
Posts: 1,508
Ryan M. has much to be proud ofRyan M. has much to be proud ofRyan M. has much to be proud ofRyan M. has much to be proud ofRyan M. has much to be proud ofRyan M. has much to be proud ofRyan M. has much to be proud ofRyan M. has much to be proud ofRyan M. has much to be proud of
Re: Visual Basic

Quote:
Originally Posted by Astronouth7303
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).
Hardly any (hopefully none) professional programmers would do this. Not only do you introduce the possiblity of introducing errors, it is less clean and violates a lot of principles of programming, such as information hiding.

P.S. VB gives me shivers. Go Java and C++.
__________________

Closed Thread


Thread Tools
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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

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


All times are GMT -5. The time now is 15:43.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi