Not understanding what I'm doing wrong

Idk if I'm missing something
120 Replies
Unknown User
Unknown User3y ago
Message Not Public
Sign In & Join Server To View
pip
pip3y ago
int.Parse is trying to parse null
Unknown User
Unknown User3y ago
Message Not Public
Sign In & Join Server To View
pip
pip3y ago
Ha beat you
Kaoruko Waguri
Kaoruko WaguriOP3y ago
lmao
pip
pip3y ago
where's my prize
Unknown User
Unknown User3y ago
Message Not Public
Sign In & Join Server To View
pip
pip3y ago
Add some if statements for those inputs to make sure you're only int.Parse valid ints you can also use int.TryParse
Unknown User
Unknown User3y ago
Message Not Public
Sign In & Join Server To View
pip
pip3y ago
yo, fair tbh
Unknown User
Unknown User3y ago
Message Not Public
Sign In & Join Server To View
Kaoruko Waguri
Kaoruko WaguriOP3y ago
oh, but how do I make the combo box start with 0? when i start the program
Unknown User
Unknown User3y ago
Message Not Public
Sign In & Join Server To View
Kaoruko Waguri
Kaoruko WaguriOP3y ago
how
Unknown User
Unknown User3y ago
Message Not Public
Sign In & Join Server To View
Kaoruko Waguri
Kaoruko WaguriOP3y ago
yeah
Unknown User
Unknown User3y ago
Message Not Public
Sign In & Join Server To View
Kaoruko Waguri
Kaoruko WaguriOP3y ago
this one?
Unknown User
Unknown User3y ago
Message Not Public
Sign In & Join Server To View
Kaoruko Waguri
Kaoruko WaguriOP3y ago
okay yeah it worked thanks
pip
pip3y ago
BOOM
Unknown User
Unknown User3y ago
Message Not Public
Sign In & Join Server To View
pip
pip3y ago
it's the cinnamon toast crunch meme from 2002 "what the cinnamon toast fuck is this"
Unknown User
Unknown User3y ago
Message Not Public
Sign In & Join Server To View
Kaoruko Waguri
Kaoruko WaguriOP3y ago
do you guys know how I can clear the radio box?
Unknown User
Unknown User3y ago
Message Not Public
Sign In & Join Server To View
Kaoruko Waguri
Kaoruko WaguriOP3y ago
yeah
Unknown User
Unknown User3y ago
Message Not Public
Sign In & Join Server To View
Kaoruko Waguri
Kaoruko WaguriOP3y ago
still trying to figure out how
Unknown User
Unknown User3y ago
Message Not Public
Sign In & Join Server To View
Kaoruko Waguri
Kaoruko WaguriOP3y ago
lets say I picked smalled but I changed my mind so I clicked clear the only thing clearing is the text box and the combo box but I want to uncheck the radio buttons to
Unknown User
Unknown User3y ago
Message Not Public
Sign In & Join Server To View
Kaoruko Waguri
Kaoruko WaguriOP3y ago
under clear button right
Unknown User
Unknown User3y ago
Message Not Public
Sign In & Join Server To View
Kaoruko Waguri
Kaoruko WaguriOP3y ago
?
Unknown User
Unknown User3y ago
Message Not Public
Sign In & Join Server To View
Kaoruko Waguri
Kaoruko WaguriOP3y ago
yeah idk why it didn't change
Unknown User
Unknown User3y ago
Message Not Public
Sign In & Join Server To View
Kaoruko Waguri
Kaoruko WaguriOP3y ago
oh
Unknown User
Unknown User3y ago
Message Not Public
Sign In & Join Server To View
Kaoruko Waguri
Kaoruko WaguriOP3y ago
one more problem
Unknown User
Unknown User3y ago
Message Not Public
Sign In & Join Server To View
Kaoruko Waguri
Kaoruko WaguriOP3y ago
that's right now I didn't do anything right
Unknown User
Unknown User3y ago
Message Not Public
Sign In & Join Server To View
Kaoruko Waguri
Kaoruko WaguriOP3y ago
if you look at timbits right it shows 10 pack for 209 2.09
Unknown User
Unknown User3y ago
Message Not Public
Sign In & Join Server To View
Kaoruko Waguri
Kaoruko WaguriOP3y ago
Kaoruko Waguri
Kaoruko WaguriOP3y ago
once I clicked calculate the tibits only shows the price idk what I'm doing wrong
Unknown User
Unknown User3y ago
Message Not Public
Sign In & Join Server To View
pip
pip3y ago
when you click calculate it's clearing some of the text from the buttons show us the calc function again?
Kaoruko Waguri
Kaoruko WaguriOP3y ago
Unknown User
Unknown User3y ago
Message Not Public
Sign In & Join Server To View
pip
pip3y ago
you're setting the text to the packs at the top, you can just delete that code i think or comment it out
Unknown User
Unknown User3y ago
Message Not Public
Sign In & Join Server To View
Kaoruko Waguri
Kaoruko WaguriOP3y ago
which one? the const double?
Unknown User
Unknown User3y ago
Message Not Public
Sign In & Join Server To View
Kaoruko Waguri
Kaoruko WaguriOP3y ago
oh
pip
pip3y ago
yup
Kaoruko Waguri
Kaoruko WaguriOP3y ago
thanks
Unknown User
Unknown User3y ago
Message Not Public
Sign In & Join Server To View
Kaoruko Waguri
Kaoruko WaguriOP3y ago
it worked
Unknown User
Unknown User3y ago
Message Not Public
Sign In & Join Server To View
Kaoruko Waguri
Kaoruko WaguriOP3y ago
quick question for the price for the timbits I'm using a class level right
Unknown User
Unknown User3y ago
Message Not Public
Sign In & Join Server To View
Kaoruko Waguri
Kaoruko WaguriOP3y ago
Unknown User
Unknown User3y ago
Message Not Public
Sign In & Join Server To View
Kaoruko Waguri
Kaoruko WaguriOP3y ago
like that right
Unknown User
Unknown User3y ago
Message Not Public
Sign In & Join Server To View
pip
pip3y ago
ye looks good to me
Kaoruko Waguri
Kaoruko WaguriOP3y ago
I'm using it correctly?
pip
pip3y ago
ye it looks good
Kaoruko Waguri
Kaoruko WaguriOP3y ago
then this would be useless
Kaoruko Waguri
Kaoruko WaguriOP3y ago
pip
pip3y ago
well no, you can define those at the class level too, then just do price = Pack_10; or something
Kaoruko Waguri
Kaoruko WaguriOP3y ago
Kaoruko Waguri
Kaoruko WaguriOP3y ago
being underlined
Unknown User
Unknown User3y ago
Message Not Public
Sign In & Join Server To View
Kaoruko Waguri
Kaoruko WaguriOP3y ago
pip
pip3y ago
right, the const double Pack_10 is being defined locally, inside of the function. move those to the class instead
Unknown User
Unknown User3y ago
Message Not Public
Sign In & Join Server To View
Kaoruko Waguri
Kaoruko WaguriOP3y ago
beside price I would just put Pack_10?
Kaoruko Waguri
Kaoruko WaguriOP3y ago
or int Pack_10?
pip
pip3y ago
tbh, you can just change it back to how you had it. what you had works tbh because idk how your app is structured i'm making a few guesses
Unknown User
Unknown User3y ago
Message Not Public
Sign In & Join Server To View
pip
pip3y ago
alright peace out @niko
Kaoruko Waguri
Kaoruko WaguriOP3y ago
thanks and bye
Unknown User
Unknown User3y ago
Message Not Public
Sign In & Join Server To View
Kaoruko Waguri
Kaoruko WaguriOP3y ago
I'm not sure if this is gonna help but this is like the half of the code for timbits
pip
pip3y ago
well compile your program and see if it works what you had before worked right? before we started messing with const double Pack_10, etc
Kaoruko Waguri
Kaoruko WaguriOP3y ago
kk OHHHHHHHHHHHHH I forgot to add it maybe
Kaoruko Waguri
Kaoruko WaguriOP3y ago
but I forgot to add it to the final code
Kaoruko Waguri
Kaoruko WaguriOP3y ago
stuff
pip
pip3y ago
ahhh ok, so you may want to just grab the value of the timbits and add it to what you have and you should be good right?
Kaoruko Waguri
Kaoruko WaguriOP3y ago
I think so I'll take break first @pip my bad for the ping but quick question for the class lvl I did price = 1.90 right for the timbits but I have another code that shows prices wouldn't that just over ride the class level?
Kaoruko Waguri
Kaoruko WaguriOP3y ago
Kaoruko Waguri
Kaoruko WaguriOP3y ago
this worked
Kaoruko Waguri
Kaoruko WaguriOP3y ago
the price class level was working this "const double Pack_10 = 2.09;" code was useless
pip
pip3y ago
yea, those only work if something else is reading from them in your program. if nothing is reading from them then no reason to use them
Kaoruko Waguri
Kaoruko WaguriOP3y ago
oh okay
Kaoruko Waguri
Kaoruko WaguriOP3y ago
one more question how do I make the radio button work with the text box? If I click small it can only read the small one not the other ones
Kaoruko Waguri
Kaoruko WaguriOP3y ago
my bad if my explaining is bad
pip
pip3y ago
where you have the logic for your radio, hold references in that file to the text components. then you can do something like
if(button1.Checked == true) { //use the text from text1.Text }
if(button1.Checked == true) { //use the text from text1.Text }
or actually, you can do this in your main file if you hold references to everything there
Kaoruko Waguri
Kaoruko WaguriOP3y ago
I don't understand
pip
pip3y ago
can i see 100% of the file that has your calculate click function? you have component references in that file somewhere Like Small_One for example
Kaoruko Waguri
Kaoruko WaguriOP3y ago
pip
pip3y ago
that's the function, not the file you declared some stuff like Small_One, Medium_Two for example(unless you're getting that via inheritance)
Kaoruko Waguri
Kaoruko WaguriOP3y ago
@pip I already fixed it but now I have a different problem
Kaoruko Waguri
Kaoruko WaguriOP3y ago
on this line I'm not sure what I'm doing wrog
pip
pip3y ago
add a + in between the COFFE string and the Small string
Kaoruko Waguri
Kaoruko WaguriOP3y ago
oof
pip
pip3y ago
you're probably ToString() ing the wrong thing go to where that is in the program and you should be able to find the answer
Kaoruko Waguri
Kaoruko WaguriOP3y ago
?
pip
pip3y ago
probably somewhere else you can find it, just find out where it's relaying the text
Kaoruko Waguri
Kaoruko WaguriOP3y ago
the only Tostring I was able to find
pip
pip3y ago
go to wherever the logic for checkout is and find what it is printing
Kaoruko Waguri
Kaoruko WaguriOP3y ago
is it the result??
pip
pip3y ago
ye you're printing the object you need to print their text
Unknown User
Unknown User3y ago
Message Not Public
Sign In & Join Server To View
pip
pip3y ago
we got through it i think pepecoffee
Kaoruko Waguri
Kaoruko WaguriOP3y ago
I kinda fixed it for the Total I'm not sure what I'm doing wrong but I'm just gonna move on
Want results from more Discord servers?
Add your server