32 Replies
You can declare them as instance variables so they atleast available in the entire class. And consider sharing code either as text or actual screenshot of the computer.
how do i do that?
you can for example use
or if you prefer fields over properties:
Okay and how do i use this to refer to the height snd weight in the button click
you assign the local variables to the instance properties/fields
I apologise but i am confused
i dknt understand what the second example is dojng
i created the class and now what?
You have to declare them in the class your event handlers are in
Im sorry but i still dont understand
ill work it out thanks for your help
I did it
thank you so much
Could you just explain what the Get set means?
thats auto implementing properties. using this shortcut you basically get the following out of the box in comparison of a field backed property:
you can also just do, without the get, set. Might be easier for a beginner
However now when i do calculations in the void calculates i get the result of Nan
in your code shown above, you would first need to change text of both text boxes to actually set the variables
otherweise weight will be 0, which leads to division by 0
i see
so the text inputted in the text box
isnt being used for the calculation?
it should,
can you show the code now?
which part?
where you set height and width but the entire class
its the same as before i just added the get set part.
see, you never assign them to the isntance variables, in your case you need to do Height = height and Weight = weight; in the corresponding methods.
amazing got jt
it works thanks
just got some logic errors to take care of
good job
Unknown User•2mo ago
Message Not Public
Sign In & Join Server To View
Unknown User•2mo ago
Message Not Public
Sign In & Join Server To View
If your code is too long, you can post to https://paste.mod.gg/, save, and copy the link into chat for others to see your shared code!
whats the huge deal with a photo?
- You cannot execute the code in a photo unless you type it out, which is fine if your function is a few lines long, and even then depends on the code complexity
- Some people can adjust their font size to read code. You can zoom on a picture but it may get blurry. Then there's the fact that some cameras flash portion of the image, which makes it harder to read for everyone
- Photos come across as low effort
$screenshot
If you want to share code, please copy and paste the code into a markdown code block in your discord post, or paste the code into https://paste.mod.gg/ and share a link to it in your discord post.
If want to share a screenshot, please do not take a photo of your computer screen with your phone or camera. Instead see https://www.take-a-screenshot.org/ for how to take a screen capture on your device. You may want to crop the image before pasting it into your discord message.
I mean to be fair if they are for example using a school computer where discord is blocked or cannot be installed there's literally no way for them to share it outside of a picture
No there isn't.
You can absolutely still go to a pastebin site or similar
Also, please consider that noone is entitled to help. They can ask for it, and 99% do get it - but there is no entitlement and a bare minimum of effort is required to get it.
Unknown User•2mo ago
Message Not Public
Sign In & Join Server To View